0||p.length>0)&&this._adjustColgroups(h[0],u),e(u).find("[headers]").length>0&&this._associateHeaderIds(u),this._clearColIndexAttr(u),this.releaseRange(l),this._resetTableResizing(this.editor)},_processForColSpan:function(n,i,o,r){var a,s,l=i-1;if(a=e(n).find("[col-index="+i+"]")[0],a&&a.colSpan>1&&"after"===o&&a!==r)return a.colSpan+=1,t;if(a)return a;for(l;l>=0&&(a=e(n).find("[col-index="+l+"]")[0],!(a&&a.colSpan>1));l--);return a?(s=parseInt(a.getAttribute("col-index"),10)+a.colSpan-1,s===i&&"after"===o?a:(i<=s&&a.setAttribute(_,a.colSpan+1),t)):t},_resizeCells:function(e,t){var n,i,o,r=e.style.width;r&&(n=parseFloat(r),i=r.slice((""+n).length),o=n/2+i,e.style.width=o,t.style.width=o)}}),V=O.extend({exec:function(){var n,i,o,s=this.lockRange(),d=l.mapAll(s,function(t){return e(t).closest(x)[0]}),u=a.closest(s.endContainer,[C,T]),c=d[0],p=u?u.rowSpan:1,f=e(d[0]).index(),h=a.closest(c,y),m=c.parentElement;if(!h||this.immutables()&&r.Immutables.immutableParent(c))return this.releaseRange(s),t;for(i=0;i0?this._associateHeaderIds(h):a.is(m,w)&&e(h).find("[scope]").length>0&&this._adjustColgroups(m.rows[0],h),n&&(s.setStart(n,0),s.collapse(!0),this.editor.selectRange(s)),this._resetTableResizing(this.editor)},_handleRowSpanCells:function(t,n){var i,o,r,s,l=a.findNodeIndex(n,!0),d=t.rows[0],u=d.cells[d.cells.length-1],c=parseInt(u.getAttribute("col-index"),10)+u.colSpan-1;for(i=0;i<=c;i+=o.prop("colSpan"))o=e(n).find("[col-index="+i+"]"),o.length&&o.prop("rowSpan")>1&&(s=t.rows[l+1],r=e(s).find("[col-index="+(i+1)+"]"),r.length?r.before(o):e(s).append(o),this._reduceRowSpan(o)),o.length||(o=this._findRowSpanCell(n.parentElement,l,i),this._reduceRowSpan(o))},_reduceRowSpan:function(e){var t=e.prop("rowSpan")-1;t<=1?(e.removeAttr(b),e.attr(f)===g&&e.attr(f,h)):e.attr(b,t)}}),U=O.extend({exec:function(){var n,i,o,s,l=this.lockRange(),d=a.closest(l.endContainer,[C,T]),u=a.closest(d,y),c=u&&u.rows,p=a.findNodeIndex(d,!0),f=c&&c[0].cells.length,h=u.getElementsByTagName(m),g=u.getElementsByTagName(v);if(!d||this.immutables()&&r.Immutables.immutableParent(d))return this.releaseRange(l),t;if(1==f||d.colSpan==f)n=a.next(u),n&&!a.insignificant(n)||(n=a.prev(u)),a.remove(u),this._resetTableResizing(this.editor);else{for(a.removeTextSiblings(d),n=a.next(d)||a.prev(d),this._mapColIndices(u),p=parseInt(d.getAttribute("col-index"),10),s=0;s0||g.length>0)&&this._adjustColgroups(c[0],u),e(u).find("[headers]").length>0&&this._associateHeaderIds(u),n&&(l.setStart(n,0),l.collapse(!0),this.editor.selectRange(l)),this._resetTableResizing(this.editor)},_handleColSpanCells:function(n,i){var o,r,a=e(n).find("[col-index="+i+"]");if(a.length&&a.prop("colSpan")>1)return o=a.clone(!0),a.after(o),this._reduceColSpan(o),o.attr("col-index",parseInt(a.attr("col-index"),10)+1),a.remove(),t;for(r=i;r>=0;r--)if(a=e(n).find("[col-index="+r+"]"),a.length)return this._reduceColSpan(a),a.attr("col-index",parseInt(a.attr("col-index"),10)+1),t},_reduceColSpan:function(e){var t=e.prop("colSpan")-1;t<=1?(e.removeAttr(_),e.attr(f)===v&&e.attr(f,m)):e.attr(_,t)}}),W=O.extend({exec:function(){var n,i,o,s,l,d=this.lockRange(),u=a.closest(d.endContainer,[C,T]);return u?(n=a.closest(u,y),i=u.parentNode,o=a.findNodeIndex(u,!0),s=i.children[o+1],this.immutables()&&r.Immutables.immutableParent(u)?(this.releaseRange(d),t):(this._mapColIndices(n),o=parseInt(e(u).attr("col-index"),10),s=e(i).find("[col-index="+(o+1+this._getColspan(u)-1)+"]").get(0),s&&s.rowSpan===u.rowSpan&&u.tagName===s.tagName?(l=this._getColspan(u)+this._getColspan(s),e(u).prop(_,l).append(a.emptyNode(s)?"":"
"+s.innerHTML),e(u).width(u.offsetWidth),e(s).remove(),u.getAttribute(f)===m&&u.setAttribute(f,v),u.getAttribute(f)===v&&this._adjustColgroups(i,n),e(n).find("[headers]").length>0&&this._associateHeaderIds(n),this._clearColIndexAttr(n),this.releaseRange(d),this._resetTableResizing(this.editor),t):(this._clearColIndexAttr(n),this.releaseRange(d),t))):(this.releaseRange(d),t)},_getColspan:function(e){return parseInt(e.getAttribute(_),10)||1}}),j=O.extend({exec:function(){var n,i,o,s,l,d,u,c=this.lockRange(),p=a.closest(c.endContainer,[C,T]);return p?(n=a.closest(p,x),i=a.closest(p,[w,k]),o=a.closest(p,y),s=a.findNodeIndex(p,!0),l=a.findNodeIndex(n,!0),l+1===i.rows.length?(this.releaseRange(c),t):(d=i.rows[l+this._getRowspan(p)],u=d&&d.children[s],this.immutables()&&r.Immutables.immutableParent(p)?(this.releaseRange(c),t):(this._mapColIndices(o),s=e(p).attr("col-index"),u=e(d).find("[col-index="+s+"]").get(0),u&&u.colSpan===p.colSpan&&p.tagName===u.tagName?(e(p).prop(b,this._getRowspan(p)+this._getRowspan(u)).append(a.emptyNode(u)?"":"
"+u.innerHTML),p.getAttribute(f)===h&&p.setAttribute(f,g),e(u).remove(),e(o).find("[headers]").length>0&&this._associateHeaderIds(o),this._clearColIndexAttr(o),this.releaseRange(c),t):(this._clearColIndexAttr(o),this.releaseRange(c),t)))):(this.releaseRange(c),t)},_getRowspan:function(e){return parseInt(e.getAttribute(b),10)||1}}),q=O.extend({exec:function(){var n=this.lockRange(),i=this.options.type,o="row"===i?_:b,s=a.closest(n.endContainer,[C,T]),l=a.closest(s,[w,k]),d=a.closest(s,y),u=a.createEmptyNode(this.editor.document,s.nodeName.toLowerCase());return!s||this.immutables()&&r.Immutables.immutableParent(s)?(this.releaseRange(n),t):(this._mapColIndices(d),"row"===i&&e(s).is("["+o+"]")?this._splitCellHorizontally(s,l,o,u):"column"===i&&e(s).is("["+o+"]")&&this._splitCellVertically(s,l,o,u),e(s).prop(o.toLowerCase())<=1&&e(s).removeAttr(o),e(d).find("[headers]").length>0&&this._associateHeaderIds(d),this._clearColIndexAttr(d),this.releaseRange(n),t)},_getRowspanValue:function(e){return parseInt(e.getAttribute(b),10)},_getColspanValue:function(e){return parseInt(e.getAttribute(_),10)},_splitCellHorizontally:function(t,n,i,o){var r=t.rowSpan,a=t.colSpan,s=e(o),l=Math.floor(a/2);l>1&&s.attr(_,l),r>1&&s.attr(b,r),e(t).prop(i,a-l).after(s),e(t).width(t.offsetWidth),s.width(s[0].offsetWidth),t.hasAttribute(f)&&(t.getAttribute(f)===v?(s.attr(f,m),t.getAttribute(_)&&"1"!==t.getAttribute(_)||t.setAttribute(f,m),this._adjustColgroups(t.parentNode,n.parentNode)):s.attr(f,t.getAttribute(f)))},_splitCellVertically:function(t,n,i,o){var r=a.closest(t,x),s=parseInt(e(t).attr("col-index"),10),l=a.findNodeIndex(r,!0),d=t.rowSpan,u=t.colSpan,c=Math.floor(d/2),p=e(n).find(x).eq(l+d-c),m=this._findNextTdInRow(p,s+u),v=e(o);c>1&&v.attr(b,c),u>1&&v.attr(_,u),m&&m.length?m.before(v):p.append(v),e(t).prop(i,d-c),t.hasAttribute(f)&&(t.getAttribute(f)===g?(v.attr(f,h),t.getAttribute(b)&&"1"!==t.getAttribute(b)||t.setAttribute(f,h)):v.attr(f,t.getAttribute(f)))}}),G=S.extend({command:function(e){var t={row:{insert:B,"delete":V,merge:W,split:q},column:{insert:L,"delete":U,merge:j,split:q}};return e=i(e,this.options),e.action=e.action||"insert",new t[e.type][e.action](e)},initialize:function(e,t){S.fn.initialize.call(this,e,t),e.addClass("k-state-disabled"),e.attr("disabled","disabled")},update:function(e,t){var n=!R.isFormatted(t);n===!0?(e.parent().addClass("k-hidden k-state-disabled"),e.attr("disabled","disabled"),e.addClass("k-state-disabled")):(e.parent().removeClass("k-hidden k-state-disabled"),e.removeAttr("disabled"),e.removeClass("k-state-disabled"))}});i(n.ui.editor,{PopupTool:P,TableCommand:H,InsertTableTool:M,TableModificationTool:G,InsertRowCommand:B,InsertColumnCommand:L,DeleteRowCommand:V,DeleteColumnCommand:U,MergeCellsHorizontallyCommand:W,MergeCellsVerticallyCommand:j,SplitCellCommand:q}),z("createTable",new M({template:new F({template:s.buttonTemplate,popup:!0,title:"Create table"})})),z("addColumnLeft",new G({type:"column",position:"before",template:new F({template:s.buttonTemplate,title:"Add column on the left"})})),z("addColumnRight",new G({type:"column",template:new F({template:s.buttonTemplate,title:"Add column on the right"})})),z("addRowAbove",new G({type:"row",position:"before",template:new F({template:s.buttonTemplate,title:"Add row above"})})),z("addRowBelow",new G({type:"row",template:new F({template:s.buttonTemplate,title:"Add row below"})})),z("deleteRow",new G({type:"row",action:"delete",template:new F({template:s.buttonTemplate,title:"Delete row"})})),z("deleteColumn",new G({type:"column",action:"delete",template:new F({template:s.buttonTemplate,title:"Delete column"})})),z("mergeCellsHorizontally",new G({type:"row",action:"merge",template:new F({template:s.buttonTemplate,title:"Merge Cell Right"})})),z("mergeCellsVertically",new G({type:"column",action:"merge",template:new F({template:s.buttonTemplate,title:"Merge Cell Down"})})),z("splitCellHorizontally",new G({type:"row",action:"split",template:new F({template:s.buttonTemplate,title:"Split Cell"})})),z("splitCellVertically",new G({type:"column",action:"split",template:new F({template:s.buttonTemplate,title:"Split Cell"})}))}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()}),function(e,define){define("editor/plugins/clipboard.min",["editor/command.min"],e)}(function(){!function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=i.RangeUtils,r=i.Dom,a=i.RestorePoint,s=i.Marker,l=t.support.browser,d=e.extend,u=n.extend({init:function(e){this.editor=e;var t=e.options.pasteCleanup;this.cleaners=[new p(t),new f(t),new h(t),new m(t),new v(t),new _(t),new k(t),new x(t)]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=r.create(n,"div"),o=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)o.appendChild(i.firstChild);return o},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_startModification:function(){var e,t,n=this.editor;if(!this._inProgress)return this._inProgress=!0,e=n.getRange(),t=new a(e,n.body),r.persistScrollTop(n.document),{range:e,restorePoint:t}},_endModification:function(e){i._finishUpdate(this.editor,e.restorePoint),this.editor._selectionChange(),this._inProgress=!1},_contentModification:function(e,t){var n=this,i=n.editor,o=n._startModification();o&&(e.call(n,i,o.range),setTimeout(function(){t.call(n,i,o.range),n._endModification(o)}))},_removeBomNodes:function(e){var t,n=o.textNodes(e);for(t=0;t10))return t=e.clipboardData||e.originalEvent.clipboardData||window.clipboardData||{},n=t.items||t.files,this._insertImages(n)},_insertImages:function(t){var n,i,o;if(t&&(n=e.grep(t,function(e){return/^image\//i.test(e.type)}),i=e.grep(t,function(e){return/^text\/html/i.test(e.type)}),!i.length&&n.length&&(o=this._startModification())))return e.when.apply(e,e.map(n,this._fileToDataURL)).done(e.proxy(function(){var t=Array.prototype.slice.call(arguments),n=e.map(t,function(e){return'
'}).join("");this._triggerPaste(n),this._endModification(o)},this)),!0},onpaste:function(n){if("false"!==this.editor.body.contentEditable){if(this._handleImagePaste(n))return void n.preventDefault();this.expandImmutablesIn(),this._contentModification(function(i,o){var a,s,l,d=r.create(i.document,"div",{className:"k-paste-container",innerHTML:"\ufeff"}),u=t.support.browser,c=i.body;this._decoreateClipboardNode(d,c),c.appendChild(d),u.webkit&&this._moveToCaretPosition(d,o),u.msie&&u.version<11?(n.preventDefault(),a=i.createRange(),a.selectNodeContents(d),i.selectRange(a),s=i.document.body.createTextRange(),s.moveToElementText(d),e(c).unbind("paste"),s.execCommand("Paste"),e(c).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(d),i.selectRange(l)),o.deleteContents()},function(t,n){var i,o="";t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&r.is(e,"br")&&r.remove(e),o+=this.innerHTML}),i.remove(),this._triggerPaste(o,{clean:!0})})}},ondragover:function(e){(l.msie||l.edge)&&(e.stopPropagation(),e.preventDefault())},ondrop:function(e){var t,n;"FileReader"in window&&(t=(e.originalEvent||e).dataTransfer||{},n=t.items||t.files,this._insertImages(n)&&e.preventDefault())},_decoreateClipboardNode:function(t,n){var i,o,r,a;(l.msie||l.webkit)&&(t=e(t),t.css({borderWidth:"0px",width:"0px",height:"0px",overflow:"hidden",margin:"0",padding:"0"}),l.msie&&(i=e(n.ownerDocument.documentElement),t.css({fontVariant:"normal",fontWeight:"normal",lineSpacing:"normal",lineHeight:"normal",textDecoration:"none"}),o=i.css("color"),o&&t.css("color",o),r=i.css("fontFamily"),r&&t.css("fontFamily",r),a=i.css("fontSize"),a&&t.css("fontSize",a)))},_moveToCaretPosition:function(t,n){var i=this,o=i.editor.body,a=r.offset(t,o),s=i._caretOffset(n,o),l=s.left-a.left,d=s.top-a.top,u="translate("+l+"px,"+d+"px)";e(t).css({"-webkit-transform":u,transform:u})},_caretOffset:function(e,t){var n,i,o,a,s,l,d=this.editor,u=r.create(d.document,"span",{innerHTML:"\ufeff"}),c=e.startContainer;return e.collapsed?(i=r.isDataNode(c),i&&(r.isBom(c)||0===e.startOffset)?r.insertBefore(u,c):i&&e.startOffset===c.length?r.insertAfter(u,c):(e.insertNode(u),n=!0)):(c=c===t?c.childNodes[e.startOffset]:c,r.insertBefore(u,c)),o=r.offset(u,t),a=u.previousSibling,s=u.nextSibling,r.remove(u),n&&r.isDataNode(a)&&r.isDataNode(s)&&!r.isBom(a)&&!r.isBom(s)&&(l=a.length,s.data=a.data+s.data,e.setStart(s,l),r.remove(a),e.collapse(!0),d.selectRange(e)),o},expandImmutablesIn:function(e){var n,i,o,r=this.editor;r&&r.options.immutables&&(n=r.body,e=e||r.getRange(),t.ui.editor.Immutables.expandImmutablesIn(e),e.startContainer===n&&0===e.startOffset&&(i=n.ownerDocument,o=i.createTextNode("\ufeff"),n.insertBefore(o,n.childNodes[0]),e.setStartBefore(o)),r.selectRange(e))},splittableParent:function(e,t){var n,i;if(e)return r.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,r.isInline(n))for(;n.parentNode!=i&&!r.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var i,a,l,u,c,p,f,h,m,g,v,_,b,y,w,k,x,C=this.editor;if(this.expandImmutablesIn(),n=d({clean:!1,split:!0},n),!n.skipCleaners)for(i=0,a=this.cleaners.length;i(\s| )*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/<(a|span|font)([^>]*)> <\/\1>/gi,"<$1$2> $1>"),t=t.replace(/^$/g,"li>"),u=this.isBlock(t),C.focus(),c=C.getRange(),c.deleteContents(),c.startContainer==C.document&&c.selectNodeContents(C.body),p=new s,f=p.addCaret(c),h=this.splittableParent(u,f),m=!1,g=h!=C.body&&!r.is(h,"td"),n.split&&g&&(u||r.isInline(h))&&(c.selectNode(f),o.split(c,h,!0),m=!0),v=this.htmlToFragment(t),v.firstChild&&"k-paste-container"===v.firstChild.className){for(_=[],i=0,a=v.childNodes.length;i"))}if(l=v.childNodes,e(l).filter("table").addClass("k-table").end().find("table").addClass("k-table"),e(l).each(function(e,t){r.isBlock(t)&&!r.isSelfClosing(t)&&""===t.innerHTML&&t.appendChild(C.document.createTextNode("\ufeff"))}),c.insertNode(v),h=this.splittableParent(u,f),m){for(;f.parentNode!=h;)r.unwrap(f.parentNode);r.unwrap(f.parentNode)}if(r.normalize(c.commonAncestorContainer),f.style.display="inline",r.restoreScrollTop(C.document),r.scrollTo(f),p.removeCaret(c),b=c.commonAncestorContainer.parentNode,(c.collapsed&&"tbody"==r.name(b)||c.collapsed&&"thead"==r.name(b))&&(c.setStartAfter(e(b).closest("table")[0]),c.collapse(!0)),y=e(c.commonAncestorContainer.parentNode).closest("table"),y.get(0)){for(w=y.parent().contents(),k=w.length-1,x=w.get(k);null!==x.nodeValue&&(" "===x.nodeValue||""===x.nodeValue);)k-=1,x=w.get(k);x!==y.get(0)||y.parents("table").length||r.insertAfter(r.createEmptyNode(C.document,"p"),y[0])}C.selectRange(c)}}),c=n.extend({init:function(e){this.options=e||{},this.replacements=[]},clean:function(e,t){var n,i,o=this,r=t||o.replacements;for(n=0,i=r.length;n]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return!this.options.none&&/';\n src = 'javascript:document.write(\\'' + domainScript + '\\')';\n iframe.src = src;\n }\n wnd = iframe.contentWindow || iframe;\n doc = wnd.document || iframe.contentDocument;\n $(iframe).one('load', function () {\n editor.toolbar.decorateFrom(doc.body);\n });\n lang = document.getElementsByTagName('html')[0].getAttribute('lang') || DEFAULT_LANGUAGE;\n doc.open();\n doc.write('' + '' + 'Kendo UI Editor content' + '' + domainScript + $.map(stylesheets, function (href) {\n return '';\n }).join('') + '');\n doc.close();\n return wnd;\n },\n _blur: function () {\n var textarea = this.textarea;\n var old = textarea ? textarea.val() : this._oldValue;\n var value = this.options.encoded ? this.encodedValue() : this.value();\n this.update();\n if (textarea) {\n textarea.trigger('blur');\n }\n if (value != old) {\n this.trigger('change');\n if (textarea) {\n textarea.trigger('change');\n }\n }\n },\n _spellCorrect: function (editor) {\n var beforeCorrection;\n var falseTrigger = false;\n this._registerHandler(editor.body, {\n 'contextmenu': function () {\n editor.one('select', function () {\n beforeCorrection = null;\n });\n editor._spellCorrectTimeout = setTimeout(function () {\n beforeCorrection = new kendo.ui.editor.RestorePoint(editor.getRange(), editor.body);\n falseTrigger = false;\n }, 10);\n },\n 'input': function () {\n if (!beforeCorrection) {\n return;\n }\n if (kendo.support.browser.mozilla && !falseTrigger) {\n falseTrigger = true;\n return;\n }\n kendo.ui.editor._finishUpdate(editor, beforeCorrection);\n }\n });\n },\n _registerHandler: function (element, type, handler) {\n var editor = this;\n var NS = '.kendoEditor';\n var eventNames;\n var i;\n element = $(element);\n if (!this._handlers) {\n this._handlers = [];\n }\n if (element.length) {\n if ($.isPlainObject(type)) {\n for (var t in type) {\n if (type.hasOwnProperty(t)) {\n this._registerHandler(element, t, type[t]);\n }\n }\n } else {\n eventNames = kendo.applyEventMap(type).split(' ');\n for (i = 0; i < eventNames.length; i++) {\n editor._handlers.push({\n element: element,\n type: eventNames[i] + NS,\n handler: handler\n });\n element.on(eventNames[i] + NS, handler);\n }\n }\n }\n },\n _deregisterHandlers: function () {\n var handlers = this._handlers;\n for (var i = 0; i < handlers.length; i++) {\n var h = handlers[i];\n h.element.off(h.type, h.handler);\n }\n this._handlers = [];\n },\n _initializeContentElement: function () {\n var editor = this;\n var doc;\n var blurTrigger;\n var mousedownTrigger;\n if (editor.textarea) {\n editor.window = editor._createContentElement(editor.options.stylesheets);\n doc = editor.document = editor.window.contentDocument || editor.window.document;\n if (!doc.body) {\n var body = doc.createElement('body');\n body.setAttribute('contenteditable', 'true');\n body.setAttribute('autocorrect', 'off');\n doc.getElementsByTagName('html')[0].appendChild(body);\n var interval = setInterval(function () {\n if ($(editor.document).find('body').length > 1) {\n $(editor.document).find('body:last').remove();\n window.clearInterval(interval);\n }\n }, 10);\n }\n editor.body = doc.body;\n blurTrigger = editor.window;\n mousedownTrigger = doc;\n this._registerHandler(doc, 'mouseup', proxy(this._mouseup, this));\n } else {\n editor.window = window;\n doc = editor.document = document;\n editor.body = editor.element[0];\n blurTrigger = editor.body;\n mousedownTrigger = editor.body;\n editor.toolbar.decorateFrom(editor.body);\n }\n this._registerHandler(blurTrigger, 'blur', proxy(this._blur, this));\n editor._registerHandler(mousedownTrigger, 'down', proxy(editor._mousedown, editor));\n try {\n doc.execCommand('enableInlineTableEditing', null, false);\n } catch (e) {\n }\n if (kendo.support.touch) {\n this._registerHandler(doc, {\n 'keydown': function () {\n if (kendo._activeElement() != doc.body) {\n editor.window.focus();\n }\n }\n });\n }\n this._initializePlaceholder();\n this._spellCorrect(editor);\n this._registerHandler(editor.document, {\n 'mouseover dragenter': function (e) {\n var height = $(editor.body).height();\n var htmlHeight = $(editor.body.parentElement).height();\n if (htmlHeight > height && e.target.nodeName.toLowerCase() === 'html') {\n editor._cachedHeight = '' + editor.body.style.height;\n editor.body.style.height = '100%';\n }\n },\n 'mouseout dragleave drop contextmenu': function (e) {\n var restoreHeight = function () {\n if (editor._cachedHeight !== undefined && e.target === editor.body) {\n editor.body.style.height = editor._cachedHeight;\n delete editor._cachedHeight;\n }\n };\n if (e.type === 'contextmenu') {\n setTimeout(function () {\n restoreHeight();\n }, 10);\n } else {\n restoreHeight();\n }\n }\n });\n this._registerHandler(editor.body, {\n 'keydown': function (e) {\n var range;\n if ((e.keyCode === keys.BACKSPACE || e.keyCode === keys.DELETE) && editor.body.getAttribute('contenteditable') !== 'true') {\n return false;\n }\n if (e.keyCode === keys.F10) {\n setTimeout(proxy(editor.toolbar.focus, editor.toolbar), 100);\n editor.toolbar.preventPopupHide = true;\n e.preventDefault();\n return;\n } else if (e.keyCode == keys.LEFT || e.keyCode == keys.RIGHT) {\n range = editor.getRange();\n var left = e.keyCode == keys.LEFT;\n var container = range[left ? 'startContainer' : 'endContainer'];\n var offset = range[left ? 'startOffset' : 'endOffset'];\n var direction = left ? -1 : 1;\n var next = offset + direction;\n var nextChar = left ? next : offset;\n if (container.nodeType == 3 && container.nodeValue[nextChar] == '\\uFEFF') {\n range.setStart(container, next);\n range.collapse(true);\n editor.selectRange(range);\n }\n }\n var tools = editor.toolbar.tools;\n var toolName = editor.keyboard.toolFromShortcut(tools, e);\n var toolOptions = toolName ? tools[toolName].options : {};\n if (toolName && !toolOptions.keyPressCommand) {\n e.preventDefault();\n if (!/^(undo|redo)$/.test(toolName)) {\n editor.keyboard.endTyping(true);\n }\n editor.trigger('keydown', e);\n editor.exec(toolName);\n editor._runPostContentKeyCommands(e);\n return false;\n }\n editor.keyboard.clearTimeout();\n editor.keyboard.keydown(e);\n },\n 'keypress': function (e) {\n setTimeout(function () {\n editor._runPostContentKeyCommands(e);\n editor._showTableResizeHandles();\n }, 0);\n },\n 'keyup': function (e) {\n var selectionCodes = [\n keys.BACKSPACE,\n keys.TAB,\n keys.PAGEUP,\n keys.PAGEDOWN,\n keys.END,\n keys.HOME,\n keys.LEFT,\n keys.UP,\n keys.RIGHT,\n keys.DOWN,\n keys.INSERT,\n keys.DELETE\n ];\n if ($.inArray(e.keyCode, selectionCodes) > -1 || e.keyCode == 65 && e.ctrlKey && !e.altKey && !e.shiftKey) {\n window.clearTimeout(this._refreshInterval);\n this._refreshInterval = window.setTimeout(function () {\n editor._selectionChange();\n }, REFRESH_INTERVAL);\n }\n editor.keyboard.keyup(e);\n },\n 'click': function (e) {\n var dom = kendo.ui.editor.Dom, range;\n if (dom.name(e.target) === 'img') {\n range = editor.createRange();\n range.selectNode(e.target);\n editor.selectRange(range);\n }\n },\n 'cut copy paste drop dragover': function (e) {\n editor.clipboard['on' + e.type](e);\n },\n 'focusin': function () {\n if (editor.body.hasAttribute('contenteditable')) {\n $(this).addClass('k-state-active');\n editor.toolbar.show();\n editor._togglePlaceholder(false);\n }\n },\n 'focusout': function () {\n setTimeout(function () {\n var active = kendo._activeElement();\n var body = editor.body;\n var toolbar = editor.toolbar;\n if (toolbar.options.popup) {\n var toolbarContainerElement = toolbar.window.element.get(0);\n if (toolbarContainerElement && !($.contains(toolbarContainerElement, active) || toolbarContainerElement == active)) {\n toolbar.preventPopupHide = false;\n }\n }\n if (active != body && !$.contains(body, active) && !$(active).is('.k-editortoolbar-dragHandle') && !toolbar.focused()) {\n $(body).removeClass('k-state-active');\n toolbar.hide();\n }\n editor._togglePlaceholder(!editor.value().trim());\n }, 10);\n }\n });\n editor._initializeColumnResizing();\n editor._initializeRowResizing();\n editor._initializeTableResizing();\n },\n _initializePlaceholder: function () {\n var that = this, placeholder = that.options.placeholder, style, $head;\n if (!that.textarea || !placeholder) {\n return;\n }\n style = '';\n $head = $(that.document.head);\n $head.find('#' + PLACEHOLDER_TAG_ID).remove();\n $head.append(style);\n that._togglePlaceholder(!that.value().trim());\n },\n _initializeImmutables: function () {\n var that = this, editorNS = kendo.ui.editor;\n if (that.options.immutables) {\n that.immutables = new editorNS.Immutables(that);\n }\n },\n _mousedown: function (e) {\n var editor = this;\n editor._selectionStarted = true;\n if ($(editor.body).parents('.k-window').length) {\n e.stopPropagation();\n }\n if (browser.gecko) {\n return;\n }\n var target = $(e.target).closest('a[href]');\n if ((e.which == 2 || e.which == 1 && e.ctrlKey) && target && target.is('a[href]')) {\n window.open(target.attr('href'), '_new');\n }\n if (e.target.tagName && e.target.tagName.toLowerCase() === 'html') {\n setTimeout(function () {\n editor.body.focus();\n }, 0);\n }\n },\n _mouseup: function (e) {\n var that = this;\n if (kendo.support.mobileOS.ios && e && $(e.target).is(SELECT_OVERLAY_SELECTOR)) {\n return;\n }\n if (that._selectionStarted) {\n setTimeout(function () {\n that._selectionChange();\n }, 1);\n }\n },\n _runPostContentKeyCommands: function (e) {\n var range = this.getRange();\n var tools = this.keyboard.toolsFromShortcut(this.toolbar.tools, e);\n for (var i = 0; i < tools.length; i++) {\n var tool = tools[i];\n var o = tool.options;\n if (!o.keyPressCommand) {\n continue;\n }\n var cmd = new o.command({ range: range });\n if (cmd.changesContent()) {\n this.keyboard.endTyping(true);\n this.exec(tool.name);\n }\n }\n },\n refresh: function () {\n var that = this;\n if (that.textarea) {\n that._destroyResizings();\n var value = that.value();\n that.textarea.val(value);\n that.wrapper.find('iframe').remove();\n that._initializeContentElement(that);\n that.value(value);\n }\n },\n events: [\n 'select',\n 'change',\n 'execute',\n 'error',\n 'paste',\n 'keydown',\n 'keyup'\n ],\n options: {\n name: 'Editor',\n messages: messages,\n placeholder: '',\n formats: {},\n encoded: true,\n domain: null,\n resizable: false,\n deserialization: { custom: null },\n serialization: {\n entities: true,\n semantic: true,\n scripts: false\n },\n pasteCleanup: {\n all: false,\n css: false,\n custom: null,\n keepNewLines: false,\n msAllFormatting: false,\n msConvertLists: true,\n msTags: true,\n none: false,\n span: false\n },\n stylesheets: [],\n dialogOptions: {\n modal: true,\n resizable: false,\n draggable: true,\n animation: false\n },\n imageBrowser: null,\n fileBrowser: null,\n fontName: [\n {\n text: 'Arial',\n value: 'Arial, Helvetica, sans-serif'\n },\n {\n text: 'Courier New',\n value: '\"Courier New\", Courier, monospace'\n },\n {\n text: 'Georgia',\n value: 'Georgia, serif'\n },\n {\n text: 'Impact',\n value: 'Impact, Charcoal, sans-serif'\n },\n {\n text: 'Lucida Console',\n value: '\"Lucida Console\", Monaco, monospace'\n },\n {\n text: 'Tahoma',\n value: 'Tahoma, Geneva, sans-serif'\n },\n {\n text: 'Times New Roman',\n value: '\"Times New Roman\", Times, serif'\n },\n {\n text: 'Trebuchet MS',\n value: '\"Trebuchet MS\", Helvetica, sans-serif'\n },\n {\n text: 'Verdana',\n value: 'Verdana, Geneva, sans-serif'\n }\n ],\n fontSize: [\n {\n text: '1 (8pt)',\n value: 'xx-small'\n },\n {\n text: '2 (10pt)',\n value: 'x-small'\n },\n {\n text: '3 (12pt)',\n value: 'small'\n },\n {\n text: '4 (14pt)',\n value: 'medium'\n },\n {\n text: '5 (18pt)',\n value: 'large'\n },\n {\n text: '6 (24pt)',\n value: 'x-large'\n },\n {\n text: '7 (36pt)',\n value: 'xx-large'\n }\n ],\n formatBlock: [\n {\n text: 'Paragraph',\n value: 'p'\n },\n {\n text: 'Quotation',\n value: 'blockquote'\n },\n {\n text: 'Heading 1',\n value: 'h1'\n },\n {\n text: 'Heading 2',\n value: 'h2'\n },\n {\n text: 'Heading 3',\n value: 'h3'\n },\n {\n text: 'Heading 4',\n value: 'h4'\n },\n {\n text: 'Heading 5',\n value: 'h5'\n },\n {\n text: 'Heading 6',\n value: 'h6'\n }\n ],\n tools: [].concat.call(['formatting'], toolGroups.basic, toolGroups.alignment, toolGroups.formatPainter, toolGroups.lists, toolGroups.indenting, toolGroups.links, ['insertImage'], toolGroups.tables)\n },\n destroy: function () {\n var editor = this;\n Widget.fn.destroy.call(this);\n this._endTyping(true);\n this._deregisterHandlers();\n clearTimeout(this._spellCorrectTimeout);\n this._focusOutside();\n this.toolbar.destroy();\n editor._destroyUploadWidget();\n editor._destroyResizings();\n kendo.destroy(this.wrapper);\n },\n _destroyResizings: function () {\n var editor = this;\n editor._destroyTableResizing();\n kendo.ui.editor.TableResizing.dispose(editor);\n editor._destroyRowResizing();\n kendo.ui.editor.RowResizing.dispose(editor);\n editor._destroyColumnResizing();\n kendo.ui.editor.ColumnResizing.dispose(editor);\n },\n _focusOutside: function () {\n if (kendo.support.browser.msie && this.textarea) {\n var tempInput = $('').appendTo(document.body).focus();\n tempInput.blur().remove();\n }\n },\n _destroyUploadWidget: function () {\n var editor = this;\n if (editor._uploadWidget) {\n editor._uploadWidget.destroy();\n editor._uploadWidget = null;\n }\n },\n state: function (toolName) {\n var tool = Editor.defaultTools[toolName];\n var finder = tool && (tool.options.finder || tool.finder);\n var RangeUtils = kendo.ui.editor.RangeUtils;\n var range, textNodes;\n if (finder) {\n range = this.getRange();\n textNodes = RangeUtils.textNodes(range);\n if (!textNodes.length && range.collapsed) {\n textNodes = [range.startContainer];\n }\n return finder.getFormat ? finder.getFormat(textNodes) : finder.isFormatted(textNodes);\n }\n return false;\n },\n value: function (html) {\n var body = this.body, editorNS = kendo.ui.editor, options = this.options, currentHtml = editorNS.Serializer.domToXhtml(body, options.serialization);\n if (html === undefined) {\n return currentHtml;\n }\n if (html == currentHtml) {\n return;\n }\n editorNS.Serializer.htmlToDom(html, body, options.deserialization);\n this.selectionRestorePoint = null;\n this.update();\n this.toolbar.refreshTools();\n },\n saveSelection: function (range) {\n range = range || this.getRange();\n var container = range.commonAncestorContainer, body = this.body;\n if (container == body || $.contains(body, container)) {\n this.selectionRestorePoint = new kendo.ui.editor.RestorePoint(range, body);\n }\n },\n _focusBody: function () {\n var body = this.body;\n var iframe = this.wrapper && this.wrapper.find('iframe')[0];\n var documentElement = this.document.documentElement;\n var activeElement = kendo._activeElement();\n var scrollTop;\n if (!iframe && body.scrollHeight > body.clientHeight) {\n scrollTop = body.scrollTop;\n body.focus();\n body.scrollTop = scrollTop;\n } else if (activeElement != body && activeElement != iframe) {\n scrollTop = documentElement.scrollTop;\n body.focus();\n documentElement.scrollTop = scrollTop;\n }\n },\n restoreSelection: function () {\n this._focusBody();\n if (this.selectionRestorePoint) {\n this.selectRange(this.selectionRestorePoint.toRange());\n }\n },\n focus: function () {\n this.restoreSelection();\n },\n update: function (value) {\n value = value || this.options.encoded ? this.encodedValue() : this.value();\n if (this.textarea) {\n this.textarea.val(value);\n this._togglePlaceholder(!value.trim());\n } else {\n this._oldValue = value;\n }\n },\n encodedValue: function () {\n return kendo.ui.editor.Dom.encode(this.value());\n },\n createRange: function (document) {\n return kendo.ui.editor.RangeUtils.createRange(document || this.document);\n },\n getSelection: function () {\n return kendo.ui.editor.SelectionUtils.selectionFromDocument(this.document);\n },\n selectRange: function (range) {\n this._focusBody();\n var selection = this.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n this.saveSelection(range);\n },\n getRange: function () {\n var selection = this.getSelection(), range = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : this.createRange(), doc = this.document;\n if (range.startContainer == doc && range.endContainer == doc && !range.startOffset && !range.endOffset) {\n range.setStart(this.body, 0);\n range.collapse(true);\n }\n return range;\n },\n _containsRange: function (range) {\n var dom = kendo.ui.editor.Dom;\n var body = this.body;\n return range && dom.isAncestorOrSelf(body, range.startContainer) && dom.isAncestorOrSelf(body, range.endContainer);\n },\n _deleteSavedRange: function () {\n if ('_range' in this) {\n delete this._range;\n }\n },\n selectedHtml: function () {\n return kendo.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents());\n },\n paste: function (html, options) {\n this.focus();\n var command = new kendo.ui.editor.InsertHtmlCommand($.extend({\n range: this.getRange(),\n html: html\n }, options));\n command.editor = this;\n command.exec();\n },\n exec: function (name, params) {\n var that = this;\n var command = null;\n var range, tool, prevented;\n if (!name) {\n throw new Error('kendoEditor.exec(): `name` parameter cannot be empty');\n }\n if (that.body.getAttribute('contenteditable') !== 'true' && name !== 'print' && name !== 'pdf' && name !== 'exportAs') {\n return false;\n }\n name = name.toLowerCase();\n if (!that.keyboard.isTypingInProgress()) {\n that._focusBody();\n that.selectRange(that._range || that.getRange());\n }\n tool = that.toolbar.toolById(name);\n if (!tool) {\n for (var id in Editor.defaultTools) {\n if (id.toLowerCase() == name) {\n tool = Editor.defaultTools[id];\n break;\n }\n }\n }\n if (tool) {\n range = that.getRange();\n if (tool.command) {\n command = tool.command(extend({\n range: range,\n body: that.body,\n immutables: !!that.immutables\n }, params));\n }\n prevented = that.trigger('execute', {\n name: name,\n command: command\n });\n if (prevented) {\n return;\n }\n if (/^(undo|redo)$/i.test(name)) {\n that.undoRedoStack[name]();\n } else if (command) {\n that.execCommand(command);\n if (command.async) {\n command.change = proxy(that._selectionChange, that);\n return;\n }\n }\n that._selectionChange();\n }\n },\n execCommand: function (command) {\n if (!command.managesUndoRedo) {\n this.undoRedoStack.push(command);\n }\n command.editor = this;\n command.exec();\n }\n });\n Editor.defaultTools = {\n undo: {\n options: {\n key: 'Z',\n ctrl: true\n }\n },\n redo: {\n options: {\n key: 'Y',\n ctrl: true\n }\n }\n };\n kendo.ui.plugin(Editor);\n var Tool = Class.extend({\n init: function (options) {\n this.options = options;\n },\n initialize: function (ui, options) {\n ui.attr({\n unselectable: 'on',\n title: options.title,\n 'aria-label': options.title\n });\n },\n command: function (commandArguments) {\n return new this.options.command(commandArguments);\n },\n update: $.noop\n });\n Tool.exec = function (editor, name, value) {\n editor.exec(name, { value: value });\n };\n EditorUtils.registerTool('separator', new Tool({ template: new ToolTemplate({ template: EditorUtils.separatorTemplate }) }));\n var bomFill = browser.msie && browser.version < 9 ? '\\uFEFF' : '';\n var emptyElementContent = '\\uFEFF';\n var emptyTableCellContent = emptyElementContent;\n if (browser.msie || browser.edge) {\n emptyTableCellContent = emptyElementContent = ' ';\n }\n extend(kendo.ui, {\n editor: {\n ToolTemplate: ToolTemplate,\n EditorUtils: EditorUtils,\n Tool: Tool,\n _bomFill: bomFill,\n emptyElementContent: emptyElementContent,\n emptyTableCellContent: emptyTableCellContent\n }\n });\n if (kendo.PDFMixin) {\n kendo.PDFMixin.extend(Editor.prototype);\n Editor.prototype._drawPDF = function () {\n return kendo.drawing.drawDOM(this.body, this.options.pdf);\n };\n Editor.prototype.saveAsPDF = function () {\n var progress = new $.Deferred();\n var promise = progress.promise();\n var args = { promise: promise };\n if (this.trigger('pdfExport', args)) {\n return;\n }\n var options = this.options.pdf;\n this._drawPDF(progress).then(function (root) {\n return kendo.drawing.exportPDF(root, options);\n }).done(function (dataURI) {\n kendo.saveAs({\n dataURI: dataURI,\n fileName: options.fileName,\n proxyURL: options.proxyURL,\n proxyTarget: options.proxyTarget,\n forceProxy: options.forceProxy\n });\n progress.resolve();\n }).fail(function (err) {\n progress.reject(err);\n });\n return promise;\n };\n }\n }(window.kendo.jQuery));\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('editor/dom', ['editor/main'], f);\n}(function () {\n (function ($) {\n var kendo = window.kendo, map = $.map, extend = $.extend, browser = kendo.support.browser, STYLE = 'style', FLOAT = 'float', CSSFLOAT = 'cssFloat', STYLEFLOAT = 'styleFloat', CLASS = 'class', KMARKER = 'k-marker';\n function makeMap(items) {\n var obj = {}, i, len;\n for (i = 0, len = items.length; i < len; i++) {\n obj[items[i]] = true;\n }\n return obj;\n }\n var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed'.split(',')), nonListBlockElements = 'p,div,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption'.split(','), blockElements = nonListBlockElements.concat([\n 'ul',\n 'ol',\n 'li'\n ]), block = makeMap(blockElements), selfClosing = makeMap('area,base,br,col,command,embed,hr,img,input,keygen,link,menuitem,meta,param,source,track,wbr'.split(',')), inlineElements = 'span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby'.split(','), inline = makeMap(inlineElements), fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'.split(','));\n var normalize = function (node) {\n if (node.nodeType == 1) {\n node.normalize();\n }\n };\n if (browser.msie && browser.version >= 8) {\n normalize = function (parent) {\n if (parent.nodeType == 1 && parent.firstChild) {\n var prev = parent.firstChild, node = prev;\n normalize(node);\n while (true) {\n node = node.nextSibling;\n if (!node) {\n break;\n }\n normalize(node);\n if (node.nodeType == 3 && prev.nodeType == 3) {\n node.nodeValue = prev.nodeValue + node.nodeValue;\n Dom.remove(prev);\n }\n prev = node;\n }\n }\n };\n }\n var whitespace = /^\\s+$/, emptyspace = /^[\\n\\r\\t]+$/, rgb = /rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)/i, bom = /\\ufeff/g, whitespaceOrBom = /^(\\s+|\\ufeff)$/, persistedScrollTop, cssAttributes = ('color,padding-left,padding-right,padding-top,padding-bottom,' + 'background-color,background-attachment,background-image,background-position,background-repeat,' + 'border-top-style,border-top-width,border-top-color,' + 'border-bottom-style,border-bottom-width,border-bottom-color,' + 'border-left-style,border-left-width,border-left-color,' + 'border-right-style,border-right-width,border-right-color,' + 'font-family,font-size,font-style,font-variant,font-weight,line-height').split(','), htmlRe = /[<>\\&]/g, entityRe = /[\\u00A0-\\u2666<>\\&]/g, entityTable = {\n 34: 'quot',\n 38: 'amp',\n 39: 'apos',\n 60: 'lt',\n 62: 'gt',\n 160: 'nbsp',\n 161: 'iexcl',\n 162: 'cent',\n 163: 'pound',\n 164: 'curren',\n 165: 'yen',\n 166: 'brvbar',\n 167: 'sect',\n 168: 'uml',\n 169: 'copy',\n 170: 'ordf',\n 171: 'laquo',\n 172: 'not',\n 173: 'shy',\n 174: 'reg',\n 175: 'macr',\n 176: 'deg',\n 177: 'plusmn',\n 178: 'sup2',\n 179: 'sup3',\n 180: 'acute',\n 181: 'micro',\n 182: 'para',\n 183: 'middot',\n 184: 'cedil',\n 185: 'sup1',\n 186: 'ordm',\n 187: 'raquo',\n 188: 'frac14',\n 189: 'frac12',\n 190: 'frac34',\n 191: 'iquest',\n 192: 'Agrave',\n 193: 'Aacute',\n 194: 'Acirc',\n 195: 'Atilde',\n 196: 'Auml',\n 197: 'Aring',\n 198: 'AElig',\n 199: 'Ccedil',\n 200: 'Egrave',\n 201: 'Eacute',\n 202: 'Ecirc',\n 203: 'Euml',\n 204: 'Igrave',\n 205: 'Iacute',\n 206: 'Icirc',\n 207: 'Iuml',\n 208: 'ETH',\n 209: 'Ntilde',\n 210: 'Ograve',\n 211: 'Oacute',\n 212: 'Ocirc',\n 213: 'Otilde',\n 214: 'Ouml',\n 215: 'times',\n 216: 'Oslash',\n 217: 'Ugrave',\n 218: 'Uacute',\n 219: 'Ucirc',\n 220: 'Uuml',\n 221: 'Yacute',\n 222: 'THORN',\n 223: 'szlig',\n 224: 'agrave',\n 225: 'aacute',\n 226: 'acirc',\n 227: 'atilde',\n 228: 'auml',\n 229: 'aring',\n 230: 'aelig',\n 231: 'ccedil',\n 232: 'egrave',\n 233: 'eacute',\n 234: 'ecirc',\n 235: 'euml',\n 236: 'igrave',\n 237: 'iacute',\n 238: 'icirc',\n 239: 'iuml',\n 240: 'eth',\n 241: 'ntilde',\n 242: 'ograve',\n 243: 'oacute',\n 244: 'ocirc',\n 245: 'otilde',\n 246: 'ouml',\n 247: 'divide',\n 248: 'oslash',\n 249: 'ugrave',\n 250: 'uacute',\n 251: 'ucirc',\n 252: 'uuml',\n 253: 'yacute',\n 254: 'thorn',\n 255: 'yuml',\n 402: 'fnof',\n 913: 'Alpha',\n 914: 'Beta',\n 915: 'Gamma',\n 916: 'Delta',\n 917: 'Epsilon',\n 918: 'Zeta',\n 919: 'Eta',\n 920: 'Theta',\n 921: 'Iota',\n 922: 'Kappa',\n 923: 'Lambda',\n 924: 'Mu',\n 925: 'Nu',\n 926: 'Xi',\n 927: 'Omicron',\n 928: 'Pi',\n 929: 'Rho',\n 931: 'Sigma',\n 932: 'Tau',\n 933: 'Upsilon',\n 934: 'Phi',\n 935: 'Chi',\n 936: 'Psi',\n 937: 'Omega',\n 945: 'alpha',\n 946: 'beta',\n 947: 'gamma',\n 948: 'delta',\n 949: 'epsilon',\n 950: 'zeta',\n 951: 'eta',\n 952: 'theta',\n 953: 'iota',\n 954: 'kappa',\n 955: 'lambda',\n 956: 'mu',\n 957: 'nu',\n 958: 'xi',\n 959: 'omicron',\n 960: 'pi',\n 961: 'rho',\n 962: 'sigmaf',\n 963: 'sigma',\n 964: 'tau',\n 965: 'upsilon',\n 966: 'phi',\n 967: 'chi',\n 968: 'psi',\n 969: 'omega',\n 977: 'thetasym',\n 978: 'upsih',\n 982: 'piv',\n 8226: 'bull',\n 8230: 'hellip',\n 8242: 'prime',\n 8243: 'Prime',\n 8254: 'oline',\n 8260: 'frasl',\n 8472: 'weierp',\n 8465: 'image',\n 8476: 'real',\n 8482: 'trade',\n 8501: 'alefsym',\n 8592: 'larr',\n 8593: 'uarr',\n 8594: 'rarr',\n 8595: 'darr',\n 8596: 'harr',\n 8629: 'crarr',\n 8656: 'lArr',\n 8657: 'uArr',\n 8658: 'rArr',\n 8659: 'dArr',\n 8660: 'hArr',\n 8704: 'forall',\n 8706: 'part',\n 8707: 'exist',\n 8709: 'empty',\n 8711: 'nabla',\n 8712: 'isin',\n 8713: 'notin',\n 8715: 'ni',\n 8719: 'prod',\n 8721: 'sum',\n 8722: 'minus',\n 8727: 'lowast',\n 8730: 'radic',\n 8733: 'prop',\n 8734: 'infin',\n 8736: 'ang',\n 8743: 'and',\n 8744: 'or',\n 8745: 'cap',\n 8746: 'cup',\n 8747: 'int',\n 8756: 'there4',\n 8764: 'sim',\n 8773: 'cong',\n 8776: 'asymp',\n 8800: 'ne',\n 8801: 'equiv',\n 8804: 'le',\n 8805: 'ge',\n 8834: 'sub',\n 8835: 'sup',\n 8836: 'nsub',\n 8838: 'sube',\n 8839: 'supe',\n 8853: 'oplus',\n 8855: 'otimes',\n 8869: 'perp',\n 8901: 'sdot',\n 8968: 'lceil',\n 8969: 'rceil',\n 8970: 'lfloor',\n 8971: 'rfloor',\n 9001: 'lang',\n 9002: 'rang',\n 9674: 'loz',\n 9824: 'spades',\n 9827: 'clubs',\n 9829: 'hearts',\n 9830: 'diams',\n 338: 'OElig',\n 339: 'oelig',\n 352: 'Scaron',\n 353: 'scaron',\n 376: 'Yuml',\n 710: 'circ',\n 732: 'tilde',\n 8194: 'ensp',\n 8195: 'emsp',\n 8201: 'thinsp',\n 8204: 'zwnj',\n 8205: 'zwj',\n 8206: 'lrm',\n 8207: 'rlm',\n 8211: 'ndash',\n 8212: 'mdash',\n 8216: 'lsquo',\n 8217: 'rsquo',\n 8218: 'sbquo',\n 8220: 'ldquo',\n 8221: 'rdquo',\n 8222: 'bdquo',\n 8224: 'dagger',\n 8225: 'Dagger',\n 8240: 'permil',\n 8249: 'lsaquo',\n 8250: 'rsaquo',\n 8364: 'euro'\n };\n var Dom = {\n block: block,\n inline: inline,\n findNodeIndex: function (node, skipText) {\n var i = 0;\n if (!node) {\n return -1;\n }\n while (true) {\n node = node.previousSibling;\n if (!node) {\n break;\n }\n if (!(skipText && node.nodeType == 3)) {\n i++;\n }\n }\n return i;\n },\n isDataNode: function (node) {\n return node && node.nodeValue !== null && node.data !== null;\n },\n isAncestorOf: function (parent, node) {\n try {\n return !Dom.isDataNode(parent) && ($.contains(parent, Dom.isDataNode(node) ? node.parentNode : node) || node.parentNode == parent);\n } catch (e) {\n return false;\n }\n },\n isAncestorOrSelf: function (root, node) {\n return Dom.isAncestorOf(root, node) || root == node;\n },\n findClosestAncestor: function (root, node) {\n if (Dom.isAncestorOf(root, node)) {\n while (node && node.parentNode != root) {\n node = node.parentNode;\n }\n }\n return node;\n },\n getAllComments: function (rootElem) {\n var comments = [];\n var iterator = document.createNodeIterator(rootElem, NodeFilter.SHOW_COMMENT, function () {\n return NodeFilter.FILTER_ACCEPT;\n }, false);\n var curNode = iterator.nextNode();\n while (curNode) {\n comments.push(curNode.nodeValue);\n curNode = iterator.nextNode();\n }\n return comments;\n },\n getNodeLength: function (node) {\n return Dom.isDataNode(node) ? node.length : node.childNodes.length;\n },\n splitDataNode: function (node, offset) {\n var newNode = node.cloneNode(false);\n var denormalizedText = '';\n var iterator = node.nextSibling;\n var temp;\n while (iterator && iterator.nodeType == 3 && iterator.nodeValue) {\n denormalizedText += iterator.nodeValue;\n temp = iterator;\n iterator = iterator.nextSibling;\n Dom.remove(temp);\n }\n node.deleteData(offset, node.length);\n newNode.deleteData(0, offset);\n newNode.nodeValue += denormalizedText;\n Dom.insertAfter(newNode, node);\n },\n attrEquals: function (node, attributes) {\n for (var key in attributes) {\n var value = node[key];\n if (key == FLOAT) {\n value = node[kendo.support.cssFloat ? CSSFLOAT : STYLEFLOAT];\n }\n if (typeof value == 'object') {\n if (!Dom.attrEquals(value, attributes[key])) {\n return false;\n }\n } else if (value != attributes[key]) {\n return false;\n }\n }\n return true;\n },\n blockParentOrBody: function (node) {\n return Dom.parentOfType(node, blockElements) || node.ownerDocument.body;\n },\n blockParents: function (nodes) {\n var blocks = [], i, len;\n for (i = 0, len = nodes.length; i < len; i++) {\n var block = Dom.parentOfType(nodes[i], Dom.blockElements);\n if (block && $.inArray(block, blocks) < 0) {\n blocks.push(block);\n }\n }\n return blocks;\n },\n windowFromDocument: function (document) {\n return document.defaultView || document.parentWindow;\n },\n normalize: normalize,\n blockElements: blockElements,\n nonListBlockElements: nonListBlockElements,\n inlineElements: inlineElements,\n empty: empty,\n fillAttrs: fillAttrs,\n nodeTypes: {\n ELEMENT_NODE: 1,\n ATTRIBUTE_NODE: 2,\n TEXT_NODE: 3,\n CDATA_SECTION_NODE: 4,\n ENTITY_REFERENCE_NODE: 5,\n ENTITY_NODE: 6,\n PROCESSING_INSTRUCTION_NODE: 7,\n COMMENT_NODE: 8,\n DOCUMENT_NODE: 9,\n DOCUMENT_TYPE_NODE: 10,\n DOCUMENT_FRAGMENT_NODE: 11,\n NOTATION_NODE: 12\n },\n toHex: function (color) {\n var matches = rgb.exec(color);\n if (!matches) {\n return color;\n }\n return '#' + map(matches.slice(1), function (x) {\n x = parseInt(x, 10).toString(16);\n return x.length > 1 ? x : '0' + x;\n }).join('');\n },\n encode: function (value, options) {\n var encodableChars = !options || options.entities ? entityRe : htmlRe;\n return value.replace(encodableChars, function (c) {\n var charCode = c.charCodeAt(0);\n var entity = entityTable[charCode];\n return entity ? '&' + entity + ';' : c;\n });\n },\n isBom: function (node) {\n return node && node.nodeType === 3 && /^[\\ufeff]+$/.test(node.nodeValue);\n },\n stripBom: function (text) {\n return (text || '').replace(bom, '');\n },\n stripBomNode: function (node) {\n if (Dom.isBom(node)) {\n node.parentNode.removeChild(node);\n }\n },\n insignificant: function (node) {\n var attr = node.attributes;\n return node.className == 'k-marker' || Dom.is(node, 'br') && (node.className == 'k-br' || attr._moz_dirty || attr._moz_editor_bogus_node) || Dom.is(node, 'span') && node.className == 'k-br';\n },\n tableCell: function (node) {\n return Dom.is(node, 'td') || Dom.is(node, 'th');\n },\n significantNodes: function (nodes) {\n return $.grep(nodes, function (child) {\n var name = Dom.name(child);\n if (name == 'br') {\n return false;\n } else if (Dom.insignificant(child)) {\n return false;\n } else if (Dom.emptyTextNode(child)) {\n return false;\n } else if (child.nodeType == 1 && !empty[name] && Dom.emptyNode(child)) {\n return false;\n }\n return true;\n });\n },\n emptyTextNode: function (node) {\n return node && node.nodeType == 3 && whitespaceOrBom.test(node.nodeValue);\n },\n emptyNode: function (node) {\n return node.nodeType == 1 && !Dom.significantNodes(node.childNodes).length;\n },\n name: function (node) {\n return node.nodeName.toLowerCase();\n },\n significantChildNodes: function (node) {\n return $.grep(node.childNodes, function (child) {\n return child.nodeType != 3 || !Dom.isWhitespace(child);\n });\n },\n lastTextNode: function (node) {\n var result = null;\n if (node.nodeType == 3) {\n return node;\n }\n for (var child = node.lastChild; child; child = child.previousSibling) {\n result = Dom.lastTextNode(child);\n if (result) {\n return result;\n }\n }\n return result;\n },\n is: function (node, nodeName) {\n return node && Dom.name(node) == nodeName;\n },\n isMarker: function (node) {\n return node.className == KMARKER;\n },\n isWhitespace: function (node) {\n return whitespace.test(node.nodeValue);\n },\n allWhitespaceContent: function (node) {\n var child = node.firstChild;\n while (child && Dom.isWhitespace(child)) {\n child = child.nextSibling;\n }\n return !child;\n },\n isEmptyspace: function (node) {\n return emptyspace.test(node.nodeValue);\n },\n htmlIndentSpace: function (node) {\n if (!(Dom.isDataNode(node) && Dom.isWhitespace(node))) {\n return false;\n }\n if (emptyspace.test(node.nodeValue)) {\n return true;\n }\n var sibling = function (el, direction) {\n while (el[direction]) {\n el = el[direction];\n if (Dom.significantNodes([el]).length > 0) {\n return el;\n }\n }\n };\n var parent = node.parentNode;\n var prev = sibling(node, 'previousSibling');\n var next = sibling(node, 'nextSibling');\n if (bom.test(node.nodeValue)) {\n return !!(prev || next);\n }\n if ($(parent).is('tr,tbody,thead,tfoot,table,ol,ul')) {\n return true;\n }\n if (Dom.isBlock(parent) || Dom.is(parent, 'body')) {\n var isPrevBlock = prev && Dom.isBlock(prev);\n var isNextBlock = next && Dom.isBlock(next);\n if (!next && isPrevBlock || !prev && isNextBlock || isPrevBlock && isNextBlock) {\n return true;\n }\n }\n return false;\n },\n isBlock: function (node) {\n return block[Dom.name(node)];\n },\n isSelfClosing: function (node) {\n return selfClosing[Dom.name(node)];\n },\n isEmpty: function (node) {\n return empty[Dom.name(node)];\n },\n isInline: function (node) {\n return inline[Dom.name(node)];\n },\n isBr: function (node) {\n return Dom.name(node) == 'br';\n },\n list: function (node) {\n var name = node ? Dom.name(node) : '';\n return name == 'ul' || name == 'ol' || name == 'dl';\n },\n scrollContainer: function (doc) {\n var wnd = Dom.windowFromDocument(doc), scrollContainer = (wnd.contentWindow || wnd).document || wnd.ownerDocument || wnd;\n if (scrollContainer.compatMode == 'BackCompat') {\n scrollContainer = scrollContainer.body;\n } else {\n scrollContainer = scrollContainer.scrollingElement || scrollContainer.documentElement;\n }\n return scrollContainer;\n },\n scrollTo: function (node, toStart) {\n var doc = node.ownerDocument;\n var wnd = Dom.windowFromDocument(doc);\n var windowHeight = wnd.innerHeight;\n var scrollContainer = Dom.scrollContainer(doc);\n var element, elementTop, elementHeight, marker;\n if (Dom.isDataNode(node)) {\n if (toStart) {\n marker = Dom.create(doc, 'span', { 'innerHTML': '' });\n Dom.insertBefore(marker, node);\n element = $(marker);\n } else {\n element = $(node.parentNode);\n }\n } else {\n element = $(node);\n }\n elementTop = element.offset().top;\n elementHeight = element[0].offsetHeight;\n if (toStart || !elementHeight) {\n elementHeight = parseInt(element.css('line-height'), 10) || Math.ceil(1.2 * parseInt(element.css('font-size'), 10)) || 15;\n }\n if (marker) {\n Dom.remove(marker);\n }\n if (elementHeight + elementTop > scrollContainer.scrollTop + windowHeight) {\n scrollContainer.scrollTop = elementHeight + elementTop - windowHeight;\n }\n },\n persistScrollTop: function (doc) {\n persistedScrollTop = Dom.scrollContainer(doc).scrollTop;\n },\n offset: function (target, offsetParent) {\n var result = {\n top: target.offsetTop,\n left: target.offsetLeft\n };\n var parent = target.offsetParent;\n while (parent && (!offsetParent || Dom.isAncestorOf(offsetParent, parent))) {\n result.top += parent.offsetTop;\n result.left += parent.offsetLeft;\n parent = parent.offsetParent;\n }\n return result;\n },\n restoreScrollTop: function (doc) {\n if (typeof persistedScrollTop == 'number') {\n Dom.scrollContainer(doc).scrollTop = persistedScrollTop;\n persistedScrollTop = undefined;\n }\n },\n insertAt: function (parent, newElement, position) {\n parent.insertBefore(newElement, parent.childNodes[position] || null);\n },\n insertBefore: function (newElement, referenceElement) {\n if (referenceElement.parentNode) {\n return referenceElement.parentNode.insertBefore(newElement, referenceElement);\n } else {\n return referenceElement;\n }\n },\n insertAfter: function (newElement, referenceElement) {\n return referenceElement.parentNode.insertBefore(newElement, referenceElement.nextSibling);\n },\n remove: function (node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n },\n removeChildren: function (node) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n },\n removeTextSiblings: function (node) {\n var parentNode = node.parentNode;\n while (node.nextSibling && node.nextSibling.nodeType == 3) {\n parentNode.removeChild(node.nextSibling);\n }\n while (node.previousSibling && node.previousSibling.nodeType == 3) {\n parentNode.removeChild(node.previousSibling);\n }\n },\n trim: function (parent) {\n for (var i = parent.childNodes.length - 1; i >= 0; i--) {\n var node = parent.childNodes[i];\n if (Dom.isDataNode(node)) {\n if (!Dom.stripBom(node.nodeValue).length) {\n Dom.remove(node);\n }\n } else if (node.className != KMARKER) {\n Dom.trim(node);\n if (!Dom.isEmpty(node) && node.childNodes.length === 0 || Dom.isBlock(node) && Dom.allWhitespaceContent(node)) {\n Dom.remove(node);\n }\n }\n }\n return parent;\n },\n closest: function (node, tags) {\n if (typeof tags === 'string') {\n tags = [tags];\n }\n while (node && tags.indexOf(Dom.name(node)) < 0) {\n node = node.parentNode;\n }\n return node;\n },\n closestBy: function (node, condition, rootCondition) {\n while (node && !condition(node)) {\n if (rootCondition && rootCondition(node)) {\n return null;\n }\n node = node.parentNode;\n }\n return node;\n },\n sibling: function (node, direction) {\n do {\n node = node[direction];\n } while (node && node.nodeType != 1);\n return node;\n },\n next: function (node) {\n return Dom.sibling(node, 'nextSibling');\n },\n prev: function (node) {\n return Dom.sibling(node, 'previousSibling');\n },\n parentOfType: function (node, tags) {\n do {\n node = node.parentNode;\n } while (node && !Dom.ofType(node, tags));\n return node;\n },\n ofType: function (node, tags) {\n return $.inArray(Dom.name(node), tags) >= 0;\n },\n changeTag: function (referenceElement, tagName, skipAttributes) {\n var newElement = Dom.create(referenceElement.ownerDocument, tagName), attributes = referenceElement.attributes, i, len, name, value, attribute;\n if (!skipAttributes) {\n for (i = 0, len = attributes.length; i < len; i++) {\n attribute = attributes[i];\n if (attribute.specified) {\n name = attribute.nodeName;\n value = attribute.nodeValue;\n if (name == CLASS) {\n newElement.className = value;\n } else if (name == STYLE) {\n newElement.style.cssText = referenceElement.style.cssText;\n } else {\n newElement.setAttribute(name, value);\n }\n }\n }\n }\n while (referenceElement.firstChild) {\n newElement.appendChild(referenceElement.firstChild);\n }\n Dom.insertBefore(newElement, referenceElement);\n Dom.remove(referenceElement);\n return newElement;\n },\n editableParent: function (node) {\n while (node && (node.nodeType == 3 || node.contentEditable !== 'true')) {\n node = node.parentNode;\n }\n return node;\n },\n wrap: function (node, wrapper) {\n Dom.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n },\n unwrap: function (node) {\n var parent = node.parentNode;\n while (node.firstChild) {\n parent.insertBefore(node.firstChild, node);\n }\n parent.removeChild(node);\n },\n wrapper: function (node) {\n var wrapper = Dom.closestBy(node, function (el) {\n return el.parentNode && Dom.significantNodes(el.parentNode.childNodes).length > 1;\n });\n return $(wrapper).is('body,.k-editor') ? undefined : wrapper;\n },\n create: function (document, tagName, attributes) {\n return Dom.attr(document.createElement(tagName), attributes);\n },\n createEmptyNode: function (document, tagName, attributes) {\n var node = Dom.attr(document.createElement(tagName), attributes);\n node.innerHTML = '\\uFEFF';\n return node;\n },\n attr: function (element, attributes) {\n attributes = extend({}, attributes);\n if (attributes && STYLE in attributes) {\n Dom.style(element, attributes.style);\n delete attributes.style;\n }\n for (var attr in attributes) {\n if (attributes[attr] === null) {\n element.removeAttribute(attr);\n delete attributes[attr];\n } else if (attr == 'className') {\n element[attr] = attributes[attr];\n }\n }\n return extend(element, attributes);\n },\n mergeAttributes: function (origin, target) {\n if (!origin.attributes.length) {\n return;\n }\n $.each(origin.attributes, function () {\n if (this.name !== 'contenteditable') {\n $(target).attr(this.name, this.value);\n }\n });\n },\n style: function (node, value) {\n $(node).css(value || {});\n },\n unstyle: function (node, value) {\n for (var key in value) {\n if (key == FLOAT) {\n key = kendo.support.cssFloat ? CSSFLOAT : STYLEFLOAT;\n }\n node.style[key] = '';\n }\n if (node.style.cssText === '') {\n node.removeAttribute(STYLE);\n }\n },\n inlineStyle: function (body, name, attributes) {\n var span = $(Dom.create(body.ownerDocument, name, attributes)), style;\n body.appendChild(span[0]);\n style = map(cssAttributes, function (value) {\n if (browser.msie && value == 'line-height' && span.css(value) == '1px') {\n return 'line-height:1.5';\n } else {\n return value + ':' + span.css(value);\n }\n }).join(';');\n span.remove();\n return style;\n },\n getEffectiveBackground: function (element) {\n var backgroundStyle = element.css('background-color') || '';\n if (backgroundStyle.indexOf('rgba(0, 0, 0, 0') < 0 && backgroundStyle !== 'transparent') {\n return backgroundStyle;\n } else if (element[0].tagName.toLowerCase() === 'html') {\n return 'Window';\n } else {\n return Dom.getEffectiveBackground(element.parent());\n }\n },\n innerText: function (node) {\n var text = node.innerHTML;\n text = text.replace(//gi, '');\n text = text.replace(/<\\/?[^>]+?\\/?>/gm, '');\n return text;\n },\n removeClass: function (node, classNames) {\n var className = ' ' + node.className + ' ', classes = classNames.split(' '), i, len;\n for (i = 0, len = classes.length; i < len; i++) {\n className = className.replace(' ' + classes[i] + ' ', ' ');\n }\n className = kendo.trim(className);\n if (className.length) {\n node.className = className;\n } else {\n node.removeAttribute(CLASS);\n }\n },\n commonAncestor: function () {\n var count = arguments.length, paths = [], minPathLength = Infinity, output = null, i, ancestors, node, first, j;\n if (!count) {\n return null;\n }\n if (count == 1) {\n return arguments[0];\n }\n for (i = 0; i < count; i++) {\n ancestors = [];\n node = arguments[i];\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n paths.push(ancestors.reverse());\n minPathLength = Math.min(minPathLength, ancestors.length);\n }\n if (count == 1) {\n return paths[0][0];\n }\n for (i = 0; i < minPathLength; i++) {\n first = paths[0][i];\n for (j = 1; j < count; j++) {\n if (first != paths[j][i]) {\n return output;\n }\n }\n output = first;\n }\n return output;\n },\n closestSplittableParent: function (nodes) {\n var result;\n if (nodes.length == 1) {\n result = Dom.parentOfType(nodes[0], [\n 'ul',\n 'ol'\n ]);\n } else {\n result = Dom.commonAncestor.apply(null, nodes);\n }\n if (!result) {\n result = Dom.parentOfType(nodes[0], [\n 'p',\n 'td'\n ]) || nodes[0].ownerDocument.body;\n }\n if (Dom.isInline(result)) {\n result = Dom.blockParentOrBody(result);\n }\n var editableParents = map(nodes, Dom.editableParent);\n var editableAncestor = Dom.commonAncestor(editableParents)[0];\n if ($.contains(result, editableAncestor)) {\n result = editableAncestor;\n }\n return result;\n },\n closestEditable: function (node, types) {\n var closest;\n var editable = Dom.editableParent(node);\n if (Dom.ofType(node, types)) {\n closest = node;\n } else {\n closest = Dom.parentOfType(node, types);\n }\n if (closest && editable && $.contains(closest, editable)) {\n closest = editable;\n } else if (!closest && editable) {\n closest = editable;\n }\n return closest;\n },\n closestEditableOfType: function (node, types) {\n var editable = Dom.closestEditable(node, types);\n if (editable && Dom.ofType(editable, types) && !$(editable).is('.k-editor')) {\n return editable;\n }\n },\n filter: function (tagName, nodes, invert) {\n var filterFn = function (node) {\n return Dom.name(node) == tagName;\n };\n return Dom.filterBy(nodes, filterFn, invert);\n },\n filterBy: function (nodes, condition, invert) {\n var i = 0;\n var len = nodes.length;\n var result = [];\n var match;\n for (; i < len; i++) {\n match = condition(nodes[i]);\n if (match && !invert || !match && invert) {\n result.push(nodes[i]);\n }\n }\n return result;\n },\n ensureTrailingBreaks: function (node) {\n var elements = $(node).find('p,td,th');\n var length = elements.length;\n var i = 0;\n if (length) {\n for (; i < length; i++) {\n Dom.ensureTrailingBreak(elements[i]);\n }\n } else {\n Dom.ensureTrailingBreak(node);\n }\n },\n removeTrailingBreak: function (node) {\n $(node).find('br[type=_moz],.k-br').remove();\n },\n ensureTrailingBreak: function (node) {\n Dom.removeTrailingBreak(node);\n var lastChild = node.lastChild;\n var name = lastChild && Dom.name(lastChild);\n var br;\n if (!name || name != 'br' && name != 'img' || name == 'br' && lastChild.className != 'k-br') {\n br = node.ownerDocument.createElement('br');\n br.className = 'k-br';\n node.appendChild(br);\n }\n },\n reMapTableColumns: function (table, colAttr) {\n Dom._mapColIndices(table, colAttr);\n },\n clearTableMappings: function (table, colAttr) {\n $(table).find('[' + colAttr + ']').removeAttr(colAttr);\n },\n _mapColIndices: function (table, colAttr) {\n var registeredColumns = {};\n for (var rowIndex = 0; rowIndex < table.rows.length; rowIndex++) {\n var cells = table.rows[rowIndex].cells;\n var colIndex = 0;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++, colIndex++) {\n var cell = cells[cellIndex];\n if (cell.rowSpan > 1) {\n this._mapColspan(cell, rowIndex, colIndex, registeredColumns);\n }\n if (registeredColumns[rowIndex]) {\n while (registeredColumns[rowIndex][colIndex]) {\n colIndex++;\n }\n }\n cell.setAttribute(colAttr, colIndex);\n if (cell.colSpan > 1) {\n colIndex = colIndex + cell.colSpan - 1;\n }\n }\n }\n },\n _mapColspan: function (cell, rowIndex, colIndex, registeredColumns) {\n var rowSpan = cell.rowSpan, colSpan = cell.colSpan, index;\n for (var ci = 0; ci < colSpan; ci++) {\n index = colIndex + ci;\n for (var ri = rowIndex + 1; ri < rowIndex + rowSpan; ri++) {\n if (!registeredColumns[ri]) {\n registeredColumns[ri] = {};\n registeredColumns[ri].length = 0;\n }\n if (registeredColumns[rowIndex]) {\n while (registeredColumns[rowIndex][index]) {\n index++;\n }\n }\n registeredColumns[ri][index] = true;\n registeredColumns[ri].length++;\n }\n }\n },\n associateWithIds: function (table) {\n var that = this;\n var numberOfTheadRows = 0;\n var tableRows = table.rows;\n var numberOfTableRows = tableRows.length;\n var theadMatrix = [];\n var tbodyMatrix = [];\n var theadRows, i;\n if (table.tHead) {\n theadRows = table.tHead.rows;\n numberOfTheadRows = theadRows.length;\n } else {\n numberOfTheadRows = that._getNumberOfHeaderRows(table);\n theadRows = [];\n for (i = 0; i < numberOfTheadRows; i++) {\n theadRows.push(tableRows[i]);\n }\n }\n for (i = 0; i < numberOfTheadRows; i++) {\n theadMatrix.push([]);\n }\n for (i = 0; i < numberOfTableRows; i++) {\n tbodyMatrix.push([]);\n }\n that._generateIdsForColumns(theadMatrix, theadRows);\n that._generateIdsForRows(theadMatrix, tbodyMatrix, numberOfTheadRows, tableRows);\n that._assignIds(theadMatrix, tbodyMatrix, numberOfTheadRows, tableRows);\n },\n _generateIdsForColumns: function (theadMatrix, theadRows) {\n var timestamp = new Date().getTime();\n var numberOfTheadRows = theadRows ? theadRows.length : 0;\n var row, cells, cell, col, id, colspan, rowspan, i, j, k, l;\n for (i = 0; i < numberOfTheadRows; i++) {\n row = theadRows[i];\n cells = row.cells;\n col = 0;\n for (j = 0; j < cells.length; j++) {\n cell = cells[j];\n id = 'table' + i + j + ++timestamp;\n cell.setAttribute('id', id);\n colspan = cell.getAttribute('colspan') || 1;\n rowspan = cell.getAttribute('rowspan') || 1;\n while (theadMatrix[i][j + col]) {\n col += 1;\n }\n for (k = 0; k < rowspan; k++) {\n for (l = 0; l < colspan; l++) {\n theadMatrix[i + k][j + col + l] = id;\n }\n }\n }\n }\n },\n _generateIdsForRows: function (theadMatrix, tbodyMatrix, numberOfTheadRows, tableRows) {\n var that = this;\n var timestamp = new Date().getTime();\n var numberOfTableRows = tableRows.length;\n var row, cells, cell, col, id, colspan, rowspan, i, j, k, l, colIndex, headers;\n var pushHeaderId = function (row) {\n headers.push(row[colIndex]);\n };\n for (i = numberOfTheadRows; i < numberOfTableRows; i++) {\n row = tableRows[i];\n cells = $(row.cells).filter('th');\n col = 0;\n for (j = 0; j < cells.length; j++) {\n cell = cells[j];\n id = 'table' + i + j + ++timestamp;\n cell.setAttribute('id', id);\n colspan = cell.getAttribute('colspan') || 1;\n rowspan = cell.getAttribute('rowspan') || 1;\n while (tbodyMatrix[i][j + col]) {\n col += 1;\n }\n for (k = 0; k < rowspan; k++) {\n for (l = 0; l < colspan; l++) {\n tbodyMatrix[i + k][j + col + l] = id;\n }\n }\n colIndex = cell.getAttribute('col-index');\n headers = [];\n theadMatrix.forEach(pushHeaderId);\n headers = headers.filter(that._onlyUnique);\n cell.setAttribute('headers', headers.join(' ').trim());\n }\n }\n },\n _assignIds: function (theadMatrix, tbodyMatrix, numberOfTheadRows, tableRows) {\n var that = this;\n var numberOfTableRows = tableRows.length;\n var row, cells, cell, i, j, colIndex, headers;\n var pushHeaderId = function (row) {\n headers.push(row[colIndex]);\n };\n for (i = numberOfTheadRows; i < numberOfTableRows; i++) {\n row = tableRows[i];\n cells = $(row.cells).filter('td');\n for (j = 0; j < cells.length; j++) {\n cell = cells[j];\n colIndex = cell.getAttribute('col-index');\n headers = tbodyMatrix[i].slice();\n theadMatrix.forEach(pushHeaderId);\n headers = headers.filter(that._onlyUnique);\n cell.setAttribute('headers', headers.join(' ').trim());\n }\n }\n },\n _getNumberOfColumns: function (table) {\n var cells = $(table).find('th, td');\n var numberOfCols = 0;\n var cell, i, currentIndex;\n for (i = 0; i < cells.length; i++) {\n cell = cells[i];\n currentIndex = Number(cell.getAttribute('col-index')) + 1;\n if (currentIndex > numberOfCols) {\n numberOfCols = currentIndex;\n }\n }\n return numberOfCols;\n },\n _getNumberOfHeaderColumns: function (table, numberOfHeaderRows) {\n var rows = table.rows;\n var numberOfCols = 0;\n var currentIndex, row, i, j, cell;\n for (i = numberOfHeaderRows; i < rows.length; i++) {\n row = rows[i];\n for (j = 0; j < row.cells.length; j++) {\n cell = row.cells[j];\n if (this.is(cell, 'th')) {\n currentIndex = Number(cell.getAttribute('col-index')) + 1;\n if (currentIndex > numberOfCols) {\n numberOfCols = currentIndex;\n }\n }\n }\n }\n return numberOfCols;\n },\n _getNumberOfHeaderRows: function (table) {\n var rows = table.rows;\n var thead = table.tHead;\n var number = thead && table.tHead.rows ? table.tHead.rows.length : 0;\n var j, row, cell, length;\n if (number === 0) {\n row = rows[0];\n length = row.cells && row.cells.length;\n while (row && length && this.is(row.cells[0], 'th')) {\n for (j = 0; j < length; j++) {\n cell = row ? row.cells[j] : null;\n if (!this.is(cell, 'th')) {\n row = null;\n }\n }\n if (row) {\n number += 1;\n row = this.next(row);\n length = row && row.cells && row.cells.length;\n }\n }\n }\n return number;\n },\n _onlyUnique: function (value, index, self) {\n return self.indexOf(value) === index;\n }\n };\n kendo.ui.editor.Dom = Dom;\n }(window.kendo.jQuery));\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));\n(function (f, define) {\n define('editor/serializer', ['editor/dom'], f);\n}(function () {\n (function ($, undefined) {\n var kendo = window.kendo;\n var Editor = kendo.ui.editor;\n var dom = Editor.Dom;\n var extend = $.extend;\n var fontSizeMappings = 'xx-small,x-small,small,medium,large,x-large,xx-large'.split(',');\n var quoteRe = /\"/g;\n var brRe = /
]*>/i;\n var pixelRe = /^\\d+(\\.\\d*)?(px)?$/i;\n var emptyPRe = /(?: )?<\\/p>/i;\n var cssDeclaration = /(\\*?[-#\\/\\*\\\\\\w]+(?:\\[[0-9a-z_-]+\\])?)\\s*:\\s*((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/g;\n var sizzleAttr = /^sizzle-\\d+/i;\n var scriptAttr = /^k-script-/i;\n var onerrorRe = /\\s*onerror\\s*=\\s*(?:'|\")?([^'\">\\s]*)(?:'|\")?/i;\n var br = '
';\n var bomSpan = '\\uFEFF';\n var div = document.createElement('div');\n div.innerHTML = '
';\n var supportsLeadingWhitespace = div.firstChild.nodeType === 3;\n div = null;\n var isFunction = $.isFunction;\n var TD = 'td';\n var Serializer = {\n toEditableHtml: function (html) {\n return (html || '').replace(//g, '').replace(/<(\\/?)script([^>]*)>/gi, '<$1k:script$2>').replace(/
]*)>/gi, function (match) {\n return match.replace(onerrorRe, '');\n }).replace(/(<\\/?img[^>]*>)[\\r\\n\\v\\f\\t ]+/gi, '$1').replace(/^<(table|blockquote)/i, br + '<$1').replace(/^[\\s]*( |\\u00a0)/i, '$1').replace(/<\\/(table|blockquote)>$/i, '$1>' + br);\n },\n _toEditableImmutables: function (body) {\n var immutable = Editor.Immutables.immutable, emptyTextNode = dom.emptyTextNode, first = body.firstChild, last = body.lastChild;\n while (emptyTextNode(first)) {\n first = first.nextSibling;\n }\n while (emptyTextNode(last)) {\n last = last.previousSibling;\n }\n if (first && immutable(first)) {\n $(bomSpan).prependTo(body);\n }\n if (last && immutable(last)) {\n $(bomSpan).appendTo(body);\n }\n },\n _fillEmptyElements: function (body) {\n $(body).find('p,td').each(function () {\n var p = $(this);\n if (/^\\s*$/g.test(p.text()) && !p.find('img,input').length) {\n var node = this;\n while (node.firstChild && node.firstChild.nodeType != 3) {\n node = node.firstChild;\n }\n if (node.nodeType == 1 && !dom.empty[dom.name(node)]) {\n if (dom.is(node, 'td')) {\n node.innerHTML = kendo.ui.editor.emptyTableCellContent;\n } else {\n node.innerHTML = kendo.ui.editor.emptyElementContent;\n }\n }\n }\n });\n },\n _removeSystemElements: function (body) {\n $('.k-paste-container', body).remove();\n },\n _resetOrderedLists: function (root) {\n var ols = root.getElementsByTagName('ol'), i, ol, originalStart;\n for (i = 0; i < ols.length; i++) {\n ol = ols[i];\n originalStart = ol.getAttribute('start');\n ol.setAttribute('start', 1);\n if (originalStart) {\n ol.setAttribute('start', originalStart);\n } else {\n ol.removeAttribute(originalStart);\n }\n }\n },\n _preventScriptExecution: function (root) {\n $(root).find('*').each(function () {\n var attributes = this.attributes;\n var attribute, i, l, name;\n var attributesToRemove = [];\n for (i = 0, l = attributes.length; i < l; i++) {\n attribute = attributes[i];\n name = attribute.nodeName;\n if (attribute.specified && /^on/i.test(name)) {\n this.setAttribute('k-script-' + name, attribute.value);\n attributesToRemove.push(name);\n }\n }\n for (i = 0, l = attributesToRemove.length; i < l; i++) {\n this.removeAttribute(attributesToRemove[i]);\n }\n });\n },\n htmlToDom: function (html, root, options) {\n var browser = kendo.support.browser;\n var msie = browser.msie;\n var legacyIE = msie && browser.version < 9;\n var originalSrc = 'originalsrc';\n var originalHref = 'originalhref';\n var o = options || {};\n var immutables = o.immutables;\n html = Serializer.toEditableHtml(html);\n if (legacyIE) {\n html = '
' + html;\n html = html.replace(/href\\s*=\\s*(?:'|\")?([^'\">\\s]*)(?:'|\")?/, originalHref + '=\"$1\"');\n html = html.replace(/src\\s*=\\s*(?:'|\")?([^'\">\\s]*)(?:'|\")?/, originalSrc + '=\"$1\"');\n }\n if (isFunction(o.custom)) {\n html = o.custom(html) || html;\n }\n root.innerHTML = html;\n if (immutables) {\n immutables.deserialize(root);\n }\n if (legacyIE) {\n dom.remove(root.firstChild);\n $(root).find('k\\\\:script,script,link,img,a').each(function () {\n var node = this;\n if (node[originalHref]) {\n node.setAttribute('href', node[originalHref]);\n node.removeAttribute(originalHref);\n }\n if (node[originalSrc]) {\n node.setAttribute('src', node[originalSrc]);\n node.removeAttribute(originalSrc);\n }\n });\n } else if (msie) {\n dom.normalize(root);\n Serializer._resetOrderedLists(root);\n }\n Serializer._preventScriptExecution(root);\n Serializer._fillEmptyElements(root);\n Serializer._removeSystemElements(root);\n Serializer._toEditableImmutables(root);\n $('table', root).addClass('k-table');\n return root;\n },\n domToXhtml: function (root, options) {\n var result = [];\n var immutables = options && options.immutables;\n function semanticFilter(attributes) {\n return $.grep(attributes, function (attr) {\n return attr.name != 'style';\n });\n }\n function mapStart(node, tag) {\n result.push('<' + tag);\n attr(node);\n result.push('>');\n }\n var tagMap = {\n iframe: {\n start: function (node) {\n mapStart(node, 'iframe');\n },\n end: function () {\n result.push('');\n }\n },\n 'k:script': {\n start: function (node) {\n mapStart(node, 'script');\n },\n end: function () {\n result.push('');\n },\n skipEncoding: true\n },\n span: {\n semantic: true,\n start: function (node) {\n var style = node.style;\n var attributes = specifiedAttributes(node);\n var semanticAttributes = semanticFilter(attributes);\n if (semanticAttributes.length) {\n result.push('');\n }\n if (style.textDecoration == 'underline') {\n result.push('');\n }\n var font = [];\n if (style.color) {\n font.push('color=\"' + dom.toHex(style.color) + '\"');\n }\n if (style.fontFamily) {\n font.push('face=\"' + style.fontFamily + '\"');\n }\n if (style.fontSize) {\n var size = $.inArray(style.fontSize, fontSizeMappings);\n font.push('size=\"' + size + '\"');\n }\n if (font.length) {\n result.push('');\n }\n },\n end: function (node) {\n var style = node.style;\n if (style.color || style.fontFamily || style.fontSize) {\n result.push('');\n }\n if (style.textDecoration == 'underline') {\n result.push('');\n }\n if (semanticFilter(specifiedAttributes(node)).length) {\n result.push('');\n }\n }\n },\n strong: {\n semantic: true,\n start: function (node) {\n mapStart(node, 'b');\n },\n end: function () {\n result.push('');\n }\n },\n em: {\n semantic: true,\n start: function (node) {\n mapStart(node, 'i');\n },\n end: function () {\n result.push('