travel/admin/node_modules/tui-editor/dist/tui-editor-Editor-all.min.js

13 lines
444 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* tui-editor
* @version 1.3.3
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","codemirror","to-mark","tui-chart","squire-rte","markdown-it","highlight.js","tui-color-picker","plantuml-encoder"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):(e.tui=e.tui||{},e.tui.Editor=t(e.$,e.tui&&e.tui.util,e.CodeMirror,e.toMark,e.tui&&e.tui.chart,e.Squire,e.markdownit,e.hljs,e.tui&&e.tui.colorPicker,e.plantumlEncoder))}("undefined"!=typeof self?self:this,function(e,t,n,r,i,o,a,l,s,u){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=55)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(84),d=r(c),f=n(38),h=f.isMac?1:0,p=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),this._command=new u.default.Map,this._mdCommand=new u.default.Map,this._wwCommand=new u.default.Map,this._options=l.default.extend({useCommandShortcut:!0},n),this.base=t,this.keyMapCommand={},this._initEvent()}return o(e,[{key:"_addCommandBefore",value:function(e){var t={command:e};return this.base.eventManager.emit("addCommandBefore",t),t.command||e}},{key:"addCommand",value:function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];r.length&&(t=e.command.apply(e,[t].concat(r))),t=this._addCommandBefore(t);var o=t.getName(),a=void 0;return t.isMDType()?a=this._mdCommand:t.isWWType()?a=this._wwCommand:t.isGlobalType()&&(a=this._command),a.set(o,t),t.keyMap&&(this.keyMapCommand[t.keyMap[h]]=o),t}},{key:"_initEvent",value:function(){var e=this;this.base.eventManager.listen("command",function(){e.exec.apply(e,arguments)}),this.base.eventManager.listen("keyMap",function(t){if(e._options.useCommandShortcut){var n=e.keyMapCommand[t.keyMap];n&&(t.data.preventDefault(),e.exec(n))}})}},{key:"exec",value:function(e){var t=void 0,n=void 0,r=this.base;if(t=this._command.get(e),t||(this.base.isMarkdownMode()?(t=this._mdCommand.get(e),r=this.base.mdEditor):(t=this._wwCommand.get(e),r=this.base.wwEditor)),t){for(var i,o=arguments.length,a=Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];a.unshift(r),n=(i=t).exec.apply(i,a)}return n}}]),e}();p.command=function(e,t){var n=d.default.factory(e,t.name,t.keyMap);return u.default.extend(n,t),n},t.default=p},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.I18n=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=void 0,s="en_US",u=function(){function e(){r(this,e),this._code=s,this._langs=new a.default.Map}return i(e,[{key:"setCode",value:function(e){this._code=e}},{key:"setLanguage",value:function(e,t){var n=this;e=[].concat(e),e.forEach(function(e){if(n._langs.has(e)){var r=n._langs.get(e);n._langs.set(e,a.default.extend(r,t))}else n._langs.set(e,t)})}},{key:"get",value:function(e,t){t||(t=this._code);var n=this._langs.get(t);n||(n=this._langs.get(s));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r}}],[{key:"getSharedInstance",value:function(){return l||(l=new e),l}}]),e}();t.I18n=u,t.default=new u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),l=r(a),s=/\u200B/g,u=function(e){return e&&e.nodeType===Node.TEXT_NODE},c=function(e){return e&&e.nodeType===Node.ELEMENT_NODE},d=function(e){return/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|DETAILS|DIALOG|DD|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[\d]|HEADER|HGROUP|HR|LI|MAIN|NAV|OL|P|PRE|SECTION|UL)$/gi.test(this.getNodeName(e))},f=function(e){return c(e)?e.tagName:"TEXT"},h=function(e){var t=void 0;return c(e)?t=e.textContent.replace(s,"").length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},p=function(e){var t=void 0;return c(e)?t=e.childNodes.length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},g=function(e){var t=e.parentNode.childNodes,n=void 0,r=void 0,i=void 0;for(n=0,r=t.length;n<r;n+=1)if(t[n]===e){i=n;break}return i},v=function(e,t){var n=void 0;return u(e)?n=e:e.childNodes.length&&t>=0&&(n=e.childNodes[t]),n},m=function(e,t,n){for(var r=e+"Sibling",i=void 0,o=void 0;t&&!t[r]&&(i=f(t.parentNode))!==n&&"BODY"!==i;)t=t.parentNode;return t[r]&&(o=t[r]),o},y=function(e,t,n){return t>0?v(e,t-1):m("previous",e,n)},_=function(e,t,n){for(var r=void 0;e.parentNode&&!t(e.parentNode)&&(e=e.parentNode,!n||!n(e.parentNode)););return t(e.parentNode)&&(r=e),r},b=function(e,t){return l.default.isString(t)?_(e,function(e){return t===f(e)}):_(e,function(e){return t===e})},w=function(e,t,n){var r=e+"Sibling",i=void 0;return t=b(t,n),t&&t[r]&&(i=t[r]),i},k=function(e,t){return w("previous",e,t)},E=function(e,t){return w("next",e,t)},C=function(e){return b(e,"BODY")},T=function(e){for(e=e.previousSibling||e.parentNode;!u(e)&&"BODY"!==f(e);)if(e.previousSibling)for(e=e.previousSibling;e.lastChild;)e=e.lastChild;else e=e.parentNode;return"BODY"===f(e)&&(e=null),e},M=function(e,t){for(var n=document.createTreeWalker(e,4,null,!1),r=e===t;!r&&n.nextNode();)r=n.currentNode===t;return r},S=function(e,t,n){var r=[],i="",o=0,a=void 0;if(!t.length)return r;for(var s=t.shift(),u=document.createTreeWalker(e,4,null,!1);u.nextNode();){for(i=u.currentNode.nodeValue||"",n&&(i=n(i)),a=o+i.length;a>=s;){if(r.push({container:u.currentNode,offsetInContainer:s-o,offset:s}),!t.length)return r;s=t.shift()}o=a}do{r.push({container:u.currentNode,offsetInContainer:i.length,offset:s}),s=t.shift()}while(!l.default.isUndefined(s));return r},O=function(e){var t={};t.tagName=e.nodeName,e.id&&(t.id=e.id);var n=e.className.trim();return n&&(t.className=n),t},x=function(e,t){for(var n=[];e&&e!==t;)c(e)&&n.unshift(O(e)),e=e.parentNode;return n},I=function(e,t){var n=!0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t?null:("previous"===t&&(n=!1),n?e.nextElementSibling:e.previousElementSibling)},L=function(e,t,n){var r=!0,i=null,a=void 0,s=void 0,u=void 0,c=void 0,d=void 0,h=void 0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t?null:("previous"===t&&(r=!1),e?(a=(0,o.default)(e),r?(u=a.parent().next(),c=a.parents("thead"),d=c[0]&&c.next(),h=d&&"TBODY"===f(d[0]),s=0):(u=a.parent().prev(),c=a.parents("tbody"),d=c[0]&&c.prev(),h=d&&"THEAD"===f(d[0]),s=e.parentNode.childNodes.length-1),!l.default.isUndefined(n)&&n||(s=g(e)),u[0]?i=u.children("td,th")[s]:c[0]&&h&&(i=d.find("td,th")[s]),i):null)},A=function(e){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(e.nodeName)},N=function(e){return/^(A|ABBR|ACRONYM|B|BDI|BDO|BIG|CITE|CODE|DEL|DFN|EM|I|INS|KBD|MARK|Q|S|SAMP|SMALL|SPAN|STRONG|SUB|SUP|U|VAR)$/gi.test(e.nodeName)},P=function(e,t,n){var r=t;if(r&&e===r.parentNode)for(;r!==n;){var i=r.nextSibling;e.removeChild(r),r=i}},B=function(e,t,n){for(var r=t;r!==e;){var i=r.parentNode,o=r,a=o.nextSibling,l=o.previousSibling;!n&&a?P(i,a,null):n&&l&&P(i,i.childNodes[0],r),r=i}},R=function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t,r=n.firstChild;t=u(r)&&!h(r)?r.nextSibling||r:r}return t};t.default={getNodeName:f,isTextNode:u,isElemNode:c,isBlockNode:d,getTextLength:h,getOffsetLength:p,getPrevOffsetNodeUntil:y,getNodeOffsetOfParent:g,getChildNodeByOffset:v,containsNode:M,getTopPrevNodeUnder:k,getTopNextNodeUnder:E,getParentUntilBy:_,getParentUntil:b,getTopBlockNode:C,getPrevTextNode:T,findOffsetNode:S,getPath:x,getNodeInfo:O,getTableCellByDirection:I,getSiblingRowCellByDirection:L,isMDSupportInlineNode:A,isStyledNode:N,removeChildFromStartToEndNode:P,removeNodesByDirection:B,getLeafNode:R}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0;try{r=n(29)}catch(e){}if(!r)try{r=n(!function(){var e=new Error('Cannot find module "../viewer"');throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=(0,b.default)(e),i=r.attr("colspan"),o=r.attr("rowspan"),a=e.nodeName;if("TH"!==a&&"TD"!==a)return null;var l={nodeName:e.nodeName,colspan:i?parseInt(i,10):1,rowspan:o?parseInt(o,10):1,content:r.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(l.align=e.align),l}function o(e,t,n,r){var i=t.colspan,o=t.rowspan,a=t.nodeName,l=i>1,s=o>1;if(l||s){var u=n+o,c=r+i;k.default.range(n,u).forEach(function(t){e[t]=e[t]||[],k.default.range(r,c).forEach(function(i){var o={nodeName:a};t===n&&i===r||(l&&(o.colMergeWith=r),s&&(o.rowMergeWith=n),e[t][i]=o)})})}}function a(e){var t=[];return e.find("tr").each(function(e,n){var r=0;t[e]=t[e]||[],(0,b.default)(n).children().each(function(n,a){var l=i(a,e,n);if(l){for(var s=n+r;t[e][s];)s+=1,r+=1;t[e][s]=l,o(t,l,e,s)}})}),e[0].className&&(t.className=e[0].className),t}function l(e){var t=[];return e.forEach(function(e,n){var r=[];e.forEach(function(e,t){k.default.isUndefined(e.colMergeWith)&&k.default.isUndefined(e.rowMergeWith)&&r.push({rowIndex:n,colIndex:t})}),t.push(r)}),t}function s(e){var t=e[0];return t.map(function(e){return k.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align})}function u(e,t){var n=s(e),r=t.map(function(t){return t.map(function(t){var r=t.rowIndex,i=t.colIndex;return k.default.extend({align:n[i]},e[r][i])})});return e.className&&(r.className=e.className),r}function c(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:E,elementIndex:{rowIndex:e,colIndex:t}}}function d(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function f(e){return e.closest("td, th").prevAll().length}function h(e,t){var n=d(t),r=f(t);return e[n][r]}function p(e,t,n){var r=e[t][n],i=t;return r.rowspan>1&&(i+=r.rowspan-1),i}function g(e,t,n){var r=e[t][n],i=n;return r.colspan>1&&(i+=r.colspan-1),i}function v(e,t,n){var r=e[t][n];return t=k.default.isExisty(r.rowMergeWith)?r.rowMergeWith:t,n=k.default.isExisty(r.colMergeWith)?r.colMergeWith:n,e[t][n].elementIndex}function m(e,t){e.forEach(function(e,n){var r=e.length;if(r){var i=e[0].nodeName;k.default.range(r,t).forEach(function(t){e.push(c(n,t,i))})}})}function y(e){var t=e[0],n=t.length,r=!0;if(!n&&e[1])k.default.range(0,e[1].length).forEach(function(e){t.push(c(0,e,"TH"))});else if("TH"!==e[0][0].nodeName){var i,o=k.default.range(0,n).map(function(e){return c(0,e,"TH")});(i=[]).concat.apply(i,e).forEach(function(e){e.elementIndex&&(e.elementIndex.rowIndex+=1)}),e.unshift(o)}else if(1===e.length){var a=k.default.range(0,n).map(function(e){return c(1,e,"TD")});e.push(a)}else r=!1;return r}Object.defineProperty(t,"__esModule",{value:!0}),t.createTableData=a,t.createCellIndexData=l;var _=n(0),b=r(_),w=n(1),k=r(w),E=k.default.browser.msie?"":"<br>";t.default={createTableData:a,createCellIndexData:l,createRenderData:u,findElementRowIndex:d,findElementColIndex:f,findCellIndex:h,createBasicCell:c,findRowMergedLastIndex:p,findColMergedLastIndex:g,findElementIndex:v,stuffCellsIntoIncompleteRow:m,addTbodyOrTheadIfNeed:y}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(1),d=r(c),f=n(14),h=r(f),p="tui-popup-",g='<div class="'+p+'header">\n <span class="'+p+'title"></span>\n <div class="'+p+'header-buttons">\n <button type="button" class="'+p+'close-button"></button>\n </div>\n </div>\n <div class="'+p+'body"></div>',v='<div class="'+p+'wrapper">\n <div class="'+p+'header">\n <span class="'+p+'title"></span>\n <div class="'+p+'header-buttons">\n <button type="button" class="'+p+'close-button"></button>\n </div>\n </div>\n <div class="'+p+'body"></div>\n </div>',m=function(e){function t(e){i(this,t),e=d.default.extend({header:!0,$target:(0,u.default)("body"),textContent:""},e);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:e.modal?p+"modal-background":p+"wrapper",rootElement:e.$el}));return n._initInstance(e),n._initDOM(e),n._initDOMEvent(e),n._initEditorEvent(e),n}return a(t,e),l(t,[{key:"_initInstance",value:function(e){this._$target=e.$target,e.$el&&(this.$el=e.$el,this._isExternalHtmlUse=!0),e.content?this.$content=(0,u.default)(e.content):this.$content=e.textContent,this.options=e}},{key:"_initDOM",value:function(){this._initLayout(),this._isExternalHtmlUse||(d.default.isExisty(this.options.title)&&this.setTitle(this.options.title),this.setContent(this.$content));var e=this.options.headerButtons;if(e){this.$el.find("."+p+"close-button").remove();var t=this.$el.find("."+p+"header-buttons");t.empty(),t.append((0,u.default)(e))}this.options.css&&this.$el.css(this.options.css)}},{key:"_initDOMEvent",value:function(){var e=this,t=this.options,n=t.openerCssQuery,r=t.closerCssQuery;n&&(0,u.default)(n).on("click."+this._id,function(){return e.show()}),r&&(0,u.default)(r).on("click."+this._id,function(){return e.hide()}),this.on("click ."+p+"close-button",function(){return e.hide()})}},{key:"_initEditorEvent",value:function(){}},{key:"_initLayout",value:function(){var e=this.options;if(this._isExternalHtmlUse)this.hide(),this._$target.append(this.$el);else{var t=e.modal?v:g;this.$el.html(t),this.$el.addClass(e.className),this.hide(),this._$target.append(this.$el),this.$body=this.$el.find("."+p+"body"),e.header||this.$el.find("."+p+"header").remove()}}},{key:"setContent",value:function(e){this.$body.empty(),this.$body.append(e)}},{key:"setTitle",value:function(e){var t=this.$el.find("."+p+"title");t.empty(),t.append(e)}},{key:"getTitleElement",value:function(){return this.$el.find("."+p+"title").get(0)}},{key:"hide",value:function(){this.$el.css("display","none"),this._isShow=!1,this.trigger("hidden",this)}},{key:"show",value:function(){this.$el.css("display","block"),this._isShow=!0,this.trigger("shown",this)}},{key:"isShow",value:function(){return this._isShow}},{key:"remove",value:function(){var e=this.options,t=e.openerCssQuery,n=e.closerCssQuery;this.trigger("remove",this),this.off(),t&&(0,u.default)(t).off("."+this._id),n&&(0,u.default)(n).off("."+this._id),this.$el.remove(),this.$el=null}},{key:"setFitToWindow",value:function(e){this.$el.toggleClass("fit-window",e)}},{key:"isFitToWindow",value:function(){return this.$el.hasClass("fit-window")}},{key:"toggleFitToWindow",value:function(){var e=!this.isFitToWindow();return this.setFitToWindow(e),e}}]),t}(h.default);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.colspan>1?' colspan="'+e.colspan+'"':"";return t+=e.rowspan>1?' rowspan="'+e.rowspan+'"':"",t+=e.align?' align="'+e.align+'"':"","<"+e.nodeName+t+">"+e.content+"</"+e.nodeName+">"}function o(e,t){var n="";return e.length&&(n=e.map(function(e){return"<tr>"+e.map(i).join("")+"</tr>"}).join(""),n="<"+t+">"+n+"</"+t+">"),n}function a(e){var t=[e[0]],n=e.slice(1),r=o(t,"THEAD"),i=o(n,"TBODY");return"<table"+(e.className?' class="'+e.className+'"':"")+">"+(r+i)+"</renderData>"}function l(e,t){var n=f.default.createCellIndexData(t),r=f.default.createRenderData(t,n),i=(0,c.default)(a(r));return e.replaceWith(i),i}function s(e,t,n){t.selectNodeContents(n),t.collapse(!0),e.setSelection(t)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),c=r(u),d=n(6),f=r(d);t.default={createTableHtml:a,replaceTable:l,focusToCell:s}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=g.default.createCellIndexData(e),i=g.default.findCellIndex(r,t),o=g.default.findCellIndex(r,n),a=void 0,l=void 0,s=void 0,u=void 0;return i.rowIndex>o.rowIndex?(a=o.rowIndex,l=i.rowIndex):(a=i.rowIndex,l=o.rowIndex),i.colIndex>o.colIndex?(s=o.colIndex,u=i.colIndex):(s=i.colIndex,u=o.colIndex),{start:{rowIndex:a,colIndex:s},end:{rowIndex:l,colIndex:u}}}function o(e,t,n){var r=t[n].rowIndex,i=e[r];h.default.range(t.start.colIndex,t.end.colIndex+1).forEach(function(n){var o=i[n],a=o.rowMergeWith,l=-1;h.default.isExisty(a)?(a<t.start.rowIndex&&(t.start.rowIndex=a),l=a+e[a][n].rowspan-1):o.rowspan>1&&(l=r+o.rowspan-1),l>t.end.rowIndex&&(t.end.rowIndex=l)})}function a(e,t,n,r){var i=e[n],o=i[r],a=o.colMergeWith,l=-1;h.default.isExisty(a)?(a<t.start.colIndex&&(t.start.colIndex=a),l=a+i[a].colspan-1):o.colspan>1&&(l=r+o.colspan-1),l>t.end.colIndex&&(t.end.colIndex=l)}function l(e,t){for(var n="";n!==JSON.stringify(t);)n=JSON.stringify(t),o(e,t,"start"),o(e,t,"end"),h.default.range(t.start.rowIndex,t.end.rowIndex+1).forEach(function(n){a(e,t,n,t.start.colIndex),a(e,t,n,t.end.colIndex)});return t}function s(e,t,n){return l(e,i(e,t,n))}function u(e,t,n){var r=g.default.createCellIndexData(e),i={};if(t.length){var o=g.default.findCellIndex(r,t.first()),a=h.default.extend({},o);t.each(function(t,n){var i=g.default.findCellIndex(r,(0,d.default)(n)),o=e[i.rowIndex][i.colIndex],l=i.rowIndex+o.rowspan-1,s=i.colIndex+o.colspan-1;a.rowIndex=Math.max(a.rowIndex,l),a.colIndex=Math.max(a.colIndex,s)}),i.start=o,i.end=a}else{var l=g.default.findCellIndex(r,n);i.start=l,i.end=h.default.extend({},l)}return i}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),d=r(c),f=n(1),h=r(f),p=n(6),g=r(p);t.default={findSelectionRange:s,getTableSelectionRange:u}},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=n(19),l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var s=n(16);s.inherits=n(13);var u=n(48),c=n(28);s.inherits(r,u);for(var d=l(c.prototype),f=0;f<d.length;f++){var h=d[f];r.prototype[h]||(r.prototype[h]=c.prototype[h])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a(t,e)}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return d+=1}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),s=r(l),u=n(1),c=r(u),d=-1,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),t=c.default.extend({tagName:"div"},t),this.tagName=t.tagName,this.className=t.className,this._id=o(),this._setRootElement(t.rootElement)}return a(e,[{key:"on",value:function(e,t){var n=this;c.default.isObject(e)?c.default.forEach(e,function(e,t){n._addEvent(t,e)}):this._addEvent(e,t)}},{key:"_addEvent",value:function(e,t){var n=this._parseEventType(e),r=n.event,i=n.selector;i?this.$el.on(r,i,t):this.$el.on(r,t)}},{key:"off",value:function(e,t){if(e){var n=this._parseEventType(e),r=n.event,i=n.selector;i?this.$el.off(r,i,t):this.$el.off(r,t)}else this.$el.off()}},{key:"_parseEventType",value:function(e){var t=e.split(" ");return{event:t.shift(),selector:t.join(" ")}}},{key:"_setRootElement",value:function(e){var t=this.tagName,n=this.className;e||(n=n||"uic"+this._id,e=(0,s.default)("<"+t+' class="'+n+'"/>')),this.$el=e}},{key:"trigger",value:function(){var e;(e=this.$el).trigger.apply(e,arguments)}},{key:"_getEventNameWithNamespace",value:function(e){var t=e.split(" ");return t[0]+=".uicEvent"+this._id,t.join(" ")}},{key:"remove",value:function(){this.$el&&this.$el.remove()}},{key:"destroy",value:function(){var e=this;this.remove(),c.default.forEachOwnProperties(this,function(t,n){e[n]=null})}}]),e}();t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r),o=0;o<t.length;o+=1)i[o]=t.charCodeAt(o);return new Blob([r],{type:n})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g,u=function(){function e(t){r(this,e),this.eventManager=t,this._initEvent(),this._initDefaultImageImporter()}return o(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("drop",function(t){var n=t.data.dataTransfer&&t.data.dataTransfer.files;e._processBlobItems(n,t.data)}),this.eventManager.listen("willPaste",function(t){var n=t.data.fragment,r=n.querySelectorAll("*");if(1===r.length&&"IMG"===r[0].tagName&&/^data:image/.test(r[0].src)){t.data.preventDefault();var o=i(r[0].src);e._emitAddImageBlobHook(o,"paste")}}),this.eventManager.listen("paste",function(t){e._processClipboard(t.data)}),this.eventManager.listen("pasteBefore",function(t){e._decodeURL(t)})}},{key:"_initDefaultImageImporter",value:function(){this.eventManager.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)})}},{key:"_emitAddImageBlobHook",value:function(e,t){var n=this;this.eventManager.emit("addImageBlobHook",e,function(t,r){n.eventManager.emit("command","AddImage",{imageUrl:t,altText:r||e.name||"image"})},t)}},{key:"_decodeURL",value:function(t){var n=e.decodeURIGraceful,r=e.encodeMarkdownCharacters;if("markdown"===t.source&&t.data.text){var i=t.data.text,o=i[0];1===i.length&&o.match(s)&&(o=n(o),o=r(o),t.data.update(null,null,[o]))}else if("wysiwyg"===t.source){var a=t.$clipboardContainer.get(0),l=a.childNodes[0],u=l.innerText;1===a.childNodes.length&&"A"===l.tagName&&u.match(s)&&(l.innerText=n(u),l.href=r(l.href))}}},{key:"_processClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items,r=t.types;n&&r&&1===r.length&&-1!==l.default.inArray("Files",[].slice.call(r))&&this._processBlobItems(n,e)}},{key:"_processBlobItems",value:function(e,t){var n=this;e&&l.default.forEachArray(e,function(e){if(-1!==e.type.indexOf("image")){t.preventDefault(),t.stopPropagation(),t.codemirrorIgnore=!0;var r=e.name?e:e.getAsFile();return n._emitAddImageBlobHook(r,t.type),!1}return!0})}}],[{key:"decodeURIGraceful",value:function(e){var t=e.split(" "),n=[],r=void 0;return l.default.forEachArray(t,function(e){try{r=decodeURIComponent(e),r=r.replace(/ /g,"%20")}catch(t){r=e}return n.push(r)}),n.join(" ")}},{key:"encodeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/</g,"%3C").replace(/>/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/</g,"\\<").replace(/>/g,"\\>")}}]),e}();t.default=u},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function l(e){return"string"==typeof e}function s(e){return"symbol"==typeof e}function u(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function d(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function p(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=l,t.isSymbol=s,t.isUndefined=u,t.isRegExp=c,t.isObject=d,t.isDate=f,t.isError=h,t.isFunction=p,t.isPrimitive=g,t.isBuffer=e.isBuffer}).call(t,n(51).Buffer)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),u=r(s),c=n(14),d=r(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:t.name};i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.default.extend({className:t.className},e)));return n._name=e.name,n}return a(t,e),l(t,[{key:"getName",value:function(){return this._name}}]),t}(d.default);Object.defineProperty(f,"name",{enumerable:!0,writable:!0,value:"item"}),Object.defineProperty(f,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-item"}),t.default=f},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){g&&h&&(g=!1,h.length?p=h.concat(p):v=-1,p.length&&l())}function l(){if(!g){var e=i(a);g=!0;for(var t=p.length;t;){for(h=p,p=[];++v<t;)h&&h[v].run();v=-1,t=p.length}h=null,g=!1,o(e)}}function s(e,t){this.fun=e,this.array=t}function u(){}var c,d,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var h,p=[],g=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new s(e,t)),1!==p.length||g||i(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,l=arguments.length;switch(l){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(o=new Array(l-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=n:e.exports=t.nextTick}).call(t,n(18))},function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}var o=n(51),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(r(o,t),t.Buffer=i),r(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(17),u=r(s),c=n(30),d=r(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tagName:"button",name:t.name};i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:e.name,tagName:"button",className:e.className+" "+t.className,rootElement:e.$el}));return n._setOptions(e),n._render(),n.on("click",n._onClick.bind(n)),e.tooltip&&(n.on("mouseover",n._onOver.bind(n)),n.on("mouseout",n._onOut.bind(n))),n}return a(t,e),l(t,[{key:"setTooltip",value:function(e){this._tooltip=e}},{key:"_setOptions",value:function(e){this._command=e.command,this._event=e.event,this._text=e.text,this._tooltip=e.tooltip,this._style=e.style,this._state=e.state}},{key:"_render",value:function(){this.$el.text(this._text),this.$el.attr("type","button"),this._style&&this.$el.attr("style",this._style)}},{key:"_onClick",value:function(){this.isEnabled()&&(this._command?this.trigger("command",this._command):this._event&&this.trigger("event",this._event),this.trigger("clicked"))}},{key:"_onOver",value:function(){this.isEnabled()&&d.default.show(this.$el,this._tooltip)}},{key:"_onOut",value:function(){d.default.hide()}},{key:"enable",value:function(){this.$el.attr("disabled",!1)}},{key:"disable",value:function(){this.$el.attr("disabled",!0)}},{key:"isEnabled",value:function(){return!this.$el.attr("disabled")}}]),t}(u.default);Object.defineProperty(f,"name",{enumerable:!0,writable:!0,value:"button"}),Object.defineProperty(f,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-icons"}),t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=["","","","CANCEL","","","HELP","","BACK_SPACE","TAB","","","CLEAR","ENTER","ENTER_SPECIAL","","","","","PAUSE","CAPS_LOCK","KANA","EISU","JUNJA","FINAL","HANJA","","ESCAPE","CONVERT","NONCONVERT","ACCEPT","MODECHANGE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","SELECT","PRINT","EXECUTE","PRINTSCREEN","INSERT","DELETE","","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","AT","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","","","CONTEXT_MENU","","SLEEP","NUMPAD0","NUMPAD1","NUMPAD2","NUMPAD3","NUMPAD4","NUMPAD5","NUMPAD6","NUMPAD7","NUMPAD8","NUMPAD9","MULTIPLY","ADD","SEPARATOR","SUBTRACT","DECIMAL","DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","","","","","","","","","NUM_LOCK","SCROLL_LOCK","WIN_OEM_FJ_JISHO","WIN_OEM_FJ_MASSHOU","WIN_OEM_FJ_TOUROKU","WIN_OEM_FJ_LOYA","WIN_OEM_FJ_ROYA","","","","","","","","","","@","!",'"',"#","$","%","&","_","(",")","*","+","|","-","{","}","~","","","","","VOLUME_MUTE","VOLUME_DOWN","VOLUME_UP","","",";","=",",","-",".","/","`","","","","","","","","","","","","","","","","","","","","","","","","","","","[","\\","]","'","","META","ALTGR","","WIN_ICO_HELP","WIN_ICO_00","","WIN_ICO_CLEAR","","","WIN_OEM_RESET","WIN_OEM_JUMP","WIN_OEM_PA1","WIN_OEM_PA2","WIN_OEM_PA3","WIN_OEM_WSCTRL","WIN_OEM_CUSEL","WIN_OEM_ATTN","WIN_OEM_FINISH","WIN_OEM_COPY","WIN_OEM_AUTO","WIN_OEM_ENLW","WIN_OEM_BACKTAB","ATTN","CRSEL","EXSEL","EREOF","PLAY","ZOOM","","PA1","WIN_OEM_CLEAR",""],a=void 0,l=function(){function e(t){r(this,e),this._setSplitter(t)}return i(e,[{key:"_setSplitter",value:function(e){var t=e?e.splitter:"+";this._splitter=t}},{key:"convert",value:function(e){var t=[];e.shiftKey&&t.push("SHIFT"),e.ctrlKey&&t.push("CTRL"),e.metaKey&&t.push("META"),e.altKey&&t.push("ALT");var n=this._getKeyCodeChar(e.keyCode);return n&&t.push(n),t.join(this._splitter)}},{key:"_getKeyCodeChar",value:function(e){return o[e]}}],[{key:"getSharedInstance",value:function(){return a||(a=new e),a}},{key:"keyCode",value:function(e){return o.indexOf(e)}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=(0,u.default)("<div />");return e=e.replace(/<!--[\s\S]*?-->/g,""),n.append(e),o(n),a(n),l(n,t)}function o(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title").remove()}function a(e){e.find("*").each(function(e,t){var n=t.attributes,r=d.default.toArray(n).filter(function(e){var t=e.name.match(f),n=e.name.match(h);return!t&&!n});d.default.forEachArray(r,function(e){n.getNamedItem(e.name)&&n.removeNamedItem(e.name)})})}function l(e,t){var n=void 0;if(t)n=e[0].innerHTML;else{for(var r=document.createDocumentFragment(),i=d.default.toArray(e[0].childNodes),o=i.length,a=0;a<o;a+=1)r.appendChild(i[a]);n=r}return n}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(1),d=r(c),f=new RegExp("^(abbr|align|alt|axis|bgcolor|border|cellpadding|cellspacing|class|clear|color|cols|compact|coords|dir|face|headers|height|hreflang|hspace|ismap|lang|language|nohref|nowrap|rel|rev|rows|rules|scope|scrolling|shape|size|span|start|summary|tabindex|target|title|type|valign|value|vspace|width|checked|mathvariant|encoding|id|name|background|cite|href|longdesc|src|usemap|xlink:href|data-+|checked|style)","g"),h=new RegExp("^(accent-height|accumulate|additive|alphabetic|arabic-form|ascent|baseProfile|bbox|begin|by|calcMode|cap-height|class|color|color-rendering|content|cx|cy|d|dx|dy|descent|display|dur|end|fill|fill-rule|font-family|font-size|font-stretch|font-style|font-variant|font-weight|from|fx|fy|g1|g2|glyph-name|gradientUnits|hanging|height|horiz-adv-x|horiz-origin-x|ideographic|k|keyPoints|keySplines|keyTimes|lang|marker-end|marker-mid|marker-start|markerHeight|markerUnits|markerWidth|mathematical|max|min|offset|opacity|orient|origin|overline-position|overline-thickness|panose-1|path|pathLength|points|preserveAspectRatio|r|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|rotate|rx|ry|slope|stemh|stemv|stop-color|stop-opacity|strikethrough-position|strikethrough-thickness|stroke|stroke-dasharray|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|systemLanguage|target|text-anchor|to|transform|type|u1|u2|underline-position|underline-thickness|unicode|unicode-range|units-per-em|values|version|viewBox|visibility|width|widths|x|x-height|x1|x2|xlink:actuate|xlink:arcrole|xlink:role|xlink:show|xlink:title|xlink:type|xml:base|xml:lang|xml:space|xmlns|xmlns:xlink|y|y1|y2|zoomAndPan)","g");t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(93),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(){r(this,e),this._replacers={}}return o(e,[{key:"setReplacer",value:function(e,t){this._replacers[e]=t}},{key:"getReplacer",value:function(e){return this._replacers[e]}},{key:"createCodeBlockHtml",value:function(e,t){var n=this.getReplacer(e);return n?n(t,e):l.default.getLanguage(e)?l.default.highlight(e,t).value:i(t,!1)}}],[{key:"getHighlightJSLanguages",value:function(){return l.default.listLanguages()}}]),e}();t.CodeBlockManager=s,t.default=new s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){var n=e.start,r=e.end,i=void 0;if(n.ch>=t){i={from:{line:n.line,ch:n.ch-t},to:{line:r.line,ch:r.ch+t}}}return i},i=t.removeSyntax=function(e,t){var n=t.length;return e.substr(n,e.length-2*n)},o=t.appendSyntax=function(e,t){return""+t+e+t},a=t.expandReplace=function(e,t,n,i,o){var a=r(t,n),l=!1;if(a){var s=a.from,u=a.to,c=e.getRange(s,u);i(c)&&(e.setSelection(s,u),e.replaceSelection(o(c),"around"),l=!0)}return l},l=t.replace=function(e,t,n,r){var i=!1;return n(t)&&(e.replaceSelection(r(t),"around"),i=!0),i};t.changeSyntax=function(e,t,n,r,s){var u=e.getCursor(),c=u.line,d=u.ch,f=e.getSelection(),h=n.length,p=function(e){return r.test(e)};if(!a(e,t,h,p,function(e){return i(e,n)})&&!l(e,f,p,function(e){return i(e,n)})){var g=f.replace(s,"$1");e.replaceSelection(o(g,n),"around")}var v=e.getSelection(),m=d;f||(p(v)?m+=h:m-=h,e.setCursor(c,m))}},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,l,s,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),n.apply(this,l)}else if(o(n))for(l=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,s=0;s<i;s++)u[s].apply(this,l);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(l=a;l-- >0;)if(n[l]===t||n[l].listener&&n[l].listener===t){i=l;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){t=e.exports=n(48),t.Stream=t,t.Readable=t,t.Writable=n(28),t.Duplex=n(11),t.Transform=n(54),t.PassThrough=n(176)},function(e,t,n){"use strict";(function(t,r,i){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){S(t,e)}}function a(e){return P.from(e)}function l(e){return P.isBuffer(e)||e instanceof B}function s(){}function u(e,t){x=x||n(11),e=e||{},this.objectMode=!!e.objectMode,t instanceof x&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function c(e){if(x=x||n(11),!(D.call(c,this)||this instanceof x))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),N.call(this)}function d(e,t){var n=new Error("write after end");e.emit("error",n),O(t,n)}function f(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),O(r,o),i=!1),i}function h(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=P.from(t,n)),t}function p(e,t,n,r,i,o){if(!n){var a=h(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var l=t.objectMode?1:r.length;t.length+=l;var s=t.length<t.highWaterMark;if(s||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else g(e,t,!1,l,r,i,o);return s}function g(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,n,r,i){--t.pendingcb,n?(O(i,r),O(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),T(e,t))}function m(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function y(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(m(n),t)v(e,n,r,t,i);else{var o=k(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?I(_,e,n,o,i):_(e,n,o,i)}}function _(e,t,n,r){n||b(e,t),t.pendingcb--,r(),T(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var l=0,s=!0;n;)i[l]=n,n.isBuf||(s=!1),n=n.next,l+=1;i.allBuffers=s,g(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t)}else{for(;n;){var u=n.chunk,c=n.encoding,d=n.callback;if(g(e,t,!1,t.objectMode?1:u.length,u,c,d),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function C(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,O(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function T(e,t){var n=k(t);return n&&(C(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function M(e,t,n){t.ending=!0,T(e,t),n&&(t.finished?O(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function S(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}var O=n(19);e.exports=c;var x,I=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:O;c.WritableState=u;var L=n(16);L.inherits=n(13);var A={deprecate:n(175)},N=n(50),P=n(20).Buffer,B=i.Uint8Array||function(){},R=n(52);L.inherits(c,N),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var D;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!D.call(this,e)||e&&e._writableState instanceof u}})):D=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,n){var r=this._writableState,i=!1,o=l(e)&&!r.objectMode;return o&&!P.isBuffer(e)&&(e=a(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=s),r.ended?d(this,n):(o||f(this,r,e,n))&&(r.pendingcb++,i=p(this,r,o,e,t,n)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||M(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=R.destroy,c.prototype._undestroy=R.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,n(18),n(173).setImmediate,n(12))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(21),d=r(c),f=n(58),h=r(f),p=n(33),g=r(p),v=n(69),m=r(v),y=n(83),_=r(y),b=n(39),w=r(b),k=n(2),E=r(k),C=n(40),T=r(C),M=n(15),S=r(M),O=n(37),x=r(O),I=n(41),L=r(I),A=n(94),N=r(A),P=n(3),B=r(P),R=n(95),D=r(R),j=n(4),H=r(j),$=n(35),U=r($),F=n(36),W=r(F),q=n(24),V=r(q),z=n(112),K=r(z),Y=n(113),G=r(Y),X=n(114),J=r(X),Q=n(115),Z=r(Q),ee=n(116),te=r(ee),ne=n(117),re=r(ne),ie=n(118),oe=r(ie),ae=n(119),le=r(ae),se=n(120),ue=r(se),ce=n(121),de=r(ce),fe=n(122),he=r(fe),pe=n(123),ge=r(pe),ve=n(124),me=r(ve),ye=n(125),_e=r(ye),be=n(126),we=r(be),ke=n(127),Ee=r(ke),Ce=n(128),Te=r(Ce),Me=n(129),Se=r(Me),Oe=n(130),xe=r(Oe),Ie=n(131),Le=r(Ie),Ae=n(132),Ne=r(Ae),Pe=n(133),Be=r(Pe),Re=n(134),De=r(Re),je=n(135),He=r(je),$e=n(136),Ue=r($e),Fe=n(137),We=r(Fe),qe=n(138),Ve=r(qe),ze=n(139),Ke=r(ze),Ye=n(140),Ge=r(Ye),Xe=n(141),Je=r(Xe),Qe=n(142),Ze=r(Qe),et=n(143),tt=r(et),nt=n(144),rt=r(nt),it=n(145),ot=r(it),at=n(146),lt=r(at),st=n(147),ut=r(st),ct=n(148),dt=r(ct),ft=n(149),ht=r(ft),pt=n(150),gt=r(pt),vt=n(151),mt=r(vt);n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167);var yt=[],_t="UA-129966929-1",bt=function(){function e(t){var n=this;i(this,e),this.initialHtml=t.el.innerHTML,t.el.innerHTML="",this.options=l.default.extend({previewStyle:"tab",initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en_US",useDefaultHTMLSanitizer:!0,useCommandShortcut:!0,codeBlockLanguages:q.CodeBlockManager.getHighlightJSLanguages(),usageStatistics:!0,toolbarItems:["heading","bold","italic","strike","divider","hr","quote","divider","ul","ol","task","indent","outdent","divider","table","image","link","divider","code","codeblock"],hideModeSwitch:!1,customConvertor:null},t),this.eventManager=new w.default,this.importManager=new S.default(this.eventManager),this.commandManager=new E.default(this,{useCommandShortcut:this.options.useCommandShortcut}),this.options.customConvertor?this.convertor=new this.options.customConvertor(this.eventManager):this.convertor=new L.default(this.eventManager),this.options.useDefaultHTMLSanitizer&&this.convertor.initHtmlSanitizer(),this.options.hooks&&u.default.forEach(this.options.hooks,function(e,t){return n.addHook(t,e)}),this.options.events&&u.default.forEach(this.options.events,function(e,t){return n.on(t,e)}),this.layout=new _.default(t,this.eventManager),this.i18n=B.default,this.i18n.setCode(this.options.language),this.setUI(this.options.UI||new D.default(this)),this.mdEditor=h.default.factory(this.layout.getMdEditorContainerEl(),this.eventManager,this.options),this.preview=new g.default(this.layout.getPreviewEl(),this.eventManager,this.convertor),this.wwEditor=m.default.factory(this.layout.getWwEditorContainerEl(),this.eventManager),this.toMarkOptions=null,this.changePreviewStyle(this.options.previewStyle),this.changeMode(this.options.initialEditType,!0),this.minHeight(this.options.minHeight),this.height(this.options.height),this.setValue(this.options.initialValue,!1),this.options.placeholder&&this.setPlaceholder(this.options.placeholder),this.options.initialValue||this.setHtml(this.initialHtml,!1),T.default.applyExtension(this,this.options.exts),this.eventManager.emit("load",this),yt.push(this),this._addDefaultCommands(),this.options.usageStatistics&&u.default.sendHostname("editor",_t)}return o(e,[{key:"changePreviewStyle",value:function(e){this.layout.changePreviewStyle(e),this.mdPreviewStyle=e,this.eventManager.emit("changePreviewStyle",e),this.eventManager.emit("previewNeedsRefresh")}},{key:"exec",value:function(){var e;(e=this.commandManager).exec.apply(e,arguments)}},{key:"_addDefaultCommands",value:function(){this.addCommand(K.default),this.addCommand(G.default),this.addCommand(Z.default),this.addCommand(te.default),this.addCommand(re.default),this.addCommand(oe.default),this.addCommand(le.default),this.addCommand(ue.default),this.addCommand(de.default),this.addCommand(he.default),this.addCommand(ge.default),this.addCommand(me.default),this.addCommand(_e.default),this.addCommand(we.default),this.addCommand(Ee.default),this.addCommand(Te.default),this.addCommand(J.default),this.addCommand(Se.default),this.addCommand(xe.default),this.addCommand(Ne.default),this.addCommand(Ve.default),this.addCommand(Ke.default),this.addCommand(Be.default),this.addCommand(De.default),this.addCommand(He.default),this.addCommand(Ue.default),this.addCommand(We.default),this.addCommand(ut.default),this.addCommand(dt.default),this.addCommand(ht.default),this.addCommand(Ge.default),this.addCommand(Je.default),this.addCommand(Ze.default),this.addCommand(tt.default),this.addCommand(rt.default),this.addCommand(ot.default),this.addCommand(lt.default),this.addCommand(gt.default),this.addCommand(mt.default),this.addCommand(Le.default)}},{key:"addCommand",value:function(e,t){t?this.commandManager.addCommand(E.default.command(e,t)):this.commandManager.addCommand(e)}},{key:"afterAddedCommand",value:function(){this.eventManager.emit("afterAddedCommand",this)}},{key:"on",value:function(e,t){this.eventManager.listen(e,t)}},{key:"off",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"addHook",value:function(e,t){this.eventManager.removeEventHandler(e),this.eventManager.listen(e,t)}},{key:"removeHook",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"getCodeMirror",value:function(){return this.mdEditor.getEditor()}},{key:"getSquire",value:function(){return this.wwEditor.getEditor()}},{key:"focus",value:function(){this.getCurrentModeEditor().focus()}},{key:"blur",value:function(){this.getCurrentModeEditor().blur()}},{key:"moveCursorToEnd",value:function(){this.getCurrentModeEditor().moveCursorToEnd()}},{key:"moveCursorToStart",value:function(){this.getCurrentModeEditor().moveCursorToStart()}},{key:"setMarkdown",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e=e||"",this.isMarkdownMode()?this.mdEditor.setValue(e,t):this.wwEditor.setValue(this.convertor.toHTML(e),t),this.eventManager.emit("setMarkdownAfter",e)}},{key:"setHtml",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e=e||"",this.wwEditor.setValue(e,t),this.isMarkdownMode()){var n=this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions);this.mdEditor.setValue(n,t),this.eventManager.emit("setMarkdownAfter",n)}}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setMarkdown(e,t)}},{key:"getMarkdown",value:function(){return this.isMarkdownMode()?this.mdEditor.getValue():this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)}},{key:"getHtml",value:function(){return this.isWysiwygMode()&&this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)),this.convertor.toHTML(this.mdEditor.getValue())}},{key:"getValue",value:function(){return this.getMarkdown()}},{key:"insertText",value:function(e){this.isMarkdownMode()?this.mdEditor.replaceSelection(e):this.wwEditor.insertText(e)}},{key:"addWidget",value:function(e,t,n,r){this.getCurrentModeEditor().addWidget(e,t,n,r)}},{key:"height",value:function(e){return u.default.isExisty(e)&&("auto"===e?((0,l.default)(this.options.el).addClass("auto-height"),this.minHeight(this.minHeight())):((0,l.default)(this.options.el).removeClass("auto-height"),this.minHeight(e)),u.default.isNumber(e)&&(e+="px"),this.options.el.style.height=e,this._height=e),this._height}},{key:"minHeight",value:function(e){if(u.default.isExisty(e)){var t=this._ui.getEditorHeight(),n=this._ui.getEditorSectionHeight(),r=t-n;this._minHeight=e,e=parseInt(e,10),e=Math.max(e-r,0),this.wwEditor.setMinHeight(e),this.mdEditor.setMinHeight(e),this.preview.setMinHeight(e)}return this._minHeight}},{key:"getCurrentModeEditor",value:function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor}},{key:"isMarkdownMode",value:function(){return"markdown"===this.currentMode}},{key:"isWysiwygMode",value:function(){return"wysiwyg"===this.currentMode}},{key:"isViewer",value:function(){return!1}},{key:"getCurrentPreviewStyle",value:function(){return this.mdPreviewStyle}},{key:"changeMode",value:function(e,t){this.currentMode!==e&&(this.eventManager.emit("changeModeBefore",this.currentMode),this.currentMode=e,this.isWysiwygMode()?(this.layout.switchToWYSIWYG(),this.wwEditor.setValue(this.convertor.toHTML(this.mdEditor.getValue()),!t),this.eventManager.emit("changeModeToWysiwyg")):(this.layout.switchToMarkdown(),this.mdEditor.resetState(),this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions),!t),this.getCodeMirror().refresh(),this.eventManager.emit("changeModeToMarkdown")),this.eventManager.emit("changeMode",e),t||this.focus())}},{key:"remove",value:function(){var e=this,t=yt.length-1;for(this.wwEditor.remove(),this.mdEditor.remove(),this.layout.remove(),this.preview.remove(),this.getUI()&&this.getUI().remove(),this.eventManager.emit("removeEditor"),this.eventManager.events.forEach(function(t,n){e.off(n)}),this.eventManager=null;t>=0;t-=1)yt[t]===this&&yt.splice(t,1)}},{key:"hide",value:function(){this.eventManager.emit("hide",this)}},{key:"show",value:function(){this.eventManager.emit("show",this),this.getCodeMirror().refresh()}},{key:"scrollTop",value:function(e){return this.getCurrentModeEditor().scrollTop(e)}},{key:"setUI",value:function(e){this._ui=e}},{key:"getUI",value:function(){return this._ui}},{key:"reset",value:function(){this.wwEditor.reset(),this.mdEditor.reset()}},{key:"getRange",value:function(){return this.getCurrentModeEditor().getRange()}},{key:"getTextObject",value:function(e){return this.getCurrentModeEditor().getTextObject(e)}},{key:"getSelectedText",value:function(){var e=this.getRange();return this.getTextObject(e).getTextContent()||""}},{key:"setPlaceholder",value:function(e){this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)}}],[{key:"getInstances",value:function(){return yt}},{key:"defineExtension",value:function(e,t){T.default.defineExtension(e,t)}},{key:"factory",value:function(t){return t.viewer?new N.default(t):new e(t)}}]),e}();bt.isViewer=!1,bt.i18n=B.default,bt.domUtils=H.default,bt.codeBlockManager=V.default,bt.Button=d.default,bt.WwCodeBlockManager=x.default,bt.WwTableManager=U.default,bt.WwTableSelectionManager=W.default,bt.CommandManager=E.default,bt.markdownitHighlight=L.default.getMarkdownitHighlightRenderer(),bt.markdownit=L.default.getMarkdownitRenderer(),e.exports=bt},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l='<div class="tui-tooltip"><div class="arrow"></div><span class="text"></span></span></div>',s=function(){function e(){r(this,e),this.$el=(0,a.default)(l),this.$el.appendTo("body"),this.hide()}return i(e,[{key:"show",value:function(e,t){this.$el.css({top:e.offset().top+e.height()+13,left:e.offset().left+3}).find(".text").html(t).end().show()}},{key:"hide",value:function(){this.$el.hide()}},{key:"remove",value:function(){this.$el.remove()}}]),e}();t.default=new s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(10),u=r(s);n(59),n(60),n(61),n(62),n(63),n(64),n(65);var c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,e),this.editorContainerEl=t,this.cm=null,this._init(n)}return o(e,[{key:"_init",value:function(e){var t=document.createElement("textarea");this.editorContainerEl.appendChild(t),e=l.default.extend(!0,{lineWrapping:!0,theme:"default",extraKeys:{"Shift-Tab":"indentLess","Alt-Up":"replaceLineTextToUpper","Alt-Down":"replaceLineTextToLower"},indentUnit:4,cursorScrollMargin:12,specialCharPlaceholder:function(){return document.createElement("span")}},e),this.cm=u.default.fromTextArea(t,e)}},{key:"getCurrentRange",value:function(){var e=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{from:e,to:t,collapsed:e.line===t.line&&e.ch===t.ch}}},{key:"focus",value:function(){this.cm.focus()}},{key:"blur",value:function(){this.cm.getInputField().blur()}},{key:"remove",value:function(){this.cm.toTextArea()}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.cm.setValue(e),t&&this.moveCursorToEnd(),this.cm.refresh()}},{key:"getValue",value:function(){return this.cm.getValue("\n")}},{key:"getEditor",value:function(){return this.cm}},{key:"reset",value:function(){this.setValue("")}},{key:"getCaretPosition",value:function(){return this.cm.cursorCoords()}},{key:"addWidget",value:function(e,t,n,r){r&&(e.ch+=r),this.cm.addWidget(e.end,t,!0,n)}},{key:"replaceSelection",value:function(e,t){t&&this.cm.setSelection(t.from,t.to),this.cm.replaceSelection(e),this.focus()}},{key:"replaceRelativeOffset",value:function(e,t,n){var r=this.cm.getCursor(),i={from:{line:r.line,ch:r.ch+t},to:{line:r.line,ch:r.ch+t+n}};this.replaceSelection(e,i)}},{key:"setHeight",value:function(e){this.getWrapperElement().style.height=e+"px"}},{key:"setMinHeight",value:function(e){this.getWrapperElement().style.minHeight=e+"px"}},{key:"setPlaceholder",value:function(e){e&&this.cm.setOption("placeholder",e)}},{key:"getWrapperElement",value:function(){return this.cm.getWrapperElement()}},{key:"getCursor",value:function(e){return this.cm.getCursor(e)}},{key:"moveCursorToEnd",value:function(){var e=this.getEditor().getDoc(),t=e.lastLine();e.setCursor(t,e.getLine(t).length)}},{key:"moveCursorToStart",value:function(){var e=this.getEditor().getDoc(),t=e.firstLine();e.setCursor(t,0)}},{key:"scrollTop",value:function(e){return e&&this.cm.scrollTo(0,e),this.cm.getScrollInfo().top}},{key:"getRange",value:function(){var e=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{start:{line:e.line,ch:e.ch},end:{line:t.line,ch:t.ch}}}},{key:"on",value:function(e,t){this.cm.on(e,t)}},{key:"off",value:function(e,t){this.cm.off(e,t)}}]),e}();t.default=c},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t){r(this,e),this._managers={},this._editor=t}return i(e,[{key:"addManager",value:function(e,t){t||(t=e,e=null);var n=new t(this._editor);this._managers[e||n.name]=n}},{key:"getManager",value:function(e){return this._managers[e]}},{key:"removeManager",value:function(e){var t=this.getManager(e);t&&(t.destroy&&t.destroy(),delete this._managers[e])}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},s=n(34),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,n,o,a){r(this,t);var l=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,o,a));return l._initEvent(),l}return o(t,e),a(t,[{key:"_initEvent",value:function(){var e=this,t="";this.eventManager.listen("contentChangedFromMarkdown",function(n){t=n.getValue(),e.isVisible()&&e.lazyRunner.run("refresh",t.replace(/<br>\n/g,"<br>"))}),this.eventManager.listen("previewNeedsRefresh",function(n){e.refresh(n||t)}),this.$el.on("scroll",function(t){e.eventManager.emit("scroll",{source:"preview",data:t})})}},{key:"render",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,e),this.eventManager.emit("previewRenderAfter",this)}},{key:"remove",value:function(){this.$el.off("scroll"),this.$el=null}}]),t}(u.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(68),u=r(s),c=function(){function e(t,n,r,o){i(this,e),this.eventManager=n,this.convertor=r,this.$el=t,this.isViewer=!!o,this._initContentSection(),this.lazyRunner=new u.default,this.lazyRunner.registerLazyRunFunction("refresh",this.refresh,800,this)}return o(e,[{key:"_initContentSection",value:function(){this._$previewContent=(0,l.default)('<div class="tui-editor-contents" />'),this.$el.append(this._$previewContent)}},{key:"refresh",value:function(e){this.render(this.convertor.toHTMLWithCodeHightlight(e))}},{key:"getHTML",value:function(){return this._$previewContent.html()}},{key:"setHTML",value:function(e){this._$previewContent.html(e)}},{key:"render",value:function(e){var t=this._$previewContent;e=this.eventManager.emit("previewBeforeHook",e)||e,t.empty(),t.html(e)}},{key:"setHeight",value:function(e){this.$el.get(0).style.height=e+"px"}},{key:"setMinHeight",value:function(e){this.$el.get(0).style.minHeight=e+"px"}},{key:"isVisible",value:function(){return"none"!==this.$el.css("display")}}]),e}();t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n="<"+t+"><br /></"+t+">",r="",i=0;i<e;i+=1)r+=n;return r}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),s=r(l),u=n(1),c=r(u),d=n(4),f=r(d),h=c.default.browser.msie&&10===c.default.browser.version,p=c.default.browser.msie&&(10===c.default.browser.version||11===c.default.browser.version),g=c.default.browser.msie?"":"<br>",v=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="table",this._lastCellNode=null,this._init()}return a(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent(),this.tableID=0}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygRangeChangeAfter.table",function(){var t=e.wwe.getEditor().getSelection(),n=e.wwe.isInTable(t);if(e._unwrapBlockInTable(),e._completeTableIfNeed(),!n){e.wwe.componentManager.getManager("tableSelection").removeClassAttrbuteFromAllCellsIfNeed()}e._insertDefaultBlockBetweenTable()}),this.eventManager.listen("wysiwygSetValueAfter.table",function(){e._unwrapBlockInTable(),e._insertDefaultBlockBetweenTable()}),this.eventManager.listen("wysiwygProcessHTMLText.table",function(e){return e.replace(/<br \/>(<\/td>|<\/th>)/g,"$1")}),this.eventManager.listen("cut.table",function(){var t=e.wwe.componentManager.getManager("tableSelection"),n=t.getSelectedCells();n.length&&n.get().forEach(function(e){return(0,s.default)(e).html(g)}),t.removeClassAttrbuteFromAllCellsIfNeed()}),this.eventManager.listen("copyBefore.table",function(t){var n=t.$clipboardContainer;return e.updateTableHtmlOfClipboardIfNeed(n)})}},{key:"updateTableHtmlOfClipboardIfNeed",value:function(e){var t=this,n=this.wwe.componentManager.getManager("tableSelection");if(n.getSelectedCells().length){n.createRangeBySelectedCells();var r=this.wwe.getEditor().getSelection().cloneContents();(0,s.default)(r).children().each(function(e,n){var r=(0,s.default)(n);t.isTableOrSubTableElement(n.nodeName)&&("TABLE"===n.nodeName&&0===r.find("thead").length&&0===r.find("tbody").length?r.remove():n.previousSibling&&"TABLE"===n.previousSibling.nodeName?n.previousSibling.appendChild(n):(t._completeIncompleteTable(n),"TABLE"!==n.nodeName&&"THEAD"!==n.nodeName&&(0,s.default)(n).closest("table").find("thead").remove()))}),e.append(r),e.find(".te-cell-selected").removeClass("te-cell-selected")}}},{key:"pasteTableData",value:function(e){var t=(0,s.default)(e);this._expandTableIfNeed(t),this._pasteDataIntoTable(t)}},{key:"_initKeyHandler",value:function(){var e=this;this.keyEventHandlers={DEFAULT:function(t,n,r){var i=e.wwe.isInTable(n);i&&!e._isSingleModifierKey(r)?(e._recordUndoStateIfNeed(n),e._removeBRIfNeed(n),e._removeContentsAndChangeSelectionIfNeed(n,r,t)):!i&&e._lastCellNode&&e._recordUndoStateAndResetCellNode(n),i&&!e._isModifierKeyPushed(t)&&e.wwe.getEditor().modifyDocument(function(){e.wwe.componentManager.getManager("tableSelection").removeClassAttrbuteFromAllCellsIfNeed()})},ENTER:function(t,n){var r=void 0;return e._isAfterTable(n)?(t.preventDefault(),n.setStart(n.startContainer,n.startOffset-1),e.wwe.breakToNewDefaultBlock(n),r=!1):e._isBeforeTable(n)?(t.preventDefault(),e.wwe.breakToNewDefaultBlock(n,"before"),r=!1):e.wwe.isInTable(n)&&(e._isInStyledText(n)&&e.wwe.defer(function(){e._removeBRinStyleText()}),e._appendBrIfTdOrThNotHaveAsLastChild(n),r=!1),r},BACK_SPACE:function(t,n,r){return e._handleBackspaceAndDeleteKeyEvent(t,n,r)},DELETE:function(t,n,r){return e._handleBackspaceAndDeleteKeyEvent(t,n,r)},TAB:function(){return e._moveCursorTo("next","cell")},"SHIFT+TAB":function(t){return e._moveCursorTo("previous","cell",t)},UP:function(t){return e._moveCursorTo("previous","row",t)},DOWN:function(t){return e._moveCursorTo("next","row",t)}},c.default.forEach(this.keyEventHandlers,function(t,n){return e.wwe.addKeyEventHandler(n,t)})}},{key:"_isInStyledText",value:function(e){var t=e.startContainer,n=void 0;return n=f.default.isTextNode(t)?t.parentNode:t,e.collapsed&&f.default.isStyledNode(n)}},{key:"_removeBRinStyleText",value:function(){var e=this.wwe.getRange(),t=e.startContainer,n=e.startOffset,r=void 0;r="TD"===t.nodeName?f.default.getChildNodeByOffset(t,n-1):f.default.getParentUntil(t,"TD");var i=r.querySelector("br"),o=r,a=o.parentNode,l=o.nodeName;if("CODE"!==l||i.previousSibling)if("CODE"!==l||i.nextSibling){var s=this._splitByBR(r,i);e.setStart(s,0)}else a.insertBefore(i,r.nextSibling),e.setStart(a,f.default.getNodeOffsetOfParent(i)+1);else a.insertBefore(i,r),e.setStart(r,0);e.collapse(!0),this.wwe.getEditor().setSelection(e)}},{key:"_splitByBR",value:function(e,t){var n=e.cloneNode(!0),r=document.createElement("br"),i=e.parentNode;f.default.removeNodesByDirection(e,t,!1),t.parentNode.removeChild(t);var o=n.querySelector("br");f.default.removeNodesByDirection(n,o,!0),o.parentNode.removeChild(o),i.insertBefore(n,e.nextSibling),i.insertBefore(r,n);var a=f.default.getLeafNode(n);return f.default.getTextLength(a)||(a.textContent=""),a}},{key:"_isBeforeTable",value:function(e){return"TABLE"===f.default.getNodeName(f.default.getChildNodeByOffset(e.startContainer,e.startOffset))}},{key:"_isAfterTable",value:function(e){var t=f.default.getPrevOffsetNodeUntil(e.startContainer,e.startOffset);return"TABLE"===f.default.getNodeName(t)&&e.commonAncestorContainer===this.wwe.get$Body()[0]}},{key:"_handleBackspaceAndDeleteKeyEvent",value:function(e,t,n){var r="BACK_SPACE"===n,i=this.wwe.componentManager.getManager("tableSelection"),o=i.getSelectedCells(),a=!0;if(t.collapsed){if(this.wwe.isInTable(t))r?this._tableHandlerOnBackspace(t,e):this._tableHandlerOnDelete(t,e),this._insertBRIfNeed(t),this._removeContentsAndChangeSelectionIfNeed(t,n,e),a=!1;else if(!r&&this._isBeforeTable(t)||r&&this._isAfterTable(t)){e.preventDefault();var l=r?t.startOffset-1:t.startOffset;this._removeTable(t,f.default.getChildNodeByOffset(t.startContainer,l)),a=!1}}else if(this.wwe.isInTable(t)&&o.length>0){var s=this._removeContentsAndChangeSelectionIfNeed(t,n,e);s&&(e.preventDefault(),a=!1)}return a}},{key:"_tableHandlerOnBackspace",value:function(e,t){var n=f.default.getPrevOffsetNodeUntil(e.startContainer,e.startOffset,"TR"),r=f.default.getNodeName(n);n&&"TD"!==r&&"TH"!==r?"BR"===r&&1!==n.parentNode.childNodes.length&&(t.preventDefault(),(0,s.default)(n).remove()):t.preventDefault()}},{key:"isNonTextDeleting",value:function(e){var t=e.startContainer,n=t.nextSibling,r=f.default.getNodeName(n),i=f.default.getNodeName(t),o=i===r&&"TEXT"!==i,a=(!n||"BR"===r&&n.parentNode.lastChild===n)&&f.default.isTextNode(t)&&e.startOffset===t.nodeValue.length,l=!a&&(0,s.default)(t).parents("tr").children().last()[0]===t&&("TD"===i||"TH"===i);return o||a||l}},{key:"_tableHandlerOnDelete",value:function(e,t){this.isNonTextDeleting(e)&&(t.preventDefault(),e.startContainer.normalize())}},{key:"_appendBrIfTdOrThNotHaveAsLastChild",value:function(e){var t=f.default.getNodeName(e.startContainer),n=void 0;if("TD"===t||"TH"===t)n=e.startContainer;else{var r=(0,s.default)(e.startContainer).parentsUntil("tr");n=r[r.length-1]}"BR"===f.default.getNodeName(n.lastChild)||"DIV"===f.default.getNodeName(n.lastChild)||p||(0,s.default)(n).append((0,s.default)("<br />")[0])}},{key:"_unwrapBlockInTable",value:function(){this.wwe.get$Body().find("td div,th div,tr>br,td>br,th>br").each(function(e,t){if("BR"===f.default.getNodeName(t)){var n=f.default.getNodeName(t.parentNode),r=/TD|TH/.test(n),i=0===t.parentNode.textContent.length,o=t.parentNode.lastChild===t;("TR"===n||r&&!i&&o)&&(0,s.default)(t).remove()}else(0,s.default)(t).children().unwrap()})}},{key:"_insertDefaultBlockBetweenTable",value:function(){this.wwe.get$Body().find("table").each(function(e,t){t.nextElementSibling&&"TABLE"===t.nextElementSibling.nodeName&&(0,s.default)("<div><br /></div>").insertAfter(t)})}},{key:"_removeTable",value:function(e,t){"TABLE"===t.tagName&&(this.wwe.getEditor().saveUndoState(e),this.wwe.saveSelection(e),(0,s.default)(t).remove(),this.wwe.restoreSavedSelection())}},{key:"_recordUndoStateIfNeed",value:function(e){var t=f.default.getParentUntil(e.startContainer,"TR");e.collapsed&&t&&this._lastCellNode!==t&&(this.wwe.getEditor().saveUndoState(e),this._lastCellNode=t)}},{key:"_recordUndoStateAndResetCellNode",value:function(e){this.wwe.getEditor().saveUndoState(e),this.resetLastCellNode()}},{key:"_pasteDataIntoTable",value:function(e){var t=this.wwe.getEditor().getSelection(),n=t.startContainer,r=this._getTableDataFromTable(e),i="TD"===n.tagName||"TH"===n.tagName,o=h?"":"<br />",a=void 0,l=void 0,u=void 0,c=void 0;for(i?a=n:(a=f.default.getParentUntilBy(n,function(e){return"TD"===e.tagName||"TH"===e.tagName},function(e){return 0===(0,s.default)(e).closest("table").length}),a=a?a.parentNode:null),a=a||(0,s.default)(n).find("th,td").get(0),l=a;r.length;){for(u=r.shift();l&&u.length;)c=u.shift(),c.length?l.textContent=c:l.innerHTML=o,l=f.default.getTableCellByDirection(l,"next");l=f.default.getSiblingRowCellByDirection(a,"next",!1),a=l}}},{key:"_getTableDataFromTable",value:function(e){var t=(0,s.default)(e),n=[];return t.find("tr").each(function(e,t){var r=[];(0,s.default)(t).children().each(function(e,t){r.push(t.textContent)}),r.length&&n.push(r)}),n}},{key:"_removeTableContents",value:function(e){this.wwe.getEditor().saveUndoState(),e.each(function(e,t){var n=h?"":"<br />";(0,s.default)(t).html(n)})}},{key:"wrapDanglingTableCellsIntoTrIfNeed",value:function(e){var t=e.children("td,th"),n=void 0;if(t.length){var r=(0,s.default)("<tr></tr>");t.each(function(e,t){r.append(t)}),n=r.get(0)}return n}},{key:"wrapTrsIntoTbodyIfNeed",value:function(e){var t=e.children("tr"),n=t.find("th"),r=void 0;if(n.length&&n.each(function(e,t){var n=(0,s.default)(t),r=(0,s.default)("<td></td>");r.html(n.html()),r.insertBefore(t),n.detach()}),t.length){var i=(0,s.default)("<tbody></tbody>");t.each(function(e,t){i.append(t)}),r=i.get(0)}return r}},{key:"wrapTheadAndTbodyIntoTableIfNeed",value:function(e){var t=e.children("thead"),n=e.children("tbody"),r=(0,s.default)("<table></table>"),i=void 0;return!n.length&&t.length?(r.append(t[0]),r.append("<tbody><tr></tr></tbody>"),i=r.get(0)):n.length&&!t.length?(r.append("<thead><tr></tr></thead>"),r.append(n[0]),i=r.get(0)):n.length&&t.length&&(r.append(t[0]),r.append(n[0]),i=r.get(0)),i}},{key:"isTableOrSubTableElement",value:function(e){return"TABLE"===e||"TBODY"===e||"THEAD"===e||"TR"===e||"TD"===e}},{key:"_stuffTableCellsIntoIncompleteRow",value:function(e,t){e.each(function(e,n){for(var r=(0,s.default)(n),i=r.find("th,td"),a=f.default.getNodeName(r.parent()[0]),l="THEAD"===a?"th":"td",u=i.length;u<t;u+=1)r.append((0,s.default)(o(1,l))[0])})}},{key:"prepareToTableCellStuffing",value:function(e){var t=e.eq(0).find("th,td").length,n=!1;return e.each(function(e,r){var i=(0,s.default)(r).find("th,td").length;t!==i&&(n=!0,t<i&&(t=i))}),{maximumCellLength:t,needTableCellStuffingAid:n}}},{key:"_addTbodyOrTheadIfNeed",value:function(e){var t=!e.find("thead").length,n=!e.find("tbody").length,r=void 0;t?(r=(0,s.default)("<thead><tr></tr></thead>").get(0),e.prepend(r)):n&&(r=(0,s.default)("<tbody><tr></tr></tbody>").get(0),e.append(r))}},{key:"tableCellAppendAidForTableElement",value:function(e){var t=(0,s.default)(e);this._addTbodyOrTheadIfNeed(t),this._addTrIntoContainerIfNeed(t);var n=t.find("tr"),r=this.prepareToTableCellStuffing(n),i=r.maximumCellLength;r.needTableCellStuffingAid&&this._stuffTableCellsIntoIncompleteRow(n,i)}},{key:"_generateTheadAndTbodyFromTbody",value:function(e){var t=(0,s.default)("<tr></tr>"),n=(0,s.default)("<thead></thead>");return t.append(o((0,s.default)(e).find("tr").eq(0).find("td").length,"th")),n.append(t),{thead:n[0],tbody:e}}},{key:"_generateTheadAndTbodyFromThead",value:function(e){var t=(0,s.default)("<tr></tr>"),n=(0,s.default)("<tbody></tbody>");return t.append(o((0,s.default)(e).find("th").length,"td")),n.append(t),{thead:e,tbody:n[0]}}},{key:"_generateTheadAndTbodyFromTr",value:function(e){var t=(0,s.default)(e),n=(0,s.default)("<thead></thead>"),r=(0,s.default)("<tbody></tbody>"),i=void 0,a=void 0;return"TH"===t.children()[0].tagName?(i=e,a=(0,s.default)("<tr>"+o(t.find("th").length,"td")+"</tr>").get(0)):(i=(0,s.default)("<tr>"+o(t.find("td").length,"th")+"</tr>").get(0),a=e),n.append(i),r.append(a),{thead:n[0],tbody:r[0]}}},{key:"_completeIncompleteTable",value:function(e){var t=e.tagName,n=void 0,r=void 0;"TABLE"===t?n=e:(n=document.createElement("table"),e.parentNode.insertBefore(n,e.nextSibling),"TBODY"===t?r=this._generateTheadAndTbodyFromTbody(e):"THEAD"===t?r=this._generateTheadAndTbodyFromThead(e):"TR"===t&&(r=this._generateTheadAndTbodyFromTr(e)),n.appendChild(r.thead),n.appendChild(r.tbody)),this._removeEmptyRows(n),this.tableCellAppendAidForTableElement(n)}},{key:"_removeEmptyRows",value:function(e){var t=e.querySelectorAll("tr");c.default.forEachArray(t,function(e){e.cells.length||e.parentNode.removeChild(e)})}},{key:"_completeTableIfNeed",value:function(){var e=this;this.wwe.getEditor().get$Body().children().each(function(t,n){var r=(0,s.default)(n);e.isTableOrSubTableElement(n.nodeName)&&("TABLE"===n.nodeName&&0===r.find("tbody").length?r.remove():e._completeIncompleteTable(n))})}},{key:"resetLastCellNode",value:function(){this._lastCellNode=null}},{key:"setLastCellNode",value:function(e){this._lastCellNode=e}},{key:"_isSingleModifierKey",value:function(e){return"META"===e||"SHIFT"===e||"ALT"===e||"CONTROL"===e}},{key:"_isModifierKeyPushed",value:function(e){return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}},{key:"_addTrIntoContainerIfNeed",value:function(e){e.children().each(function(e,t){0===(0,s.default)(t).find("tr").length&&(0,s.default)(t).append((0,s.default)("<tr></tr>")[0])})}},{key:"_expandTableIfNeed",value:function(e){var t=this.wwe.getEditor().getSelection().cloneRange(),n=(0,s.default)(t.startContainer).parents("table"),r=this._getColumnAndRowDifference(e,t);r.column<0&&this._appendCellForAllRow(n,r.column),r.row<0&&this._appendRow(n,r.row)}},{key:"_getColumnAndRowDifference",value:function(e,t){var n=this._getTableDataFromTable(e),r=n.length,i=n[0].length,o=(0,s.default)(t.startContainer).closest("th,td"),a=o.parent(),l=f.default.getNodeOffsetOfParent(o[0]),u=f.default.getNodeOffsetOfParent(o[0].parentNode),c=a.parents("table"),d=c.find("tr").eq(0).children().length,h=c.find("tr").length;return a.parents("tbody").length&&(u+=1),{row:h-(u+r),column:d-(l+i)}}},{key:"_appendCellForAllRow",value:function(e,t){var n=h?"":"<br />";e.find("tr").each(function(e,r){for(var i=void 0,o=t;o<0;o+=1)i=0===e?"th":"td",(0,s.default)(r).append((0,s.default)("<"+i+">"+n+"</"+i+">")[0])})}},{key:"_appendRow",value:function(e,t){var n=e.find("tr").last().clone(),r=h?"":"<br />";for(n.find("td").html(r);t<0;t+=1)e.find("tbody").append(n.clone()[0])}},{key:"_getSiblingTextNodeByDirection",value:function(e,t){var n=e.previousSibling&&"BR"===e.previousSibling.nodeName&&e.previousSibling.previousSibling&&3===e.previousSibling.previousSibling.nodeType,r=e.nextSibling&&"BR"===e.nextSibling.nodeName&&e.nextSibling.nextSibling&&3===e.nextSibling.nextSibling.nodeType,i=void 0;return t&&r?i=e.nextSibling.nextSibling:!t&&n&&(i=e.previousSibling.previousSibling),i}},{key:"_changeSelectionToTargetCell",value:function(e,t,n,r){var i=t.startContainer,o="next"===n,a="row"===r,l=void 0,u=void 0;if(a){if(f.default.isTextNode(i)&&(l=this._getSiblingTextNodeByDirection(i,o)))return u=l.length<t.startOffset?l.length:t.startOffset,t.setStart(l,u),void t.collapse(!0);l=f.default.getSiblingRowCellByDirection(e,n,!1)}else(l=f.default.getTableCellByDirection(e,n))||(l=f.default.getSiblingRowCellByDirection(e,n,!0));l?(t.setStart(l,0),t.collapse(!0)):(l=(0,s.default)(e).parents("table").get(0),o?t.setStart(l.nextElementSibling,0):l.previousElementSibling&&"TABLE"!==l.previousElementSibling.nodeName?t.setStart(l.previousElementSibling,1):t.setStartBefore(l),t.collapse(!0))}},{key:"_moveCursorTo",value:function(e,t,n){var r=this.wwe.getEditor(),i=r.getSelection().cloneRange(),o=(0,s.default)(i.startContainer).closest("td,th").get(0),a=void 0;return i.collapsed&&this.wwe.isInTable(i)&&o&&("previous"!==e&&"row"!==t||c.default.isUndefined(n)||n.preventDefault(),this._changeSelectionToTargetCell(o,i,e,t),r.setSelection(i),a=!1),a}},{key:"_removeContentsAndChangeSelectionIfNeed",value:function(e,t,n){var r=t.length<=1,i="BACK_SPACE"===t||"DELETE"===t,o=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),a=o.first().get(0),l=!1;return(r||i)&&!this._isModifierKeyPushed(n)&&o.length&&(i&&this._recordUndoStateIfNeed(e),this._removeTableContents(o),this._lastCellNode=a,e.setStart(a,0),e.collapse(!0),this.wwe.getEditor().setSelection(e),l=!0),l}},{key:"getTableIDClassName",value:function(){var e="te-content-table-"+this.tableID;return this.tableID+=1,e}},{key:"_removeBRIfNeed",value:function(e){var t=f.default.isTextNode(e.startContainer),n=t?e.startContainer.parentNode:e.startContainer;/td|th/i.test(f.default.getNodeName(n))&&e.collapsed&&1===n.textContent.length&&(0,s.default)(n).find("br").remove()}},{key:"_insertBRIfNeed",value:function(e){var t=f.default.isTextNode(e.startContainer),n=t?e.startContainer.parentNode:e.startContainer,r=f.default.getNodeName(n),i=(0,s.default)(n);!/td|th/i.test(r)||!e.collapsed||n.textContent.length||i.children().length||p||(n.normalize(),i.append("<br>"))}},{key:"destroy",value:function(){var e=this;this.eventManager.removeEventHandler("wysiwygRangeChangeAfter.table"),this.eventManager.removeEventHandler("wysiwygSetValueAfter.table"),this.eventManager.removeEventHandler("wysiwygProcessHTMLText.table"),this.eventManager.removeEventHandler("cut.table"),this.eventManager.removeEventHandler("copyBefore.table"),c.default.forEach(this.keyEventHandlers,function(t,n){return e.wwe.removeKeyEventHandler(n,t)})}}]),e}();t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(4),d=r(c),f=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="tableSelection",this._init()}return o(e,[{key:"_init",value:function(){this._initEvent(),u.default.browser.firefox&&(document.execCommand("enableObjectResizing",!1,"false"),document.execCommand("enableInlineTableEditing",!1,"false"))}},{key:"_initEvent",value:function(){var e=this,t=void 0,n=void 0,r=void 0;this._tableSelectionTimer=null,this._removeSelectionTimer=null,this._isSelectionStarted=!1;var i=function(i){n=(0,l.default)(i.data.target).closest("[contenteditable=true] td,th").get(0);var o=e.wwe.getEditor().getSelection(),a=(0,l.default)(n).parents("[contenteditable=true] table").get(0),s=t===n,c=e._isTextSelect(o,s)&&!(0,l.default)(t).hasClass("te-cell-selected");e._isSelectionStarted&&a&&!c&&(window.getSelection().removeAllRanges(),u.default.browser.firefox&&!e._removeSelectionTimer&&(e._removeSelectionTimer=setInterval(function(){window.getSelection().removeAllRanges()},10)),e.highlightTableCellsBy(t,n),r=n)},o=function(){e._isSelectionStarted&&(e._isSelectionStarted=!1,e.eventManager.removeEventHandler("mouseover.tableSelection"),e.eventManager.removeEventHandler("mouseup.tableSelection"))},a=function(i){n=(0,l.default)(i.data.target).closest("[contenteditable=true] td,th").get(0);var a=e.wwe.getEditor().getSelection(),s=t===n,c=e._isTextSelect(a,s)&&!(0,l.default)(t).hasClass("te-cell-selected");e._clearTableSelectionTimerIfNeed(),e._isSelectionStarted&&(c?e.removeClassAttrbuteFromAllCellsIfNeed():(e.wwe.componentManager.getManager("table").resetLastCellNode(),n=n||r,a=e.wwe.getEditor().getSelection(),a.setStart(n,0),u.default.browser.msie?a.setEnd(n,1):(a.setEnd(n,0),a.collapse(!1)),e.wwe.getEditor().setSelection(a)),e.onDragEnd&&e.onDragEnd()),o()},s=function(r){t=(0,l.default)(r.data.target).closest("[contenteditable=true] td,th").get(0);var s=(0,l.default)(t).hasClass("te-cell-selected");n=null,!s||s&&2!==r.data.button?(e.removeClassAttrbuteFromAllCellsIfNeed(),e.setTableSelectionTimerIfNeed(t),e.eventManager.listen("mouseover.tableSelection",i),e.eventManager.listen("mouseup.tableSelection",a),e.onDragStart&&t&&e.onDragStart(t)):2===r.data.button&&o()};this.eventManager.listen("mousedown.tableSelection",s),this.eventManager.listen("copyBefore.tableSelection",o),this.eventManager.listen("pasteBefore.tableSelection",o)}},{key:"_isTextSelect",value:function(e,t){return/TD|TH|TEXT/i.test(e.commonAncestorContainer.nodeName)&&t}},{key:"setTableSelectionTimerIfNeed",value:function(e){(0,l.default)(e).parents("[contenteditable=true] table").length&&(this._isSelectionStarted=!0)}},{key:"_clearTableSelectionTimerIfNeed",value:function(){clearTimeout(this._tableSelectionTimer),u.default.browser.firefox&&this._removeSelectionTimer&&(clearTimeout(this._removeSelectionTimer),this._removeSelectionTimer=null)}},{key:"_reArrangeSelectionIfneed",value:function(e,t){var n=(0,l.default)(e).parents("[contenteditable=true] table").length,r=(0,l.default)(t).parents("[contenteditable=true] table").length,i=r&&!n,o=!r&&n;return i?e=(0,l.default)(t).parents("[contenteditable=true] table").find("th").first().get(0):o&&(t=(0,l.default)(e).parents("[contenteditable=true] table").find("td").last().get(0)),{startContainer:e,endContainer:t}}},{key:"_applySelectionDirection",value:function(e,t){var n=d.default.getNodeOffsetOfParent,r=e.startContainer,i=e.endContainer,o=n((0,l.default)(r).closest("[contenteditable=true] tr")[0])-n((0,l.default)(i).closest("[contenteditable=true] tr")[0]),a=n(r)-n(i),s=0===o,u=o<0,c=a>0;return s?c?(t.setStart(i,0),t.setEnd(r,1)):(t.setStart(r,0),t.setEnd(i,1)):u?(t.setStart(r,0),t.setEnd(i,1)):(t.setStart(i,0),t.setEnd(r,1)),t}},{key:"getSelectionRangeFromTable",value:function(e,t){var n=d.default.getNodeOffsetOfParent,r=n(e.parentNode),i=n(t.parentNode),o=n(e),a=n(t),s=d.default.getParentUntil(e,"TABLE"),u=d.default.getParentUntil(t,"TABLE"),c="TBODY"===d.default.getNodeName(s)&&"THEAD"===d.default.getNodeName(u),f=s!==u,h=!!(0,l.default)(e).parents("tbody").length&&!!(0,l.default)(t).parents("tbody").length,p={row:r,cell:o},g={row:i,cell:a},v=void 0,m=void 0;return c?p.row+=1:f?g.row+=1:h&&(p.row+=1,g.row+=1),r>i||r===i&&o>a?(v=g,m=p):(v=p,m=g),{from:v,to:m}}},{key:"highlightTableCellsBy",value:function(e,t){var n=(0,l.default)(e).parents("[contenteditable=true] table").find("tr"),r=this.getSelectionRangeFromTable(e,t),i=r.from.row,o=r.from.cell,a=r.to.row,s=r.to.cell;n.each(function(e,t){(0,l.default)(t).find("td,th").each(function(t,n){var r=(0,l.default)(n),u=e===i,c=e===a;u&&t<o||c&&t>s||e<i||e>a?r.removeClass("te-cell-selected"):r.addClass("te-cell-selected")})})}},{key:"removeClassAttrbuteFromAllCellsIfNeed",value:function(){this.wwe.get$Body().find("td.te-cell-selected,th.te-cell-selected").each(function(e,t){var n=(0,l.default)(t);n.removeClass("te-cell-selected"),n.attr("class").length||n.removeAttr("class")})}},{key:"getSelectedCells",value:function(){return this.wwe.get$Body().find(".te-cell-selected")}},{key:"createRangeBySelectedCells",value:function(){var e=this.wwe.getEditor(),t=e.getSelection().cloneRange(),n=this.getSelectedCells(),r=n.first().get(0),i=n.last().get(0);n.length&&this.wwe.isInTable(t)&&(t.setStart(r,0),t.setEnd(i,i.childNodes.length),e.setSelection(t))}},{key:"styleToSelectedCells",value:function(e,t){this.createRangeBySelectedCells(),e(this.wwe.getEditor(),t)}},{key:"destroy",value:function(){this.eventManager.removeEventHandler("mousedown.tableSelection"),this.eventManager.removeEventHandler("mouseover.tableSelection"),this.eventManager.removeEventHandler("mouseup.tableSelection"),this.eventManager.removeEventHandler("copyBefore.tableSelection"),this.eventManager.removeEventHandler("pasteBefore.tableSelection")}}]),e}();t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e?e.replace(/[<>&]/g,function(e){return g[e]||e}):""}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),s=r(l),u=n(1),c=r(u),d=n(4),f=r(d),h=c.default.browser.msie&&10===c.default.browser.version,p=h?"":"<br>",g={"&":"&amp;","<":"&lt;",">":"&gt;"},v=/\u200B/g,m=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="codeblock",this._init()}return a(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent()}},{key:"_initKeyHandler",value:function(){var e=this;this._keyEventHandlers={BACK_SPACE:this._onBackspaceKeyEventHandler.bind(this),ENTER:function(t,n){!e.wwe.isInTable(n)&&e.wwe.getEditor().hasFormat("CODE")&&e.wwe.defer(function(){var t=e.wwe.getRange(),n=t.startContainer,r=e._getCodeNode(n);r&&!f.default.getTextLength(r)&&r.parentNode.removeChild(r)})}},c.default.forEach(this._keyEventHandlers,function(t,n){return e.wwe.addKeyEventHandler(n,t)})}},{key:"_getCodeNode",value:function(e){var t=void 0;return"CODE"===e.nodeName?t=e:"CODE"===e.parentNode.nodeName&&(t=e.parentNode),t}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter.codeblock",function(){e.modifyCodeBlockForWysiwyg()}),this.eventManager.listen("wysiwygProcessHTMLText.codeblock",function(t){return e._changePreToPreCode(t)})}},{key:"prepareToPasteOnCodeblock",value:function(e){var t=this.wwe.getEditor().getDocument().createDocumentFragment(),n=this.convertNodesToText(e);return n=n.replace(/\n$/,""),t.appendChild(document.createTextNode(n)),t}},{key:"convertNodesToText",value:function(e){for(var t="",n=e.shift();c.default.isTruthy(n);){if(n.childNodes&&f.default.isBlockNode(n))t+=this.convertNodesToText(c.default.toArray(n.childNodes));else if("BR"===n.nodeName)t+="\n";else{var r=n,i=r.textContent;t+=o(i)}n=e.shift()}return t}},{key:"_copyCodeblockTypeFromRangeCodeblock",value:function(e,t){var n=f.default.getParentUntil(t.commonAncestorContainer,this.wwe.get$Body()[0]);if("PRE"===f.default.getNodeName(n)){var r=(0,s.default)(n).prop("attributes");c.default.forEach(r,function(t){(0,s.default)(e).attr(t.name,t.value)})}return e}},{key:"_changePreToPreCode",value:function(e){return e.replace(/<pre( .*?)?>((.|\n)*?)<\/pre>/g,function(e,t,n){return"<pre><code"+(t||"")+">"+n+"</code></pre>"})}},{key:"modifyCodeBlockForWysiwyg",value:function(e){e||(e=this.wwe.get$Body()),(0,s.default)(e).find("pre").each(function(e,t){var n=(0,s.default)(t),r=n.find("code").attr("data-language"),i=n.find("code").attr("data-backticks");n.children().length>1&&n.children().each(function(e,t){"DIV"!==t.nodeName&&"P"!==t.nodeName||(0,s.default)(t).find("br").length||(0,s.default)(t).append("\n")}),n.find("br").replaceWith("\n");var o=n.text().replace(/\s+$/,"");n.empty(),n.html(o||p),r&&(n.attr("data-language",r),n.addClass("lang-"+r)),i&&n.attr("data-backticks",i),n.attr("data-te-codeblock","")})}},{key:"_onBackspaceKeyEventHandler",value:function(e,t){var n=!0,r=this.wwe.getEditor(),i=t.commonAncestorContainer;if(this._isCodeBlockFirstLine(t)&&!this._isFrontCodeblock(t))this._removeCodeblockFirstLine(i),t.collapse(!0),n=!1;else if(t.collapsed&&this._isEmptyLine(i)&&this._isBetweenSameCodeblocks(i)){var o=i.previousSibling,a=i.nextSibling,l=o.textContent.length;r.saveUndoState(t),i.parentNode.removeChild(i),this._mergeCodeblocks(o,a),t.setStart(o.childNodes[0],l),t.collapse(!0),n=!1}return n||(r.setSelection(t),e.preventDefault()),n}},{key:"_isEmptyLine",value:function(e){var t=e.nodeName,n=e.childNodes,r=h?""===e.textContent:1===n.length&&"BR"===n[0].nodeName;return"DIV"===t&&r}},{key:"_isBetweenSameCodeblocks",value:function(e){var t=e.previousSibling,n=e.nextSibling;return"PRE"===f.default.getNodeName(t)&&"PRE"===f.default.getNodeName(n)&&t.getAttribute("data-language")===n.getAttribute("data-language")}},{key:"_mergeCodeblocks",value:function(e,t){var n=t.textContent;e.childNodes[0].textContent+="\n"+n,t.parentNode.removeChild(t)}},{key:"_isCodeBlockFirstLine",value:function(e){return this.isInCodeBlock(e)&&e.collapsed&&0===e.startOffset}},{key:"_isFrontCodeblock",value:function(e){var t=f.default.getParentUntil(e.startContainer,this.wwe.getEditor().getRoot()),n=t.previousSibling;return n&&"PRE"===n.nodeName}},{key:"_removeCodeblockFirstLine",value:function(e){var t=this.wwe.getEditor(),n="PRE"===e.nodeName?e:e.parentNode,r=n.textContent.replace(v,"");t.modifyBlocks(function(){var e=t.getDocument().createDocumentFragment(),i=r.split("\n"),o=document.createElement("div"),a=i.shift();if(o.innerHTML=""+a+p,e.appendChild(o),i.length){var l=n.cloneNode();l.textContent=i.join("\n"),e.appendChild(l)}return e})}},{key:"isInCodeBlock",value:function(e){var t=void 0;return t=e.collapsed?e.startContainer:e.commonAncestorContainer,!!(0,s.default)(t).closest("pre").length}},{key:"destroy",value:function(){var e=this;this.eventManager.removeEventHandler("wysiwygSetValueAfter.codeblock"),this.eventManager.removeEventHandler("wysiwygProcessHTMLText.codeblock"),c.default.forEach(this._keyEventHandlers,function(t,n){return e.wwe.removeKeyEventHandler(n,t)})}}]),e}();t.default=m},function(e,t,n){"use strict";var r=/Mac/.test(navigator.platform);e.exports={isMac:r}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=["previewBeforeHook","previewRenderAfter","previewNeedsRefresh","addImageBlobHook","setMarkdownAfter","contentChangedFromWysiwyg","changeFromWysiwyg","contentChangedFromMarkdown","changeFromMarkdown","change","changeModeToWysiwyg","changeModeToMarkdown","changeModeBefore","changeMode","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","openPopupAddLink","openPopupAddImage","openPopupAddTable","openPopupTableUtils","openHeadingSelect","openPopupCodeBlockLanguages","openPopupCodeBlockEditor","openDropdownToolbar","closePopupCodeBlockLanguages","closePopupCodeBlockEditor","closeAllPopup","command","addCommandBefore","htmlUpdate","markdownUpdate","renderedHtmlUpdated","removeEditor","convertorAfterMarkdownToHtmlConverted","convertorBeforeHtmlToMarkdownConverted","convertorAfterHtmlToMarkdownConverted","stateChange","wysiwygSetValueAfter","wysiwygSetValueBefore","wysiwygGetValueBefore","wysiwygProcessHTMLText","wysiwygRangeChangeAfter","wysiwygKeyEvent","scroll","click","mousedown","mouseover","mouseout","mouseup","contextmenu","keydown","keyup","keyMap","load","focus","blur","paste","pasteBefore","willPaste","copy","copyBefore","copyAfter","cut","cutAfter","drop","show","hide"],s=function(){function e(){r(this,e),this.events=new a.default.Map,this.TYPE=new a.default.Enum(l)}return i(e,[{key:"listen",value:function(e,t){var n=this._getTypeInfo(e),r=this.events.get(n.type)||[];if(!this._hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)}},{key:"emit",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.shift(),i=this._getTypeInfo(r),o=this.events.get(i.type),l=void 0;return o&&a.default.forEach(o,function(e){var n=e.apply(void 0,t);a.default.isUndefined(n)||(l=l||[],l.push(n))}),l}},{key:"emitReduce",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.shift(),i=this.events.get(r);return i&&a.default.forEach(i,function(e){var n=e.apply(void 0,t);a.default.isFalsy(n)||(t[0]=n)}),t[0]}},{key:"_getTypeInfo",value:function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}}},{key:"_hasEventType",value:function(e){return!a.default.isUndefined(this.TYPE[this._getTypeInfo(e).type])}},{key:"addEventType",value:function(e){if(this._hasEventType(e))throw new Error("There is already have event type "+e);this.TYPE.set(e)}},{key:"removeEventHandler",value:function(e,t){var n=this,r=this._getTypeInfo(e),i=r.type,o=r.namespace;i&&t?this._removeEventHandlerWithHandler(i,t):i&&!o?this.events.delete(i):!i&&o?this.events.forEach(function(e,t){n._removeEventHandlerWithTypeInfo(t,o)}):i&&o&&this._removeEventHandlerWithTypeInfo(i,o)}},{key:"_removeEventHandlerWithHandler",value:function(e,t){var n=this.events.get(e)||[],r=n.indexOf(t);r>=0&&n.splice(r,1)}},{key:"_removeEventHandlerWithTypeInfo",value:function(e,t){var n=[],r=this.events.get(e);r&&(r.map(function(e){return e.namespace!==t&&n.push(e),null}),this.events.set(e,n))}}]),e}();t.default=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(){r(this,e),this.exts=new a.default.Map}return i(e,[{key:"defineExtension",value:function(e,t){this.exts.set(e,t)}},{key:"applyExtension",value:function(e,t){var n=this;t&&t.forEach(function(t){var r=a.default.isObject(t),i=r?t.name:t;if(n.exts.has(i)){var o=n.exts.get(i);r?o(e,t):o(e)}})}}]),e}();t.default=new l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(85),d=r(c),f=n(42),h=r(f),p=n(23),g=r(p),v=n(86),m=r(v),y=n(87),_=r(y),b=n(88),w=r(b),k=n(89),E=r(k),C=n(90),T=r(C),M=n(91),S=r(M),O=n(92),x=r(O),I=n(24),L=r(I),A=new d.default({html:!0,breaks:!0,quotes:"“”‘’",langPrefix:"lang-",highlight:function(e,t){return L.default.createCodeBlockHtml(t,e)}}),N=new d.default({html:!0,breaks:!0,quotes:"“”‘’",langPrefix:"lang-"});A.block.ruler.at("code",w.default),A.block.ruler.at("table",T.default,{alt:["paragraph","reference"]}),A.block.ruler.at("blockquote",E.default,{alt:["paragraph","reference","blockquote","list"]}),A.block.ruler.at("html_block",S.default,{alt:["paragraph","reference","blockquote"]}),A.inline.ruler.at("backticks",x.default),A.use(m.default),A.use(_.default),N.block.ruler.at("code",w.default),N.block.ruler.at("table",T.default,{alt:["paragraph","reference"]}),N.block.ruler.at("blockquote",E.default,{alt:["paragraph","reference","blockquote","list"]}),N.block.ruler.at("html_block",S.default,{alt:["paragraph","reference","blockquote"]}),N.inline.ruler.at("backticks",x.default),N.use(m.default),N.use(_.default);var P=function(){function e(t){i(this,e),this.eventManager=t}return o(e,[{key:"_markdownToHtmlWithCodeHighlight",value:function(e){e=e.replace(/<br>/gi,"<br data-tomark-pass>");for(var t=/(<img[^>]*)(onerror\s*=\s*[\"']?[^\"']*[\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");var n=A.render(e);return n=this._removeBrToMarkPassAttributeInCode(n)}},{key:"_markdownToHtml",value:function(e){e=e.replace(/<br>/gi,"<br data-tomark-pass>");for(var t=/(<img[^>]*)(onerror\s*=\s*[\"']?[^\"']*[\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");var n=N.render(e);return n=this._removeBrToMarkPassAttributeInCode(n)}},{key:"_removeBrToMarkPassAttributeInCode",value:function(e){var t=(0,l.default)("<div />");return t.html(e),t.find("code, pre").each(function(e,t){var n=(0,l.default)(t);n.html(n.html().replace(/&lt;br data-tomark-pass&gt;/,"&lt;br&gt;"))}),e=t.html()}},{key:"toHTMLWithCodeHightlight",value:function(e){var t=this._markdownToHtmlWithCodeHighlight(e);return t=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t)}},{key:"toHTML",value:function(e){var t=this._markdownToHtml(e);return t=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t)}},{key:"initHtmlSanitizer",value:function(){this.eventManager.listen("convertorAfterMarkdownToHtmlConverted",function(e){return(0,g.default)(e,!0)})}},{key:"toMarkdown",value:function(e,t){var n=[];e=this.eventManager.emitReduce("convertorBeforeHtmlToMarkdownConverted",e);var r=(0,h.default)(this._appendAttributeForBrIfNeed(e),t);return r=this.eventManager.emitReduce("convertorAfterHtmlToMarkdownConverted",r),u.default.forEach(r.split("\n"),function(e,t){var r=/^\|[^|]*\|/gi;/`[^`]*<br>[^`]*`/gi.test(e)||r.test(e)||(e=e.replace(/<br>/gi,"<br>\n")),n[t]=e}),n.join("\n")}},{key:"_appendAttributeForBrIfNeed",value:function(e){var t=/<br>/gi,n=/<br \/><br \/>/gi,r=/<br data-tomark-pass \/><br \/>(.)/gi,i=/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|<img [^>]*>)/,o=/<br data-tomark-pass \/><br data-tomark-pass \/>/,a=new RegExp(i.source+o.source,"g");e=e.replace(t,"<br />"),e=e.replace(n,"<br data-tomark-pass /><br data-tomark-pass />");var s=document.createElement("div"),u=(0,l.default)(s);return u.html(e),u.find("pre br,code br").each(function(e,t){t.hasAttribute("data-tomark-pass")&&t.removeAttribute("data-tomark-pass")}),e=u.html().replace(/<br data-tomark-pass="">/gi,"<br data-tomark-pass />"),e=e.replace(t,"<br />"),e=e.replace(r,"<br data-tomark-pass /><br data-tomark-pass />$1"),e=e.replace(a,"$1<br /><br />")}}],[{key:"getMarkdownitHighlightRenderer",value:function(){return A}},{key:"getMarkdownitRenderer",value:function(){return N}}]),e}();t.default=P},function(e,t){e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(14),p=r(h),g=n(21),v=r(g),m=n(17),y=r(m),_=n(44),b=r(_),w=n(45),k=r(w),E=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"tui-editor-defaultUI-toolbar"}));return Object.defineProperty(r,"_items",{enumerable:!0,writable:!0,value:[]}),r._eventManager=e,r.setItems(n),r._initEvent(e),r}return a(t,e),l(t,[{key:"_initEvent",value:function(e){var t=this;e.listen("stateChange",function(e){t._items.forEach(function(t){t._state&&(e[t._state]?t.$el.addClass("active"):t.$el.removeClass("active"))})}),e.listen("changePreviewTabPreview",function(){return t.disableAllButton()}),e.listen("changePreviewTabWrite",function(){return t.enableAllButton()}),e.listen("changeMode",function(){return t.enableAllButton()})}},{key:"disableAllButton",value:function(){this._items.forEach(function(e){e instanceof v.default&&e.disable()})}},{key:"enableAllButton",value:function(){this._items.forEach(function(e){e instanceof v.default&&e.enable()})}},{key:"getItems",value:function(){return this._items.slice(0)}},{key:"getItem",value:function(e){return this._items[e]}},{key:"setItems",value:function(e){this.removeAllItems(),e.forEach(this.addItem.bind(this))}},{key:"addItem",value:function(e){this.insertItem(this._items.length,e)}},{key:"insertItem",value:function(e,t){var n=this;f.default.isString(t)?t=k.default.create(t):f.default.isString(t.type)&&(t=k.default.create(t.type,t.options));var r=this.$el.children();e>=0&&e<r.length?(t.$el.insertBefore(r.eq(e)),this._items.splice(e,0,t)):(t.$el.appendTo(this.$el),this._items.push(t)),t.onCommandHandler=function(e,t){return n._eventManager.emit("command",t)},t.onEventHandler=function(e,t){return n._eventManager.emit(t)},t.on("command",t.onCommandHandler),t.on("event",t.onEventHandler)}},{key:"indexOfItem",value:function(e){var t=void 0;if(e instanceof y.default)t=this._items.indexOf(e);else if(f.default.isString(e)){var n=e;t=this._items.map(function(e){return e.getName()}).indexOf(n)}return t}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0,r=void 0;return n=e instanceof y.default?this.indexOfItem(e):e,n>=0&&(r=this._items.splice(n,1)[0]),r&&(t?r.destroy():(r.off("command",r.onCommandHandler),r.off("event",r.onEventHandler),r.$el.detach())),r}},{key:"removeAllItems",value:function(){for(;this._items&&this._items.length>0;)this.removeItem(0)}},{key:"destroy",value:function(){this.removeAllItems(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"addButton",value:function(e,t){if(f.default.isArray(e))for(var n=e.length-1;n>=0;n-=1)f.default.isNumber(t)?this._addButton(e[n],t):this._addButton(e);else this._addButton(e,t)}},{key:"_addButton",value:function(e,t){var n=this._setButton(e,t).$el;f.default.isNumber(t)?this.$el.find("."+v.default.className).eq(t-1).before(n):this.$el.append(n)}},{key:"addDivider",value:function(){var e=(0,c.default)('<div class="'+b.default.className+'"></div>');return this.$el.append(e),e}},{key:"_setButton",value:function(e,t){var n=this._eventManager;return e instanceof v.default||(e=new v.default(e)),e.on("command",function(e,t){return n.emit("command",t)}),e.on("event",function(e,t){return n.emit(t)}),f.default.isNumber(t)?this._items.splice(t,0,e):this._items.push(e),e}}]),t}(p.default);t.default=E},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:t.name,tagName:"div",className:t.className}))}return o(t,e),t}(l.default);Object.defineProperty(s,"name",{enumerable:!0,writable:!0,value:"divider"}),Object.defineProperty(s,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-divider"}),t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(17),l=r(a),s=n(98),u=r(s),c=n(44),d=r(c),f=n(3),h=r(f),p=function(){function e(){i(this,e)}return o(e,null,[{key:"create",value:function(e,t){var n=void 0;switch(e){case"heading":n=new u.default({name:"heading",className:"tui-heading",event:"openHeadingSelect",tooltip:h.default.get("Headings")});break;case"bold":n=new u.default({name:"bold",className:"tui-bold",command:"Bold",tooltip:h.default.get("Bold"),state:"bold"});break;case"italic":n=new u.default({name:"italic",className:"tui-italic",command:"Italic",tooltip:h.default.get("Italic"),state:"italic"});break;case"strike":n=new u.default({name:"strike",className:"tui-strike",command:"Strike",tooltip:h.default.get("Strike"),state:"strike"});break;case"hr":n=new u.default({name:"hr",className:"tui-hrline",command:"HR",tooltip:h.default.get("Line")});break;case"quote":n=new u.default({name:"quote",className:"tui-quote",command:"Blockquote",tooltip:h.default.get("Blockquote"),state:"quote"});break;case"ul":n=new u.default({name:"ul",className:"tui-ul",command:"UL",tooltip:h.default.get("Unordered list")});break;case"ol":n=new u.default({name:"ol",className:"tui-ol",command:"OL",tooltip:h.default.get("Ordered list")});break;case"task":n=new u.default({name:"task",className:"tui-task",command:"Task",tooltip:h.default.get("Task")});break;case"table":n=new u.default({name:"table",className:"tui-table",event:"openPopupAddTable",tooltip:h.default.get("Insert table")});break;case"image":n=new u.default({name:"image",className:"tui-image",event:"openPopupAddImage",tooltip:h.default.get("Insert image"),state:""});break;case"link":n=new u.default({name:"link",className:"tui-link",event:"openPopupAddLink",tooltip:h.default.get("Insert link")});break;case"code":n=new u.default({name:"code",className:"tui-code",command:"Code",tooltip:h.default.get("Code"),state:"code"});break;case"codeblock":n=new u.default({name:"codeblock",className:"tui-codeblock",command:"CodeBlock",tooltip:h.default.get("Insert CodeBlock"),state:"codeBlock"});break;case"indent":n=new u.default({name:"indent",className:"tui-indent",command:"Indent",tooltip:h.default.get("Indent")});break;case"outdent":n=new u.default({name:"outdent",className:"tui-outdent",command:"Outdent",tooltip:h.default.get("Outdent")});break;case"divider":n=new d.default;break;case"button":n=new u.default(t);break;case"item":default:n=new l.default(t)}return n}}]),e}();t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(14),d=r(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"te-tab"}));return n.sections=e.sections,n._$activeButton=null,n._render(e),n._initEvent(e),n}return a(t,e),l(t,[{key:"_initEvent",value:function(e){var t=e.onItemClick;t&&this.on("itemClick",t),this.on("click button",this._onTabButton.bind(this))}},{key:"_render",value:function(e){for(var t=e.items,n=e.initName,r=[],i=0,o=t.length;i<o;i+=1)r.push('<button type="button" data-index="'+i+'">'+t[i]+"</button>");this.$el.html(r.join("")),this.activate(n)}},{key:"activate",value:function(e){var t=this.$el.find('button:contains("'+e+'")');this._activateTabByButton(t)}},{key:"_onTabButton",value:function(e){var t=(0,u.default)(e.target);this._activateTabByButton(t),this.trigger("itemClick",t.text())}},{key:"_activateTabByButton",value:function(e){this._isActivatedButton(e)||this._updateClassByButton(e)}},{key:"_updateClassByButton",value:function(e){if(this._$activeButton){var t=this._$activeButton.attr("data-index");this._$activeButton.removeClass("te-tab-active"),this.sections&&this.sections[t].removeClass("te-tab-active")}e.addClass("te-tab-active"),this._$activeButton=e;var n=e.attr("data-index");this.sections&&this.sections[n].addClass("te-tab-active")}},{key:"_isActivatedButton",value:function(e){return this._$activeButton&&this._$activeButton.text()===e.text()}}]),t}(d.default);t.default=f},function(e,t,n){function r(){i.call(this)}e.exports=r;var i=n(26).EventEmitter;n(13)(r,i),r.Readable=n(27),r.Writable=n(177),r.Duplex=n(178),r.Transform=n(179),r.PassThrough=n(180),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function r(){u.readable&&u.resume&&u.resume()}function o(){c||(c=!0,e.end())}function a(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(s(),0===i.listenerCount(this,"error"))throw e}function s(){u.removeListener("data",n),e.removeListener("drain",r),u.removeListener("end",o),u.removeListener("close",a),u.removeListener("error",l),e.removeListener("error",l),u.removeListener("end",s),u.removeListener("close",s),e.removeListener("close",s)}var u=this;u.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(u.on("end",o),u.on("close",a));var c=!1;return u.on("error",l),e.on("error",l),u.on("end",s),u.on("close",s),e.on("close",s),e.emit("pipe",u),e}},function(e,t,n){"use strict";(function(t,r){function i(e){return D.from(e)}function o(e){return D.isBuffer(e)||e instanceof j}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?P(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function l(e,t){N=N||n(11),e=e||{},this.objectMode=!!e.objectMode,t instanceof N&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new W,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(F||(F=n(53).StringDecoder),this.decoder=new F(e.encoding),this.encoding=e.encoding)}function s(e){if(N=N||n(11),!(this instanceof s))return new s(e);this._readableState=new l(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),R.call(this)}function u(e,t,n,r,o){var a=e._readableState;if(null===t)a.reading=!1,g(e,a);else{var l;o||(l=d(a,t)),l?e.emit("error",l):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===D.prototype||(t=i(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?c(e,a,t,!1):y(e,a)):c(e,a,t,!1))):r||(a.reading=!1)}return f(a)}function c(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),y(e,t)}function d(e,t){var n;return o(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function h(e){return e>=z?e=z:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=h(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function g(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(U("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?A(m,e):m(e))}function m(e){U("emit readable"),e.emit("readable"),C(e)}function y(e,t){t.readingMore||(t.readingMore=!0,A(_,e,t))}function _(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(U("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;U("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&B(e,"data")&&(t.flowing=!0,C(e))}}function w(e){U("readable nexttick read 0"),e.read(0)}function k(e,t){t.resumeScheduled||(t.resumeScheduled=!0,A(E,e,t))}function E(e,t){t.reading||(U("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),C(e),t.flowing&&!t.reading&&e.read(0)}function C(e){var t=e._readableState;for(U("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=M(e,t.buffer,t.decoder),n}function M(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?S(e,t):O(e,t),r}function S(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function O(e,t){var n=D.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function x(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,A(I,t,e))}function I(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var A=n(19);e.exports=s;var N,P=n(49);s.ReadableState=l;var B=(n(26).EventEmitter,function(e,t){return e.listeners(t).length}),R=n(50),D=n(20).Buffer,j=t.Uint8Array||function(){},H=n(16);H.inherits=n(13);var $=n(171),U=void 0;U=$&&$.debuglog?$.debuglog("stream"):function(){};var F,W=n(172),q=n(52);H.inherits(s,R);var V=["error","close","destroy","pause","resume"];Object.defineProperty(s.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),s.prototype.destroy=q.destroy,s.prototype._undestroy=q.undestroy,s.prototype._destroy=function(e,t){this.push(null),t(e)},s.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=D.from(e,t),t=""),n=!0),u(this,e,t,!1,n)},s.prototype.unshift=function(e){return u(this,e,null,!0,!1)},s.prototype.isPaused=function(){return!1===this._readableState.flowing},s.prototype.setEncoding=function(e){return F||(F=n(53).StringDecoder),this._readableState.decoder=new F(e),this._readableState.encoding=e,this};var z=8388608;s.prototype.read=function(e){U("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return U("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?x(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&x(this),null;var r=t.needReadable;U("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,U("length less than watermark",r)),t.ended||t.reading?(r=!1,U("reading or ended",r)):r&&(U("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=p(n,t)));var i;return i=e>0?T(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&x(this)),null!==i&&this.emit("data",i),i},s.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},s.prototype.pipe=function(e,t){function n(e,t){U("onunpipe"),e===f&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){U("onend"),e.end()}function o(){U("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",s),e.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",d),f.removeListener("data",l),m=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function l(t){U("ondata"),y=!1,!1!==e.write(t)||y||((1===h.pipesCount&&h.pipes===e||h.pipesCount>1&&-1!==L(h.pipes,e))&&!m&&(U("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,y=!0),f.pause())}function s(t){U("onerror",t),d(),e.removeListener("error",s),0===B(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),d()}function c(){U("onfinish"),e.removeListener("close",u),d()}function d(){U("unpipe"),f.unpipe(e)}var f=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,U("pipe count=%d opts=%j",h.pipesCount,t);var p=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,g=p?i:d;h.endEmitted?A(g):f.once("end",g),e.on("unpipe",n);var v=b(f);e.on("drain",v);var m=!1,y=!1;return f.on("data",l),a(e,"error",s),e.once("close",u),e.once("finish",c),e.emit("pipe",f),h.flowing||(U("pipe resume"),f.resume()),e},s.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=L(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},s.prototype.on=function(e,t){var n=R.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&v(this):A(w,this))}return n},s.prototype.addListener=s.prototype.on,s.prototype.resume=function(){var e=this._readableState;return e.flowing||(U("resume"),e.flowing=!0,k(this,e)),this},s.prototype.pause=function(){return U("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(U("pause"),this._readableState.flowing=!1,this.emit("pause")),this},s.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(U("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(U("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){r.push(i)||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<V.length;o++)e.on(V[o],r.emit.bind(r,V[o]));return r._read=function(t){U("wrapped _read",t),n&&(n=!1,e.resume())},r},s._fromList=T}).call(t,n(12),n(18))},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){e.exports=n(26).EventEmitter},function(e,t,n){"use strict";(function(e){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?f(e,t,n,r):"string"==typeof t?c(e,t,n):h(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function s(e,t,n,r){return l(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}function u(e,t){if(l(t),e=i(e,t<0?0:0|p(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);e=i(e,r);var a=e.write(t,n);return a!==r&&(e=e.slice(0,a)),e}function d(e,t){var n=t.length<0?0:0|p(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=o.prototype):e=d(e,t),e}function h(e,t){if(o.isBuffer(t)){var n=0|p(t.length);return e=i(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||G(t.length)?i(e,0):d(e,t);if("Buffer"===t.type&&Q(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return K(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,s/=2,n/=2}var u;if(i){var c=-1;for(u=n;u<l;u++)if(o(e,u)===o(t,-1===c?0:u-c)){if(-1===c&&(c=u),u-c+1===s)return c*a}else-1!==c&&(u-=u-c),c=-1}else for(n+s>l&&(n=l-s),u=n;u>=0;u--){for(var d=!0,f=0;f<s;f++)if(o(e,u+f)!==o(t,f)){d=!1;break}if(d)return u}return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var l=parseInt(t.substr(2*a,2),16);if(isNaN(l))return a;e[n+a]=l}return a}function k(e,t,n,r){return Y(q(t,e.length-n),e,n,r)}function E(e,t,n,r){return Y(V(t),e,n,r)}function C(e,t,n,r){return E(e,t,n,r)}function T(e,t,n,r){return Y(K(t),e,n,r)}function M(e,t,n,r){return Y(z(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(i+l<=n){var s,u,c,d;switch(l){case 1:o<128&&(a=o);break;case 2:s=e[i+1],128==(192&s)&&(d=(31&o)<<6|63&s)>127&&(a=d);break;case 3:s=e[i+1],u=e[i+2],128==(192&s)&&128==(192&u)&&(d=(15&o)<<12|(63&s)<<6|63&u)>2047&&(d<55296||d>57343)&&(a=d);break;case 4:s=e[i+1],u=e[i+2],c=e[i+3],128==(192&s)&&128==(192&u)&&128==(192&c)&&(d=(15&o)<<18|(63&s)<<12|(63&u)<<6|63&c)>65535&&d<1114112&&(a=d)}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return x(r)}function x(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Z));return n}function I(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=W(e[o]);return i}function N(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function j(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function H(e,t,n,r,i){return i||j(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,i){return i||j(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(e,t,n,r,52,8),n+8}function U(e){if(e=F(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function F(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function z(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function K(e){return X.toByteArray(U(e))}function Y(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e){return e!==e}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var X=n(169),J=n(170),Q=n(49);t.Buffer=o,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return s(null,e,t,n)},o.allocUnsafe=function(e){return u(null,e)},o.allocUnsafeSlow=function(e){return u(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,l=n-t,s=Math.min(a,l),u=this.slice(r,i),c=e.slice(t,n),d=0;d<s;++d)if(u[d]!==c[d]){a=u[d],l=c[d];break}return a<l?-1:l<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return C(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=o.prototype;else{var i=t-e;r=new o(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),J.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),J.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),J.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),J.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){B(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){B(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var l=o.isBuffer(e)?e:q(new o(e,r).toString()),s=l.length;for(a=0;a<n-t;++a)this[a+t]=l[a%s]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,n(12))},function(e,t,n){"use strict";function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(r||i)return void(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a(o,this,e));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}var a=n(19);e.exports={destroy:r,undestroy:i}},function(e,t,n){"use strict";function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=r(e);if("string"!=typeof t&&(y.isEncoding===_||!_(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=f,this.end=h,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=p,this.end=g,t=3;break;default:return this.write=v,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=y.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function l(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n?0:(i=a(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n?0:(i=a(t[r]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function s(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"<22>".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>".repeat(n+2)}}function u(e){var t=this.lastTotal-this.lastNeed,n=s(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var n=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>".repeat(this.lastTotal-this.lastNeed):t}function f(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var y=n(20).Buffer,_=y.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=d,o.prototype.text=c,o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);l.call(this,e),this._transformState=new r(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(t)})}function a(e,t,n){if(t)return e.emit("error",t);null!==n&&void 0!==n&&e.push(n);var r=e._writableState,i=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}e.exports=o;var l=n(11),s=n(16);s.inherits=n(13),s.inherits(o,l),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;l.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";n(56),n(182),n(185),n(200),n(202);var r=n(204);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){e=p(e);var n=e.split(/\n{2,}/),r=n[0],i=n[1],o=h(r),a=o&&o.editorChart&&o.editorChart.url,l=void 0;if(O.default.isString(a)){var u=function(e){l=s(e,r),t(l)},c=function(){return t(null)};M.default.get(a).done(u).fail(c)}else l=s(r,i),t(l)}function s(e,t){return{data:d(e),options:h(t)}}function u(e){e=p(e);var t=e.split(j).slice(0,10).join("\n");return H.map(function(e){return{delimiter:e,delta:c(t,e)}}).sort(function(e,t){return e.delta-t.delta})[0].delimiter}function c(e,t){var n=void 0,r=void 0;try{if(P.default.COLUMN_SEPARATOR=t,n=P.default.parse(e),n[0].length<2)throw new Error("parser fail");r=n.map(function(e){return e.length}).reduce(function(e,t){return{deltaSum:e.deltaSum+Math.abs(e.length-t),length:t}},{deltaSum:0,length:n[0].length}).deltaSum}catch(e){r=1/0}return r}function d(e,t){e=p(e),P.default.COLUMN_SEPARATOR=t||u(e);var n=P.default.parse(e);n=n.map(function(e){return e.map(function(e){return e.trim()})});var r=n[0].filter(function(e,t){return t>0}).reduce(function(e,t){return e||!g(t)},!1),i=r?n.shift():[],o=n.slice(1).reduce(function(e,t){return e||!g(t[0])},!1),a=o?n.map(function(e){return e.shift()}):[];return o&&i.shift(),n=n[0].map(function(e,t){return n.map(function(e){return parseFloat(e[t])})}),{categories:a,series:n.map(function(e,t){return r?{name:i[t],data:e}:{data:e}})}}function f(e,t){var n=function(e){var n=d(e);t(n)},r=function(){return t(null)};M.default.get(e).done(n).fail(r)}function h(e){var t=["type","url"],n={};return O.default.isUndefined(e)?n:(e.split(j).forEach(function(e){var r=e.split($),i=r[0],o=r.slice(1),a=o.join($);if(i=i.trim(),0!==a.length){try{a=JSON.parse(a.trim())}catch(e){a=a.trim()}var l=i.split("."),s=l.slice(0),u=s[0];O.default.inArray(u,t)>=0?s.unshift("editorChart"):1===s.length?s.unshift("chart"):"x"!==u&&"y"!==u||(s[0]=u+"Axis");for(var c=n,d=0;d<s.length;d+=1){var f=s[d];c[f]=c[f]||(s.length-1===d?a:{}),c=c[f]}}}),n)}function p(e){return e.replace(/(^(\s*[\n\r])+)|([\n\r]+\s*$)/g,"")}function g(e){return!isNaN(e)&&isFinite(e)}function v(e,t,n){e=O.default.extend({editorChart:{},chart:{},chartExportMenu:{},usageStatistics:t.usageStatistics},e),t=O.default.extend(W,t);var r=e.chart,i=r.width,o=r.height,a=O.default.isUndefined(i),l=O.default.isUndefined(o);if(a||l){var s=n.getBoundingClientRect(),u=s.width;i=a?t.width:i,o=l?t.height:o,i="auto"===i?u:i,o="auto"===o?u:o}return i=Math.min(t.maxWidth,i),o=Math.min(t.maxHeight,o),e.chart.width=Math.max(t.minWidth,i),e.chart.height=Math.max(t.minHeight,o),e.editorChart.type=e.editorChart.type?e.editorChart.type+"Chart":"columnChart",e.chartExportMenu.visible=e.chartExportMenu.visible||!1,e}function m(e,t){var n="chart-"+Math.random().toString(36).substr(2,10),r='<div id="'+n+'" class="chart" />';return setTimeout(function(){var r=document.querySelector("#"+n);try{l(e,function(e){var n=e.data,i=e.options;i=v(i,t,r);var o=i.editorChart.type;U.indexOf(o)<0?r.innerHTML="invalid chart type. type: bar, column, line, area, pie":F.indexOf(o)>-1&&n.categories.length!==n.series[0].data.length?r.innerHTML="invalid chart data":I.default[o](r,n,i)})}catch(e){r.innerHTML="invalid chart data"}},0),r}function y(e){return e.reduce(function(e,t){var n=t.map(function(e){return!g(e)&&e.indexOf(" ")>=0&&(e='"'+e+'"'),e});return e.push(n.join("\t")),e},[])}function _(e){var t=e.wwEditor.componentManager;t.removeManager("codeblock"),t.addManager(function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),E(t,[{key:"convertNodesToText",value:function(e){if(1!==e.length||"TABLE"!==e[0].tagName)return C(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"convertNodesToText",this).call(this,e);var n=e.shift(),r="";return r+=y([].slice.call(n.rows).map(function(e){return[].slice.call(e.cells).map(function(e){return e.innerText.trim()})})).reduce(function(e,t){return e+(t+"\n")},[])}}]),t}(B))}function b(e,t,n){var r="markdown"===t&&e.getTokenAt(n.from).state.overlay.codeBlock;return r=r||"codeblock"===t,r=r&&"wysiwyg"!==t}function w(e,t){var n=t.source,r=t.data;if(b(e,n,r)){var i=r.text.join("\n");if(0===c(i,"\t")){P.default.COLUMN_SEPARATOR="\t";var o=y(P.default.parse(i));r.update(r.from,r.to,o)}}}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.options.codeBlockLanguages;n&&n.indexOf(D)<0&&n.push(D),t=O.default.extend({usageStatistics:e.options.usageStatistics},t),R.setReplacer(D,function(e){return m(e,t)}),e.isViewer()||(_(e),e.eventManager.listen("pasteBefore",function(t){return w(e.mdEditor.cm,t)}))}Object.defineProperty(t,"__esModule",{value:!0}),t.setDefaultOptions=t.detectDelimiter=t.parseDSV2ChartData=t.parseCode2ChartOption=t.parseURL2ChartData=t.parseCode2DataAndOptions=void 0;var E=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),C=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},T=n(0),M=r(T),S=n(1),O=r(S),x=n(57),I=r(x),L=n(5),A=r(L),N=n(168),P=r(N),B=A.default.WwCodeBlockManager,R=A.default.codeBlockManager,D="chart";P.default.IGNORE_QUOTE_WHITESPACE=!1,P.default.IGNORE_RECORD_LENGTH=!0,P.default.DETECT_TYPES=!1;var j=/[\n\r]/,H=[",","\t",/\s+/],$=":",U=["barChart","columnChart","lineChart","areaChart","pieChart"],F=["lineChart","areaChart"],W={minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,height:"auto",width:"auto"};A.default.defineExtension("chart",k),t.parseCode2DataAndOptions=l,t.parseURL2ChartData=f,t.parseCode2ChartOption=h,t.parseDSV2ChartData=d,t.detectDelimiter=u,t.setDefaultOptions=v},function(e,t){e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(1),c=r(u),d=n(31),f=r(d),h=n(22),p=r(h),g=n(66),v=r(g),m=n(32),y=r(m),_=n(67),b=r(_),w=p.default.getSharedInstance(),k=function(e){function t(e,n,r){i(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.get(0),{mode:"gfm",dragDrop:!0,allowDropFileTypes:["image"],extraKeys:{Enter:"newlineAndIndentContinueMarkdownList",Tab:"indentOrderedList","Shift-Tab":"indentLessOrderedList"},viewportMargin:r&&"auto"===r.height?1/0:10}));return a.eventManager=n,a.componentManager=new y.default(a),a.componentManager.addManager(v.default),a._latestState=null,a._initEvent(),a}return a(t,e),l(t,[{key:"_initEvent",value:function(){var e=this;this.cm.getWrapperElement().addEventListener("click",function(){e.eventManager.emit("click",{source:"markdown"})}),this.cm.on("beforeChange",function(t,n){"paste"===n.origin&&e.eventManager.emit("pasteBefore",{source:"markdown",data:n})}),this.cm.on("change",function(t,n){e._emitMarkdownEditorContentChangedEvent(),e._emitMarkdownEditorChangeEvent(n)}),this.cm.on("focus",function(){e.eventManager.emit("focus",{source:"markdown"})}),this.cm.on("blur",function(){e.eventManager.emit("blur",{source:"markdown"})}),this.cm.on("scroll",function(t,n){e.eventManager.emit("scroll",{source:"markdown",data:n})}),this.cm.on("keydown",function(t,n){e.eventManager.emit("keydown",{source:"markdown",data:n}),e.eventManager.emit("keyMap",{source:"markdown",keyMap:w.convert(n),data:n})}),this.cm.on("keyup",function(t,n){e.eventManager.emit("keyup",{source:"markdown",data:n})}),this.cm.on("copy",function(t,n){e.eventManager.emit("copy",{source:"markdown",data:n})}),this.cm.on("cut",function(t,n){e.eventManager.emit("cut",{source:"markdown",data:n})}),this.cm.on("paste",function(t,n){e.eventManager.emit("paste",{source:"markdown",data:n})}),this.cm.on("drop",function(t,n){n.preventDefault(),e.eventManager.emit("drop",{source:"markdown",data:n})}),this.cm.on("cursorActivity",function(){var t=e.cm.getTokenAt(e.cm.getCursor()),n=t.state.base,r={bold:!!n.strong,italic:!!n.em,strike:!!n.strikethrough,code:n.code>0,codeBlock:-1===n.code,quote:!!n.quote,list:!!n.list,task:!!n.taskList,source:"markdown"};e._latestState&&!e._isStateChanged(e._latestState,r)||(e.eventManager.emit("stateChange",r),e._latestState=r)})}},{key:"setValue",value:function(e,n){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e,n),this._emitMarkdownEditorContentChangedEvent()}},{key:"getTextObject",value:function(e){return new b.default(this,e)}},{key:"_emitMarkdownEditorContentChangedEvent",value:function(){this.eventManager.emit("contentChangedFromMarkdown",this)}},{key:"_emitMarkdownEditorChangeEvent",value:function(e){if("setValue"!==e.origin){var t={source:"markdown"};this.eventManager.emit("changeFromMarkdown",t),this.eventManager.emit("change",t)}}},{key:"_isStateChanged",value:function(e,t){var n=!1;return c.default.forEach(t,function(t,r){return!(n=e[r]!==t)}),n}},{key:"resetState",value:function(){this._latestState=null}}],[{key:"factory",value:function(e,n,r){return new t(e,n,r)}}]),t}(f.default);t.default=k},function(e,t,n){"use strict";function r(e,t,n,i){var o=void 0,a=void 0,s=void 0,u=void 0,c=n,d=i.getLine(e);do{var f=l.exec(d);if(o=f[1],a=f[4],s=f[5],(u=o.length)===t)i.replaceRange(""+o+c+a+s,{line:e,ch:0},{line:e,ch:d.length}),c+=1,e+=1;else{if(!(u>t))return e;e=r(e,u,1,i)}d=i.getLine(e)}while(l.test(d));return e}function i(e,t){for(var n=e,r=t.getLine(e);l.test(r);)n-=1,r=t.getLine(n);return e===n?n=-1:n+=1,n}var o=n(10),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/;a.default.commands.indentLessOrderedList=function(e){return e.getOption("disableInput")?a.default.Pass:(e.execCommand("indentLess"),e.execCommand("fixOrderedListNumber"),null)},a.default.commands.fixOrderedListNumber=function(e){if(e.getOption("disableInput"))return a.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n+=1){var o=t[n].head,s=i(o.line,e);if(s>=0){var u=e.getLine(s),c=l.exec(u),d=c[1],f=c[3];r(s,d.length,parseInt(f,10),e)}}return null}},function(e,t,n){"use strict";var r=n(10),i=function(e){return e&&e.__esModule?e:{default:e}}(r);i.default.overlayMode=function(e,t,n){return{startState:function(){return{base:i.default.startState(e),overlay:i.default.startState(t),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:i.default.copyState(e,n.base),overlay:i.default.copyState(t,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(r,i){return(r!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<r.start)&&(i.streamSeen=r,i.basePos=i.overlayPos=r.start),r.start==i.basePos&&(i.baseCur=e.token(r,i.base),i.basePos=r.pos),r.start==i.overlayPos&&(r.pos=r.start,i.overlayCur=t.token(r,i.overlay),i.overlayPos=r.pos),r.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||n&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:e.indent&&function(t,n){return e.indent(t.base,n)},electricChars:e.electricChars,innerMode:function(t){return{state:t.base,mode:e}},blankLine:function(n){e.blankLine&&e.blankLine(n.base),t.blankLine&&t.blankLine(n.overlay)}}}},function(e,t,n){"use strict";var r=n(10),i=function(e){return e&&e.__esModule?e:{default:e}}(r);i.default.defineMode("markdown",function(e,t){function n(t){if(i.default.findModeByName){var n=i.default.findModeByName(t);n&&(t=n.mime||n.mimes[0])}var r=i.default.getMode(e,t);return"null"==r.name?null:r}function r(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==u){var t=w;if(!t){var n=i.default.innerMode(b,e.htmlState);t="xml"==n.mode.name&&null===n.state.tagStart&&!n.state.context&&n.state.tokenize.isInText}t&&(e.f=h,e.block=s,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function s(e,o){var l=e.column()===o.indentation,s=a(o.prevLine.stream),u=o.indentedCode,f=o.prevLine.hr,h=!1!==o.list,p=(o.listStack[o.listStack.length-1]||0)+3;o.indentedCode=!1;var g=o.indentation;if(null===o.indentationDiff&&(o.indentationDiff=o.indentation,h)){for(o.em=!1,o.strong=!1,o.code=!1,o.strikethrough=!1,o.list=null;g<o.listStack[o.listStack.length-1];)o.listStack.pop(),o.listStack.length?o.indentation=o.listStack[o.listStack.length-1]:o.list=!1;!1!==o.list&&(o.indentationDiff=g-o.listStack[o.listStack.length-1])}var v=!(s||f||o.prevLine.header||h&&u||o.prevLine.fencedCodeEnd),y=(!1===o.list||f||s)&&o.indentation<=p&&e.match(C),_=null;if(o.indentationDiff>=4&&(u||o.prevLine.fencedCodeEnd||o.prevLine.header||s))return e.skipToEnd(),o.indentedCode=!0,k.code;if(e.eatSpace())return null;if(l&&o.indentation<=p&&(_=e.match(S))&&_[1].length<=6)return o.quote=0,o.header=_[1].length,o.thisLine.header=!0,t.highlightFormatting&&(o.formatting="header"),o.f=o.inline,d(o);if(o.indentation<=p&&e.eat(">"))return o.quote=l?1:o.quote+1,t.highlightFormatting&&(o.formatting="quote"),e.eatSpace(),d(o);if(!y&&!o.setext&&l&&o.indentation<=p&&(_=e.match(T))){var b=_[1]?"ol":"ul";return o.indentation=g+e.current().length,o.list=!0,o.quote=0,o.listStack.push(o.indentation),t.taskLists&&e.match(M,!1)&&(o.taskList=!0),o.f=o.inline,t.highlightFormatting&&(o.formatting=["list","list-"+b]),d(o)}return l&&o.indentation<=p&&(_=e.match(I,!0))?(o.quote=0,o.fencedEndRE=new RegExp(_[1]+"+ *$"),o.localMode=t.fencedCodeBlockHighlighting&&n(_[2]),o.localMode&&(o.localState=i.default.startState(o.localMode)),o.f=o.block=c,t.highlightFormatting&&(o.formatting="code-block"),o.code=-1,d(o)):o.setext||!(v&&h||o.quote||!1!==o.list||o.code||y||L.test(e.string))&&(_=e.lookAhead(1))&&(_=_.match(O))?(o.setext?(o.header=o.setext,o.setext=0,e.skipToEnd(),t.highlightFormatting&&(o.formatting="header")):(o.header="="==_[0].charAt(0)?1:2,o.setext=o.header),o.thisLine.header=!0,o.f=o.inline,d(o)):y?(e.skipToEnd(),o.hr=!0,o.thisLine.hr=!0,k.hr):"["===e.peek()?r(e,o,m):r(e,o,o.inline)}function u(e,t){var n=b.token(e,t.htmlState);if(!w){var r=i.default.innerMode(b,t.htmlState);("xml"==r.mode.name&&null===r.state.tagStart&&!r.state.context&&r.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=h,t.block=s,t.htmlState=null)}return n}function c(e,n){var r=n.listStack[n.listStack.length-1]||0,i=n.indentation<r,a=r+3;if(n.fencedEndRE&&n.indentation<=a&&(i||e.match(n.fencedEndRE))){t.highlightFormatting&&(n.formatting="code-block");var l;return i||(l=d(n)),n.localMode=n.localState=null,n.block=s,n.f=h,n.fencedEndRE=null,n.code=0,n.thisLine.fencedCodeEnd=!0,i?o(e,n,n.block):l}return n.localMode?n.localMode.token(e,n.localState):(e.skipToEnd(),k.code)}function d(e){var n=[];if(e.formatting){n.push(k.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)n.push(k.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&n.push(k.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(k.formatting+"-"+e.formatting[r]+"-"+e.quote):n.push("error"))}if(e.taskOpen)return n.push("meta"),n.length?n.join(" "):null;if(e.taskClosed)return n.push("property"),n.length?n.join(" "):null;if(e.linkHref?n.push(k.linkHref,"url"):(e.strong&&n.push(k.strong),e.em&&n.push(k.em),e.strikethrough&&n.push(k.strikethrough),e.emoji&&n.push(k.emoji),e.linkText&&n.push(k.linkText),e.code&&n.push(k.code),e.image&&n.push(k.image),e.imageAltText&&n.push(k.imageAltText,"link"),e.imageMarker&&n.push(k.imageMarker)),e.header&&n.push(k.header,k.header+"-"+e.header),e.quote&&(n.push(k.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(k.quote+"-"+e.quote):n.push(k.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?n.push(k.list2):n.push(k.list3):n.push(k.list1)}return e.trailingSpaceNewLine?n.push("trailing-space-new-line"):e.trailingSpace&&n.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),n.length?n.join(" "):null}function f(e,t){if(e.match(x,!0))return d(t)}function h(e,n){var r=n.text(e,n);if(void 0!==r)return r;if(n.list)return n.list=null,d(n);if(n.taskList){return" "===e.match(M,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,t.highlightFormatting&&(n.formatting="task"),n.taskList=!1,d(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(n.formatting="header"),d(n);var a=e.next();if(n.linkTitle){n.linkTitle=!1;var l=a;"("===a&&(l=")"),l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var s="^\\s*(?:[^"+l+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(s),!0))return k.linkHref}if("`"===a){var c=n.formatting;t.highlightFormatting&&(n.formatting="code"),e.eatWhile("`");var f=e.current().length;if(0!=n.code||n.quote&&1!=f){if(f==n.code){var v=d(n);return n.code=0,v}return n.formatting=c,d(n)}return n.code=f,d(n)}if(n.code)return d(n);if("\\"===a&&(e.next(),t.highlightFormatting)){var m=d(n),y=k.formatting+"-escape";return m?m+" "+y:y}if("!"===a&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,t.highlightFormatting&&(n.formatting="image"),d(n);if("["===a&&n.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,t.highlightFormatting&&(n.formatting="image"),d(n);if("]"===a&&n.imageAltText){t.highlightFormatting&&(n.formatting="image");var m=d(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=g,m}if("["===a&&!n.image)return n.linkText&&e.match(/^.*?\]/)?d(n):(n.linkText=!0,t.highlightFormatting&&(n.formatting="link"),d(n));if("]"===a&&n.linkText){t.highlightFormatting&&(n.formatting="link");var m=d(n);return n.linkText=!1,n.inline=n.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?g:h,m}if("<"===a&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=p,t.highlightFormatting&&(n.formatting="link");var m=d(n);return m?m+=" ":m="",m+k.linkInline}if("<"===a&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=p,t.highlightFormatting&&(n.formatting="link");var m=d(n);return m?m+=" ":m="",m+k.linkEmail}if(t.xml&&"<"===a&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=e.string.indexOf(">",e.pos);if(-1!=_){/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(e.string.substring(e.start,_))&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=i.default.startState(b),o(e,n,u)}if(t.xml&&"<"===a&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===a||"_"===a){for(var w=1,E=1==e.pos?" ":e.string.charAt(e.pos-2);w<3&&e.eat(a);)w++;var C=e.peek()||" ",T=!/\s/.test(C)&&(!A.test(C)||/\s/.test(E)||A.test(E)),S=!/\s/.test(E)&&(!A.test(E)||/\s/.test(C)||A.test(C)),O=null,x=null;if(w%2&&(n.em||!T||"*"!==a&&S&&!A.test(E)?n.em!=a||!S||"*"!==a&&T&&!A.test(C)||(O=!1):O=!0),w>1&&(n.strong||!T||"*"!==a&&S&&!A.test(E)?n.strong!=a||!S||"*"!==a&&T&&!A.test(C)||(x=!1):x=!0),null!=x||null!=O){t.highlightFormatting&&(n.formatting=null==O?"strong":null==x?"em":"strong em"),!0===O&&(n.em=a),!0===x&&(n.strong=a);var v=d(n);return!1===O&&(n.em=!1),!1===x&&(n.strong=!1),v}}else if(" "===a&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return d(n);e.backUp(1)}if(t.strikethrough)if("~"===a&&e.eatWhile(a)){if(n.strikethrough){t.highlightFormatting&&(n.formatting="strikethrough");var v=d(n);return n.strikethrough=!1,v}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,t.highlightFormatting&&(n.formatting="strikethrough"),d(n)}else if(" "===a&&e.match(/^~~/,!0)){if(" "===e.peek())return d(n);e.backUp(2)}if(t.emoji&&":"===a&&e.match(/^[a-z_\d+-]+:/)){n.emoji=!0,t.highlightFormatting&&(n.formatting="emoji");var I=d(n);return n.emoji=!1,I}return" "===a&&(e.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),d(n)}function p(e,n){if(">"===e.next()){n.f=n.inline=h,t.highlightFormatting&&(n.formatting="link");var r=d(n);return r?r+=" ":r="",r+k.linkInline}return e.match(/^[^>]+/,!0),k.linkInline}function g(e,n){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(n.f=n.inline=v("("===r?")":"]"),t.highlightFormatting&&(n.formatting="link-string"),n.linkHref=!0,d(n)):"error"}function v(e){return function(n,r){if(n.next()===e){r.f=r.inline=h,t.highlightFormatting&&(r.formatting="link-string");var i=d(r);return r.linkHref=!1,i}return n.match(N[e]),r.linkHref=!0,d(r)}}function m(e,n){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(n.f=y,e.next(),t.highlightFormatting&&(n.formatting="link"),n.linkText=!0,d(n)):r(e,n,h)}function y(e,n){if(e.match(/^\]:/,!0)){n.f=n.inline=_,t.highlightFormatting&&(n.formatting="link");var r=d(n);return n.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function _(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,k.linkHref+" url")}var b=i.default.getMode(e,"text/html"),w="null"==b.name;void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var k={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var E in k)k.hasOwnProperty(E)&&t.tokenTypeOverrides[E]&&(k[E]=t.tokenTypeOverrides[E]);var C=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,M=/^\[(x| )\](?=\s)/i,S=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ *(?:\={1,}|-{1,})\s*$/,x=/^[^#!\[\]*_\\<>` "'(~:]+/,I=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,L=/^\s*\[[^\]]+?\]:.*$/,A=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~]/,N={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},P={startState:function(){return{f:s,prevLine:{stream:null},thisLine:{stream:null},block:s,htmlState:null,indentation:0,inline:h,text:f,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&i.default.copyState(b,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?i.default.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return l(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=u)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==u?{state:e.htmlState,mode:b}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(e,t,n){return e.block==u&&b.indent?b.indent(e.htmlState,t,n):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,n):i.default.Pass},blankLine:l,getType:d,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P},"xml"),i.default.defineMIME("text/markdown","markdown"),i.default.defineMIME("text/x-markdown","markdown")},function(e,t,n){"use strict";var r=n(10),i=function(e){return e&&e.__esModule?e:{default:e}}(r);i.default.defineMode("gfm",function(e,t){function n(e){return e.code=!1,null}var r=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```+/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var i=1+e.pos-n;return t.code?i===r&&(t.code=!1):(r=i,t.code=!0),null}return t.code?(e.next(),null):e.eatSpace()?(t.ateSpace=!0,null):(e.next(),null)},blankLine:n},a={taskLists:!0,strikethrough:!0,emoji:!0};for(var l in t)a[l]=t[l];return a.name="markdown",i.default.overlayMode(i.default.getMode(e,a),o)},"markdown"),i.default.defineMIME("text/x-gfm","gfm")},function(e,t,n){"use strict";function r(e,t){var n=t.line,r=0,i=0,o=a.exec(e.getLine(n)),l=o[1];do{r+=1;var s=n+r,u=e.getLine(s),c=a.exec(u);if(c){var d=c[1],f=parseInt(o[3],10)+r-i,h=parseInt(c[3],10),p=h;if(l!==d||isNaN(h)){if(l.length>d.length)return;if(l.length<d.length&&1===r)return;i+=1}else f===h&&(p=h+1),f>h&&(p=f+1),e.replaceRange(u.replace(a,d+p+c[4]+c[5]),{line:s,ch:0},{line:s,ch:u.length})}}while(c)}var i=n(10),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,l=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,s=/[*+-]\s/;o.default.commands.indentOrderedList=function(e){if(e.getOption("disableInput"))return o.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n].head,i=e.getLine(r.line),l=i.substr(0,r.ch);a.test(l)||e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertSoftTab")}e.execCommand("fixOrderedListNumber")},o.default.commands.newlineAndIndentContinueMarkdownList=function(e){if(e.getOption("disableInput"))return o.default.Pass;for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){var u=t[i].head,c=e.getStateAfter(u.line),d=!1!==c.list,f=0!==c.quote,h=e.getLine(u.line),p=a.exec(h),g=/^\s*$/.test(h.slice(0,u.ch));if(!t[i].empty()||!d&&!f||!p||g)return void e.execCommand("newlineAndIndent");if(l.test(h))/>\s*$/.test(h)||e.replaceRange("",{line:u.line,ch:0},{line:u.line,ch:u.ch+1}),n[i]="\n";else{var v=p[1],m=p[5],y=!(s.test(p[2])||p[2].indexOf(">")>=0),_=y?parseInt(p[3],10)+1+p[4]:p[2].replace("x"," ");n[i]="\n"+v+_+m,y&&r(e,u)}}e.replaceSelections(n)}},function(e,t,n){"use strict";function r(e){return i(e)&&e.anchor.ch===e.head.ch}function i(e){return e.anchor.line===e.head.line}function o(e,t,n,i){var o=e.getLine(n.line),a=e.getLine(n.line+i),l={anchor:t,head:n};e.replaceRange(a,{line:n.line,ch:0},{line:n.line,ch:o.length},"+input"),e.replaceRange(o,{line:n.line+i,ch:0},{line:n.line+i,ch:a.length},"+input"),r(l)?e.setCursor({line:n.line+i,ch:n.ch}):e.setSelection({line:t.line+i,ch:t.ch},{line:n.line+i,ch:n.ch})}function a(e,t,n,r){var i=e.getRange({line:t.line,ch:0},{line:n.line,ch:e.getLine(n.line).length}),o=r>0?n:t,a=e.getLine(o.line+r),l=void 0;l=r>0?t:n,e.replaceRange(a,{line:l.line,ch:0},{line:l.line,ch:e.getLine(l.line).length},"+input"),e.replaceRange(i,{line:t.line+r,ch:0},{line:n.line+r,ch:e.getLine(n.line+r).length},"+input"),e.setSelection({line:t.line+r,ch:t.ch},{line:n.line+r,ch:n.ch})}var l=n(10),s=function(e){return e&&e.__esModule?e:{default:e}}(l);s.default.commands.replaceLineTextToUpper=function(e){if(e.getOption("disableInput"))return s.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var l=t[n],u=l.anchor,c=l.head;if(i(l)&&c.line>0)o(e,u,c,-1);else if(!r(l)){var d=u.line<c.line?u.line:c.line;if(d>0){var f=u.line===d?u:c,h=u.line===d?c:u;a(e,f,h,-1)}}}},s.default.commands.replaceLineTextToLower=function(e){if(e.getOption("disableInput"))return s.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var l=t[n],u=l.anchor,c=l.head,d=c.line===e.lastLine();if(i(l)&&!d)o(e,u,c,1);else if(!r(l)){var f=u.line<c.line?u.line:c.line,h=u.line===f?u:c,p=u.line===f?c:u;p.line<e.lastLine()&&a(e,h,p,1)}}}},function(e,t,n){"use strict";function r(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function i(e){r(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.className="CodeMirror-placeholder";var n=e.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),t.appendChild(n),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function o(e){l(e)&&i(e)}function a(e){var t=e.getWrapperElement(),n=l(e);t.className=t.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?i(e):r(e)}function l(e){return 1===e.lineCount()&&""===e.getLine(0)}var s=n(10),u=function(e){return e&&e.__esModule?e:{default:e}}(s);u.default.defineOption("placeholder","",function(e,t,n){var i=n&&n!=u.default.Init;if(t&&!i)e.on("blur",o),e.on("change",a),e.on("swapDoc",a),a(e);else if(!t&&i){e.off("blur",o),e.off("change",a),e.off("swapDoc",a),r(e);var l=e.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}t&&!e.hasFocus()&&o(e)})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=/^[ \t]*([-*]|[\d]+\.)( \[[ xX]])? /,a=/^[ \t]*([*-] |[\d]+\. )(\[[ xX]] )/,l=/^[ \t]*[-*] .*/,s=/^[ \t]*[\d]+\. \[[ xX]] .*/,u=/([*-] |[\d]+\. )/,c=/([-*] |[\d]+\. )(\[[ xX]] )/,d=/([-*]|[\d]+\.)( \[[ xX]])? /,f=/([-*])( \[[ xX]]) /,h=/([\d])+\.( \[[ xX]])? /,p=/^\|([-\s\w\d\t<>?!@#$%^&*()_=+\\\/'";: \r[\]]*\|+)+/i,g=/^#+\s/,v=/^ {0,3}(```|\||>)/,m=function(){function e(t){r(this,e),this.cm=t.getEditor(),this.doc=this.cm.getDoc(),this.name="list"}return i(e,[{key:"_createSortedLineRange",value:function(e){var t=e.from.line>e.to.line;return{start:{line:t?e.to.line:e.from.line,ch:0}.line,end:{line:t?e.from.line:e.to.line,ch:0}.line}}},{key:"_calculateOrdinalNumber",value:function(e){for(var t=1,n=e-1;n>=0;n-=1){var r=this._getListDepth(n);if(1===r&&h.exec(this.doc.getLine(n))){t=parseInt(RegExp.$1,10)+1;break}if(0===r)break}return t}},{key:"_isListLine",value:function(e){return!!o.exec(this.doc.getLine(e))}},{key:"_isCanBeList",value:function(e){var t=this.doc.getLine(e);return!v.test(t)&&!p.test(t)&&!g.test(t)}},{key:"_getChangeFn",value:function(e){var t=this,n=void 0;switch(e){case"ol":case"ul":n=function(n){return t._changeToList(n,e)};break;case"task":n=function(e){return t._changeToTask(e)}}return n}},{key:"changeSyntax",value:function(e,t){for(var n=[],r=this._createSortedLineRange(e),i=r.start,o=r.end,a=this._getChangeFn(t),l=i;l<=o&&this._isCanBeList(l);l+=1)this._isListLine(l)||n.push(l),a(l);this._insertBlankLineForNewList(n),this.cm.focus()}},{key:"_replaceLineText",value:function(e,t){this.doc.replaceRange(e,{line:t,ch:0})}},{key:"_changeToList",value:function(e,t){var n=this;this._isListLine(e)?this._changeSameDepthList(e,"ol"===t?function(e,t){n._replaceListTypeToOL(e,t)}:function(e){n._replaceListTypeToUL(e)}):this._replaceLineText("ol"===t?this._calculateOrdinalNumber(e)+". ":"* ",e)}},{key:"_changeToTask",value:function(e){a.exec(this.doc.getLine(e))?this._replaceLineTextByRegexp(e,c,"$1"):this._isListLine(e)?this._replaceLineTextByRegexp(e,u,"$1[ ] "):this._replaceLineText("* [ ] ",e)}},{key:"_getListDepth",value:function(e){return this.doc.getLine(e)?this.doc.cm.getStateAfter(e).base.listStack.length:0}},{key:"_findSameDepthList",value:function(e,t,n){for(var r=this.doc.lineCount(),i=[],o=e,a=void 0;n?o<r-1:o>0;)if(o=n?o+1:o-1,(a=this._getListDepth(o))===t)i.push(o);else if(a<t)break;return i}},{key:"_changeSameDepthList",value:function(e,t){var n=this._getListDepth(e),r=this._findSameDepthList(e,n,!1).reverse(),i=this._findSameDepthList(e,n,!0);r.concat([e]).concat(i).forEach(function(e,n){t(e,n+1)})}},{key:"_replaceLineTextByRegexp",value:function(e,t,n){var r=this.doc.getLine(e),i={line:e,ch:0},o={line:e,ch:r.length};r=r.replace(t,n),this.doc.replaceRange(r,i,o)}},{key:"_replaceListTypeToUL",value:function(e){var t=this.doc.getLine(e);f.exec(t)?this._replaceLineTextByRegexp(e,f,"$1 "):h.exec(t)&&this._replaceLineTextByRegexp(e,h,"* ")}},{key:"_replaceListTypeToOL",value:function(e,t){var n=this.doc.getLine(e);l.exec(n)||s.exec(n)?this._replaceLineTextByRegexp(e,d,t+". "):h.exec(n)&&parseInt(RegExp.$1,10)!==t&&this._replaceLineTextByRegexp(e,h,t+". ")}},{key:"_insertBlankLineForNewList",value:function(e){var t=e.length;if(t){var n=e[0],r=e[t-1];this._isNotBlankNotListLine(r+1)&&this.doc.replaceRange("\n",{line:r,ch:this.doc.getLine(r).length}),n>0&&this._isNotBlankNotListLine(n-1)&&this.doc.replaceRange("\n",{line:n,ch:0})}}},{key:"_isNotBlankNotListLine",value:function(e){return!!this.doc.getLine(e)&&!this._isListLine(e)}}]),e}();t.default=m},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(t,n){r(this,e),this._mde=t,this.setRange(n||t.getRange())}return i(e,[{key:"_setStart",value:function(e){this._start=e}},{key:"_setEnd",value:function(e){this._end=e}},{key:"setRange",value:function(e){this._setStart(e.start),this._setEnd(e.end)}},{key:"setEndBeforeRange",value:function(e){this._setEnd(e.start)}},{key:"expandStartOffset",value:function(){var e=this._start;0!==e.ch&&(e.ch-=1)}},{key:"expandEndOffset",value:function(){var e=this._end;e.ch<this._mde.getEditor().getDoc().getLine(e.line).length&&(e.ch+=1)}},{key:"getTextContent",value:function(){return this._mde.getEditor().getRange(this._start,this._end)}},{key:"replaceContent",value:function(e){this._mde.getEditor().replaceRange(e,this._start,this._end,"+input")}},{key:"deleteContent",value:function(){this._mde.getEditor().replaceRange("",this._start,this._end,"+delete")}},{key:"peekStartBeforeOffset",value:function(e){var t={line:this._start.line,ch:Math.max(this._start.ch-e,0)};return this._mde.getEditor().getRange(t,this._start)}}]),e}();t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(){r(this,e),this.globalTOID=null,this.lazyRunFunctions={}}return i(e,[{key:"run",value:function(e,t,n,r){var i=void 0;return a.default.isString(e)?i=this._runRegisteredRun(e,t,n,r):(i=this._runSingleRun(e,t,n,r,this.globalTOID),this.globalTOID=i),i}},{key:"registerLazyRunFunction",value:function(e,t,n,r){r=r||this,this.lazyRunFunctions[e]={fn:t,delay:n,context:r,TOID:null}}},{key:"_runSingleRun",value:function(e,t,n,r,i){return this._clearTOIDIfNeed(i),i=setTimeout(function(){e.call(n,t)},r)}},{key:"_runRegisteredRun",value:function(e,t,n,r){var i=this.lazyRunFunctions[e],o=i.fn,a=i.TOID;return r=r||i.delay,n=n||i.context,a=this._runSingleRun(o,t,n,r,a),i.TOID=a,a}},{key:"_clearTOIDIfNeed",value:function(e){e&&clearTimeout(e)}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(4),d=r(c),f=n(70),h=r(f),p=n(73),g=r(p),v=n(74),m=r(v),y=n(35),_=r(y),b=n(36),w=r(b),k=n(75),E=r(k),C=n(76),T=r(C),M=n(77),S=r(M),O=n(37),x=r(O),I=n(78),L=r(I),A=n(22),N=r(A),P=n(80),B=r(P),R=n(32),D=r(R),j=n(81),H=r(j),$=N.default.getSharedInstance(),U=/<([a-z]+|h\d)>(<br>|<br \/>)<\/\1>/gi,F=/(?:<br>|<br \/>)<\/(.+?)>/gi,W=/\b(H[\d]|LI|P|BLOCKQUOTE|TD|PRE)\b/,q=/^(TABLE|H[1-6])$/,V="undefined"!=typeof MutationObserver,z=function(){function e(t,n){var r=this;i(this,e),this.componentManager=new D.default(this),this.eventManager=n,this.$editorContainerEl=t,this._height=0,this._silentChange=!1,this._keyEventHandlers={},this._managers={},this._initEvent(),this._initDefaultKeyEventHandler(),this.debouncedPostProcessForChange=u.default.debounce(function(){return r.postProcessForChange()},0)}return o(e,[{key:"init",value:function(){var e=(0,l.default)("<div />");this.$editorContainerEl.append(e),this.editor=new L.default(e[0],{blockTag:"DIV",leafNodeNames:{HR:!1}}),this.editor.blockCommandShortcuts(),this._clipboardManager=new h.default(this),this._initSquireEvent(),this._clipboardManager.init(),this.get$Body().addClass("tui-editor-contents"),this.$editorContainerEl.css("position","relative"),this._togglePlaceholder(),this.codeBlockGadget=new H.default({eventManager:this.eventManager,container:this.$editorContainerEl,wysiwygEditor:this})}},{key:"_preprocessForInlineElement",value:function(e){return e.replace(/<br>( *)<img/g,"<br><br>$1<img")}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._preprocessForInlineElement(t)}),this.eventManager.listen("wysiwygKeyEvent",function(t){return e._runKeyEventHandlers(t.data,t.keyMap)}),this.eventManager.listen("wysiwygRangeChangeAfter",function(){return e.scrollIntoCursor()}),this.eventManager.listen("contentChangedFromWysiwyg",function(){e._togglePlaceholder()})}},{key:"addKeyEventHandler",value:function(e,t){var n=this;t||(t=e,e="DEFAULT"),u.default.isArray(e)||(e=[e]),e.forEach(function(e){n._keyEventHandlers[e]||(n._keyEventHandlers[e]=[]),n._keyEventHandlers[e].push(t)})}},{key:"removeKeyEventHandler",value:function(e,t){t||(t=e,e="DEFAULT");var n=this._keyEventHandlers[e];n&&(this._keyEventHandlers[e]=n.filter(function(e){return e!==t}))}},{key:"_runKeyEventHandlers",value:function(e,t){var n=this.getRange(),r=void 0,i=void 0;r=this._keyEventHandlers.DEFAULT,r&&u.default.forEachArray(r,function(r){return i=r(e,n,t)}),(r=this._keyEventHandlers[t])&&!1!==i&&u.default.forEachArray(r,function(r){return r(e,n,t)})}},{key:"_initSquireEvent",value:function(){var e=this,t=this.getEditor(),n=!1;t.addEventListener("copy",function(t){e.eventManager.emit("copy",{source:"wysiwyg",data:t}),u.default.debounce(function(){e.isEditorValid()&&e.eventManager.emit("copyAfter",{source:"wysiwyg",data:t})})()}),t.addEventListener(u.default.browser.msie?"beforecut":"cut",function(t){e.eventManager.emit("cut",{source:"wysiwyg",data:t}),u.default.debounce(function(){e.isEditorValid()&&e.eventManager.emit("cutAfter",{source:"wysiwyg",data:t})})()}),t.addEventListener(u.default.browser.msie?"beforepaste":"paste",function(t){e.eventManager.emit("paste",{source:"wysiwyg",data:t})}),t.addEventListener("dragover",function(e){return e.preventDefault(),!1}),t.addEventListener("drop",function(t){return t.preventDefault(),e.eventManager.emit("drop",{source:"wysiwyg",data:t}),!1}),t.addEventListener("input",u.default.debounce(function(){if(e.isEditorValid()){if(e._silentChange)e._silentChange=!1;else{var t={source:"wysiwyg"};e.eventManager.emit("changeFromWysiwyg",t),e.eventManager.emit("change",t),e.eventManager.emit("contentChangedFromWysiwyg",e)}e.getEditor().preserveLastLine()}},0)),t.addEventListener("keydown",function(t){e.getEditor().getSelection().collapsed||(n=!0),e.eventManager.emit("keydown",{source:"wysiwyg",data:t}),e._onKeyDown(t)}),u.default.browser.firefox&&(t.addEventListener("keypress",function(t){var r=t.keyCode;if(13===r||9===r){e.getEditor().getSelection().collapsed||(n=!0),e.eventManager.emit("keydown",{source:"wysiwyg",data:t}),e._onKeyDown(t)}}),t.addEventListener("keyup",function(){var t=e.getRange();if(d.default.isTextNode(t.commonAncestorContainer)&&d.default.isTextNode(t.commonAncestorContainer.previousSibling)){var n=t.commonAncestorContainer.previousSibling.length,r=t.commonAncestorContainer;t.commonAncestorContainer.previousSibling.appendData(t.commonAncestorContainer.data),t.setStart(t.commonAncestorContainer.previousSibling,n+t.startOffset),t.collapse(!0),r.parentNode.removeChild(r),e.setRange(t),t.detach()}})),t.addEventListener("keyup",function(t){n&&(e.debouncedPostProcessForChange(),n=!1),e.eventManager.emit("keyup",{source:"wysiwyg",data:t})}),this.$editorContainerEl.on("scroll",function(t){e.eventManager.emit("scroll",{source:"wysiwyg",data:t})}),t.addEventListener("click",function(t){e.eventManager.emit("click",{source:"wysiwyg",data:t})}),t.addEventListener("mousedown",function(t){e.eventManager.emit("mousedown",{source:"wysiwyg",data:t})}),t.addEventListener("mouseover",function(t){e.eventManager.emit("mouseover",{source:"wysiwyg",data:t})}),t.addEventListener("mouseout",function(t){e.eventManager.emit("mouseout",{source:"wysiwyg",data:t})}),t.addEventListener("mouseup",function(t){e.eventManager.emit("mouseup",{source:"wysiwyg",data:t})}),t.addEventListener("contextmenu",function(t){e.eventManager.emit("contextmenu",{source:"wysiwyg",data:t})}),t.addEventListener("focus",function(){e.eventManager.emit("focus",{source:"wysiwyg"})}),t.addEventListener("blur",function(){e.fixIMERange(),e.eventManager.emit("blur",{source:"wysiwyg"})}),t.addEventListener("pathChange",function(t){var n={bold:/(>B|>STRONG|^B$|^STRONG$)/.test(t.path),italic:/(>I|>EM|^I$|^EM$)/.test(t.path),strike:/(^S>|>S$|>S>|^S$)/.test(t.path),code:/CODE/.test(t.path),codeBlock:/PRE/.test(t.path),quote:/BLOCKQUOTE/.test(t.path),list:/LI(?!.task-list-item)/.test(e._getLastLiString(t.path)),task:/LI.task-list-item/.test(e._getLastLiString(t.path)),source:"wysiwyg"};e.eventManager.emit("stateChange",n)}),t.addEventListener("willPaste",function(t){t.fragment&&e.eventManager.emit("willPaste",{source:"wysiwyg",data:t})})}},{key:"_togglePlaceholder",value:function(){var e=this.getEditor();e.modifyDocument(function(){var t=e.getRoot();t.textContent||t.childNodes.length>1?t.classList.remove("tui-editor-contents-placeholder"):t.classList.add("tui-editor-contents-placeholder")})}},{key:"_getLastLiString",value:function(e){var t=/LI[^UO]*$/.exec(e);return t?t[0]:""}},{key:"_onKeyDown",value:function(e){var t=$.convert(e);e.keyCode&&(this.eventManager.emit("keyMap",{source:"wysiwyg",keyMap:t,data:e}),e.defaultPrevented||this.eventManager.emit("wysiwygKeyEvent",{keyMap:t,data:e}))}},{key:"_initDefaultKeyEventHandler",value:function(){var e=this;this.addKeyEventHandler("ENTER",function(t,n){e._isInOrphanText(n)&&e.defer(function(){e._wrapDefaultBlockToOrphanTexts(),e.breakToNewDefaultBlock(n,"before")}),e.defer(function(){return e.scrollIntoCursor()})}),this.addKeyEventHandler("TAB",function(t){var n=e.getEditor(),r=n.getSelection(),i=r.collapsed&&e._isCursorNotInRestrictedAreaOfTabAction(n),o=!r.collapsed&&d.default.isTextNode(r.commonAncestorContainer);return t.preventDefault(),!i&&!o||(n.insertPlainText("    "),!1)}),this.addKeyEventHandler("BACK_SPACE",function(t,n,r){return e._handleRemoveKeyEvent(t,n,r)}),this.addKeyEventHandler("DELETE",function(t,n,r){return e._handleRemoveKeyEvent(t,n,r)})}},{key:"_handleRemoveKeyEvent",value:function(e,t,n){var r=this.getEditor();if(this._isStartHeadingOrTableAndContainsThem(t)){var i="BACK_SPACE"===n?"backspace":"delete";return r.removeAllFormatting(),r._keyHandlers[i](r,e,r.getSelection()),r.removeLastUndoStack(),!1}return!0}},{key:"_isStartHeadingOrTableAndContainsThem",value:function(e){var t=e.startContainer,n=e.startOffset,r=e.commonAncestorContainer,i=e.collapsed,o=this.getEditor().getRoot();if(!i&&r===o){if(t===o)return q.test(d.default.getChildNodeByOffset(t,n).nodeName);if(0===n)return q.test(d.default.getParentUntil(t,o).nodeName)}return!1}},{key:"_wrapDefaultBlockToOrphanTexts",value:function(){this.get$Body().contents().filter(this.findTextNodeFilter).each(function(e,t){t.nextSibling&&"BR"===t.nextSibling.tagName&&(0,l.default)(t.nextSibling).remove(),(0,l.default)(t).wrap("<div />")})}},{key:"_isInOrphanText",value:function(e){return e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer.parentNode===this.get$Body()[0]}},{key:"_wrapDefaultBlockTo",value:function(e){this.saveSelection(e),this._joinSplitedTextNodes(),this.restoreSavedSelection(),e=this.getRange();var t=e.startContainer,n=e.startOffset,r=this.getEditor().createDefaultBlock([e.startContainer]),i=d.default.getChildNodeByOffset(e.startContainer,e.startOffset);i?e.setStartBefore(i):e.selectNodeContents(e.startContainer),e.collapse(!0),e.insertNode(r),e.setStart(t,n),e.collapse(!0),this.setRange(e)}},{key:"findTextNodeFilter",value:function(){return this.nodeType===Node.TEXT_NODE}},{key:"_joinSplitedTextNodes",value:function(){var e=void 0,t=void 0,n=[];this.get$Body().contents().filter(this.findTextNodeFilter).each(function(r,i){e===i.previousSibling?(t.nodeValue+=i.nodeValue,n.push(i)):t=i,e=i}),(0,l.default)(n).remove()}},{key:"saveSelection",value:function(e){e||(e=this.getRange()),this.getEditor()._saveRangeToBookmark(e)}},{key:"setSelectionByContainerAndOffset",value:function(e,t,n,r){var i=this.getEditor(),o=i.getSelection();return o.setStart(e,t),o.setEnd(n,r),i.setSelection(o),o}},{key:"restoreSavedSelection",value:function(){this.setRange(this.getEditor()._getRangeAndRemoveBookmark())}},{key:"reset",value:function(){this.setValue("")}},{key:"changeBlockFormatTo",value:function(e){this.getEditor().changeBlockFormatTo(e),this.eventManager.emit("wysiwygRangeChangeAfter",this)}},{key:"makeEmptyBlockCurrentSelection",value:function(){var e=this;this.getEditor().modifyBlocks(function(t){return t.textContent||(t=e.getEditor().createDefaultBlock()),t})}},{key:"focus",value:function(){var e=this.scrollTop();this.editor.focus(),e!==this.scrollTop()&&this.scrollTop(e)}},{key:"blur",value:function(){this.editor.blur()}},{key:"remove",value:function(){this.$editorContainerEl.off("scroll"),this.getEditor().destroy(),this.editor=null,this.$body=null,this.eventManager=null}},{key:"setHeight",value:function(e){this._height=e,this.$editorContainerEl.css("overflow","auto"),this.$editorContainerEl.css("height","100%"),this.$editorContainerEl.parent().height(e);var t=parseInt(this.$editorContainerEl.css("padding-top"),10)-parseInt(this.$editorContainerEl.css("padding-bottom"),10),n=parseInt(this.get$Body().css("margin-top"),10)-parseInt(this.get$Body().css("margin-bottom"),10);this.get$Body().css("min-height",e-n-t+"px")}},{key:"setMinHeight",value:function(e){this.get$Body().get(0).style.minHeight=e+"px"}},{key:"setPlaceholder",value:function(e){e&&this.getEditor().getRoot().setAttribute("data-placeholder",e)}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e=this.eventManager.emitReduce("wysiwygSetValueBefore",e),this.editor.setHTML(e),this.eventManager.emit("wysiwygSetValueAfter",this),this.eventManager.emit("contentChangedFromWysiwyg",this),t&&this.moveCursorToEnd(),this.getEditor().preserveLastLine(),this.getEditor().removeLastUndoStack(),this.getEditor().saveUndoState()}},{key:"insertText",value:function(e){this.editor.insertPlainText(e)}},{key:"getValue",value:function(){this._prepareGetHTML();var e=this.editor.getHTML();return e=e.replace(U,function(e,t){return"li"===t?e:"td"===t||"th"===t?"<"+t+"></"+t+">":"<br />"}),e=e.replace(F,"</$1>"),e=e.replace(/<div[^>]*>/g,""),e=e.replace(/<\/div>/g,"<br />"),e=this.eventManager.emitReduce("wysiwygProcessHTMLText",e)}},{key:"_prepareGetHTML",value:function(){var e=this;this.getEditor().modifyDocument(function(){e._joinSplitedTextNodes(),e.eventManager.emit("wysiwygGetValueBefore",e)})}},{key:"postProcessForChange",value:function(){var e=this;this.isEditorValid()&&this.getEditor().modifyDocument(function(){e.eventManager.emit("wysiwygRangeChangeAfter",e)})}},{key:"readySilentChange",value:function(){V&&!this.getEditor().isIgnoreChange()&&(this._silentChange=!0)}},{key:"getEditor",value:function(){return this.editor}},{key:"replaceSelection",value:function(e,t){this.getEditor().replaceSelection(e,t)}},{key:"replaceRelativeOffset",value:function(e,t,n){this.getEditor().replaceRelativeOffset(e,t,n)}},{key:"addWidget",value:function(e,t,n,r){var i=this.getEditor().getSelectionPosition(e,n,r),o=this.$editorContainerEl.offset();this.$editorContainerEl.append(t),(0,l.default)(t).css({position:"absolute",top:i.top-o.top+this.scrollTop(),left:i.left-o.left})}},{key:"get$Body",value:function(){return this.getEditor().get$Body()}},{key:"hasFormatWithRx",value:function(e){return this.getEditor().getPath().match(e)}},{key:"breakToNewDefaultBlock",value:function(e,t){var n=this.editor.createDefaultBlock(),r=d.default.getChildNodeByOffset(e.startContainer,e.startOffset)||d.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),i=d.default.getParentUntil(r,this.get$Body()[0]);"before"===t?(0,l.default)(i).before(n):(0,l.default)(i).after(n),e.setStart(n,0),e.collapse(!0),this.setRange(e)}},{key:"replaceContentText",value:function(e,t,n){var r=(0,l.default)(e).html();(0,l.default)(e).html(r.replace(t,n))}},{key:"unwrapBlockTag",value:function(e){e||(e=function(e){return W.test(e)}),this.getEditor().changeBlockFormat(e),this.eventManager.emit("wysiwygRangeChangeAfter",this)}},{key:"scrollIntoCursor",value:function(){var e=this.scrollTop(),t=this.getEditor().getCursorPosition(),n=t.top,r=t.height,i=this.$editorContainerEl.get(0).getBoundingClientRect(),o=i.top,a=i.height,l=n-o,s=n+r-(o+a);l<0?this.scrollTop(e+l):s>0&&this.scrollTop(Math.ceil(e+s))}},{key:"moveCursorToEnd",value:function(){this.getEditor().moveCursorToEnd(),this.scrollIntoCursor(),this._correctRangeAfterMoveCursor("end")}},{key:"moveCursorToStart",value:function(){this.getEditor().moveCursorToStart(),this.scrollTop(0)}},{key:"scrollTop",value:function(e){return u.default.isUndefined(e)?this.$editorContainerEl.scrollTop():this.$editorContainerEl.scrollTop(e)}},{key:"_correctRangeAfterMoveCursor",value:function(e){var t=this.getRange(),n=this.get$Body().get(0);if("start"===e)for(;n.firstChild;)n=n.firstChild;else for(;n.lastChild;)n=n.lastChild;"BR"===n.tagName?t.setStartBefore(n):t.setStartAfter(n),t.collapse(!0),this.setRange(t)}},{key:"getRange",value:function(){return this.getEditor().getSelection().cloneRange()}},{key:"getIMERange",value:function(){var e=void 0,t=getSelection();return t&&t.rangeCount&&(e=t.getRangeAt(0).cloneRange()),e}},{key:"fixIMERange",value:function(){var e=this.getIMERange();e&&(0,l.default)(e.commonAncestorContainer).closest(this.$editorContainerEl).length&&this.setRange(e)}},{key:"setRange",value:function(e){this.getEditor().setSelection(e)}},{key:"isInTable",value:function(e){var t=e.collapsed?e.startContainer:e.commonAncestorContainer;return!!(0,l.default)(t).closest("[contenteditable=true] table").length}},{key:"getTextObject",value:function(e){return new B.default(this,e)}},{key:"defer",value:function(e,t){var n=this,r=t||0;setTimeout(function(){n.isEditorValid()&&e(n)},r)}},{key:"isEditorValid",value:function(){return this.getEditor()&&l.default.contains(this.$editorContainerEl[0].ownerDocument,this.$editorContainerEl[0])}},{key:"_isCursorNotInRestrictedAreaOfTabAction",value:function(e){return!e.hasFormat("li")&&!e.hasFormat("blockquote")&&!e.hasFormat("table")}}],[{key:"factory",value:function(t,n,r){var i=new e(t,n,r);return i.init(),i.componentManager.addManager(g.default),i.componentManager.addManager(m.default),i.componentManager.addManager(w.default),i.componentManager.addManager(_.default),i.componentManager.addManager(E.default),i.componentManager.addManager(T.default),i.componentManager.addManager(S.default),i.componentManager.addManager(x.default),i}}]),e}();t.default=z},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(4),d=r(c),f=n(71),h=r(f),p=n(72),g=r(p),v=function(){function e(t){i(this,e),this.wwe=t,this._pch=new h.default(this.wwe),this._tablePasteHelper=new g.default(this.wwe),this._selectedSellCount=0,this._$clipboardArea=null}return o(e,[{key:"init",value:function(){var e=this;this.wwe.eventManager.listen("willPaste",function(t){return e._onWillPaste(t.data)}),this.wwe.eventManager.listen("copy",this._onCopyCut.bind(this)),this.wwe.eventManager.listen("copyAfter",this._onCopyAfter.bind(this)),this.wwe.eventManager.listen("cut",this._onCopyCut.bind(this)),this.wwe.eventManager.listen("cutAfter",this._onCutAfter.bind(this)),this.wwe.eventManager.listen("paste",this._onPasteIntoTable.bind(this))}},{key:"_onCopyCut",value:function(e){var t=this.wwe.componentManager.getManager("tableSelection");if(t.getSelectedCells().length){if(!t.mergedTableSelectionManager)return t.createRangeBySelectedCells(),void t.removeClassAttrbuteFromAllCellsIfNeed();var n=this.wwe.getEditor(),r=e.data,i=n.getSelection().cloneRange(),o=(0,l.default)("<div />");this._extendRange(i),o.append(i.cloneContents()),this._updateCopyDataForListTypeIfNeed(i,o),this.wwe.eventManager.emit("copyBefore",{source:"wysiwyg",$clipboardContainer:o}),this._setClipboardData(r,o.html(),o.text())}}},{key:"_clearClipboardArea",value:function(){this._$clipboardArea&&(this._$clipboardArea.remove(),this._$clipboardArea=null)}},{key:"_onCopyAfter",value:function(){this.wwe.getEditor().get$Body().focus(),this._clearClipboardArea()}},{key:"_onCutAfter",value:function(){this.wwe.getEditor().getSelection().deleteContents(),this.wwe.getEditor().focus(),this._clearClipboardArea()}},{key:"_onPasteIntoTable",value:function(e){var t=e.data,n=this.wwe.getEditor().getSelection();this.wwe.isInTable(n)&&this._isSingleCellSelected(n)&&this._tablePasteHelper.pasteClipboard(t)}},{key:"_isSingleCellSelected",value:function(e){var t=e.startContainer,n=e.endContainer;return this._getCell(t)===this._getCell(n)}},{key:"_getCell",value:function(e){return"TD"===e.nodeName?e:d.default.getParentUntil(e,"TR")}},{key:"_onWillPaste",value:function(e){var t=this,n=(0,l.default)("<div>").append(e.fragment.cloneNode(!0));this._preparePaste(n),this._setTableBookmark(n),e.fragment=document.createDocumentFragment(),n.contents().each(function(t,n){e.fragment.appendChild(n)}),this._pasteToEmptyCodeBlock(e);var r=function e(){t.wwe.getEditor().removeEventListener("input",e),t.wwe.eventManager.emit("wysiwygRangeChangeAfter",t),t._focusTableBookmark()};this.wwe.getEditor().addEventListener("input",r)}},{key:"_pasteToEmptyCodeBlock",value:function(e){var t=this,n=this.wwe.getEditor(),r=n.getSelection().cloneRange(),i=r.startContainer,o=this.wwe.componentManager.getManager("codeblock"),a=!1;if(o.isInCodeBlock(r)&&r.collapse&&"PRE"===i.nodeName&&!i.textContent){var l=i.firstChild;i.insertBefore(e.fragment,l),e.defaultPrevented=!0,a=!0}var s=function e(){t.wwe.getEditor().removeEventListener("input",e),a&&(r.setStart(i,1),n.setSelection(r))};this.wwe.getEditor().addEventListener("input",s)}},{key:"_setClipboardData",value:function(e,t,n){u.default.browser.msie?(e.squirePrevented=!0,this._$clipboardArea=this._createClipboardArea(),this._$clipboardArea.html(t),this._$clipboardArea.focus(),window.getSelection().selectAllChildren(this._$clipboardArea[0])):(e.preventDefault(),e.stopPropagation(),e.clipboardData.setData("text/html",t),e.clipboardData.setData("text/plain",n))}},{key:"_createClipboardArea",value:function(){return(0,l.default)("<DIV>").attr({contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"}).appendTo(document.body)}},{key:"_updateCopyDataForListTypeIfNeed",value:function(e,t){var n=e.commonAncestorContainer.nodeName;if("UL"===n||"OL"===n){var r=(0,l.default)("<"+n+" />");r.append(t.html()),t.html(""),t.append(r)}}},{key:"_removeEmptyFontElement",value:function(e){e.children("font").each(function(e,t){var n=(0,l.default)(t);n.text().trim()||n.remove()})}},{key:"_preparePaste",value:function(e){this._removeEmptyFontElement(e),this._pch.preparePaste(e),this.wwe.eventManager.emit("pasteBefore",{source:"wysiwyg",$clipboardContainer:e})}},{key:"_setTableBookmark",value:function(e){var t=(0,l.default)(e[0].childNodes).last();t[0]&&"TABLE"===t[0].nodeName&&t.addClass("tui-paste-table-bookmark")}},{key:"_focusTableBookmark",value:function(){var e=this.wwe.getEditor(),t=e.getSelection().cloneRange(),n=e.get$Body().find(".tui-paste-table-bookmark"),r=e.get$Body().find(".tui-paste-table-cell-bookmark");n.length&&(n.removeClass("tui-paste-table-bookmark"),t.setEndAfter(n[0]),t.collapse(!1),e.setSelection(t)),r.length&&(r.removeClass("tui-paste-table-cell-bookmark"),t.selectNodeContents(r[0]),t.collapse(!1),e.setSelection(t))}},{key:"_extendRange",value:function(e){(!d.default.isTextNode(e.commonAncestorContainer)||0===e.startOffset&&e.commonAncestorContainer.textContent.length===e.endOffset||"TD"===e.commonAncestorContainer.nodeName)&&(0===e.startOffset&&(e=this._extendStartRange(e)),e.endOffset===d.default.getOffsetLength(e.endContainer)&&(e=this._extendEndRange(e)),this._isWholeCommonAncestorContainerSelected(e)&&e.selectNode(e.commonAncestorContainer),this.wwe.getEditor().setSelection(e))}},{key:"_extendStartRange",value:function(e){for(var t=e.startContainer;t.parentNode!==e.commonAncestorContainer&&t.parentNode!==this.wwe.get$Body()[0]&&!t.previousSibling;)t=t.parentNode;return e.setStart(t.parentNode,d.default.getNodeOffsetOfParent(t)),e}},{key:"_extendEndRange",value:function(e){for(var t=e.endContainer,n=t.nextSibling;t.parentNode!==e.commonAncestorContainer&&t.parentNode!==this.wwe.get$Body()[0]&&(!n||"BR"===d.default.getNodeName(n)&&t.parentNode.lastChild===n);)t=t.parentNode,n=t.nextSibling;return e.setEnd(t.parentNode,d.default.getNodeOffsetOfParent(t)+1),e}},{key:"_isWholeCommonAncestorContainerSelected",value:function(e){return e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE&&e.commonAncestorContainer!==this.wwe.get$Body()[0]&&0===e.startOffset&&e.endOffset===e.commonAncestorContainer.childNodes.length&&e.commonAncestorContainer===e.startContainer&&e.commonAncestorContainer===e.endContainer}}]),e}();t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(4),d=r(c),f=n(23),h=r(f),p=function(){function e(t){i(this,e),this.wwe=t}return o(e,[{key:"preparePaste",value:function(e){var t=this.wwe.getEditor().getSelection().cloneRange(),n=this.wwe.componentManager.getManager("codeblock"),r=!1,i=(0,l.default)("<div />"),o=void 0,a=void 0,s=void 0;this._pasteFirstAid(e);for(var c=u.default.toArray(e[0].childNodes);c.length;)a=c[0],o=d.default.getNodeName(a),s="LI"===o||"UL"===o||"OL"===o,n.isInCodeBlock(t)?i.append(n.prepareToPasteOnCodeblock(c)):s?(i.append(this._prepareToPasteList(c,t,r)),r=!0):i.append(c.shift());e.html(i.html())}},{key:"_wrapOrphanNodeWithDiv",value:function(e){var t=(0,l.default)("<div />"),n=u.default.toArray(e[0].childNodes),r=void 0;return u.default.forEachArray(n,function(e){var n=3===e.nodeType,i=/^(SPAN|A|CODE|EM|I|STRONG|B|S|U|ABBR|ACRONYM|CITE|DFN|KBD|SAMP|VAR|BDO|Q|SUB|SUP)$/gi.test(e.tagName);n||i?(r||(r=document.createElement("div"),t.append(r)),r.appendChild(e)):(r&&"BR"!==r.lastChild.tagName&&r.appendChild((0,l.default)("<br/>")[0]),r=null,t.append(e))}),t.html()}},{key:"_pasteFirstAid",value:function(e){var t=this,n="div, section, article, aside, nav, menus, p";e.html((0,h.default)(e.html(),!0)),e.find("*").each(function(e,n){t._removeStyles(n)}),this._unwrapIfNonBlockElementHasBr(e),this._unwrapNestedBlocks(e,n),this._removeUnnecessaryBlocks(e,n),e.html(this._wrapOrphanNodeWithDiv(e)),this._preElementAid(e),this._tableElementAid(e),e.children("br").remove()}},{key:"_preElementAid",value:function(e){this.wwe.componentManager.getManager("codeblock").modifyCodeBlockForWysiwyg(e)}},{key:"_unwrapIfNonBlockElementHasBr",value:function(e){e.find("span, a, b, em, i, s").each(function(e,t){var n=(0,l.default)(t).children("br");n.length&&"LI"!==t.nodeName&&"UL"!==t.nodeName&&n.eq(0).unwrap()})}},{key:"_unwrapNestedBlocks",value:function(e,t){e.find(":not(:has(*))").not("b,s,i,em,code,span").each(function(n,r){for(var i="BR"===r.nodeName?(0,l.default)(r.parentNode):(0,l.default)(r);i.parents(t).length;){var o=i.parent(t);o.length&&o[0]!==e[0]?i.unwrap():i=i.parent()}})}},{key:"_removeUnnecessaryBlocks",value:function(e,t){e.find(t).each(function(e,n){var r=(0,l.default)(n),i=n.tagName,o="DIV"===i,a=0!==r.parent("li").length,s=0!==r.parent("blockquote").length,u=r.children(t).length;o&&(a||s||!u)||r.replaceWith(r.html())})}},{key:"_removeStyles",value:function(e){var t=(0,l.default)(e),n=void 0;"SPAN"!==d.default.getNodeName(t[0])?t.removeAttr("style"):(t.attr("style")&&(n=t.css("color")),t.removeAttr("style"),n?t.css("color",n):t.contents().unwrap())}},{key:"_prepareToPasteList",value:function(e,t,n){var r=d.default.getNodeName(e[0]),i=e.shift(),o=this.wwe.getEditor().getDocument().createDocumentFragment();if("LI"!==r&&e.length&&"LI"===e[0].tagName&&(r="LI",i=this._makeNodeAndAppend({tagName:r},i)),"OL"===r||"UL"===r)!n&&this.wwe.getEditor().hasFormat("LI")?(0,l.default)(o).append(this._wrapCurrentFormat(i)):(0,l.default)(o).append(i);else if("LI"===r){var a=this.wwe.getEditor().getDocument().createDocumentFragment();for(a.appendChild(i);e.length&&"LI"===e[0].tagName;)a.appendChild(e.shift());!n&&this.wwe.getEditor().hasFormat("LI")?(0,l.default)(o).append(this._wrapCurrentFormat(a)):!t||"UL"!==t.commonAncestorName&&"OL"!==t.commonAncestorName?(0,l.default)(o).append(this._makeNodeAndAppend({tagName:"UL"},a)):(0,l.default)(o).append(this._makeNodeAndAppend({tagName:t.commonAncestorName},a))}return o}},{key:"_unwrapFragmentFirstChildForPasteAsInline",value:function(e){return(0,l.default)(e).find("br").remove(),e.childNodes}},{key:"_wrapCurrentFormat",value:function(e){var t=this,n=void 0;return this._eachCurrentPath(function(r){"DIV"!==r.tagName&&(n=d.default.isElemNode(e)?e.tagName:e.firstChild.tagName,r.tagName!==n&&(e=t._makeNodeAndAppend(r,e)))}),e}},{key:"_eachCurrentPath",value:function(e){for(var t=d.default.getPath(this.wwe.getEditor().getSelection().startContainer,this.wwe.get$Body()[0]),n=t.length-1;n>-1;n-=1)e(t[n])}},{key:"_makeNodeAndAppend",value:function(e,t){var n=(0,l.default)("<"+e.tagName+"/>");return n.append(t),e.id&&n.attr("id",e.id),e.className&&n.addClass(e.className),n[0]}},{key:"_tableElementAid",value:function(e){this._removeColgroup(e),this._completeTableIfNeed(e),this._updateTableIDClassName(e)}},{key:"_removeColgroup",value:function(e){e.find("colgroup").remove()}},{key:"_completeTableIfNeed",value:function(e){var t=this.wwe.componentManager.getManager("table"),n=t.wrapDanglingTableCellsIntoTrIfNeed(e);n&&e.append(n);var r=t.wrapTrsIntoTbodyIfNeed(e);r&&e.append(r);var i=t.wrapTheadAndTbodyIntoTableIfNeed(e);i&&e.append(i)}},{key:"_updateTableIDClassName",value:function(e){var t=this.wwe.componentManager.getManager("table");e.find("table").each(function(e,t){(0,l.default)(t).removeClass(function(e,t){return t.replace(/.*\s*(te-content-table-\d+)\s*.*/,"$1")})}),e.find("table").each(function(e,n){(0,l.default)(n).addClass(t.getTableIDClassName())})}}]),e}();t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),s=n(4),u=r(s),c=n(23),d=r(c),f=function(){function e(t){i(this,e),this.wwe=t}return o(e,[{key:"pasteClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items;n?(this._pasteClipboardItem(n),e.preventDefault()):(this._pasteClipboardUsingPasteArea(),e.squirePrevented=!0)}},{key:"_pasteClipboardUsingPasteArea",value:function(){var e=this,t=this.wwe.getEditor(),n=t.getSelection(),r=n.startContainer,i=n.startOffset,o=n.endContainer,a=n.endOffset,l=document.createElement("div"),s=document,u=s.body;l.setAttribute("contenteditable",!0),l.setAttribute("style","position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"),u.appendChild(l),n.selectNodeContents(l),t.setSelection(n),setTimeout(function(){var s=u.removeChild(l);n.setStart(r,i),n.setEnd(o,a),t.focus(),t.setSelection(n),e._pasteClipboardHtml(s.innerHTML)})}},{key:"_pasteClipboardItem",value:function(e){var t=this,n=null,r=null;l.default.forEachArray(e,function(e){"text/html"===e.type?r=e:"text/plain"===e.type&&(n=e)}),r?r.getAsString(function(e){t._pasteClipboardHtml(e)}):n&&n.getAsString(function(e){t._pasteClipboardContainer(document.createTextNode(e))})}},{key:"_pasteClipboardHtml",value:function(e){var t=document.createDocumentFragment(),n=e.indexOf("\x3c!--StartFragment--\x3e"),r=e.lastIndexOf("\x3c!--EndFragment--\x3e");n>-1&&r>-1&&(e=e.slice(n+"\x3c!--StartFragment--\x3e".length,r)),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e="<TR>"+e+"</TR>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e="<TABLE>"+e+"</TABLE>"),t.appendChild((0,d.default)(e)),this._pasteClipboardContainer(t)}},{key:"_pasteClipboardContainer",value:function(e){var t=this.wwe.getEditor(),n=e.childNodes;if(1===n.length&&"TABLE"===n[0].nodeName)this.wwe.componentManager.getManager("table").pasteTableData(e);else{var r=t.getSelection().cloneRange(),i=this._preparePasteDocumentFragment(e);t.saveUndoState(r),r.collapsed||this._deleteContentsRange(r),u.default.isTextNode(r.startContainer)?this._pasteIntoTextNode(r,i):this._pasteIntoElements(r,i),t.setSelection(r)}}},{key:"_preparePasteDocumentFragment",value:function(e){var t=e.childNodes,n=document.createDocumentFragment();return t.length?n.appendChild(this._unwrapBlock(e)):this._isPossibleInsertToTable(e)&&n.appendChild(e),n}},{key:"_unwrapBlock",value:function(e){for(var t=document.createDocumentFragment(),n=l.default.toArray(e.childNodes);n.length;){var r=n.shift();if(this._isPossibleInsertToTable(r))t.appendChild(r);else{t.appendChild(this._unwrapBlock(r));var i=t.lastChild;n.length&&i&&"BR"!==i.nodeName&&t.appendChild(document.createElement("br"))}}return t}},{key:"_isPossibleInsertToTable",value:function(e){return!("CODE"===e.nodeName&&e.childNodes.length>1)&&(u.default.isMDSupportInlineNode(e)||u.default.isTextNode(e))}},{key:"_pasteIntoElements",value:function(e,t){var n=e.startContainer,r=e.startOffset,i=u.default.getChildNodeByOffset(n,r);if(i)n.insertBefore(t,i),e.setStart(i,0);else if("TD"===n.nodeName)n.appendChild(t),e.setStart(n,n.childNodes.length);else{var o=n.parentNode,a=n.nextSibling;o.insertBefore(t,a),a?e.setStart(a,0):e.setStartAfter(o.lastChild)}e.collapse(!0)}},{key:"_pasteIntoTextNode",value:function(e,t){var n=e.startContainer,r=e.startOffset,i=n.parentNode,o=n.textContent,a=o.slice(0,r),s=o.slice(r,o.length),c=t.childNodes,d=c[0],f=1===c.length&&u.default.isTextNode(d);if(a)if(s)if(f){var h=d.textContent;n.textContent=""+a+h+s,e.setStart(n,a.length+h.length)}else{var p=document.createDocumentFragment();p.appendChild(document.createTextNode(a)),p.appendChild(t),p.appendChild(document.createTextNode(s)),i.replaceChild(p,n);var g=l.default.toArray(i.childNodes),v=0;g.forEach(function(e,t){e.textContent===s&&(v=t)}),e.setStart(i.childNodes[v],0)}else{var m=n.nextSibling;i.insertBefore(t,m),e.setStartAfter(m)}else i.insertBefore(t,n),e.setStart(n,0);e.collapse(!0)}},{key:"_deleteContentsRange",value:function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,i=e.endOffset;t===r?(this._deleteContentsByOffset(t,n,i),e.setStart(t,n),e.collapse(!0)):this._deleteNotCollapsedRangeContents(e)}},{key:"_deleteNotCollapsedRangeContents",value:function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,i=e.endOffset,o=e.commonAncestorContainer,a=this._getBlock(t,o,n),l=this._getBlock(r,o,i-1);if(a===l)this._removeInSameBlock(a,t,r,n,i),l=r!==l?null:l;else{var s=a.nextSibling;"TD"===t.nodeName?s=this._removeOneLine(a):(this._deleteContentsByOffset(t,n,u.default.getOffsetLength(t)),u.default.removeNodesByDirection(a,t,!1)),"TD"===r.nodeName?l=this._removeOneLine(l):(this._deleteContentsByOffset(r,0,i),u.default.removeNodesByDirection(l,r,!0)),u.default.removeChildFromStartToEndNode(o,s,l)}l?e.setStart(l,0):e.setStartAfter(a),e.collapse(!0)}},{key:"_removeInSameBlock",value:function(e,t,n,r,i){var o=t===e?r:0,a=n===e?i:u.default.getOffsetLength(e);this._deleteContentsByOffset(e,o,a)}},{key:"_removeOneLine",value:function(e){var t=e.nextSibling,n=e.parentNode,r=t;return n.removeChild(e),t&&"BR"===t.nodeName&&(r=t.nextSibling,n.removeChild(t)),r}},{key:"_getBlock",value:function(e,t,n){return u.default.getParentUntil(e,t)||u.default.getChildNodeByOffset(e,n)}},{key:"_deleteContentsByOffset",value:function(e,t,n){if(u.default.isTextNode(e)){var r=e.textContent,i=r.slice(0,t),o=r.slice(n,r.length);e.textContent=""+i+o}else{var a=u.default.getChildNodeByOffset(e,t),l=u.default.getChildNodeByOffset(e,n);a&&u.default.removeChildFromStartToEndNode(e,a,l||null)}}}]),e}();t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(4),u=r(s),c=/<li/i,d=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="list",this._init()}return o(e,[{key:"_init",value:function(){this._initEvent(),this._initKeyHandler()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._convertToArbitraryNestingList(t)}),this.eventManager.listen("wysiwygRangeChangeAfter",function(){e._findAndRemoveEmptyList(),e._removeBranchListAll()}),this.eventManager.listen("wysiwygSetValueAfter",function(){e._removeBranchListAll()}),this.eventManager.listen("wysiwygProcessHTMLText",function(t){return t=e._insertBlankToBetweenSameList(t),t=e._convertFromArbitraryNestingList(t)}),this.eventManager.listen("convertorAfterHtmlToMarkdownConverted",function(e){return e.replace(/:BLANK_LINE:\n/g,"")})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler(["TAB","CTRL+]","META+]"],function(t){var n=void 0;return e.wwe.getEditor().hasFormat("LI")&&(t.preventDefault(),e.eventManager.emit("command","Indent"),n=!1),n}),this.wwe.addKeyEventHandler(["SHIFT+TAB","CTRL+[","META+["],function(t,n){var r=void 0;if(e.wwe.getEditor().hasFormat("LI")){t.preventDefault();var i=(0,l.default)(n.startContainer).closest("li").children("OL,UL");e.eventManager.emit("command","Outdent"),i.length&&!i.prev().length&&e._removeBranchList(i),r=!1}return r}),this.wwe.addKeyEventHandler("ENTER",function(t,n){n.collapsed&&e.wwe.getEditor().hasFormat("LI")&&e.wwe.defer(function(){var t=e.wwe.getRange(),n=(0,l.default)(t.startContainer).parents("li").eq(0);e._removeBranchListAll(n)})}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){n.collapsed&&e.wwe.getEditor().hasFormat("LI")&&e.wwe.defer(function(){e._removeBranchListAll()})})}},{key:"_findAndRemoveEmptyList",value:function(){this.wwe.get$Body().find("OL,UL").each(function(e,t){c.test(t.innerHTML)||(0,l.default)(t).remove()})}},{key:"_removeBranchListAll",value:function(e){var t=this;e=e?(0,l.default)(e):this.wwe.get$Body(),e.find("li ul, li ol").each(function(e,n){n&&!n.previousSibling&&t._removeBranchList(n)})}},{key:"_removeBranchList",value:function(e){for(var t=(0,l.default)(e),n=t;!n[0].previousSibling&&n[0].parentElement.tagName.match(/UL|OL|LI/g);)n=n.parent();var r=n.children("li").eq(0);n.prepend(t.children().unwrap()),r.remove()}},{key:"_insertBlankToBetweenSameList",value:function(e){return e.replace(/<\/(ul|ol)>(<br \/>|<br>){0,}<\1>/g,"</$1>:BLANK_LINE:<$1>")}},{key:"_convertToArbitraryNestingList",value:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.querySelector("li > ul, li > ol");null!==n;){var r=n.parentNode;r.parentNode.insertBefore(n,r.nextElementSibling),n=t.querySelector("li > ul, li > ol")}return t.innerHTML}},{key:"_convertFromArbitraryNestingList",value:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.querySelector("ol > ol, ol > ul, ul > ol, ul > ul");null!==n;){for(var r=n.previousElementSibling;r&&"LI"!==r.tagName;)r=r.previousElementSibling;r?r.appendChild(n):this._unwrap(n),n=t.querySelector("ol > ol, ol > ul, ul > ol, ul > ul")}return t.innerHTML}},{key:"_unwrap",value:function(e){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}},{key:"getLinesOfSelection",value:function(e,t){var n=[],r=!1,i=!0,o=void 0;u.default.isTextNode(e)&&(e=(0,l.default)(e).parents("DIV,LI").first().get(0)),u.default.isTextNode(t)&&(t=(0,l.default)(t).parents("DIV,LI").first().get(0));for(var a=e;i&&(0,l.default)(a).is("DIV,LI");a=o)n.push(a),a===t?r=!0:o=this._getNextLine(a,t),i=o&&!r;return n}},{key:"_getNextLine",value:function(e,t){var n=e.nextElementSibling;return n?(0,l.default)(n).is("OL,UL")&&(n=n.querySelector("li")):n=e.parentNode.nextElementSibling,(0,l.default)(n).is("DIV,LI")||n===t?n:this._getNextLine(n)}},{key:"mergeList",value:function(e){var t=e.parentNode,n=t.previousElementSibling,r=t.nextElementSibling;t.firstElementChild===e&&n&&(0,l.default)(n).is("OL,UL")&&(this._mergeList(t,n),t=n),t.lastElementChild===e&&r&&(0,l.default)(r).is("OL,UL")&&this._mergeList(r,t)}},{key:"_mergeList",value:function(e,t){var n=e.firstElementChild;if(t&&(0,l.default)(t).is("OL,UL")){for(;n;){var r=n.nextElementSibling;t.appendChild(n),n=r}e.parentNode.removeChild(e)}}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(t){r(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="task",this._init()}return i(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent(),this.wwe.getEditor().addEventListener("mousedown",function(e){var t=e.offsetX<18&&e.offsetY<18;e.target.hasAttribute("data-te-task")&&t&&(0,a.default)(e.target).toggleClass("checked")})}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._removeTaskListClass()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler("ENTER",function(t,n){e.isInTaskList(n)&&e.wwe.defer(function(){var t=e.wwe.getRange();(0,a.default)(t.startContainer).closest("li").removeClass("checked")})})}},{key:"isInTaskList",value:function(e){var t=void 0;return e||(e=this.wwe.getEditor().getSelection().cloneRange()),t=e.startContainer.nodeType===Node.ELEMENT_NODE&&"LI"===e.startContainer.tagName?e.startContainer:(0,a.default)(e.startContainer).parents("li").get(0),(0,a.default)(t).hasClass("task-list-item")}},{key:"unformatTask",value:function(e){var t=(0,a.default)(e).closest("li");t.removeClass("task-list-item"),t.removeClass("checked"),t.removeAttr("data-te-task"),t.attr("class")||t.removeAttr("class")}},{key:"formatTask",value:function(e){var t=(0,a.default)(e),n=t.closest("li");n.addClass("task-list-item"),n.attr("data-te-task","")}},{key:"_formatTaskIfNeed",value:function(){var e=this.wwe.getEditor().getSelection().cloneRange();this.isInTaskList(e)&&this.formatTask(e.startContainer)}},{key:"_removeTaskListClass",value:function(){this.wwe.get$Body().find(".task-list").each(function(e,t){(0,a.default)(t).removeClass("task-list")})}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return this.nodeType===Node.TEXT_NODE}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),s=r(l),u=n(4),c=r(u),d=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="hr",this._init()}return a(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._unwrapDivOnHr()}),this.eventManager.listen("wysiwygGetValueBefore",function(){e._wrapDefaultBlockToOrphanTexts()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler(function(t,n){return e._onTypedInHr(n)}),this.wwe.addKeyEventHandler("ENTER",function(t,n){return!n.collapsed||e._removeHrOnEnter(n,t)}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){return!n.collapsed||e._removeHrOnBackspace(n,t)})}},{key:"_isInHr",value:function(e){return"HR"===c.default.getNodeName(e.startContainer.childNodes[e.startOffset])}},{key:"_isNearHr",value:function(e){var t=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1);return"HR"===c.default.getNodeName(t)}},{key:"_onTypedInHr",value:function(e){var t=this;(this._isInHr(e)||this._isNearHr(e))&&this.wwe.defer(function(e){e.saveSelection(),t._wrapDefaultBlockToOrphanTexts(),e.restoreSavedSelection()})}},{key:"_removeHrOnEnter",value:function(e,t){var n=void 0,r=void 0;return this._isInHr(e)?n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset):this._isNearHr(e)&&(n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),r="before"),this._changeHrToNewDefaultBlock(n,e,t,r)}},{key:"_removeHrOnBackspace",value:function(e,t){var n=void 0,r=void 0;return this._isInHr(e)?n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset):0===e.startOffset?(n=c.default.getTopPrevNodeUnder(e.startContainer,this.wwe.get$Body()[0]),r="none"):this._isNearHr(e)&&(n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),r="before"),this._changeHrToNewDefaultBlock(n,e,t,r)}},{key:"_changeHrToNewDefaultBlock",value:function(e,t,n,r){return!e||"HR"!==c.default.getNodeName(e)||(n.preventDefault(),"none"!==r&&this.wwe.breakToNewDefaultBlock(t,r),(0,s.default)(e).remove(),!1)}},{key:"_unwrapDivOnHr",value:function(){var e=this.wwe.get$Body().get(0);this.wwe.get$Body().find("hr").each(function(t,n){var r=(0,s.default)(n).parent("div");r[0]!==e&&(r.find("br").remove(),(0,s.default)(n).unwrap())})}},{key:"_wrapDefaultBlockToOrphanTexts",value:function(){this.wwe.get$Body().contents().filter(o).each(function(e,t){(0,s.default)(t).wrap("<div />")})}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(t){r(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="p",this._initEvent()}return i(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._splitPtagContentLines(t)}),this.eventManager.listen("wysiwygSetValueAfter",function(){e._ensurePtagContentWrappedWithDiv(),e._unwrapPtags()})}},{key:"_splitPtagContentLines",value:function(e){if(e){var t=(0,a.default)("<div />");t.html(e),t.find("p").each(function(e,t){var n=t.innerHTML,r=n.split(/<br>/gi),i=r.length-1,o=t.nextElementSibling||t.nextSibling,l="";l=r.map(function(e,t){var n="";return t>0&&t<i&&(e=e||"<br>"),e&&(n="<div>"+e+"</div>"),n}),o&&"P"===o.nodeName&&l.push("<div><br></div>"),(0,a.default)(t).replaceWith((0,a.default)(l.join("")))}),e=t.html()}return e}},{key:"_ensurePtagContentWrappedWithDiv",value:function(){this.wwe.get$Body().find("p").each(function(e,t){(0,a.default)(t).find("div").length<=0&&(0,a.default)(t).wrapInner("<div />"),(0,a.default)(t).next().is("p")&&(0,a.default)(t).append("<div><br></div>")})}},{key:"_unwrapPtags",value:function(){this.wwe.get$Body().find("div").each(function(e,t){(0,a.default)(t).parent().is("p")&&(0,a.default)(t).unwrap()})}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(4),u=r(s),c=/h[\d]/i,d=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="heading",this._init()}return o(e,[{key:"_init",value:function(){this._initEvent(),this._initKeyHandler()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._wrapDefaultBlockToHeadingInner()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler("ENTER",function(t,n){return!e.wwe.hasFormatWithRx(c)||(e._onEnter(t,n),!1)}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){return!e.wwe.hasFormatWithRx(c)||(e._removePrevTopNodeIfNeed(t,n),!1)})}},{key:"_wrapDefaultBlockToHeadingInner",value:function(){this.wwe.get$Body().find("h1, h2, h3, h4, h5, h6").each(function(e,t){(0,l.default)(t).children("div, p").length<=0&&(0,l.default)(t).wrapInner("<div />")})}},{key:"_unwrapHeading",value:function(){this.wwe.unwrapBlockTag(function(e){return c.test(e)})}},{key:"_onEnter",value:function(e,t){var n=this;t.startOffset>0?this.wwe.defer(function(e){n._unwrapHeading(),e.getEditor().removeLastUndoStack()}):(e.preventDefault(),this._insertEmptyBlockToPrevious(t))}},{key:"_insertEmptyBlockToPrevious",value:function(e){this.wwe.getEditor().saveUndoState(e),(0,l.default)("<div><br></div>").insertBefore(u.default.getParentUntil(e.startContainer,this.wwe.get$Body()[0]))}},{key:"_removePrevTopNodeIfNeed",value:function(e,t){var n=!1;if(t.collapsed&&0===t.startOffset){var r=t.startContainer,i=u.default.getTopPrevNodeUnder(r,this.wwe.get$Body()[0]),o=i&&0===i.textContent.length,a=this.wwe.getEditor();0===r.textContent.length?n=this._removeHedingAndChangeSelection(e,t,i):o&&(e.preventDefault(),a.saveUndoState(t),(0,l.default)(i).remove(),n=!0)}return n}},{key:"_removeHedingAndChangeSelection",value:function(e,t,n){var r=t.startContainer,i=this.wwe.getEditor(),o=this.wwe.get$Body(),a=c.test(u.default.getNodeName(r)),s=a?r:(0,l.default)(r).parents("h1,h2,h3,h4,h5,h6")[0],d=n,f=1;return e.defaultPrevented||(e.preventDefault(),i.saveUndoState(t)),(0,l.default)(s).remove(),n||(d=o.children("div").first().get(0),f=0),t.setStart(d,f),t.collapse(!0),i.setSelection(t),!0}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(1),d=r(c),f=n(79),h=r(f),p=n(4),g=r(p),v=n(38),m=/\b(H[\d]|LI|P|BLOCKQUOTE|TD)\b/,y=/Trident\/[456]\./.test(navigator.userAgent),_=function(e){function t(){var e;i(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var l=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return l._decorateHandlerToCancelable("copy"),l._decorateHandlerToCancelable(y?"beforecut":"cut"),l._decorateHandlerToCancelable(y?"beforepaste":"paste"),l.get$Body=function(){return l.$body=l.$body||(0,u.default)(l.getRoot()),l.$body},l}return a(t,e),l(t,[{key:"_decorateHandlerToCancelable",value:function(e){var t=this._events[e];if(t.length>1)throw new Error("too many"+e+"handlers in squire");var n=t[0].bind(this);t[0]=function(e){e.defaultPrevented||e.squirePrevented||n(e)}}},{key:"changeBlockFormat",value:function(e,t){var n=this;this.modifyBlocks(function(r){var i=void 0,o=void 0,a=void 0,l=void 0,s=void 0,u=void 0,c=void 0;if(r.childNodes.length?i=r.childNodes.item(0):(i=n.createDefaultBlock(),r.appendChild(i)),e){for(;i.firstChild;)i=i.firstChild;for(c=function(e){l.appendChild(e)};i!==r;){if(s=i.tagName,d.default.isFunction(e)?e(s):s===e){l=i.childNodes.item(0),(!g.default.isElemNode(l)||i.childNodes.length>1)&&(l=n.createDefaultBlock(),d.default.forEachArray(d.default.toArray(i.childNodes),c),(u=l.lastChild)&&"BR"===g.default.getNodeName(u)&&l.removeChild(u)),a=t?n.createElement(t,[l]):l,o=n.getDocument().createDocumentFragment(),o.appendChild(a),r=o;break}i=i.parentNode}}return o&&e||!t||"DIV"!==g.default.getNodeName(r.childNodes[0])||(r=n.createElement(t,[r.childNodes[0]])),r})}},{key:"changeBlockFormatTo",value:function(e){this.changeBlockFormat(function(e){return m.test(e)},e)}},{key:"getCaretPosition",value:function(){return this.getCursorPosition()}},{key:"replaceSelection",value:function(e,t){t&&this.setSelection(t),this._ignoreChange=!0,this.insertHTML(e)}},{key:"replaceRelativeOffset",value:function(e,t,n){var r=this.getSelection().cloneRange();this._replaceRelativeOffsetOfSelection(e,t,n,r)}},{key:"_replaceRelativeOffsetOfSelection",value:function(e,t,n,r){var i=void 0,o=void 0,a=void 0,l=r.endContainer,s=r.endOffset;"TEXT"!==g.default.getNodeName(l)&&(l=this._getClosestTextNode(l,s))&&(s=g.default.isTextNode(l)?l.nodeValue.length:l.textContent.length),l?(i=this.getSelectionInfoByOffset(l,s+t),r.setStart(i.element,i.offset),a=s+(t+n),o=this.getSelectionInfoByOffset(l,a),r.setEnd(o.element,o.offset),this.replaceSelection(e,r)):this.replaceSelection(e)}},{key:"_getClosestTextNode",value:function(e,t){var n=g.default.getChildNodeByOffset(e,t-1);return"TEXT"!==g.default.getNodeName(n)&&(n=n.previousSibling),n}},{key:"getSelectionInfoByOffset",value:function(e,t){var n=void 0,r=void 0,i=void 0,o=void 0,a=t>=0?"next":"previous",l=Math.abs(t),s=n;for(n="next"===a?e:e.previousSibling,i=l,o=0;n&&(r=g.default.isTextNode(n)?n.nodeValue.length:n.textContent.length,o+=r,!(l<=o));)i-=r,g.default.getTextLength(n)>0&&(s=n),n=n[a+"Sibling"];return n||(n=s,i=g.default.getTextLength(n)),"previous"===a&&(i=g.default.getTextLength(n)-i),{element:n,offset:i}}},{key:"getSelectionPosition",value:function(e,t,n){var r=this.createElement("INPUT"),i=e.cloneRange(),o=this.getSelectionInfoByOffset(e.endContainer,e.endOffset+(n||0));i.setStart(i.startContainer,i.startOffset),i.setEnd(o.element,o.offset),this._ignoreChange=!0,this.insertElement(r,i);var a=(0,u.default)(r).offset();return"over"!==t&&(a.top+=(0,u.default)(r).outerHeight()),r.parentNode.removeChild(r),e.setStart(e.endContainer,e.endOffset),e.collapse(!0),this.setSelection(e),a}},{key:"removeLastUndoStack",value:function(){this._undoStack.length&&(this._undoStackLength-=1,this._undoIndex-=1,this._undoStack.pop(),this._isInUndoState=!1)}},{key:"replaceParent",value:function(e,t,n){var r=(0,u.default)(e).closest(t);r.length&&(r.wrapInner("<"+n+"/>"),r.children().unwrap())}},{key:"preserveLastLine",value:function(){var e=this.get$Body().children().last();"DIV"!==g.default.getNodeName(e[0])&&(this._ignoreChange=!0,(0,u.default)(this.createDefaultBlock()).insertAfter(e))}},{key:"scrollTop",value:function(e){return d.default.isUndefined(e)?this.get$Body().scrollTop():this.get$Body().scrollTop(e)}},{key:"isIgnoreChange",value:function(){return this._ignoreChange}},{key:"focus",value:function(){h.default.prototype.focus.call(this)}},{key:"blockCommandShortcuts",value:function(){var e=this,t=v.isMac?"meta":"ctrl";["b","i","u","shift-7","shift-5","shift-6","shift-8","shift-9","[","]","d"].forEach(function(n){e.setKeyHandler(t+"-"+n,function(e,t){t.preventDefault()})})}}]),t}(h.default);t.default=_},function(e,t){e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),s=n(4),u=r(s),c=l.default.browser.msie&&11===l.default.browser.version,d=-1!==navigator.appVersion.indexOf("Win")&&l.default.browser.chrome,f=c||d,h=function(){function e(t,n){i(this,e),this._wwe=t,f&&(this.isComposition=!1,this._initCompositionEvent()),this.setRange(n||this._wwe.getRange())}return o(e,[{key:"_initCompositionEvent",value:function(){var e=this;this._wwe.getEditor().addEventListener("compositionstart",function(){e.isComposition=!0}),this._wwe.getEditor().addEventListener("compositionend",function(){e.isComposition=!1})}},{key:"setRange",value:function(e){this._range&&this._range.detach(),this._range=e}},{key:"expandStartOffset",value:function(){var e=this._range;u.default.isTextNode(e.startContainer)&&e.startOffset>0&&e.setStart(e.startContainer,e.startOffset-1)}},{key:"expandEndOffset",value:function(){var e=this._range;u.default.isTextNode(e.endContainer)&&e.endOffset<e.endContainer.nodeValue.length&&e.setEnd(e.endContainer,e.endOffset+1)}},{key:"setEndBeforeRange",value:function(e){var t=e.startOffset;this.isComposition&&(t+=1),this._range.setEnd(e.startContainer,t)}},{key:"getTextContent",value:function(){return this._range.cloneContents().textContent}},{key:"replaceContent",value:function(e){this._wwe.getEditor().setSelection(this._range),this._wwe.getEditor().insertHTML(e),this._range=this._wwe.getRange()}},{key:"deleteContent",value:function(){this._wwe.getEditor().setSelection(this._range),this._wwe.getEditor().insertHTML(""),this._range=this._wwe.getRange()}},{key:"peekStartBeforeOffset",value:function(e){var t=this._range.cloneRange();return t.setStart(t.startContainer,Math.max(t.startOffset-e,0)),t.setEnd(this._range.startContainer,this._range.startOffset),t.cloneContents().textContent}}]),e}();t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(82),f=r(d),h=function(e){function t(e){var n=e.eventManager,r=e.container,a=e.wysiwygEditor;i(this,t);var l=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{eventManager:n,container:r,attachedSelector:"pre"}));return l._wysiwygEditor=a,l._popupCodeBlockLanguages=null,l._initDOM(),l._initDOMEvent(),l}return a(t,e),l(t,[{key:"_initDOM",value:function(){var e=this;this.$el.addClass("code-block-header"),this._$languageLabel=(0,c.default)("<span>text</span>"),this.$el.append(this._$languageLabel),this._$buttonOpenModalEditor=(0,c.default)('<button type="button">Editor</button>'),this.$el.append(this._$buttonOpenModalEditor),this._eventManager.emit("removeEditor",function(){e._$buttonOpenModalEditor.off("click"),e._$buttonOpenModalEditor=null})}},{key:"_initDOMEvent",value:function(){var e=this;this._$buttonOpenModalEditor.on("click",function(){return e._openPopupCodeBlockEditor()})}},{key:"_openPopupCodeBlockEditor",value:function(){this._eventManager.emit("openPopupCodeBlockEditor",this.getAttachedElement())}},{key:"_updateLanguage",value:function(){var e=this.getAttachedElement(),t=e?e.getAttribute("data-language"):null;this._$languageLabel.text(t||"text")}},{key:"syncLayout",value:function(){var e=(0,c.default)(this.getAttachedElement()),t=e.offset();t.left=t.left+(e.outerWidth()-250),this.$el.offset(t),this.$el.height(30),this.$el.width(250)}},{key:"onShow",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onShow",this).call(this),this._onAttachedElementChange=function(){return e._updateLanguage()},(0,c.default)(this.getAttachedElement()).on("language-changed",this._onAttachedElementChange),this._updateLanguage()}},{key:"onHide",value:function(){(0,c.default)(this.getAttachedElement()).off("language-changed",this._onAttachedElementChange),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onHide",this).call(this)}}]),t}(f.default);t.default=h},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(t){var n=t.eventManager,i=t.container,o=t.attachedSelector;r(this,e),this._eventManager=n,this._attachedSelector="[contenteditable=true] "+o,this._$container=(0,a.default)(i),this._$attachedElement=null,this.active=!1,this._createElement(),this._initEvent()}return i(e,[{key:"_createElement",value:function(){this.$el=(0,a.default)('<div class="te-ww-block-overlay">'),this.$el.css({position:"absolute",display:"none","z-index":1}),this._$container.append(this.$el)}},{key:"_initEvent",value:function(){var e=this;this._eventManager.listen("change",this._onChange.bind(this)),this._eventManager.listen("mouseover",this._onMouseOver.bind(this)),this._eventManager.listen("focus",function(){e.setVisibility(!1)}),this._eventManager.listen("mousedown",function(){e.setVisibility(!1)})}},{key:"_onChange",value:function(){this._$attachedElement&&a.default.contains(document,this._$attachedElement[0])?this.syncLayout():this.setVisibility(!1)}},{key:"_onMouseOver",value:function(e){var t=e.data,n=(0,a.default)(t.target),r=n.closest(this._attachedSelector);r.length?(this._$attachedElement=r,this.setVisibility(!0)):n.closest(this.$el).length?this.setVisibility(!0):this.active||this.setVisibility(!1)}},{key:"syncLayout",value:function(){this.$el.offset(this._$attachedElement.offset()),this.$el.width(this._$attachedElement.outerWidth()),this.$el.height(this._$attachedElement.outerHeight())}},{key:"getAttachedElement",value:function(){return this._$attachedElement?this._$attachedElement.get(0):null}},{key:"getVisibility",value:function(){return"block"===this.$el.css("display")}},{key:"setVisibility",value:function(e){e&&this._$attachedElement?this.getVisibility()||(this.$el.css("display","block"),this.syncLayout(),this.onShow()):e||this.getVisibility()&&(this.$el.css("display","none"),this.onHide())}},{key:"onShow",value:function(){}},{key:"onHide",value:function(){this.active=!1,this._$attachedElement=null}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=['<div class="tui-editor">','<div class="te-md-container">','<div class="te-editor" />','<div class="te-md-splitter" />','<div class="te-preview" />',"</div>",'<div class="te-ww-container">','<div class="te-editor" />',"</div>","</div>"].join(""),s=function(){function e(t,n){r(this,e),this.$el=(0,a.default)(t.el),this.height=t.height,this.type=t.initialEditType,this.eventManager=n,this.init(),this._initEvent()}return i(e,[{key:"init",value:function(){this._renderLayout(),this._initMarkdownAndPreviewSection(),this._initWysiwygSection()}},{key:"_initEvent",value:function(){this.eventManager.listen("hide",this.hide.bind(this)),this.eventManager.listen("show",this.show.bind(this))}},{key:"_renderLayout",value:function(){this.$el.css("box-sizing","border-box"),this.$containerEl=(0,a.default)(l).appendTo(this.$el)}},{key:"switchToWYSIWYG",value:function(){this.$containerEl.removeClass("te-md-mode"),this.$containerEl.addClass("te-ww-mode")}},{key:"switchToMarkdown",value:function(){this.$containerEl.removeClass("te-ww-mode"),this.$containerEl.addClass("te-md-mode")}},{key:"_initMarkdownAndPreviewSection",value:function(){this.$mdEditorContainerEl=this.$containerEl.find(".te-md-container .te-editor"),this.$previewEl=this.$containerEl.find(".te-md-container .te-preview")}},{key:"_initWysiwygSection",value:function(){this.$wwEditorContainerEl=this.$containerEl.find(".te-ww-container .te-editor")}},{key:"_verticalSplitStyle",value:function(){this.$containerEl.find(".te-md-container").removeClass("te-preview-style-tab"),this.$containerEl.find(".te-md-container").addClass("te-preview-style-vertical")}},{key:"_tabStyle",value:function(){this.$containerEl.find(".te-md-container").removeClass("te-preview-style-vertical"),this.$containerEl.find(".te-md-container").addClass("te-preview-style-tab")}},{key:"changePreviewStyle",value:function(e){"tab"===e?this._tabStyle():"vertical"===e&&this._verticalSplitStyle()}},{key:"hide",value:function(){this.$el.find(".tui-editor").addClass("te-hide")}},{key:"show",value:function(){this.$el.find(".tui-editor").removeClass("te-hide")}},{key:"remove",value:function(){this.$el.find(".tui-editor").remove()}},{key:"getEditorEl",value:function(){return this.$containerEl}},{key:"getPreviewEl",value:function(){return this.$previewEl}},{key:"getMdEditorContainerEl",value:function(){return this.$mdEditorContainerEl}},{key:"getWwEditorContainerEl",value:function(){return this.$wwEditorContainerEl}}]),e}();t.default=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(t,n,i){r(this,e),this.name=t,this.type=n,i&&this.setKeyMap(i)}return i(e,[{key:"getName",value:function(){return this.name}},{key:"getType",value:function(){return this.type}},{key:"isMDType",value:function(){return this.type===e.TYPE.MD}},{key:"isWWType",value:function(){return this.type===e.TYPE.WW}},{key:"isGlobalType",value:function(){return this.type===e.TYPE.GB}},{key:"setKeyMap",value:function(e,t){this.keyMap=[e,t]}}]),e}();l.factory=function(e,t){var n=void 0;"markdown"===e?n=l.TYPE.MD:"wysiwyg"===e?n=l.TYPE.WW:"global"===e&&(n=l.TYPE.GB);var r=new l(t.name,n);return a.default.extend(r,t),r},l.TYPE={MD:0,WW:1,GB:2},t.default=l},function(e,t){e.exports=a},function(e,t,n){"use strict";function r(e){e.content=e.content.slice(4),e.children[0].content=e.children[0].content.slice(4)}function i(e){var t=!1;return 0!==e.content.indexOf("[x]")&&0!==e.content.indexOf("[X]")||(t=!0),t}function o(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function a(e,t){return"inline"===e[t].type&&"paragraph_open"===e[t-1].type&&"list_item_open"===e[t-2].type&&(0===e[t].content.indexOf("[ ]")||0===e[t].content.indexOf("[x]")||0===e[t].content.indexOf("[X]"))}var l=function(e){e.core.ruler.after("inline","tui-task-list",function(e){var t,n,l=e.tokens;for(n=2;n<l.length;n+=1)a(l,n)&&(t=i(l[n])?"task-list-item checked":"task-list-item",r(l[n]),o(l[n-2],"class",t),o(l[n-2],"data-te-task",""))})};e.exports=l},function(e,t,n){"use strict";function r(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function i(e){return!0===e.block&&"code"===e.tag&&"fence"===e.type}function o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var a=function(e){e.core.ruler.after("block","tui-code-block",function(e){var t,n,a,l=e.tokens;for(n=0;n<l.length;n+=1)t=l[n],i(t)&&(a=t.markup.length,a>3&&r(t,"data-backticks",a),t.info&&r(t,"data-language",o(t.info.replace(" ",""),!0)))})};e.exports=a},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i,o,a=/ {0,3}(?:-|\*|\d\.) /,l=e.src.split("\n"),s=l[t],u=0;if(s.match(a)||e.sCount[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r)){if(++u>=2&&"list"===e.parentType)break;r++}else{if(u=0,!(e.sCount[r]-e.blkIndent>=4))break;r++,i=r}return e.line=i,o=e.push("code_block","code",0),o.content=e.getLines(t,i,4+e.blkIndent,!0),o.map=[t,e.line],!0}},function(e,t,n){"use strict";function r(e){switch(e){case 9:case 32:return!0}return!1}e.exports=function(e,t,n,i){var o,a,l,s,u,c,d,f,h,p,g,v,m,y,_,b,w,k,E,C,T=e.lineMax,M=e.bMarks[t]+e.tShift[t],S=e.eMarks[t],O=/(?:-|\*|\d+\.) {1,4}(?:> {0,3})[^>]*$/,x=e.src.split("\n"),I=x[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(M++))return!1;if(I.match(O))return!1;if(i)return!0;for(s=h=e.sCount[t]+M-(e.bMarks[t]+e.tShift[t]),32===e.src.charCodeAt(M)?(M++,s++,h++,o=!1,b=!0):9===e.src.charCodeAt(M)?(b=!0,(e.bsCount[t]+h)%4==3?(M++,s++,h++,o=!1):o=!0):b=!1,p=[e.bMarks[t]],e.bMarks[t]=M;M<S&&(a=e.src.charCodeAt(M),r(a));)9===a?h+=4-(h+e.bsCount[t]+(o?1:0))%4:h++,M++;for(g=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(b?1:0),c=M>=S,y=[e.sCount[t]],e.sCount[t]=h-s,_=[e.tShift[t]],e.tShift[t]=M-e.bMarks[t],k=e.md.block.ruler.getRules("blockquote"),m=e.parentType,e.parentType="blockquote",C=!1,f=t+1;f<n&&(e.sCount[f]<e.blkIndent&&(C=!0),M=e.bMarks[f]+e.tShift[f],S=e.eMarks[f],!(M>=S));f++)if(62!==e.src.charCodeAt(M++)||C){if(c)break;for(w=!1,l=0,u=k.length;l<u;l++)if(k[l](e,f,n,!0)){w=!0;break}if(w){e.lineMax=f,0!==e.blkIndent&&(p.push(e.bMarks[f]),g.push(e.bsCount[f]),_.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}p.push(e.bMarks[f]),g.push(e.bsCount[f]),_.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]=-1}else{for(s=h=e.sCount[f]+M-(e.bMarks[f]+e.tShift[f]),32===e.src.charCodeAt(M)?(M++,s++,h++,o=!1,b=!0):9===e.src.charCodeAt(M)?(b=!0,(e.bsCount[f]+h)%4==3?(M++,s++,h++,o=!1):o=!0):b=!1,p.push(e.bMarks[f]),e.bMarks[f]=M;M<S&&(a=e.src.charCodeAt(M),r(a));)9===a?h+=4-(h+e.bsCount[f]+(o?1:0))%4:h++,M++;c=M>=S,g.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(b?1:0),y.push(e.sCount[f]),e.sCount[f]=h-s,_.push(e.tShift[f]),e.tShift[f]=M-e.bMarks[f]}for(v=e.blkIndent,e.blkIndent=0,E=e.push("blockquote_open","blockquote",1),E.markup=">",E.map=d=[t,0],e.md.block.tokenize(e,t,f),E=e.push("blockquote_close","blockquote",-1),E.markup=">",e.lineMax=T,e.parentType=m,d[1]=e.line,l=0;l<_.length;l++)e.bMarks[l+t]=p[l],e.tShift[l+t]=_[l],e.sCount[l+t]=y[l],e.bsCount[l+t]=g[l];return e.blkIndent=v,!0}},function(e,t,n){"use strict";function r(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function i(e){var t,n=[],r=0,i=e.length,o=0,a=0,l=!1,s=0;for(t=e.charCodeAt(r);r<i;)96===t&&o%2==0?(l=!l,s=r):124!==t||o%2!=0||l?92===t?o+=1:o=0:(n.push(e.substring(a,r)),a=r+1),r+=1,r===i&&l&&(l=!1,r=s+1),t=e.charCodeAt(r);return n.push(e.substring(a)),n}e.exports=function(e,t,n,o){var a,l,s,u,c,d,f,h,p,g,v,m,y;if(t+2>n)return!1;if(c=t+1,e.sCount[c]<e.blkIndent)return!1;if((s=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(a=e.src.charCodeAt(s))&&45!==a&&58!==a)return!1;if(l=r(e,t+1),!/^[-:| ]+$/.test(l))return!1;for(d=l.split("|"),p=[],u=0;u<d.length;u+=1){if(!(v=d[u].trim())){if(0===u||u===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(v))return!1;58===v.charCodeAt(v.length-1)?p.push(58===v.charCodeAt(0)?"center":"right"):58===v.charCodeAt(0)?p.push("left"):p.push("")}if(g=p.length,l=r(e,t).trim(),-1===l.indexOf("|"))return!1;if(d=i(l.replace(/^\||\|$/g,"")),(f=d.length)>g)return!1;if(f<g){for(u=0;u<g-f;u+=1)d.push("");f=d.length}if(o)return!0;for(h=e.push("table_open","table",1),h.map=m=[t,0],h=e.push("thead_open","thead",1),h.map=[t,t+1],h=e.push("tr_open","tr",1),h.map=[t,t+1],u=0;u<f;u+=1)h=e.push("th_open","th",1),h.map=[t,t+1],p[u]&&(h.attrs=[["align",p[u]]]),h=e.push("inline","",0),h.content=d[u].trim(),h.map=[t,t+1],h.children=[],h=e.push("th_close","th",-1);for(h=e.push("tr_close","tr",-1),h=e.push("thead_close","thead",-1),h=e.push("tbody_open","tbody",1),h.map=y=[t+2,0],c=t+2;c<n&&!(e.sCount[c]<e.blkIndent)&&(l=r(e,c),-1!==l.indexOf("|"));c+=1){for(d=i(l.replace(/^\||\|\s*$/g,"")),h=e.push("tr_open","tr",1),u=0;u<f;u+=1)h=e.push("td_open","td",1),p[u]&&(h.attrs=[["align",p[u]]]),h=e.push("inline","",0),h.content=d[u]?d[u].trim():"",h.children=[],h=e.push("td_close","td",-1);h=e.push("tr_close","tr",-1)}return h=e.push("tbody_close","tbody",-1),h=e.push("table_close","table",-1),m[1]=y[1]=c,e.line=c,!0}},function(e,t,n){"use strict";var r=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],i=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^<("+r.join("|")+")","i"),/^\/?>$/,!0],[new RegExp("^</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|pre|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?=(\\s|/?>|$))","i"),/^$/,!0],[/^(?:<[A-Za-z][A-Za-z0-9\-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9\-]*\s*>)\s*$/,/^$/,!1]];e.exports=function(e,t,n,r){var o,a,l,s,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(u))return!1;for(s=e.src.slice(u,c),o=0;o<i.length;o++)if(i[o][0].test(s)){if(5===o)return!1;break}if(o===i.length)return!1;if(r)return i[o][2];if(a=t+1,!i[o][1].test(s))for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(u=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s=e.src.slice(u,c),i[o][1].test(s)){0!==s.length&&a++;break}return e.line=a,l=e.push("html_block","",0),l.map=[t,a],l.content=e.getLines(t,a,e.blkIndent,!0),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o,a,l,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,r=e.posMax;s<r&&96===e.src.charCodeAt(s);)s++;for(i=e.src.slice(n,s),o=a=s;-1!==(o=e.src.indexOf("`",a));){for(a=o+1;a<r&&96===e.src.charCodeAt(a);)a++;if(a-o===i.length)return t||(l=e.push("code_inline","code",0),l.markup=i,l.content=e.src.slice(s,o).replace(/[ \n]+/g," ").trim(),l.attrSet("data-backticks",l.markup.length)),e.pos=a,!0}return t||(e.pending+=i),e.pos+=i.length,!0}},function(e,t){e.exports=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(33),d=r(c),f=n(39),h=r(f),p=n(2),g=r(p),v=n(40),m=r(v),y=n(41),_=r(y),b=n(4),w=r(b),k=n(24),E=r(k),C=function(){function e(t){var n=this;i(this,e),this.options=l.default.extend({useDefaultHTMLSanitizer:!0,codeBlockLanguages:k.CodeBlockManager.getHighlightJSLanguages(),customConvertor:null},t),this.eventManager=new h.default,this.commandManager=new g.default(this),this.options.customConvertor?this.convertor=new this.options.customConvertor(this.eventManager):this.convertor=new _.default(this.eventManager),this.toMarkOptions=null,this.options.useDefaultHTMLSanitizer&&this.convertor.initHtmlSanitizer(),this.options.hooks&&u.default.forEach(this.options.hooks,function(e,t){n.addHook(t,e)}),this.options.events&&u.default.forEach(this.options.events,function(e,t){n.on(t,e)}),this.preview=new d.default((0,l.default)(this.options.el),this.eventManager,this.convertor,!0),this.preview.$el.on("mousedown",l.default.proxy(this._toggleTask,this)),m.default.applyExtension(this,this.options.exts),this.setValue(this.options.initialValue),this.eventManager.emit("load",this)}return o(e,[{key:"_toggleTask",value:function(e){var t=e.offsetX<18&&e.offsetY>18;e.target.hasAttribute("data-te-task")&&!t&&((0,l.default)(e.target).toggleClass("checked"),this.eventManager.emit("change",{source:"viewer",data:e}))}},{key:"setMarkdown",value:function(e){this.markdownValue=e=e||"",this.preview.refresh(this.markdownValue),this.eventManager.emit("setMarkdownAfter",this.markdownValue)}},{key:"setValue",value:function(e){this.setMarkdown(e)}},{key:"on",value:function(e,t){this.eventManager.listen(e,t)}},{key:"off",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"remove",value:function(){this.eventManager.emit("removeEditor"),this.preview.$el.off("mousedown",l.default.proxy(this._toggleTask,this)),this.preview.remove(),this.options=null,this.eventManager=null,this.commandManager=null,this.convertor=null,this.preview=null}},{key:"addHook",value:function(e,t){this.eventManager.removeEventHandler(e),this.eventManager.listen(e,t)}},{key:"isViewer",value:function(){return!0}},{key:"isMarkdownMode",value:function(){return!1}},{key:"isWysiwygMode",value:function(){return!1}}],[{key:"defineExtension",value:function(e,t){m.default.defineExtension(e,t)}}]),e}();C.isViewer=!0,C.domUtils=w.default,C.codeBlockManager=E.default,C.markdownitHighlight=_.default.getMarkdownitHighlightRenderer(),C.markdownit=_.default.getMarkdownitRenderer(),C.i18n=null,C.Button=null,C.WwCodeBlockManager=null,C.WwTableManager=null,C.WwTableSelectionManager=null,e.exports=C},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(96),u=r(s),c=n(46),d=r(c),f=n(7),h=r(f),p=n(100),g=r(p),v=n(101),m=r(v),y=n(102),_=r(y),b=n(103),w=r(b),k=n(104),E=r(k),C=n(105),T=r(C),M=n(106),S=r(M),O=n(107),x=r(O),I=n(3),L=r(I),A=n(30),N=r(A),P=function(){function e(t){i(this,e),Object.defineProperty(this,"name",{enumerable:!0,writable:!0,value:"default"}),Object.defineProperty(this,"_popups",{enumerable:!0,writable:!0,value:[]}),this._editor=t,this._initialEditType=t.options.initialEditType,this._init(t.options),this._initEvent()}return o(e,[{key:"_init",value:function(e){var t=e.el,n=e.toolbarItems,r=e.hideModeSwitch;this.$el=(0,l.default)('\n <div class="tui-editor-defaultUI">\n <div class="te-toolbar-section"><div class="te-markdown-tab-section"></div></div>\n <div class="te-editor-section"></div>\n <div class="te-mode-switch-section"></div>\n </div>\n').appendTo(t),this._container=t,this._editorSection=this.$el.find(".te-editor-section").get(0),this._editorSection.appendChild(this._editor.layout.getEditorEl().get(0)),this._initToolbar(this._editor.eventManager,n),this._initModeSwitch(r),this._initPopupAddLink(),this._initPopupAddImage(),this._initPopupAddTable(),this._initPopupAddHeading(),this._initPopupTableUtils(),this._initPopupCodeBlockLanguages(),this._initPopupCodeBlockEditor(),this._initMarkdownTab()}},{key:"_initEvent",value:function(){this._editor.eventManager.listen("hide",this.hide.bind(this)),this._editor.eventManager.listen("show",this.show.bind(this)),this._editor.eventManager.listen("changeMode",this._markdownTabControl.bind(this)),this._editor.eventManager.listen("changePreviewStyle",this._markdownTabControl.bind(this))}},{key:"_initToolbar",value:function(e,t){var n=new u.default(e,t);this._toolbar=n,this.$el.find(".te-toolbar-section").append(n.$el)}},{key:"_initModeSwitch",value:function(e){var t=this,n=this.$el.find(".te-mode-switch-section"),r="markdown"===this._initialEditType?g.default.TYPE.MARKDOWN:g.default.TYPE.WYSIWYG,i=new g.default(n,r);this._modeSwitch=i,e&&i.hide(),i.on("modeSwitched",function(e,n){return t._editor.changeMode(n)})}},{key:"_initMarkdownTab",value:function(){var e=this._editor;this._markdownTab=new d.default({initName:L.default.get("Write"),items:[L.default.get("Write"),L.default.get("Preview")],sections:[e.layout.getMdEditorContainerEl(),e.layout.getPreviewEl()]}),this._$markdownTabSection=this.$el.find(".te-markdown-tab-section"),this._$markdownTabSection.append(this._markdownTab.$el),this._markdownTab.on("itemClick",function(t,n){n===L.default.get("Preview")?(e.eventManager.emit("previewNeedsRefresh"),e.eventManager.emit("changePreviewTabPreview"),e.eventManager.emit("closeAllPopup")):(e.getCodeMirror().focus(),e.eventManager.emit("changePreviewTabWrite"))})}},{key:"_markdownTabControl",value:function(){this._editor.isMarkdownMode()&&"tab"===this._editor.getCurrentPreviewStyle()?(this._$markdownTabSection.show(),this._markdownTab.activate(L.default.get("Write"))):this._$markdownTabSection.hide()}},{key:"_initPopupAddLink",value:function(){this._popups.push(new m.default({$target:this.$el,editor:this._editor}))}},{key:"_initPopupAddImage",value:function(){this._popups.push(new _.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupAddTable",value:function(){this._popups.push(new E.default({$target:this._toolbar.$el,eventManager:this._editor.eventManager,$button:this.$el.find("button.tui-table"),css:{position:"absolute"}}))}},{key:"_initPopupAddHeading",value:function(){this._popups.push(new T.default({$target:this._toolbar.$el,eventManager:this._editor.eventManager,$button:this.$el.find("button.tui-heading"),css:{position:"absolute"}}))}},{key:"_initPopupTableUtils",value:function(){var e=this;this._editor.eventManager.listen("contextmenu",function(t){(0,l.default)(t.data.target).parents("[contenteditable=true] table").length>0&&(t.data.preventDefault(),e._editor.eventManager.emit("openPopupTableUtils",t.data))}),this._popups.push(new w.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupCodeBlockLanguages",value:function(){var e=this._editor;this._popups.push(new S.default({$target:this.$el,eventManager:e.eventManager,languages:e.options.codeBlockLanguages}))}},{key:"_initPopupCodeBlockEditor",value:function(){this._popups.push(new x.default({$target:this.$el,eventManager:this._editor.eventManager,convertor:this._editor.convertor}))}},{key:"getToolbar",value:function(){return this._toolbar}},{key:"setToolbar",value:function(e){this._toolbar.destroy(),this._toolbar=e}},{key:"getModeSwitch",value:function(){return this._modeSwitch}},{key:"getEditorSectionHeight",value:function(){var e=this._editorSection.getBoundingClientRect();return e.bottom-e.top}},{key:"getEditorHeight",value:function(){var e=this._container.getBoundingClientRect();return e.bottom-e.top}},{key:"getPopupTableUtils",value:function(){var e=void 0;return this._popups.forEach(function(t){t instanceof w.default&&(e=t)}),e}},{key:"hide",value:function(){this.$el.addClass("te-hide")}},{key:"show",value:function(){this.$el.removeClass("te-hide")}},{key:"remove",value:function(){this.$el.remove(),this._markdownTab.remove(),this._modeSwitch.remove(),this._toolbar.destroy(),this._popups.forEach(function(e){return e.remove()}),this._popups=[],N.default.hide()}},{key:"createPopup",value:function(e){return new h.default(e)}}]),e}();t.default=P},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(97),c=r(u),d=n(3),f=r(d),h=n(43),p=r(h),g=n(99),v=r(g),m=n(45),y=r(m),_=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r._init(e),r._bindWidthChangedEvent(),r}return a(t,e),l(t,[{key:"insertItem",value:function(e,n){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,e,n),this._arrangeMoreButton()}},{key:"_init",value:function(e){var t=y.default.create("button",{name:"more",className:"tui-more",tooltip:f.default.get("More"),event:v.default.OPEN_EVENT});this._moreButton=t,this._popupDropdownToolbar=new v.default({eventManager:e,$target:this.$el,$button:t.$el}),this.addItem(t)}},{key:"_bindWidthChangedEvent",value:function(){var e=this;this._observer=new c.default(function(){e._popupDropdownToolbar.hide(),e._balanceButtons()}),this._observer.observe(this.$el.get(0))}},{key:"_balanceButtons",value:function(){var e=this;this._popupDropdownToolbar.getItems().forEach(function(n){e._popupDropdownToolbar.removeItem(n,!1);var r=e.getItems().length;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",e).call(e,r,n)}),this.removeItem(this._moreButton,!1),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,0,this._moreButton);var n=this.$el.height();this.getItems().filter(function(e){return e.$el.position().top>n}).forEach(function(t){e.removeItem(t,!1),e._popupDropdownToolbar.addItem(t)}),this._arrangeMoreButton()}},{key:"_arrangeMoreButton",value:function(){if(this._popupDropdownToolbar){this.removeItem(this._moreButton,!1);var e=this._popupDropdownToolbar.getItems().length>0,n=this.getItems().length;e&&s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,n,this._moreButton)}}},{key:"destroy",value:function(){this._observer&&(this._observer.disconnect(),this._observer=null)}}]),t}(p.default);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function n(e){return parseFloat(e)||0}function r(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return t.reduce(function(t,r){return t+n(e["border-"+r+"-width"])},0)}function i(e){for(var t=["top","right","bottom","left"],r={},i=0,o=t;i<o.length;i+=1){var a=o[i],l=e["padding-"+a];r[a]=n(l)}return r}function o(e){var t=e.getBBox();return c(0,0,t.width,t.height)}function a(e){var t=e.clientWidth,o=e.clientHeight;if(!t&&!o)return k;var a=w(e).getComputedStyle(e),s=i(a),u=s.left+s.right,d=s.top+s.bottom,f=n(a.width),h=n(a.height);if("border-box"===a.boxSizing&&(Math.round(f+u)!==t&&(f-=r(a,"left","right")+u),Math.round(h+d)!==o&&(h-=r(a,"top","bottom")+d)),!l(e)){var p=Math.round(f+u)-t,g=Math.round(h+d)-o;1!==Math.abs(p)&&(f-=p),1!==Math.abs(g)&&(h-=g)}return c(s.left,s.top,f,h)}function l(e){return e===w(e).document.documentElement}function s(e){return f?E(e)?o(e):a(e):k}function u(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return b(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}function c(e,t,n,r){return{x:e,y:t,width:n,height:r}}var d=function(){function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return"undefined"!=typeof Map?Map:function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=null);for(var r=0,i=n.__entries__;r<i.length;r+=1){var o=i[r];e.call(t,o[1],o[0])}},Object.defineProperties(t.prototype,n),t}()}(),f="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,h=function(){return void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),p=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(h):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),g=2,v=function(e,t){function n(){o&&(o=!1,e()),a&&i()}function r(){p(n)}function i(){var e=Date.now();if(o){if(e-l<g)return;a=!0}else o=!0,a=!1,setTimeout(r,t);l=e}var o=!1,a=!1,l=0;return i},m=["top","right","bottom","left","width","height","size","weight"],y="undefined"!=typeof MutationObserver,_=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=v(this.refresh.bind(this),20)};_.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},_.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},_.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},_.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},_.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},_.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},_.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),m.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},_.getInstance=function(){return this.instance_||(this.instance_=new _),this.instance_},_.instance_=null;var b=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},w=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||h},k=c(0,0,0,0),E=function(){return"undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof w(e).SVGGraphicsElement}:function(e){return e instanceof w(e).SVGElement&&"function"==typeof e.getBBox}}(),C=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=c(0,0,0,0),this.target=e};C.prototype.isActive=function(){var e=s(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},C.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var T=function(e,t){var n=u(t);b(this,{target:e,contentRect:n})},M=function(e,t,n){if(this.activeObservations_=[],this.observations_=new d,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n};M.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof w(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new C(e)),this.controller_.addObserver(this),this.controller_.refresh())}},M.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof w(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},M.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},M.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},M.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new T(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},M.prototype.clearActive=function(){this.activeObservations_.splice(0)},M.prototype.hasActive=function(){return this.activeObservations_.length>0};var S="undefined"!=typeof WeakMap?new WeakMap:new d,O=function(e){if(!(this instanceof O))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=_.getInstance(),n=new M(e,t,this);S.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){O.prototype[e]=function(){return(t=S.get(this))[e].apply(t,arguments);var t}});var x=function(){return void 0!==h.ResizeObserver?h.ResizeObserver:O}();t.default=x}.call(t,n(12))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(21),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),t}(l.default);t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(1),c=r(u),d=n(7),f=r(d),h=n(43),p=r(h),g=function(e){function t(e){return i(this,t),e=c.default.extend({header:!1,className:"te-dropdown-toolbar"},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"getToolbar",value:function(){return this._toolbar}},{key:"getItems",value:function(){return this.getToolbar().getItems()}},{key:"getItem",value:function(e){return this.getToolbar().getItem(e)}},{key:"setItems",value:function(e){this.getToolbar().setItems(e)}},{key:"addItem",value:function(e){this.getToolbar().addItem(e)}},{key:"insertItem",value:function(e,t){this.getToolbar().insertItem(e,t)}},{key:"indexOfItem",value:function(e){return this.getToolbar().indexOfItem(e)}},{key:"removeItem",value:function(e,t){return this.getToolbar().removeItem(e,t)}},{key:"removeAllItems",value:function(){this.getToolbar().removeAllItems()}},{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e);var n=e.$button,r=e.eventManager;this._$button=n,this._eventManager=r,this._toolbar=new p.default(r)}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this),this.setContent(this._toolbar.$el)}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",function(){return e.hide()}),this._eventManager.listen("closeAllPopup",function(){return e.hide()}),this._eventManager.listen(t.OPEN_EVENT,function(){var t=e.isShow();e._eventManager.emit("closeAllPopup"),t||e.show(),e.$el.css({left:"-1000px"});var n=e._$button,r=n.position(),i=n.outerHeight(!0),o=(i-n.outerHeight())/2,a=r.top+i-o,l=r.left+n.outerWidth(!0)-e.$el.outerWidth(!0);e.$el.css({top:a,left:l})})}}]),t}(f.default);Object.defineProperty(g,"OPEN_EVENT",{enumerable:!0,writable:!0,value:"openDropdownToolbar"}),t.default=g},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(1),d=r(c),f=n(14),h=r(f),p=n(3),g=r(p),v="markdown",m=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"te-mode-switch"}));return Object.defineProperty(r,"_buttons",{enumerable:!0,writable:!0,value:{}}),r._render(e),r._switchType(d.default.isExisty(n)?n:v),r}return a(t,e),l(t,[{key:"isShown",value:function(){return"block"===this._$rootElement.css("display")}},{key:"show",value:function(){this._$rootElement.css("display","block")}},{key:"hide",value:function(){this._$rootElement.css("display","none")}},{key:"_render",value:function(e){this._buttons.$markdown=(0,u.default)('<button class="te-switch-button markdown" type="button">'+g.default.get("Markdown")+"</button>"),this._buttons.$wysiwyg=(0,u.default)('<button class="te-switch-button wysiwyg" type="button">'+g.default.get("WYSIWYG")+"</button>"),this.$el.append(this._buttons.$markdown),this.$el.append(this._buttons.$wysiwyg),e&&(e.append(this.$el),this._$rootElement=e),this.on("click .markdown",this._changeMarkdown.bind(this)),this.on("click .wysiwyg",this._changeWysiwyg.bind(this)),this.show()}},{key:"_changeMarkdown",value:function(){this._switchType(v)}},{key:"_changeWysiwyg",value:function(){this._switchType("wysiwyg")}},{key:"_setActiveButton",value:function(e){this._buttons.$markdown.removeClass("active"),this._buttons.$wysiwyg.removeClass("active"),this._buttons["$"+e].addClass("active")}},{key:"_switchType",value:function(e){this._type!==e&&(this._type=e,this._setActiveButton(e),this.trigger("modeSwitched",this._type))}}]),t}(h.default);Object.defineProperty(m,"TYPE",{enumerable:!0,writable:!0,value:{MARKDOWN:v,WYSIWYG:"wysiwyg"}}),t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(7),p=r(h),g=n(3),v=r(g),m=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/,y=function(e){function t(e){i(this,t);var n='\n <label for="linkText">'+v.default.get("Link text")+'</label>\n <input type="text" class="te-link-text-input" />\n <label for="url">'+v.default.get("URL")+'</label>\n <input type="text" class="te-url-input" />\n <div class="te-button-section">\n <button type="button" class="te-ok-button">'+v.default.get("OK")+'</button>\n <button type="button" class="te-close-button">'+v.default.get("Cancel")+"</button>\n </div>\n ";return e=f.default.extend({header:!0,title:v.default.get("Insert link"),className:"te-popup-add-link tui-editor-popup",content:n},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._editor=e.editor,this._eventManager=e.editor.eventManager}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this);var e=this.$el.get(0);this._inputText=e.querySelector(".te-link-text-input"),this._inputURL=e.querySelector(".te-url-input")}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click .te-close-button",function(){return e.hide()}),this.on("click .te-ok-button",function(){return e._addLink()}),this.on("shown",function(){var t=e._inputText,n=e._inputURL,r=e._editor.getSelectedText().trim();t.value=r,m.exec(r)&&(n.value=r),r.length>0&&n.value.length<1?n.focus():(t.focus(),t.setSelectionRange(0,r.length))}),this.on("hidden",function(){e._resetInputs()})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this);var n=this._eventManager;n.listen("focus",function(){return e.hide()}),n.listen("closeAllPopup",function(){return e.hide()}),n.listen("openPopupAddLink",function(){n.emit("closeAllPopup"),e.show()})}},{key:"_addLink",value:function(){var e=this._getValue(),t=e.url,n=e.linkText;return this._clearValidationStyle(),n.length<1?void(0,c.default)(this._inputText).addClass("wrong"):t.length<1?void(0,c.default)(this._inputURL).addClass("wrong"):(this._eventManager.emit("command","AddLink",{linkText:n,url:t}),void this.hide())}},{key:"_getValue",value:function(){return{url:this._inputURL.value,linkText:this._inputText.value}}},{key:"_clearValidationStyle",value:function(){(0,c.default)(this._inputURL).removeClass("wrong"),(0,c.default)(this._inputText).removeClass("wrong")}},{key:"_resetInputs",value:function(){this._inputText.value="",this._inputURL.value="",this._clearValidationStyle()}}]),t}(p.default);t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(1),c=r(u),d=n(7),f=r(d),h=n(46),p=r(h),g=n(3),v=r(g),m="te-image-url-input",y="te-image-file-input",_="te-alt-text-input",b="te-ok-button",w="te-close-button",k="te-file-type",E="te-url-type",C="te-tab-section",T=function(e){function t(e){i(this,t);var n='\n <div class="'+C+'"></div>\n <div class="'+E+'">\n <label for="">'+v.default.get("Image URL")+'</label>\n <input type="text" class="'+m+'" />\n </div>\n <form enctype="multipart/form-data" class="'+k+'">\n <label for="">'+v.default.get("Select image file")+'</label>\n <input type="file" class="'+y+'" accept="image/*" />\n </form>\n <label for="url">'+v.default.get("Description")+'</label>\n <input type="text" class="'+_+'" />\n <div class="te-button-section">\n <button type="button" class="'+b+'">'+v.default.get("OK")+'</button>\n <button type="button" class="'+w+'">'+v.default.get("Cancel")+"</button>\n </div>\n ";return e=c.default.extend({header:!0,title:v.default.get("Insert image"),className:"te-popup-add-image tui-editor-popup",content:n},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this);var e=this.$el;this._$imageUrlInput=e.find("."+m),this._$imageFileInput=e.find("."+y),this._$altTextInput=e.find("."+_);var n=e.find("."+k),r=e.find("."+E),i=this.$body.find("."+C);this.tab=new p.default({initName:v.default.get("File"),items:[v.default.get("File"),v.default.get("URL")],sections:[n,r]}),i.append(this.tab.$el)}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("shown",function(){return e._$imageUrlInput.focus()}),this.on("hidden",function(){return e._resetInputs()}),this.on("change ."+y,function(){var t=e._$imageFileInput.val().split("\\").pop();e._$altTextInput.val(t)}),this.on("click ."+w,function(){return e.hide()}),this.on("click ."+b,function(){var t=e._$imageUrlInput.val(),n=e._$altTextInput.val();if(t)e._applyImage(t,n);else{var r=e._$imageFileInput.get(0),i=r.files;if(i.length){var o=i.item(0),a=function(t,r){return e._applyImage(t,n||r)};e.eventManager.emit("addImageBlobHook",o,a,"ui")}}e.hide()}),this.tab.on("itemClick",function(){return e._resetInputs()})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("openPopupAddImage",function(){e.eventManager.emit("closeAllPopup"),e.show()})}},{key:"_applyImage",value:function(e,t){this.eventManager.emit("command","AddImage",{imageUrl:e,altText:t||"image"}),this.hide()}},{key:"_resetInputs",value:function(){this.$el.find("input").val("")}},{key:"remove",value:function(){this.tab.remove(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}}]),t}(f.default);t.default=T},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(7),p=r(h),g=n(3),v=r(g),m=function(e){function t(e){i(this,t);var n='\n <button type="button" class="te-table-add-row">'+v.default.get("Add row")+'</button>\n <button type="button" class="te-table-add-col">'+v.default.get("Add col")+'</button>\n <button type="button" class="te-table-remove-row">'+v.default.get("Remove row")+'</button>\n <button type="button" class="te-table-remove-col">'+v.default.get("Remove col")+'</button>\n <hr/>\n <button type="button" class="te-table-col-align-left">'+v.default.get("Align left")+'</button>\n <button type="button" class="te-table-col-align-center">'+v.default.get("Align center")+'</button>\n <button type="button" class="te-table-col-align-right">'+v.default.get("Align right")+'</button>\n <hr/>\n <button type="button" class="te-table-remove">'+v.default.get("Remove table")+"</button>\n ";return e=f.default.extend({header:!1,className:"te-popup-table-utils",content:n},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click .te-table-add-row",function(){return e.eventManager.emit("command","AddRow")}),this.on("click .te-table-add-col",function(){return e.eventManager.emit("command","AddCol")}),this.on("click .te-table-remove-row",function(){return e.eventManager.emit("command","RemoveRow")}),this.on("click .te-table-col-align-left",function(){return e.eventManager.emit("command","AlignCol","left")}),this.on("click .te-table-col-align-center",function(){return e.eventManager.emit("command","AlignCol","center")}),this.on("click .te-table-col-align-right",function(){return e.eventManager.emit("command","AlignCol","right")}),this.on("click .te-table-remove-col",function(){return e.eventManager.emit("command","RemoveCol")}),this.on("click .te-table-remove",function(){return e.eventManager.emit("command","RemoveTable")})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("mousedown",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("openPopupTableUtils",function(t){var n=e.$el.parent().offset(),r=t.clientX-n.left,i=t.clientY-n.top+(0,c.default)(window).scrollTop();e.$el.css({position:"absolute",top:i+5,left:r+10}),e.eventManager.emit("closeAllPopup"),e.show()})}}]),t}(p.default);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(1),c=r(u),d=n(7),f=r(d),h='\n <div class="te-table-selection">\n <div class="te-table-header"></div>\n <div class="te-table-body"></div>\n <div class="te-selection-area"></div>\n </div>\n <p class="te-description"></p>\n',p=function(e){function t(e){return i(this,t),e=c.default.extend({header:!1,className:"te-popup-add-table",content:h},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._selectedBound={},this._tableBound={},this._eventManager=e.eventManager,this._$button=e.$button}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this),this._cacheElements(),this._setTableSizeByBound(5,7)}},{key:"_initDOMEvent",value:function(e){var n=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this,e),this.on("mousemove .te-table-selection",function(e){var t=e.pageX-n._selectionOffset.left,r=e.pageY-n._selectionOffset.top,i=n._getSelectionBoundByOffset(t,r);n._resizeTableBySelectionIfNeed(i.col,i.row),n._setSelectionAreaByBound(i.col,i.row),n._setDisplayText(i.col,i.row),n._setSelectedBound(i.col,i.row)}),this.on("click .te-table-selection",function(){var e=n._getSelectedTableSize();n._eventManager.emit("command","Table",e.col,e.row)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",function(){return e.hide()}),this._eventManager.listen("closeAllPopup",function(){return e.hide()}),this._eventManager.listen("openPopupAddTable",function(){var t=e._$button,n=t.get(0),r=n.offsetTop,i=n.offsetLeft;e.$el.css({top:r+t.outerHeight(),left:i}),e._eventManager.emit("closeAllPopup"),e.show(),e._selectionOffset=e.$el.find(".te-table-selection").offset()})}},{key:"_cacheElements",value:function(){this.$header=this.$el.find(".te-table-header"),this.$body=this.$el.find(".te-table-body"),this.$selection=this.$el.find(".te-selection-area"),this.$desc=this.$el.find(".te-description")}},{key:"_resizeTableBySelectionIfNeed",value:function(e,t){var n=this._getResizedTableBound(e,t);n&&this._setTableSizeByBound(n.col,n.row)}},{key:"_getResizedTableBound",value:function(e,t){var n=void 0,r=void 0,i=void 0;return e>=5&&e<9?n=e+1:e<5&&(n=5),t>=7&&t<14?r=t+1:t<7&&(r=7),this._isNeedResizeTable(n,r)&&(i={row:r||this._tableBound.row,col:n||this._tableBound.col}),i}},{key:"_isNeedResizeTable",value:function(e,t){return e&&e!==this._tableBound.col||t&&t!==this._tableBound.row}},{key:"_getBoundByOffset",value:function(e,t){return{row:parseInt(t/17,10),col:parseInt(e/25,10)}}},{key:"_getOffsetByBound",value:function(e,t){return{x:25*e+25,y:17*t+17}}},{key:"_setTableSizeByBound",value:function(e,t){var n=this._getOffsetByBound(e,t-1);this._setTableSize(n.x,n.y),this._tableBound.row=t,this._tableBound.col=e}},{key:"_getSelectionBoundByOffset",value:function(e,t){var n=this._getBoundByOffset(e,t);return n.row<1?n.row=1:n.row>this._tableBound.row&&(n.row=this._tableBound.row),n.col<1?n.col=1:n.col>this._tableBound.col&&(n.col=this._tableBound.col),n}},{key:"_setSelectionAreaByBound",value:function(e,t){var n=this._getOffsetByBound(e,t);this._setSelectionArea(n.x,n.y)}},{key:"_setSelectedBound",value:function(e,t){this._selectedBound.col=e,this._selectedBound.row=t}},{key:"_getSelectedTableSize",value:function(){return{row:this._selectedBound.row+1,col:this._selectedBound.col+1}}},{key:"_setDisplayText",value:function(e,t){this.$desc.html(e+1+" x "+(t+1))}},{key:"_setTableSize",value:function(e,t){e+=1,t+=1,this.$header.css({height:17,width:e}),this.$body.css({height:t,width:e}),this.$el.css({width:e+30})}},{key:"_setSelectionArea",value:function(e,t){e+=1,t+=1,this.$selection.css({height:t,width:e})}}]),t}(f.default);p.CELL_WIDTH=25,p.CELL_HEIGHT=17,p.MIN_ROW_SELECTION_INDEX=1,p.MIN_COL_SELECTION_INDEX=1,t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(7),p=r(h),g=n(3),v=r(g),m=function(e){function t(e){i(this,t);var n='\n <ul>\n <li data-value="1" data-type="Heading"><h1>'+v.default.get("Heading")+' 1</h1></li>\n <li data-value="2" data-type="Heading"><h2>'+v.default.get("Heading")+' 2</h2></li>\n <li data-value="3" data-type="Heading"><h3>'+v.default.get("Heading")+' 3</h3></li>\n <li data-value="4" data-type="Heading"><h4>'+v.default.get("Heading")+' 4</h4></li>\n <li data-value="5" data-type="Heading"><h5>'+v.default.get("Heading")+' 5</h5></li>\n <li data-value="6" data-type="Heading"><h6>'+v.default.get("Heading")+' 6</h6></li>\n <li data-type="Paragraph"><div>'+v.default.get("Paragraph")+"</div></li>\n </ul>\n ";return e=f.default.extend({header:!1,className:"te-heading-add",content:n},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._eventManager=e.eventManager,this._$button=e.$button}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click li",function(t){var n=(0,c.default)(t.target).closest("li");e._eventManager.emit("command",n.data("type"),n.data("value"))})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",this.hide.bind(this)),this._eventManager.listen("closeAllPopup",this.hide.bind(this)),this._eventManager.listen("openHeadingSelect",function(){var t=e._$button,n=t.get(0),r=n.offsetTop,i=n.offsetLeft;e.$el.css({top:r+t.outerHeight(),left:i}),e._eventManager.emit("closeAllPopup"),e.show()})}}]),t}(p.default);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(7),p=r(h),g="te-popup-code-block-lang-",v=function(e){function t(e){i(this,t);var n=[];return e.languages.forEach(function(e){return n.push('<button type="button" class="'+g+e+'" data-lang="'+e+'">'+e+"</button>")}),e=f.default.extend({header:!1,className:"te-popup-code-block-languages",content:n.join("")},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._onSelectedLanguage=null,this._onDismissed=null,this._currentButton=null,this._$buttons=null,this._languages=e.languages,this.eventManager=e.eventManager}},{key:"_initDOM",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this,e),this.$el.css("z-index",1e4),this._$buttons=this.$el.find("button"),this._activateButtonByIndex(0)}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this);var n=function(t){var n=(0,c.default)(t.target).data("lang");e._onSelectedLanguage&&e._onSelectedLanguage(n),e.hide()};this._languages.forEach(function(t){return e.on("mousedown ."+g+t,n)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("openPopupCodeBlockLanguages",function(t){e.show(t.callback);var n=e.$el.get(0).style;return n.top=t.offset.top+"px",n.left=t.offset.left+"px",e.setCurrentLanguage(t.language),e}),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("mousedown",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("closePopupCodeBlockLanguages",function(){return e.hide()}),this.eventManager.listen("scroll",function(){return e.hide()})}},{key:"_activateButtonByIndex",value:function(e){this._currentButton&&(0,c.default)(this._currentButton).removeClass("active"),this._currentButton=this._$buttons.get(e),(0,c.default)(this._currentButton).addClass("active"),this._currentButton.scrollIntoView()}},{key:"prev",value:function(){var e=this._$buttons.index(this._currentButton)-1;e<0&&(e=this._$buttons.length-1),this._activateButtonByIndex(e)}},{key:"next",value:function(){var e=this._$buttons.index(this._currentButton)+1;e>=this._$buttons.length&&(e=0),this._activateButtonByIndex(e)}},{key:"getCurrentLanguage",value:function(){return(0,c.default)(this._currentButton).data("lang")}},{key:"setCurrentLanguage",value:function(e){var t=this._$buttons.filter("."+g+e);if(t.length>0){var n=this._$buttons.index(t);this._activateButtonByIndex(n)}}},{key:"show",value:function(e){this._onSelectedLanguage=e.selected,this._onDismissed=e.dismissed,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._onDismissed&&this._onDismissed(),this._onSelectedLanguage=null,this._onDismissed=null,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(p.default);t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},u=n(0),c=r(u),d=n(1),f=r(d),h=n(7),p=r(h),g=n(108),v=r(g),m=n(109),y=r(m),_=n(110),b=r(_),w=n(111),k=r(w),E=n(3),C=r(E),T="popup-editor-",M="te-ok-button",S="te-close-button",O='\n <button type="button" class="'+T+'toggle-scroll"></button>\n <button type="button" class="'+T+'toggle-preview"></button>\n <button type="button" class="'+T+'toggle-fit"></button>\n <button type="button" class="tui-popup-close-button"></button>\n',x=function(e){function t(e){i(this,t);var n='\n <div class="'+T+'body"></div>\n <div class="te-button-section">\n <button type="button" class="'+M+'">'+C.default.get("OK")+'</button>\n <button type="button" class="'+S+'">'+C.default.get("Cancel")+"</button>\n </div>\n ";return e=f.default.extend({header:!0,title:"CodeBlock Editor",content:n,className:"tui-popup-code-block-editor",headerButtons:O,modal:!0},e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return a(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager,this.convertor=e.convertor}},{key:"_initDOM",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this,e);var n=this.$el.get(0);this._body=n.querySelector("."+T+"body"),this._toggleFitButton=n.querySelector("."+T+"toggle-fit"),this._togglePreviewButton=n.querySelector("."+T+"toggle-preview"),this._toggleScrollButton=n.querySelector("."+T+"toggle-scroll"),this._okButton=n.querySelector("."+M),this._closeButton=n.querySelector("."+S),this._codeMirrorWrapper=this._createCodeBlockEditor(),this._previewWrapper=this._createPreview(),this._scrollSyncSplit=new v.default(this._body,this._codeMirrorWrapper,this._previewWrapper),this._updateFitWindowButton(),this._updatePreviewButton(),this._updateScrollButton(),this._codeBlockLanguagesCombo=this._createCodeBlockLanguagesCombo()}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("scroll",function(e){return e.preventDefault()}),this.on("click ."+T+"toggle-fit",function(){return e._toggleFitToWindow()}),this.on("click ."+T+"toggle-preview",function(){return e._togglePreview()}),this.on("click ."+T+"toggle-scroll",function(){return e._toggleScroll()}),this.on("click ."+M,function(){return e._save()}),this.on("click ."+S,function(){return e.hide()}),this.on("click ."+T+"close",function(){return e.hide()}),this.on("click ."+T+"editor-wrapper",function(t){t.target===e._codeMirrorWrapper&&e._focusEditor(!0)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("openPopupCodeBlockEditor",function(t){return e.eventManager.emit("closeAllPopup"),e.show(t),e}),this.eventManager.listen("closeAllPopup",this.hide.bind(this)),this.eventManager.listen("closePopupCodeBlockEditor",this.hide.bind(this))}},{key:"_createCodeBlockEditor",value:function(){var e=document.createElement("div");return e.className=T+"editor-wrapper",this._codeBlockEditor=new y.default(e,this.eventManager),e}},{key:"_createPreview",value:function(){var e=document.createElement("div");return this._codeBlockPreview=new b.default((0,c.default)(e),this.eventManager,this.convertor,this._codeBlockEditor),e}},{key:"_createCodeBlockLanguagesCombo",value:function(){var e=this,t=this.getTitleElement(),n=new k.default(this.eventManager);return n.setOnLanguageSelected(function(t){e._codeBlockEditor.setLanguage(t),e._codeBlockEditor.refresh(),e._focusEditor()}),t.innerHTML="CodeBlock Editor",t.appendChild(n.getElement()),n}},{key:"_updateFitWindowButton",value:function(){(0,c.default)(this._toggleFitButton).toggleClass("active",this.isFitToWindow())}},{key:"_updatePreviewButton",value:function(){(0,c.default)(this._togglePreviewButton).toggleClass("active",this._scrollSyncSplit.isSplitView())}},{key:"_updateScrollButton",value:function(){this._scrollSyncSplit.isSplitView()?this._toggleScrollButton.style.display="inline-block":this._toggleScrollButton.style.display="none",(0,c.default)(this._toggleScrollButton).toggleClass("active",this._scrollSyncSplit.isScrollSynced())}},{key:"_focusEditor",value:function(e){this._codeBlockEditor.focus(),e?this._codeBlockEditor.moveCursorToEnd():this._codeBlockEditor.moveCursorToStart()}},{key:"_togglePreview",value:function(){this._scrollSyncSplit.toggleSplitView(),this._updatePreviewButton(),this._updateScrollButton(),this._codeBlockEditor.refresh()}},{key:"_toggleFitToWindow",value:function(){this.toggleFitToWindow(),this._updateFitWindowButton(),this._codeBlockEditor.refresh()}},{key:"_toggleScroll",value:function(){this._scrollSyncSplit.toggleScrollSync(),this._updateScrollButton()}},{key:"_save",value:function(){this._codeBlockEditor.save(this._codeBlockElement),this.hide()}},{key:"_load",value:function(e){this._codeBlockElement=e,this._codeBlockEditor.load(e),this._codeBlockLanguagesCombo.setLanguage(this._codeBlockEditor.getLanguage()),this._focusEditor(),this._codeBlockPreview.refresh()}},{key:"show",value:function(e){if(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),!e)throw new Error("should be called with codeBlockElement");this._load(e)}},{key:"hide",value:function(){this.setFitToWindow(!1),this._codeBlockEditor&&this._codeBlockEditor.clear(),this._codeBlockPreview&&this._codeBlockPreview.clear(),this._codeBlockElement=null,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(p.default);t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c={left:"tui-split-content-left",right:"tui-split-content-right"},d=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i(this,e),o=u.default.extend({showScrollSyncButton:!1,scrollSync:!0,splitView:!0},o),this._baseElement=t,this._contentElements=[],this._initDom(n,r,o),this._initDomEvent()}return o(e,[{key:"_initDom",value:function(e,t,n){var r=document.createElement("div");r.className="tui-split-scroll",this._el=r;var i=document.createElement("div");i.className="tui-split-scroll-wrapper",this._scrollWrapper=i,this._setScrollSync(n.scrollSync),this.setSplitView(n.splitView);var o=document.createElement("div");o.className="tui-split-scroll-content",this._contentWrapper=o;var a=document.createElement("div");a.className="tui-splitter",this._baseElement.appendChild(r),r.appendChild(i),i.appendChild(o),i.appendChild(a),this._setLeft(e),this._setRight(t)}},{key:"_initDomEvent",value:function(){this._contentWrapper.addEventListener("scroll",this.sync.bind(this))}},{key:"_requireScrollIntoView",value:function(e){var t=e.target,n=t.getBoundingClientRect(),r=n.top,i=n.bottom,o=void 0,a=void 0,s=void 0;if(this.isScrollSynced())s=this._contentWrapper;else if((0,l.default)(t).parents(this._contentElements.left).length)s=this._contentElements.left;else{if(!(0,l.default)(t).parents(this._contentElements.right).length)return;s=this._contentElements.right}var u=s.getBoundingClientRect();o=u.top,a=u.bottom,r<o?s.scrollTop=s.scrollTop+r-o:i>a&&(s.scrollTop=s.scrollTop+i-a),this.sync()}},{key:"_setContentElement",value:function(e,t){var n=this,r=this._contentElements[t];r&&((0,l.default)(r).off("requireScrollIntoView"),this._contentWrapper.removeChild(r)),(0,l.default)(e).addClass(c[t]),this._contentWrapper.appendChild(e),(0,l.default)(e).on("requireScrollIntoView",function(e){return n._requireScrollIntoView(e)}),(0,l.default)(e).on("requireScrollSync",function(){return n.sync()}),this._contentElements[t]=e,this.sync()}},{key:"_setLeft",value:function(e){this._setContentElement(e,"left")}},{key:"_setRight",value:function(e){this._setContentElement(e,"right")}},{key:"_setScrollSync",value:function(e){(0,l.default)(this._el).toggleClass("scroll-sync",e)}},{key:"toggleScrollSync",value:function(){(0,l.default)(this._el).toggleClass("scroll-sync")}},{key:"setSplitView",value:function(e){(0,l.default)(this._el).toggleClass("single-content",!e)}},{key:"toggleSplitView",value:function(){(0,l.default)(this._el).toggleClass("single-content")}},{key:"isScrollSynced",value:function(){return(0,l.default)(this._el).hasClass("scroll-sync")}},{key:"isSplitView",value:function(){return!(0,l.default)(this._el).hasClass("single-content")}},{key:"sync",value:function(){if(this._contentElements.left&&this._contentElements.right){var e=this._contentWrapper.clientHeight,t=this._contentWrapper.scrollTop,n=this._contentElements.left,r=this._contentElements.right,i=n.offsetHeight-e>0?n:r,o=i===n?r:n,a=i.offsetHeight,l=Math.max(a-e,0),s=Math.max(o.offsetHeight,e),u=a-s;i.style.top="0px",o.style.top=t/l*u+"px"}}},{key:"scrollTop",value:function(e){this._contentWrapper.scrollTop=e}}]),e}();t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(31),d=r(c),f=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{singleCursorHeightPerLine:!1,theme:"none"}));return r._language="",r._eventManager=n,r._initEvent(),r}return a(t,e),l(t,[{key:"_initEvent",value:function(){var e=this;this.on("cursorActivity",this._onRequireScrollIntoView.bind(this)),this.on("beforeChange",function(t,n){"paste"===n.origin&&e._eventManager.emit("pasteBefore",{source:"codeblock",data:n})})}},{key:"_onRequireScrollIntoView",value:function(){var e=this.getCursor(),t=this.getWrapperElement();setTimeout(function(){var n=t.querySelector("pre:nth-child("+(e.line+1)+")");(0,u.default)(n).trigger("requireScrollIntoView")},0)}},{key:"load",value:function(e){var t=e.cloneNode(!0);this.setLanguage(t.getAttribute("data-language")||""),this.setEditorCodeText(t.textContent)}},{key:"save",value:function(e){e.innerHTML="",e.textContent=this.getEditorCodeText(),e.setAttribute("data-language",this._language),(0,u.default)(e).trigger("language-changed")}},{key:"clear",value:function(){this.setLanguage(""),this.setEditorCodeText("")}},{key:"getLanguage",value:function(){return this._language}},{key:"setLanguage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this._language=e}},{key:"getEditorCodeText",value:function(){return this.getValue()}},{key:"setEditorCodeText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setValue(e)}},{key:"refresh",value:function(){this.cm.refresh()}}]),t}(d.default);t.default=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},s=n(34),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,n,o,a){r(this,t);var l=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,o,!0));return l._codeBlockEditor=a,l._initEvent(),l}return o(t,e),a(t,[{key:"_initEvent",value:function(){var e=this;this._codeBlockEditor.on("update",function(){return e.lazyRunner.run("refresh")})}},{key:"refresh",value:function(){var e=this._codeBlockEditor.getLanguage(),n=this._codeBlockEditor.getEditorCodeText();l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"refresh",this).call(this,"```"+e+"\n"+n+"\n```"),this.$el.trigger("requireScrollSync")}},{key:"clear",value:function(){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,"")}}]),t}(u.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(3),u=r(s),c=n(22),d=r(c),f=function(){function e(t){i(this,e),this._eventManager=t,this._initDOM(),this._initDOMEvent()}return o(e,[{key:"_initDOM",value:function(){this._inputLanguage=(0,l.default)('<input type="text" maxlength="20" placeholder="'+u.default.get("Choose language")+'">').get(0),this._wrapper=(0,l.default)('<span class="te-input-language">').get(0),this._wrapper.appendChild(this._inputLanguage)}},{key:"_initDOMEvent",value:function(){var e=this;this._inputLanguage.addEventListener("keydown",function(t){return e._onKeyEvent(t)}),this._inputLanguage.addEventListener("focus",function(){return e._showPopupCodeBlockLanguages()}),this._inputLanguage.addEventListener("focusout",function(){return e._onFocusOut()}),this._wrapper.addEventListener("mousedown",function(t){t.target===e._wrapper&&(t.preventDefault(),e._toggleFocus())})}},{key:"_showPopupCodeBlockLanguages",value:function(){var e=this,t=this._inputLanguage.getBoundingClientRect();(0,l.default)(this._wrapper).toggleClass("active",!0),this.active=!0,this._popupCodeBlockLanguages=this._eventManager.emitReduce("openPopupCodeBlockLanguages",{language:this._prevStoredLanguage,offset:{left:t.left,top:t.bottom},callback:{selected:function(t){return e._onLanguageSelectedFromList(t)},dismissed:function(){e._popupCodeBlockLanguages=null}}})}},{key:"_toggleFocus",value:function(){var e=this._inputLanguage;(0,l.default)(this._wrapper).hasClass("active")?e.blur():e.focus()}},{key:"_onFocusOut",value:function(){(0,l.default)(this._wrapper).toggleClass("active",!1),this._inputLanguage.value=this._prevStoredLanguage,this._hidePopupCodeBlockLanguages()}},{key:"_onKeyEvent",value:function(e){if(this._popupCodeBlockLanguages)switch(e.which){case d.default.keyCode("UP"):this._popupCodeBlockLanguages.prev(),e.preventDefault();break;case d.default.keyCode("DOWN"):this._popupCodeBlockLanguages.next(),e.preventDefault();break;case d.default.keyCode("ENTER"):case d.default.keyCode("TAB"):var t=this._popupCodeBlockLanguages.getCurrentLanguage();this._inputLanguage.value=t,this._storeInputLanguage(),e.preventDefault();break;default:this._popupCodeBlockLanguages.hide()}else e.which!==d.default.keyCode("ENTER")&&e.which!==d.default.keyCode("TAB")||(this._storeInputLanguage(),e.preventDefault())}},{key:"_onLanguageSelectedFromList",value:function(e){this._inputLanguage.value=e,this._storeInputLanguage()}},{key:"setOnLanguageSelected",value:function(e){this._onLanguageSelected=e}},{key:"_hidePopupCodeBlockLanguages",value:function(){this._eventManager.emit("closePopupCodeBlockLanguages")}},{key:"setLanguage",value:function(e){this._prevStoredLanguage=e,this._inputLanguage.value=e}},{key:"_storeInputLanguage",value:function(){var e=this._inputLanguage.value;this.setLanguage(e),this._onLanguageSelected&&this._onLanguageSelected(e),this._hidePopupCodeBlockLanguages()}},{key:"getElement",value:function(){return this._wrapper}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(25),a=/^(\*{2}|_{2}).*\1$/,l=/[*_]{2,}([^*_]*)[*_]{2,}/g,s=i.default.command("markdown",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getRange();(0,o.changeSyntax)(n,r,"**",a,l),t.focus()}});t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(25),a=/^(\*{3}|_{3}).*\1$/,l=/^(\*{2}|_{2}).*\1$/,s=/^(\*|_).*\1$/,u=/([^*_])[*_]([^*_]+)[*_]([^*_])/g,c=function(e){return a.test(e)},d=function(e){return l.test(e)},f=function(e){return s.test(e)},h="*".length,p="**".length,g="***".length,v=function(e){return e?e.replace(u,"$1$2$3"):""},m=function(e,t,n){var r=o.expandReplace.bind(this,e,n);return r(g,c,function(e){return(0,o.removeSyntax)(e,"*")})||r(p,d,function(e){return(0,o.appendSyntax)(v(e),"*")})||r(h,f,function(e){return(0,o.removeSyntax)(e,"*")})||(0,o.replace)(e,t,c,function(e){return(0,o.removeSyntax)(e,"*")})||(0,o.replace)(e,t,d,function(e){return(0,o.appendSyntax)(v(e),"*")})||(0,o.replace)(e,t,f,function(e){return(0,o.removeSyntax)(e,"*")})},y=function(e,t){return(0,o.expandReplace)(e,t,g,c,function(e){return(0,o.removeSyntax)(e,"*")})||(0,o.expandReplace)(e,t,p,d,function(e){return(0,o.appendSyntax)(e,"*")})||(0,o.expandReplace)(e,t,h,f,function(){return""})||e.replaceSelection("**","around")},_=i.default.command("markdown",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=n.getCursor(),i=r.line,a=r.ch,l=e.getRange(),s=n.getSelection();if(s)m(n,s,l)||n.replaceSelection((0,o.appendSyntax)(v(s),"*"),"around");else{y(n,l);var u=n.getSelection(),p=a;c(u)||f(u)&&!d(u)?p+=h:p-=h,n.setCursor(i,p)}t.focus()}});t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(25),a=/^~~.*~~$/,l=/~~([^~]*)~~/g,s=i.default.command("markdown",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getRange();(0,o.changeSyntax)(n,r,"~~",a,l),t.focus()}});t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=/^> ?/,a=i.default.command("markdown",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getCurrentRange(),i={line:r.from.line,ch:0},o={line:r.to.line,ch:n.getLineHandle(r.to.line).text.length},a=n.getRange(i,o),l=a.split("\n"),s=this._haveBlockquote(l),u=void 0;if(u=s?this._removeBlockquote(l):this._addBlockquote(l),n.replaceRange(u.join("\n"),i,o),s){var c=l.length;this._isBlockquoteWithSpace(l[c-1])?r.to.ch-=2:r.to.ch-=1}else r.to.ch+=2;n.setCursor(r.to),t.focus()},_haveBlockquote:function(e){for(var t=0;t<e.length;t+=1)if(!o.test(e[t]))return!1;return!0},_addBlockquote:function(e){return e.map(function(e){return"> "+e})},_removeBlockquote:function(e){return e.map(function(e){return e.replace(o,"")})},_isBlockquoteWithSpace:function(e){return/^> /.test(e)}});t.default=a},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.match(u),r="";do{r+="#",t-=1}while(t>0);if(n){e=e.split(n[0])[1]}return r+" "+e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=r(o),l=n(2),s=r(l),u=/^#+\s/g,c=s.default.command("markdown",{name:"Heading",exec:function(e,t){var n=e.getEditor(),r=n.getDoc(),o=e.getCurrentRange(),l={line:o.from.line,ch:0},s={line:o.to.line,ch:r.getLineHandle(o.to.line).text.length},u=r.getLine(s.line).length,c=r.getRange(l,s),d=c.split("\n");a.default.forEachArray(d,function(e,n){d[n]=i(e,t)}),r.replaceRange(d.join("\n"),l,s),o.to.ch+=r.getLine(s.line).length-u,r.setSelection(l,o.to),n.focus()}});t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=/^(#{1,6}| *((?:\*|-|\d\.)(?: \[[ xX]])?)) /;return e.replace(t,"")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=r(o),l=n(2),s=r(l),u=s.default.command("markdown",{name:"Paragraph",exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getCurrentRange(),o={line:r.from.line,ch:0},l={line:r.to.line,ch:n.getLineHandle(r.to.line).text.length},s=n.getLine(l.line).length,u=n.getRange(o,l),c=u.split("\n");a.default.forEachArray(c,function(e,t){c[t]=i(e)}),n.replaceRange(c.join("\n"),o,l),r.to.ch+=n.getLine(l.line).length-s,n.setSelection(o,l),t.focus()}});t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r="",i=e.getCurrentRange(),o={line:i.from.line,ch:i.from.ch},a={line:i.to.line,ch:i.to.ch};i.collapsed&&(r=n.getLine(o.line),o.ch=0,a.ch=n.getLineHandle(i.to.line).text.length),n.getLine(o.line).length?r+="\n\n* * *\n\n":r+="\n* * *\n",n.replaceRange(r,o,a),t.focus()}});t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(15),l=r(a),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=l.default.escapeMarkdownCharacters,d=o.default.command("markdown",{name:"AddLink",exec:function(e,t){var n=e.getEditor(),r=n.getDoc(),i=e.getCurrentRange(),o={line:i.from.line,ch:i.from.ch},a={line:i.to.line,ch:i.to.ch},l=t.linkText,d=t.url;l=s(l),l=c(l),d=u(d);var f="["+l+"]("+d+")";r.replaceRange(f,o,a),n.focus()}});t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(15),l=r(a),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=l.default.escapeMarkdownCharacters,d=o.default.command("markdown",{name:"AddImage",exec:function(e,t){var n=e.getEditor(),r=n.getDoc(),i=e.getCurrentRange(),o={line:i.from.line,ch:i.from.ch},a={line:i.to.line,ch:i.to.ch},l=t.altText,d=t.imageUrl;l=s(l),l=c(l),d=u(d);var f="!["+l+"]("+d+")";r.replaceRange(f,o,a,"+addImage"),n.focus()}});t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"ul")}});t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"ol")}});t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"Indent",exec:function(e){e.getEditor().execCommand("indentOrderedList")}});t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"Outdent",exec:function(e){e.getEditor().execCommand("indentLessOrderedList")}});t.default=o},function(e,t,n){"use strict";function r(e,t){for(var n="|",r="|",i=0;e;)t?(n+=" "+t[i]+" |",i+=1):n+=" |",r+=" --- |",e-=1;return n+"\n"+r+"\n"}function i(e,t,n){for(var r="",i=e,o=0;o<t;o+=1){r+="|";for(var a=0;a<e;a+=1)n?(r+=" "+n[i]+" |",i+=1):r+=" |";r+="\n"}return r=r.replace(/\n$/g,"")}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=a.default.command("markdown",{name:"Table",exec:function(e,t,n,o){var a=e.getEditor(),l=a.getDoc(),s="\n";a.getCursor().ch>0&&(s+="\n"),s+=r(t,o),s+=i(t,n-1,o),l.replaceSelection(s),o||a.setCursor(a.getCursor().line-n,2),e.focus()}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"task")}});t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=/^`([^`]+)`$/,a=/`([^`]+)`/g,l=i.default.command("markdown",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=n.getSelection(),i=t.getCursor(),o=this.hasStrikeSyntax(r),a=void 0;o?(a=this.remove(r),a=this._removeCodeSyntax(a)):(a=this._removeCodeSyntax(r),a=this.append(a)),n.replaceSelection(a,"around"),r||o||this.setCursorToCenter(n,i,o),t.focus()},setCursorToCenter:function(e,t,n){var r=n?-1:1;e.setCursor(t.line,t.ch+r)},hasStrikeSyntax:function(e){return o.test(e)},append:function(e){return"`"+e+"`"},remove:function(e){return e.substr(1,e.length-2)},_removeCodeSyntax:function(e){return e?e.replace(a,"$1"):""}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("markdown",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getCurrentRange(),i=["```",n.getSelection(),"```"],o=1;0!==r.from.ch&&(i.unshift(""),o+=1),r.to.ch!==n.getLine(r.to.line).length&&i.push(""),n.replaceSelection(i.join("\n")),t.setCursor(r.from.line+o,0),t.focus()}});t.default=o},function(e,t,n){"use strict";function r(e){e.hasFormat("b")||e.hasFormat("strong")?e.changeFormat(null,{tag:"b"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.bold())}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("wysiwyg",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(r);var i=t.getSelection();i.collapse(!0),t.setSelection(i)}else r(t)}});t.default=a},function(e,t,n){"use strict";function r(e){e.hasFormat("i")||e.hasFormat("em")?e.changeFormat(null,{tag:"i"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.italic())}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("wysiwyg",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(r);var i=t.getSelection();i.collapse(!0),t.setSelection(i)}else r(t)}});t.default=a},function(e,t,n){"use strict";function r(e){e.hasFormat("S")?e.changeFormat(null,{tag:"S"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.strikethrough())}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("wysiwyg",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(r);var i=t.getSelection();i.collapse(!0),t.setSelection(i)}else r(t)}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.command("wysiwyg",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(e){var t=e.getEditor();e.focus(),t.hasFormat("TABLE")||t.hasFormat("PRE")||(t.hasFormat("BLOCKQUOTE")?t.decreaseQuoteLevel():t.increaseQuoteLevel())}});t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(15),l=r(a),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=o.default.command("wysiwyg",{name:"AddImage",exec:function(e,t){var n=e.getEditor(),r=t.altText,i=t.imageUrl;r=s(r),i=u(i),e.focus(),n.hasFormat("PRE")||n.insertImage(i,{alt:r})}});t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=n(15),u=r(s),c=u.default.decodeURIGraceful,d=u.default.encodeMarkdownCharacters,f=l.default.command("wysiwyg",{name:"AddLink",exec:function(e,t){var n=e.getEditor(),r=t.url,i=t.linkText;if(i=c(i),r=d(r),e.focus(),!n.hasFormat("PRE"))if(n.removeAllFormatting(),n.getSelectedText())n.makeLink(r);else{var a=n.createElement("A",{href:r});(0,o.default)(a).text(i),n.insertElement(a)}}});t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(4),l=r(a),s=o.default.command("wysiwyg",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),r=void 0,i=void 0,o=void 0;if(n.collapsed&&!t.hasFormat("TABLE")&&!t.hasFormat("PRE")){r=l.default.getChildNodeByOffset(n.startContainer,n.startOffset),i=l.default.getTopNextNodeUnder(r,e.get$Body()[0]),i||(i=t.createDefaultBlock(),e.get$Body().append(i));var a=t.createElement("HR");t.modifyBlocks(function(e){return e.appendChild(a),e}),o=a.previousSibling,o&&l.default.isTextNode(o)&&0===l.default.getTextLength(o)&&a.parentNode.removeChild(o),n.selectNodeContents(i),n.collapse(!0),t.setSelection(n)}e.focus()}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=l.default.command("wysiwyg",{name:"Heading",exec:function(e,t){var n=e.getEditor();e.focus(),n.hasFormat("TABLE")||n.hasFormat("PRE")||n.modifyBlocks(function(e){return(0,o.default)(e).children("h1, h2, h3, h4, h5, h6, div").each(function(e,n){var r="<H"+t+" />",i=(0,o.default)(n);if(i.is("DIV"))i.wrap(r);else{var a=(0,o.default)(r);a.insertBefore(n),a.html(i.html()),i.remove()}}),e})}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=l.default.command("wysiwyg",{name:"Paragraph",exec:function(e){var t=e.getEditor();e.focus(),t.hasFormat("TABLE")||t.hasFormat("PRE")||t.modifyBlocks(function(e){var t=(0,o.default)(document.createDocumentFragment());return(0,o.default)(e).children().each(function(e,n){n.nodeName.match(/h\d/i)?t.append((0,o.default)(n).children()):n.nodeName.match(/ul|ol/i)?(0,o.default)(n).find("li").each(function(e,n){t.append((0,o.default)(n).children())}):t.append(n)}),t[0]})}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(4),l=r(a),s=o.default.command("wysiwyg",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),r=e.componentManager.getManager("list"),i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset;e.focus(),t.saveUndoState(n);for(var u=r.getLinesOfSelection(i,o),c=[],d=0;d<u.length;d+=1){var f=this._changeFormatToUnorderedListIfNeed(e,u[d]);f&&c.push(f)}if(c.length){var h=l.default.containsNode(c[0],i)?i:c[0],p=l.default.containsNode(c[c.length-1],o)?o:c[c.length-1];e.setSelectionByContainerAndOffset(h,a,p,s)}},_changeFormatToUnorderedListIfNeed:function(e,t){var n=e.getEditor(),r=n.getSelection(),i=e.componentManager.getManager("task"),o=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),n.setSelection(r),n.hasFormat("LI")?(e.saveSelection(r),i.unformatTask(r.startContainer),n.replaceParent(r.startContainer,"ol","ul"),e.restoreSavedSelection()):(e.unwrapBlockTag(),n.makeUnorderedList()),o=n.getSelection().startContainer),o}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(4),l=r(a),s=o.default.command("wysiwyg",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),r=e.componentManager.getManager("list"),i=n.startContainer,o=n.startOffset,a=n.endContainer,s=n.endOffset;e.focus(),t.saveUndoState(n);for(var u=r.getLinesOfSelection(i,a),c=[],d=0;d<u.length;d+=1){var f=this._changeFormatToOrderedListIfNeed(e,u[d]);f&&c.push(f)}if(c.length){var h=l.default.containsNode(c[0],i)?i:c[0],p=l.default.containsNode(c[c.length-1],a)?a:c[c.length-1];e.setSelectionByContainerAndOffset(h,o,p,s)}},_changeFormatToOrderedListIfNeed:function(e,t){var n=e.getEditor(),r=n.getSelection(),i=e.componentManager.getManager("task"),o=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),n.setSelection(r),n.hasFormat("LI")?(e.saveSelection(r),i.unformatTask(r.startContainer),n.replaceParent(r.startContainer,"ul","ol"),e.restoreSavedSelection()):(e.unwrapBlockTag(),n.makeOrderedList()),o=n.getSelection().startContainer),o}});t.default=s},function(e,t,n){"use strict";function r(e,t){var n=e.getSelection();n.selectNodeContents(t.find("th")[0]),n.collapse(!0),e.setSelection(n)}function i(e,t){for(var n="<thead><tr>",r=0;e;)n+="<th>",t&&(n+=t[r],r+=1),n+="</th>",e-=1;return n+="</tr></thead>"}function o(e,t,n){for(var r="<tbody>",i=e,o=0;o<t;o+=1){r+="<tr>";for(var a=0;a<e;a+=1)r+="<td>",n&&(r+=n[i],i+=1),r+="</td>";r+="</tr>"}return r+="</tbody>"}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=l.default.command("wysiwyg",{name:"Table",exec:function(e,t,n,a){var l=e.getEditor(),s=e.componentManager.getManager("table").getTableIDClassName(),u=void 0;if(!l.getSelection().collapsed||l.hasFormat("TABLE")||l.hasFormat("PRE"))return void e.focus();u='<table class="'+s+'">',u+=i(t,a),u+=o(t,n-1,a),u+="</table>",l.insertHTML(u),e.focus(),a||r(l,e.get$Body().find("."+s))}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),r=1;if(n.length>1){var i=n.first().get(0),o=n.last().get(0),a=t.getSelectionRangeFromTable(i,o);r=a.to.row-a.from.row+1}return r}function o(e){var t=e.clone(),n=c.default.browser.msie?"":"<br />";return t.find("td").html(n),t}function a(e,t){var n=e.getSelection();n.selectNodeContents(t.find("td")[0]),n.collapse(!0),e.setSelection(n)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=r(l),u=n(1),c=r(u),d=n(2),f=r(d),h=f.default.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),r=i(e),l=void 0,u=void 0;if(e.focus(),t.hasFormat("TD")){t.saveUndoState(n),l=(0,s.default)(n.startContainer).closest("tr");for(var c=0;c<r;c+=1)u=o(l),u.insertAfter(l);a(t,u)}else if(t.hasFormat("TH")){t.saveUndoState(n),l=(0,s.default)(n.startContainer).parents("thead").next("tbody").children("tr").eq(0);for(var d=0;d<r;d+=1)u=o(l),u.insertBefore(l);a(t,u)}}});t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),r=1;if(n.length>0){var i=n.get(0).parentNode.querySelectorAll("td, th").length;r=Math.min(i,n.length)}return r}function o(e){var t=e.startContainer;return t="TD"===g.default.getNodeName(t)||"TH"===g.default.getNodeName(t)?(0,u.default)(t):(0,u.default)(t).parentsUntil("tr")}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.index(),r=void 0;e.parents("table").find("tr").each(function(e,i){for(var o="TBODY"===g.default.getNodeName(i.parentNode),a=d.default.browser.msie,l=i.children[n],s=0;s<t;s+=1)r=o?document.createElement("td"):document.createElement("th"),a||r.appendChild(document.createElement("br")),(0,u.default)(r).insertAfter(l)})}function l(e,t){var n=e.getSelection();n.selectNodeContents(t.next()[0]),n.collapse(!0),e.setSelection(n)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(1),d=r(c),f=n(2),h=r(f),p=n(4),g=r(p),v=h.default.command("wysiwyg",{name:"AddCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),r=i(e),s=void 0;e.focus(),t.hasFormat("TR")&&(t.saveUndoState(n),s=o(n),a(s,r),l(t,s))}});t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r){var i=n.find("td").get(0);t.setStart(i,0),t.collapse(!0),r.setLastCellNode(i),e.setSelection(t)}function o(e,t,n){var r=n.find("tbody tr").length,i=(0,s.default)(e).parents("thead").length,o=t.from.row,a=t.to.row;return i&&(o+=1),(1===o||i)&&a===r&&(a-=1),n.find("tr").slice(o,a+1)}function a(e,t,n){var r=t.getSelectedCells(),i=void 0,a=void 0;if(r.length)i=t.getSelectionRangeFromTable(r.first().get(0),r.last().get(0)),a=o(r.first()[0],i,n);else{var l=(0,s.default)(e.startContainer).closest("td,th").get(0);i=t.getSelectionRangeFromTable(l,l),a=o(l,i,n)}return a}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=r(l),u=n(2),c=r(u),d=c.default.command("wysiwyg",{name:"RemoveRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),r=(0,s.default)(n.startContainer).parents("table"),o=e.componentManager.getManager("tableSelection"),l=e.componentManager.getManager("table"),u=a(n,o,r),c=r.find("tbody tr").length;if(e.focus(),(t.hasFormat("TD")||t.hasFormat("TABLE"))&&c>1){t.saveUndoState(n);var d=u.last().next()[0]?u.last().next():u.first().prev();d.length&&i(t,n,d,l),u.remove()}o.removeClassAttrbuteFromAllCellsIfNeed()}});t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.startContainer;return t="TD"===h.default.getNodeName(t)||"TH"===h.default.getNodeName(t)?(0,u.default)(t):(0,u.default)(t).parentsUntil("tr")}function o(e){for(var t=e.length,n=0;n<t;n+=1){e.eq(n).length>0&&a(e.eq(n))}}function a(e){var t=e.index();e.parents("table").find("tr").each(function(e,n){(0,u.default)(n).children().eq(t).remove()})}function l(e,t,n){var r=t.get(0);if(t.length&&u.default.contains(document,t)){var i=e.getSelection();i.selectNodeContents(t[0]),i.collapse(!0),e.setSelection(i),n.setLastCellNode(r)}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(2),d=r(c),f=n(4),h=r(f),p=d.default.command("wysiwyg",{name:"RemoveCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),r=(0,u.default)(n.startContainer).parents("table"),s=e.componentManager.getManager("table"),c=e.componentManager.getManager("tableSelection"),d=(0,u.default)(n.startContainer).closest("table").find("thead tr th").length>1;if(e.focus(),n.collapse(!0),t.setSelection(n),t.hasFormat("TR",null,n)&&d){var f=r.find("tbody tr:first td").length,h=c.getSelectedCells();if(h.length<f){t.saveUndoState(n);var p=void 0;if(h.length>1){var g=h.last(),v=h.first();p=g.next().length?g.next():v.prev(),o(h)}else{var m=i(n);p=m.next().length?m.next():m.prev(),a(m)}l(t,p,s)}}}});t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=n.isDivided||!1,i=n.startColumnIndex,o=n.endColumnIndex,a=e.find("tr").eq(0).find("td,th").length;e.find("tr").each(function(e,n){(0,s.default)(n).children("td,th").each(function(e,n){r&&(i<=e&&e<=a||e<=o)?(0,s.default)(n).attr("align",t):i<=e&&e<=o&&(0,s.default)(n).attr("align",t)})})}function o(e,t){var n=e.find("tr").eq(0).find("td,th").length,r=t.from,i=t.to,o=void 0,a=void 0,l=void 0;return r.row===i.row?(o=r.cell,a=i.cell):r.row<i.row&&(r.cell<=i.cell?(o=0,a=n-1):(o=r.cell,a=i.cell,l=!0)),{startColumnIndex:o,endColumnIndex:a,isDivided:l}}function a(e,t){var n=t.getSelectedCells(),r=void 0,i=void 0;if(n.length)r=t.getSelectionRangeFromTable(n.first().get(0),n.last().get(0));else{var o=e.startContainer;i=f.default.isTextNode(o)?(0,s.default)(o).parent("td,th")[0]:o,r=t.getSelectionRangeFromTable(i,i)}return r}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=r(l),u=n(2),c=r(u),d=n(4),f=r(d),h=c.default.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),r=n.getSelection().cloneRange(),l=e.componentManager.getManager("tableSelection"),u=a(r,l);if(e.focus(),n.hasFormat("TR")){n.saveUndoState(r);var c=(0,s.default)(r.startContainer).parents("table");i(c,t,o(c,u))}l.removeClassAttrbuteFromAllCellsIfNeed()}});t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=l.default.command("wysiwyg",{name:"RemoveTable",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(t.hasFormat("TABLE")){t.saveUndoState(n);(0,o.default)(n.startContainer).closest("table").remove()}e.focus()}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=l.default.command("wysiwyg",{name:"Indent",exec:function(e){var t=e.componentManager.getManager("list"),n=e.getEditor().getSelection(),r=(0,o.default)(n.startContainer).closest("li"),i=void 0,a=void 0,l=void 0,s=r.prev();if(s.length&&r.length){var u=r.find("li").eq(0);e.getEditor().saveUndoState(),a=r.attr("class"),i=s.attr("class"),l=u.attr("class"),r.removeAttr("class"),s.removeAttr("class"),u.length&&!u.children("div").length&&u.removeAttr("class"),e.getEditor().increaseListLevel(),t.mergeList(r.get(0)),r.attr("class",a),s.attr("class",i),u.attr("class",l)}}});t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return!e.next().is("OL,UL")}function o(e){var t=e.getEditor().getSelection();return(0,l.default)(t.startContainer).closest("li")}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),s=n(2),u=r(s),c=u.default.command("wysiwyg",{name:"Outdent",exec:function(e){var t=o(e);if(t.length&&i(t)){e.getEditor().saveUndoState();var n=t.attr("class");e.getEditor().decreaseListLevel(),t=o(e),t.attr("class",n)}}});t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(2),l=r(a),s=n(4),u=r(s),c=l.default.command("wysiwyg",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),r=e.componentManager.getManager("list"),i=n.startContainer,o=n.endContainer,a=n.startOffset,l=n.endOffset;e.focus(),t.saveUndoState(n);for(var s=r.getLinesOfSelection(i,o),c=[],d=0;d<s.length;d+=1){var f=this._changeFormatToTaskIfNeed(e,s[d]);f&&c.push(f)}if(c.length){var h=u.default.containsNode(c[0],i)?i:c[0],p=u.default.containsNode(c[c.length-1],o)?o:c[c.length-1];e.setSelectionByContainerAndOffset(h,a,p,l)}},_changeFormatToTaskIfNeed:function(e,t){var n=e.getEditor(),r=n.getSelection(),i=e.componentManager.getManager("task"),a=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),n.setSelection(r),n.hasFormat("li")||(n.makeUnorderedList(),t=n.getSelection().startContainer),(0,o.default)(t).hasClass("task-list-item")?i.unformatTask(t):i.formatTask(t),a=n.getSelection().startContainer),a}});t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){"CODE"===h.default.getNodeName(e.startContainer.nextSibling)&&0===h.default.getTextLength(e.startContainer.nextSibling)&&(0,l.default)(e.startContainer.nextSibling).remove()}function o(e,t){if(!t.hasFormat("PRE")&&t.hasFormat("code"))t.changeFormat(null,{tag:"code"}),i(e.getSelection().cloneRange());else if(!t.hasFormat("a")&&!t.hasFormat("PRE")){t.hasFormat("b")?t.removeBold():t.hasFormat("i")&&t.removeItalic(),t.changeFormat({tag:"code"});var n=t.getSelection().cloneRange();n.setStart(n.endContainer,n.endOffset),n.collapse(!0),t.setSelection(n)}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),s=n(1),u=r(s),c=n(2),d=r(c),f=n(4),h=r(f),p=d.default.command("wysiwyg",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection"),r=u.default.bind(o,null,e.getEditor());if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(r);var i=t.getSelection();i.collapse(!0),t.setSelection(i)}else r(t)}});t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=t.getEditor().getSelection().cloneRange();e.removeClass(f),n.setStartBefore(e.get(0).firstChild),n.collapse(!0),t.getEditor().setSelection(n)}function o(e,t){var n=t.componentManager.getManager("codeblock"),r=void 0;if(e.collapsed)r="<br>";else{var i=e.extractContents(),o=u.default.toArray(i.childNodes);r=(0,l.default)("<div>").append(n.prepareToPasteOnCodeblock(o)).html()}return r}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),s=n(1),u=r(s),c=n(2),d=r(c),f="te-content-codeblock-temp",h=d.default.command("wysiwyg",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(e,t){var n=e.getEditor(),r=n.getSelection().cloneRange();if(!n.hasFormat("PRE")&&!n.hasFormat("TABLE")){var a='data-te-codeblock class = "'+f+'"';t&&(a+=' data-language="'+t+'"');var l=o(r,e);n.insertHTML("<pre "+a+">"+l+"</pre>"),i(e.get$Body().find("."+f),e)}e.focus()}});t.default=h},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["en","en_US"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Write",Preview:"Preview",Headings:"Headings",Paragraph:"Paragraph",Bold:"Bold",Italic:"Italic",Strike:"Strike",Code:"Inline code",Line:"Line",Blockquote:"Blockquote","Unordered list":"Unordered list","Ordered list":"Ordered list",Task:"Task",Indent:"Indent",Outdent:"Outdent","Insert link":"Insert link","Insert CodeBlock":"Insert codeBlock","Insert table":"Insert table","Insert image":"Insert image",Heading:"Heading","Image URL":"Image URL","Select image file":"Select image file",Description:"Description",OK:"OK",More:"More",Cancel:"Cancel",File:"File",URL:"URL","Link text":"Link text","Add row":"Add row","Add col":"Add col","Remove row":"Remove row","Remove col":"Remove col","Align left":"Align left","Align center":"Align center","Align right":"Align right","Remove table":"Remove table","Would you like to paste as table?":"Would you like to paste as table?","Text color":"Text color","Auto scroll enabled":"Auto scroll enabled","Auto scroll disabled":"Auto scroll disabled","Choose language":"Choose language"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["ko","ko_KR"],{Markdown:"마크다운",WYSIWYG:"위지윅",Write:"편집하기",Preview:"미리보기",Headings:"제목크기",Paragraph:"본문",Bold:"굵게",Italic:"기울임꼴",Strike:"취소선",Code:"인라인 코드",Line:"문단나눔",Blockquote:"인용구","Unordered list":"글머리 기호","Ordered list":"번호 매기기",Task:"체크박스",Indent:"들여쓰기",Outdent:"내어쓰기","Insert link":"링크 삽입","Insert CodeBlock":"코드블럭 삽입","Insert table":"표 삽입","Insert image":"이미지 삽입",Heading:"제목","Image URL":"이미지 주소","Select image file":"이미지 파일을 선택하세요.",Description:"설명",OK:"확인",More:"더 보기",Cancel:"취소",File:"파일",URL:"주소","Link text":"링크 텍스트","Add row":"행 추가","Add col":"열 추가","Remove row":"행 삭제","Remove col":"열 삭제","Align left":"왼쪽 정렬","Align center":"가운데 정렬","Align right":"오른쪽 정렬","Remove table":"표 삭제","Would you like to paste as table?":"표형태로 붙여 넣겠습니까?","Text color":"글자 색상","Auto scroll enabled":"자동 스크롤 켜짐","Auto scroll disabled":"자동 스크롤 꺼짐","Choose language":"언어 선택"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["zh","zh_CN"],{Markdown:"Markdown",WYSIWYG:"所见即所得",Write:"编辑",Preview:"预览",Headings:"标题",Paragraph:"文本",Bold:"加粗",Italic:"斜体字",Strike:"删除线",Code:"内嵌代码",Line:"水平线",Blockquote:"引用块","Unordered list":"无序列表","Ordered list":"有序列表",Task:"任务",Indent:"缩进",Outdent:"减少缩进","Insert link":"插入链接","Insert CodeBlock":"插入代码块","Insert table":"插入表格","Insert image":"插入图片",Heading:"标题","Image URL":"图片网址","Select image file":"选择图片文件",Description:"说明",OK:"确认",More:"更多",Cancel:"取消",File:"文件",URL:"URL","Link text":"链接文本","Add row":"添加行","Add col":"添加列","Remove row":"删除行","Remove col":"删除列","Align left":"左对齐","Align center":"居中对齐","Align right":"右对齐","Remove table":"删除表格","Would you like to paste as table?":"需要粘贴为表格吗?","Text color":"文字颜色","Auto scroll enabled":"自动滚动已启用","Auto scroll disabled":"自动滚动已禁用","Choose language":"选择语言"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["ja","ja_JP"],{Markdown:"マークダウン",WYSIWYG:"WYSIWYG",Write:"編集する",Preview:"プレビュー",Headings:"見出し",Paragraph:"本文",Bold:"太字",Italic:"イタリック",Strike:"ストライク",Code:"インラインコード",Line:"ライン",Blockquote:"引用","Unordered list":"番号なしリスト","Ordered list":"順序付きリスト",Task:"タスク",Indent:"インデント",Outdent:"アウトデント","Insert link":"リンク挿入","Insert CodeBlock":"コードブロック挿入","Insert table":"テーブル挿入","Insert image":"画像挿入",Heading:"見出し","Image URL":"イメージURL","Select image file":"画像ファイル選択",Description:"ディスクリプション ",OK:"はい",More:"もっと",Cancel:"キャンセル",File:"ファイル",URL:"URL","Link text":"リンクテキスト","Add row":"行追加","Add col":"列追加","Remove row":"行削除","Remove col":"列削除","Align left":"左揃え","Align center":"中央揃え","Align right":"右揃え","Remove table":"テーブル削除","Would you like to paste as table?":"テーブルを貼り付けますか?","Text color":"文字色相","Auto scroll enabled":"自動スクロールが有効","Auto scroll disabled":"自動スクロールを無効に","Choose language":"言語選択"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["nl","nl_NL"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Opslaan",Preview:"Voorbeeld",Headings:"Koppen",Paragraph:"Alinea",Bold:"Vet",Italic:"Cursief",Strike:"Doorhalen",Code:"Inline code",Line:"Regel",Blockquote:"Citaatblok","Unordered list":"Opsomming","Ordered list":"Genummerde opsomming",Task:"Taak",Indent:"Niveau verhogen",Outdent:"Niveau verlagen","Insert link":"Link invoegen","Insert CodeBlock":"Codeblok toevoegen","Insert table":"Tabel invoegen","Insert image":"Afbeelding invoegen",Heading:"Kop","Image URL":"Afbeelding URL","Select image file":"Selecteer een afbeelding",Description:"Omschrijving",OK:"OK",More:"Meer",Cancel:"Annuleren",File:"Bestand",URL:"URL","Link text":"Link tekst","Add row":"Rij toevoegen","Add col":"Kolom toevoegen","Remove row":"Rij verwijderen","Remove col":"Kolom verwijderen","Align left":"Links uitlijnen","Align center":"Centreren","Align right":"Rechts uitlijnen","Remove table":"Verwijder tabel","Would you like to paste as table?":"Wil je dit als tabel plakken?","Text color":"Tekstkleur","Auto scroll enabled":"Autoscroll ingeschakeld","Auto scroll disabled":"Autoscroll uitgeschakeld","Choose language":"Kies een taal"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["es","es_ES"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Escribir",Preview:"Vista previa",Headings:"Encabezados",Paragraph:"Párrafo",Bold:"Negrita",Italic:"Itálica",Strike:"Tachado",Code:"Código",Line:"Línea",Blockquote:"Cita","Unordered list":"Lista desordenada","Ordered list":"Lista ordenada",Task:"Tarea",Indent:"Sangría",Outdent:"Saliendo","Insert link":"Insertar enlace","Insert CodeBlock":"Insertar bloque de código","Insert table":"Insertar tabla","Insert image":"Insertar imagen",Heading:"Encabezado","Image URL":"URL de la imagen","Select image file":"Seleccionar archivo de imagen",Description:"Descripción",OK:"Aceptar",More:"Más",Cancel:"Cancelar",File:"Archivo",URL:"URL","Link text":"Texto del enlace","Add row":"Agregar fila","Add col":"Agregar columna","Remove row":"Eliminar fila","Remove col":"Eliminar columna","Align left":"Alinear a la izquierda","Align center":"Centrar","Align right":"Alinear a la derecha","Remove table":"Eliminar tabla","Would you like to paste as table?":"¿Desea pegar como tabla?","Text color":"Color del texto","Auto scroll enabled":"Desplazamiento automático habilitado","Auto scroll disabled":"Desplazamiento automático deshabilitado","Choose language":"Elegir idioma"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["de","de_DE"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Verfassen",Preview:"Vorschau",Headings:"Überschriften",Paragraph:"Text",Bold:"Fett",Italic:"Kursiv",Strike:"Durchgestrichen",Code:"Code",Line:"Trennlinie",Blockquote:"Blocktext","Unordered list":"Aufzählung","Ordered list":"Nummerierte Aufzählung",Task:"Aufgabe",Indent:"Einrücken",Outdent:"Ausrücken","Insert link":"Link einfügen","Insert CodeBlock":"Codeblock einfügen","Insert table":"Tabelle einfügen","Insert image":"Grafik einfügen",Heading:"Titel","Image URL":"Bild URL","Select image file":"Grafik auswählen",Description:"Beschreibung",OK:"OK",More:"Mehr",Cancel:"Abbrechen",File:"Datei",URL:"URL","Link text":"Anzuzeigender Text","Add row":"Zeile hinzufügen","Add col":"Spalte hinzufügen","Remove row":"Zeile entfernen","Remove col":"Spalte entfernen","Align left":"Links ausrichten","Align center":"Zentrieren","Align right":"Rechts ausrichten","Remove table":"Tabelle entfernen","Would you like to paste as table?":"Möchten Sie eine Tabelle einfügen?","Text color":"Textfarbe","Auto scroll enabled":"Autoscrollen aktiviert","Auto scroll disabled":"Autoscrollen deaktiviert","Choose language":"Sprache auswählen"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["ru","ru_RU"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написать",Preview:"Предварительный просмотр",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирный",Italic:"Курсив",Strike:"Зачеркнутый",Code:"Встроенный код",Line:"Строка",Blockquote:"Блок цитирования","Unordered list":"Неупорядоченный список","Ordered list":"Упорядоченный список",Task:"Задача",Indent:"отступ",Outdent:"Выступ","Insert link":"Вставить ссылку","Insert CodeBlock":"Вставить код","Insert table":"Вставить таблицу","Insert image":"Вставить изображение",Heading:"Заголовок","Image URL":"URL изображения","Select image file":"Выбрать файл изображения",Description:"Описание",OK:"Хорошо",More:"еще",Cancel:"Отмена",File:"Файл",URL:"URL","Link text":"Текст ссылки","Add row":"Добавить ряд","Add col":"Добавить столбец","Remove row":"Удалить ряд","Remove col":"Удалить столбец","Align left":"Выровнять по левому краю","Align center":"Выровнять по центру","Align right":"Выровнять по правому краю","Remove table":"Удалить таблицу","Would you like to paste as table?":"Вы хотите вставить в виде таблицы?","Text color":"Цвет текста","Auto scroll enabled":"Автоматическая прокрутка включена","Auto scroll disabled":"Автоматическая прокрутка отключена","Choose language":"Выбрать язык"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["fr","fr_FR"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Écrire",Preview:"Aperçu",Headings:"En-têtes",Paragraph:"Paragraphe",Bold:"Gras",Italic:"Italique",Strike:"Barré",Code:"Code en ligne",Line:"Ligne",Blockquote:"Citation","Unordered list":"Liste non-ordonnée","Ordered list":"Liste ordonnée",Task:"Tâche",Indent:"Retrait",Outdent:"Sortir","Insert link":"Insérer un lien","Insert CodeBlock":"Insérer un bloc de code","Insert table":"Insérer un tableau","Insert image":"Insérer une image",Heading:"En-tête","Image URL":"URL de l'image","Select image file":"Sélectionnez un fichier image",Description:"Description",OK:"OK",More:"de plus",Cancel:"Annuler",File:"Fichier",URL:"URL","Link text":"Texte du lien","Add row":"Ajouter une ligne","Add col":"Ajouter une colonne","Remove row":"Supprimer une ligne","Remove col":"Supprimer une colonne","Align left":"Aligner à gauche","Align center":"Aligner au centre","Align right":"Aligner à droite","Remove table":"Supprimer le tableau","Would you like to paste as table?":"Voulez-vous coller ce contenu en tant que tableau ?","Text color":"Couleur du texte","Auto scroll enabled":"Défilement automatique activé","Auto scroll disabled":"Défilement automatique désactivé","Choose language":"Choix de la langue"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["uk","uk_UA"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написати",Preview:"Попередній перегляд",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирний",Italic:"Курсив",Strike:"Закреслений",Code:"Вбудований код",Line:"Лінія",Blockquote:"Блок цитування","Unordered list":"Невпорядкований список","Ordered list":"Упорядкований список",Task:"Завдання",Indent:"відступ",Outdent:"застарілий","Insert link":"Вставити посилання","Insert CodeBlock":"Вставити код","Insert table":"Вставити таблицю","Insert image":"Вставити зображення",Heading:"Заголовок","Image URL":"URL зображення","Select image file":"Вибрати файл зображення",Description:"Опис",OK:"OK",More:"ще",Cancel:"Скасувати",File:"Файл",URL:"URL","Link text":"Текст посилання","Add row":"Додати ряд","Add col":"Додати стовпчик","Remove row":"Видалити ряд","Remove col":"Видалити стовпчик","Align left":"Вирівняти по лівому краю","Align center":"Вирівняти по центру","Align right":"Вирівняти по правому краю","Remove table":"Видалити таблицю","Would you like to paste as table?":"Ви хочете вставити у вигляді таблиці?","Text color":"Колір тексту","Auto scroll enabled":"Автоматична прокрутка включена","Auto scroll disabled":"Автоматична прокрутка відключена","Choose language":"Вибрати мову"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["tr","tr_TR"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Düzenle",Preview:"Ön izleme",Headings:"Başlıklar",Paragraph:"Paragraf",Bold:"Kalın",Italic:"İtalik",Strike:"Altı çizgili",Code:"Satır içi kod",Line:"Çizgi",Blockquote:"Alıntı","Unordered list":"Sıralanmamış liste","Ordered list":"Sıralı liste",Task:"Görev kutusu",Indent:"Girintiyi arttır",Outdent:"Girintiyi azalt","Insert link":"Bağlantı ekle","Insert CodeBlock":"Kod bloku ekle","Insert table":"Tablo ekle","Insert image":"İmaj ekle",Heading:"Başlık","Image URL":"İmaj URL","Select image file":"İmaj dosyası seç",Description:"Açıklama",OK:"Onay",More:"Daha Fazla",Cancel:"İptal",File:"Dosya",URL:"URL","Link text":"Bağlantı yazısı","Add row":"Satır ekle","Add col":"Sütun ekle","Remove row":"Satır sil","Remove col":"Sütun sil","Align left":"Sola hizala","Align center":"Merkeze hizala","Align right":"Sağa hizala","Remove table":"Tabloyu kaldır","Would you like to paste as table?":"Tablo olarak yapıştırmak ister misiniz?","Text color":"Metin rengi","Auto scroll enabled":"Otomatik kaydırma açık","Auto scroll disabled":"Otomatik kaydırma kapalı","Choose language":"Dil seçiniz"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["fi","fi_FI"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Kirjoita",Preview:"Esikatselu",Headings:"Otsikot",Paragraph:"Kappale",Bold:"Lihavointi",Italic:"Kursivointi",Strike:"Yliviivaus",Code:"Koodi",Line:"Vaakaviiva",Blockquote:"Lainaus","Unordered list":"Luettelo","Ordered list":"Numeroitu luettelo",Task:"Tehtävä",Indent:"Suurenna sisennystä",Outdent:"Pienennä sisennystä","Insert link":"Lisää linkki","Insert CodeBlock":"Lisää koodia","Insert table":"Lisää taulukko","Insert image":"Lisää kuva",Heading:"Otsikko","Image URL":"Kuvan URL","Select image file":"Valitse kuvatiedosto",Description:"Kuvaus",OK:"OK",More:"Lisää",Cancel:"Peruuta",File:"Tiedosto",URL:"URL","Link text":"Linkkiteksti","Add row":"Lisää rivi","Add col":"Lisää sarake","Remove row":"Poista rivi","Remove col":"Poista sarake","Align left":"Tasaus vasemmalle","Align center":"Keskitä","Align right":"Tasaus oikealle","Remove table":"Poista taulukko","Would you like to paste as table?":"Haluatko liittää taulukkomuodossa?","Text color":"Tekstin väri","Auto scroll enabled":"Automaattinen skrollaus käytössä","Auto scroll disabled":"Automaattinen skrollaus pois käytöstä","Choose language":"Valitse kieli"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["cs","cs_CZ"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Napsat",Preview:"Náhled",Headings:"Nadpisy",Paragraph:"Odstavec",Bold:"Tučné",Italic:"Kurzíva",Strike:"Přeškrtnuté",Code:"Kód",Line:"Vodorovná čára",Blockquote:"Citace","Unordered list":"Seznam s odrážkami","Ordered list":"Číslovaný seznam",Task:"Úkol",Indent:"Zvětšit odsazení",Outdent:"Zmenšit odsazení","Insert link":"Vložit odkaz","Insert CodeBlock":"Vložit blok kódu","Insert table":"Vložit tabulku","Insert image":"Vložit obrázek",Heading:"Nadpis","Image URL":"URL obrázku","Select image file":"Vybrat obrázek",Description:"Popis",OK:"OK",More:"Více",Cancel:"Zrušit",File:"Soubor",URL:"URL","Link text":"Text odkazu","Add row":"Přidat řádek","Add col":"Přidat sloupec","Remove row":"Odebrat řádek","Remove col":"Odebrat sloupec","Align left":"Zarovnat vlevo","Align center":"Zarovnat na střed","Align right":"Zarovnat vpravo","Remove table":"Odstranit tabulku","Would you like to paste as table?":"Chcete vložit jako tabulku?","Text color":"Barva textu","Auto scroll enabled":"Automatické rolování zapnuto","Auto scroll disabled":"Automatické rolování vypnuto","Choose language":"Vybrat jazyk"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["ar","ar_AR"],{Markdown:"لغة ترميز",WYSIWYG:"ما تراه هو ما تحصل عليه",Write:"يكتب",Preview:"عرض مسبق",Headings:"العناوين",Paragraph:"فقرة",Bold:"خط عريض",Italic:"خط مائل",Strike:"إضراب",Code:"رمز",Line:"خط",Blockquote:"فقرة مقتبسة","Unordered list":"قائمة غير مرتبة","Ordered list":"قائمة مرتبة",Task:"مهمة",Indent:"المسافة البادئة",Outdent:"المسافة الخارجة","Insert link":"أدخل الرابط","Insert CodeBlock":"أدخل الكود","Insert table":"أدخل جدول","Insert image":"أدخل صورة",Heading:"عنوان","Image URL":"رابط الصورة","Select image file":"حدد ملف الصورة",Description:"وصف",OK:"موافقة",More:"أكثر",Cancel:"إلغاء",File:"ملف",URL:"رابط","Link text":"نص الرابط","Add row":"ضف سطر","Add col":"ضف عمود","Remove row":"حذف سطر","Remove col":"حذف عمود","Align left":"محاذاة اليسار","Align center":"محاذاة الوسط","Align right":"محاذاة اليمين","Remove table":"حذف الجدول","Would you like to paste as table?":"هل تريد اللصق كجدول","Text color":"لون النص","Auto scroll enabled":"التحريك التلقائي ممكّن","Auto scroll disabled":"التحريك التلقائي معطّل","Choose language":"اختر اللغة"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["pl","pl_PL"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Napisz",Preview:"Podgląd",Headings:"Nagłówki",Paragraph:"Akapit",Bold:"Pogrubienie",Italic:"Kursywa",Strike:"Przekreślenie",Code:"Fragment kodu",Line:"Linia",Blockquote:"Cytat","Unordered list":"Lista nieuporządkowana","Ordered list":"Lista uporządkowana",Task:"Zadanie",Indent:"Utwórz wcięcie",Outdent:"Usuń wcięcie","Insert link":"Umieść odnośnik","Insert CodeBlock":"Umieść blok kodu","Insert table":"Umieść tabelę","Insert image":"Umieść obraz",Heading:"Nagłówek","Image URL":"Adres URL obrazu","Select image file":"Wybierz plik obrazu",Description:"Opis",OK:"OK",More:"Więcej",Cancel:"Anuluj",File:"Plik",URL:"URL","Link text":"Tekst odnośnika","Add row":"Dodaj rząd","Add col":"Dodaj kolumnę","Remove row":"Usuń rząd","Remove col":"Usuń kolumnę","Align left":"Wyrównaj do lewej","Align center":"Wyśrodkuj","Align right":"Wyrównaj do prawej","Remove table":"Usuń tabelę","Would you like to paste as table?":"Czy chcesz wkleić tekst jako tabelę?","Text color":"Kolor tekstu","Auto scroll enabled":"Włączono automatyczne przewijanie","Auto scroll disabled":"Wyłączono automatyczne przewijanie","Choose language":"Wybierz język"})},function(e,t,n){"use strict";var r=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(r).default.setLanguage(["zhtw","zh_TW"],{Markdown:"Markdown",WYSIWYG:"所見即所得",Write:"編輯",Preview:"預覽",Headings:"標題",Paragraph:"內文",Bold:"粗體",Italic:"斜體",Strike:"刪除線",Code:"內嵌程式碼",Line:"分隔線",Blockquote:"引言","Unordered list":"項目符號清單","Ordered list":"編號清單",Task:"核取方塊清單",Indent:"增加縮排",Outdent:"減少縮排","Insert link":"插入超連結","Insert CodeBlock":"插入程式碼區塊","Insert table":"插入表格","Insert image":"插入圖片",Heading:"標題","Image URL":"圖片網址","Select image file":"選擇圖片檔案",Description:"描述",OK:"確認",More:"更多",Cancel:"取消",File:"檔案",URL:"URL","Link text":"超連結文字","Add row":"增加行","Add col":"增加列","Remove row":"刪除行","Remove col":"刪除列","Align left":"靠左對齊","Align center":"置中","Align right":"靠右對齊","Remove table":"刪除表格","Would you like to paste as table?":"您要以表格貼上嗎?","Text color":"文字顏色","Auto scroll enabled":"已啟用自動滾動","Auto scroll disabled":"已停用自動滾動","Choose language":"選擇語言"})},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;!function(r){var i={};i.RELAXED=!1,i.IGNORE_RECORD_LENGTH=!1,i.IGNORE_QUOTES=!1,i.LINE_FEED_OK=!0,i.CARRIAGE_RETURN_OK=!0,i.DETECT_TYPES=!0,i.IGNORE_QUOTE_WHITESPACE=!0,i.DEBUG=!1,i.COLUMN_SEPARATOR=",",i.ERROR_EOF="UNEXPECTED_END_OF_FILE",i.ERROR_CHAR="UNEXPECTED_CHARACTER",i.ERROR_EOL="UNEXPECTED_END_OF_RECORD",i.WARN_SPACE="UNEXPECTED_WHITESPACE";i.parse=function(e){var t=i.result=[];i.COLUMN_SEPARATOR=i.COLUMN_SEPARATOR instanceof RegExp?new RegExp("^"+i.COLUMN_SEPARATOR.source):i.COLUMN_SEPARATOR,i.offset=0,i.str=e,i.record_begin(),i.debug("parse()",e);for(var n;;){if(n=e[i.offset++],i.debug("c",n),null==n){i.escaped&&i.error(i.ERROR_EOF),i.record&&(i.token_end(),i.record_end()),i.debug("...bail",n,i.state,i.record),i.reset();break}if(null==i.record){if(i.RELAXED&&("\n"==n||"\r"==n&&"\n"==e[i.offset+1]))continue;i.record_begin()}if(0==i.state){if((" "===n||"\t"===n)&&'"'==i.next_nonspace()){if(i.RELAXED||i.IGNORE_QUOTE_WHITESPACE)continue;i.warn(i.WARN_SPACE)}if('"'==n&&!i.IGNORE_QUOTES){i.debug("...escaped start",n),i.escaped=!0,i.state=1;continue}i.state=1}1==i.state&&i.escaped?'"'==n?'"'==e[i.offset]?(i.debug("...escaped quote",n),i.token+='"',i.offset++):(i.debug("...escaped end",n),i.escaped=!1,i.state=2):(i.token+=n,i.debug("...escaped add",n,i.token)):"\r"==n?("\n"==e[i.offset]?i.offset++:i.CARRIAGE_RETURN_OK||i.error(i.ERROR_CHAR),i.token_end(),i.record_end()):"\n"==n?(i.LINE_FEED_OK||i.RELAXED||i.error(i.ERROR_CHAR),i.token_end(),i.record_end()):i.test_regex_separator(e)||i.COLUMN_SEPARATOR==n?i.token_end():1==i.state?(i.token+=n,i.debug("...add",n,i.token)):" "===n||"\t"===n?i.IGNORE_QUOTE_WHITESPACE||i.error(i.WARN_SPACE):i.RELAXED||i.error(i.ERROR_CHAR)}return t},i.stream=function(){var e=n(47),t=new e.Transform({objectMode:!0});return t.EOL="\n",t.prior="",t.emitter=function(e){return function(t){e.push(i.parse(t+e.EOL))}}(t),t._transform=function(e,t,n){var r=""==this.prior?e.toString().split(this.EOL):(this.prior+e.toString()).split(this.EOL);this.prior=r.pop(),r.forEach(this.emitter),n()},t._flush=function(e){""!=this.prior&&(this.emitter(this.prior),this.prior=""),e()},t},i.test_regex_separator=function(e){if(!(i.COLUMN_SEPARATOR instanceof RegExp))return!1;var t;return e=e.slice(i.offset-1),t=i.COLUMN_SEPARATOR.exec(e),t&&(i.offset+=t[0].length-1),null!==t},i.stream.json=function(){var e=n(181),t=(n(47),new streamTransform({objectMode:!0}));return t._transform=function(n,r,i){t.push(JSON.stringify(n.toString())+e.EOL),i()},t},i.reset=function(){i.state=null,i.token=null,i.escaped=null,i.record=null,i.offset=null,i.result=null,i.str=null},i.next_nonspace=function(){for(var e,t=i.offset;t<i.str.length;)if(" "!=(e=i.str[t++])&&"\t"!==e)return e;return null},i.record_begin=function(){i.escaped=!1,i.record=[],i.token_begin(),i.debug("record_begin")},i.record_end=function(){i.state=4,!i.IGNORE_RECORD_LENGTH&&!i.RELAXED&&i.result.length>0&&i.record.length!=i.result[0].length&&i.error(i.ERROR_EOL),i.result.push(i.record),i.debug("record end",i.record),i.record=null},i.resolve_type=function(e){return e.match(/^[-+]?[0-9]+(\.[0-9]+)?([eE][-+]?[0-9]+)?$/)?e=parseFloat(e):e.match(/^(true|false)$/i)?e=Boolean(e.match(/true/i)):"undefined"===e?e=void 0:"null"===e&&(e=null),e},i.token_begin=function(){i.state=0,i.token=""},i.token_end=function(){i.DETECT_TYPES&&(i.token=i.resolve_type(i.token)),i.record.push(i.token),i.debug("token end",i.token),i.token_begin()},i.debug=function(){i.DEBUG&&console.log(arguments)},i.dump=function(e){return[e,"at char",i.offset,":",i.str.substr(i.offset-50,50).replace(/\r/gm,"\\r").replace(/\n/gm,"\\n").replace(/\t/gm,"\\t")].join(" ")},i.error=function(e){var t=i.dump(e);throw i.reset(),t},i.warn=function(e){if(i.DEBUG){var t=i.dump(e);try{return void console.warn(t)}catch(e){}try{console.log(t)}catch(e){}}},void 0!==e&&e.exports?e.exports=i:t.CSV=i}()},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,a,l=e.length;o=r(e),a=new d(3*l/4-o),n=o>0?l-4:l;var s=0;for(t=0;t<n;t+=4)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[s++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}function a(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function l(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(a(r));return i.join("")}function s(e){for(var t,n=e.length,r=n%3,i="",o=[],a=0,s=n-r;a<s;a+=16383)o.push(l(e,a,a+16383>s?s:a+16383));return 1===r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")}t.byteLength=i,t.toByteArray=o,t.fromByteArray=s;for(var u=[],c=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=f.length;h<p;++h)u[h]=f[h],c[f.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,u=s>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-c)-1,h>>=-c,c+=l;c>0;o=256*o+e[t+d],d+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===o)o=1-u;else{if(o===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,l,s,u=8*o-i-1,c=(1<<u)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),t+=a+d>=1?f/s:f*Math.pow(2,1-d),t*s>=2&&(a++,s/=2),a+d>=c?(l=0,a=c):a+d>=1?(l=(t*s-1)*Math.pow(2,i),a+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&l,h+=p,l/=256,i-=8);for(a=a<<i|l,u+=i;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*g}},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,n){e.copy(t,n)}var o=n(20).Buffer;e.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t},e}()},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(174),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return u[s]=r,l(s),s++}function i(e){delete u[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function a(e){if(c)setTimeout(a,0,e);else{var t=u[e];if(t){c=!0;try{o(t)}finally{i(e),c=!1}}}}if(!e.setImmediate){var l,s=1,u={},c=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?function(){l=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&a(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),l=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},l=function(t){e.port2.postMessage(t)}}():d&&"onreadystatechange"in d.createElement("script")?function(){var e=d.documentElement;l=function(t){var n=d.createElement("script");n.onreadystatechange=function(){a(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){l=function(e){setTimeout(a,0,e)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(12),n(18))},function(e,t,n){(function(t){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=n}).call(t,n(12))},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}e.exports=r;var i=n(54),o=n(16);o.inherits=n(13),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(28)},function(e,t,n){e.exports=n(11)},function(e,t,n){e.exports=n(27).Transform},function(e,t,n){e.exports=n(27).PassThrough},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){function t(){"vertical"===e.mdPreviewStyle&&"markdown"===e.currentMode?(d.$el.show(),h.show()):(d.$el.hide(),h.hide())}var n=e.i18n,r={active:n.get("Auto scroll enabled"),inactive:n.get("Auto scroll disabled")};if(!e.isViewer()){var i=e.getCodeMirror(),o=new f.default(i,e.preview),l=new c.default(o,i,e.preview.$el),s=!1,u=!0,d=void 0,h=void 0;if("default"===e.getUI().name){var p=e.getUI().getToolbar();p.addItem("divider"),p.addItem({type:"button",options:{className:"tui-scrollsync",command:"scrollSyncToggle",tooltip:r.active,$el:(0,a.default)('<button class="active tui-scrollsync" type="button"></button>')}});var g=p.getItems();h=g[g.length-2].$el,d=g[g.length-1],t(),e.on("changeMode",t),e.on("changePreviewStyle",t),e.addCommand("markdown",{name:"scrollSyncToggle",exec:function(){u=!u,d._onOut(),u?(d.$el.addClass("active"),d.setTooltip(r.active)):(d.$el.removeClass("active"),d.setTooltip(r.inactive)),d._onOver()}})}i.on("change",function(){s=!1,o.makeSectionList()}),e.on("previewRenderAfter",function(){o.sectionMatch(),u&&l.syncPreviewScrollTopToMarkdown(),s=!0}),e.eventManager.listen("scroll",function(t){u&&(s&&e.preview.isVisible()?"markdown"!==t.source||l.isMarkdownScrollEventBlocked?"preview"!==t.source||l.isPreviewScrollEventBlocked||l.syncMarkdownScrollTopToPreview():l.syncPreviewScrollTopToMarkdown():l.saveScrollInfo())})}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=r(o),l=n(5),s=r(l),u=n(183),c=r(u),d=n(184),f=r(d);s.default.defineExtension("scrollSync",i),t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=function(){function e(t,n,i){r(this,e),this.sectionManager=t,this.cm=n,this.$previewContainerEl=i,this.$contents=this.$previewContainerEl.find(".tui-editor-contents"),this.releaseTimer=null,this._currentTimeoutId=null,this._savedScrollInfo=null}return i(e,[{key:"_getEditorSectionHeight",value:function(e){var t=this.cm.heightAtLine(e.end,"local");return t-=this.cm.heightAtLine(e.start>0?e.start-1:0,"local")}},{key:"_getEditorLineHeightGapInSection",value:function(e,t){var n=this.cm.heightAtLine(t,"local");return n-=this.cm.heightAtLine(e.start>0?e.start-1:0,"local"),Math.max(n,0)}},{key:"_getEditorSectionScrollRatio",value:function(e,t){var n=e.end===e.start;return n?0:this._getEditorLineHeightGapInSection(e,t)/this._getEditorSectionHeight(e)}},{key:"_getScrollFactorsOfEditor",value:function(){var e=this.cm,t=e.getScrollInfo(),n=void 0,r=void 0,i=void 0,o=void 0;t=this._fallbackScrollInfoIfIncorrect(t);var a=t.height-t.top<=t.clientHeight;return a?o={isEditorBottom:a}:(n=e.coordsChar({left:t.left,top:t.top},"local").line,r=this.sectionManager.sectionByLine(n),i=this._getEditorSectionScrollRatio(r,n),o={section:r,sectionRatio:i}),o}},{key:"_getScrollInfoForMarkdown",value:function(){var e=this,t=this.sectionManager.getSectionList(),n=void 0;return a.default.forEachArray(t,function(t){var r=t.$previewSectionEl,i=r.parent().parent(),o=i[0].clientHeight-i.scrollTop()<=i[0].height,a=!0;return o?(n={isPreviewBottom:o},a=!1):e._isTopSection(i,r)&&(n={section:t,sectionRatio:e._getMarkdownEditorScrollRatio(i,r)},a=!1),a}),n}},{key:"_getMarkdownEditorScrollRatio",value:function(e,t){return(e.scrollTop()-t[0].offsetTop)/t.height()}},{key:"_getScrollTopForPreview",value:function(){var e=void 0,t=this._getScrollFactorsOfEditor(),n=t.section,r=t.sectionRatio;return t.isEditorBottom?e=this.$contents.height():n.$previewSectionEl&&(e=n.$previewSectionEl[0].offsetTop,e+=n.$previewSectionEl.height()*r-20),e=e&&Math.max(e,0)}},{key:"_getScrollTopForMarkdown",value:function(){var e=void 0,t=this._getScrollInfoForMarkdown(),n=t.sectionRatio;if(t.isPreviewBottom)e=this.cm.getScrollInfo().height;else if(t.section){var r=t.section,i=this.cm.charCoords({line:r.start,char:0},"local"),o=this.cm.charCoords({line:r.end,char:0},"local");e=i.top,e+=(o.top-i.top)*n}return e=e&&Math.max(e,0)}},{key:"syncPreviewScrollTopToMarkdown",value:function(){var e=this,t=this.$previewContainerEl,n=t.scrollTop(),r=this._getScrollTopForPreview();this.isPreviewScrollEventBlocked=!0,this._animateRun(n,r,function(n){clearTimeout(e.releaseTimer),t.scrollTop(n),e.releaseTimer=setTimeout(function(){e.isPreviewScrollEventBlocked=!1},15)})}},{key:"syncMarkdownScrollTopToPreview",value:function(){var e=this,t=this.cm,n=t.getScrollInfo(),r=n.top,i=this._getScrollTopForMarkdown();this.isMarkdownScrollEventBlocked=!0,this._animateRun(r,i,function(n){clearTimeout(e.releaseTimer),t.scrollTo(0,n),e.releaseTimer=setTimeout(function(){e.isMarkdownScrollEventBlocked=!1},15)})}},{key:"_animateRun",value:function(e,t,n){function r(){var l=Date.now(),s=(l-o)/200,u=void 0;s<1?(u=e+i*Math.cos((1-s)*Math.PI/2),n(Math.ceil(u)),a._currentTimeoutId=setTimeout(r,1)):(n(t),a._currentTimeoutId=null)}var i=t-e,o=Date.now(),a=this;this._currentTimeoutId&&clearTimeout(this._currentTimeoutId),r()}},{key:"_fallbackScrollInfoIfIncorrect",value:function(e){return e.height<0&&this._savedScrollInfo?this._savedScrollInfo:e}},{key:"saveScrollInfo",value:function(){this._savedScrollInfo=this.cm.getScrollInfo()}},{key:"_isTopSection",value:function(e,t){var n=e.scrollTop(),r=t[0].offsetTop,i=t.height(),o=n>=r-57,a=n>r+i;return o&&!a}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return this.nodeType===Node.ELEMENT_NODE}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/,u=/^ *(\*|-|\d+\.|[*-] \[[ xX]])\s/,c=/^ {0,3}(> ?)+\s/,d=/^ {0,3}!\[([^[\]]*)]\(([^)]*)\)/,f=/^ *(?:={1,}|-{1,})\s*$/,h=/^ *(`{3,}|~{3,})[ ]*$/,p=/^ *(`{3,}|~{3,})[ .]*(\S+)? */,g=/\s/g,v=function(){function e(t,n){r(this,e),this.cm=t,this.preview=n,this.$previewContent=n.$el.find(".tui-editor-contents"),this._sectionList=null,this._currentSection=null}return o(e,[{key:"_addNewSection",value:function(e,t){var n=this._makeSectionData(e,t);this._sectionList.push(n),this._currentSection=n}},{key:"getSectionList",value:function(){return this._sectionList||this.makeSectionList(),this._sectionList}},{key:"_makeSectionData",value:function(e,t){return{start:e,end:t,$previewSectionEl:null}}},{key:"_updateCurrentSectionEnd",value:function(e){this._currentSection.end=e}},{key:"_eachLineState",value:function(e){var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,a=!0,l=!1,s=!1,u="",c=!1,d=!1,f=void 0,h=this.cm.getDoc().lineCount();for(n=0;n<h;n+=1){t=!1,r=this.cm.getLine(n),i=this.cm.getLine(n+1)||"",o=this.cm.getLine(n-1)||"";var p=this._isCodeBlockEnd(o)&&f!==n-1;if(!l||r&&this._isTableCode(r)?!l&&this._isTable(r,i)&&(l=!0):l=!1,s&&p&&(s=!1),!s&&this._isCodeBlockStart(r)&&(s=this._doFollowedLinesHaveCodeBlockEnd(n,h),f=n),d&&0!==r.length?(this._isIndependentImage(s,l,r,o)?(c=!0,d=!0):(c=!1,d=!1),t=!0):this._isAtxHeader(r)?(c=!1,t=!0,d=!1):this._isCodeBlockEnd(r)||l||!this._isSeTextHeader(r,i)?this._isIndependentImage(s,l,r,o)?(c=!0,t=!0,d=!1):c&&0===r.length&&(c=!1,d=!0):(c=!1,t=!0,d=!1),a){if(!(u+=r.trim()))continue;a=!1}e(t,n)}}},{key:"_isIndependentImage",value:function(e,t,n,r){return!e&&!t&&this._isImage(n)&&!this._isList(n)&&!this._isQuote(n)&&0===r.length}},{key:"_doFollowedLinesHaveCodeBlockEnd",value:function(e,t){for(var n=!1,r=e+1;r<t;r+=1)if(this._isCodeBlockEnd(this.cm.getLine(r))){n=!0;break}return n}},{key:"_isCodeBlockStart",value:function(e){return p.test(e)}},{key:"_isCodeBlockEnd",value:function(e){return h.test(e)}},{key:"_isTable",value:function(e,t){return this._isTableCode(e)&&this._isTableAligner(t)}},{key:"_isTableCode",value:function(e){return/(^\S?.*\|.*)/.test(e)}},{key:"_isTableAligner",value:function(e){return/(\s*[-:]+\s*\|)+/.test(e)}},{key:"_isAtxHeader",value:function(e){return s.test(e)}},{key:"_isSeTextHeader",value:function(e,t){return""!==e.replace(g,"")&&!this._isQuote(e)&&t&&f.test(t)}},{key:"_isImage",value:function(e){return d.test(e)}},{key:"_isList",value:function(e){return u.test(e)}},{key:"_isQuote",value:function(e){return c.test(e)}},{key:"makeSectionList",value:function(){var e=this;this._sectionList=[],this._eachLineState(function(t,n){t||!e._sectionList.length?e._addNewSection(n,n):e._updateCurrentSectionEnd(n)})}},{key:"sectionMatch",value:function(){if(this.getSectionList()){var e=this._getPreviewSections();this._matchPreviewSectionsWithSectionlist(e)}}},{key:"_matchPreviewSectionsWithSectionlist",value:function(e){var t=this.getSectionList();e.forEach(function(e,n){var r=t[n];if(r){var i=(0,l.default)("<div class='content-id-"+n+"'></div>");r.$previewSectionEl=(0,l.default)(e).wrapAll(i).parent()}})}},{key:"_getPreviewSections",value:function(){var e=[],t=0,n=!1;return e[0]=[],this.$previewContent.contents().filter(i).each(function(r,i){var o="P"===i.tagName,a=i.tagName.match(/^(H1|H2|H3|H4|H5|H6)$/),l=o&&"IMG"===i.childNodes[0].nodeName;(a||l||n)&&e[t].length&&(e.push([]),t+=1,n=!1),l&&(n=!0),e[t].push(i)}),e}},{key:"sectionByLine",value:function(e){var t=void 0,n=this.getSectionList(),r=n.length;for(t=0;t<r&&!(e<=n[t].end);t+=1);return t===r&&(t=r-1),n[t]}}]),e}();t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.eventManager;if(e.toMarkOptions=e.toMarkOptions||{},e.toMarkOptions.renderer=_.default,u(t),!e.isViewer()){var n=e.wwEditor.componentManager,r=e.getUI().getPopupTableUtils();o(e),a(n),r&&H.default.updateContextMenu(r,t,n.getManager("tableSelection"))}}function o(e){e.addCommand(B.default),e.addCommand(D.default)}function a(e){e.removeManager("table"),e.removeManager("tableSelection"),e.addManager(w.default),e.addManager(E.default)}function l(e,t){var n=(0,d.default)("<div>"+e+"</div>"),r=n.find("table");return r.length&&(r.get().forEach(function(e){var n=t(e);(0,d.default)(e).replaceWith(n)}),e=n.html()),e}function s(e){var t=e.command;if(t.isWWType())switch(t.getName()){case"AddRow":e.command=T.default;break;case"AddCol":e.command=S.default;break;case"RemoveRow":e.command=x.default;break;case"RemoveCol":e.command=L.default;break;case"AlignCol":e.command=N.default}}function u(e){e.listen("convertorAfterMarkdownToHtmlConverted",function(e){return l(e,g.default)}),e.listen("convertorBeforeHtmlToMarkdownConverted",function(e){return l(e,m.default)}),e.listen("addCommandBefore",s)}var c=n(0),d=r(c),f=n(5),h=r(f);n(186);var p=n(187),g=r(p),v=n(188),m=r(v),y=n(189),_=r(y),b=n(190),w=r(b),k=n(191),E=r(k),C=n(192),T=r(C),M=n(193),S=r(M),O=n(194),x=r(O),I=n(195),L=r(I),A=n(196),N=r(A),P=n(197),B=r(P),R=n(198),D=r(R),j=n(199),H=r(j);h.default.defineExtension("table",i)},function(e,t,n){"use strict";var r=n(5),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=i.default.i18n;o&&(o.setLanguage(["ko","ko_KR"],{"Merge cells":"셀 병합","Unmerge cells":"셀 병합해제","Cannot change part of merged cell":"병합 된 셀의 일부를 변경할 수 없습니다.","Cannot paste row merged cells into the table header":"테이블 헤더에는 행 병합된 셀을 붙여넣을 수 없습니다."}),o.setLanguage(["en","en_US"],{"Merge cells":"Merge cells","Unmerge cells":"Unmerge cells","Cannot change part of merged cell":"Cannot change part of merged cell.","Cannot paste row merged cells into the table header":"Cannot paste row merged cells into the table header."}),o.setLanguage(["es","es_ES"],{"Merge cells":"Combinar celdas","Unmerge cells":"Separar celdas","Cannot change part of merged cell":"No se puede cambiar parte de una celda combinada.","Cannot paste row merged cells into the table header":"No se pueden pegar celdas combinadas en el encabezado de tabla."}),o.setLanguage(["ja","ja_JP"],{"Merge cells":"セルの結合","Unmerge cells":"セルの結合を解除","Cannot change part of merged cell":"結合されたセルの一部を変更することはできません。","Cannot paste row merged cells into the table header":"行にマージされたセルをヘッダーに貼り付けることはできません。"}),o.setLanguage(["nl","nl_NL"],{"Merge cells":"Cellen samenvoegen","Unmerge cells":"Samengevoegde cellen ongedaan maken","Cannot change part of merged cell":"Kan geen deel uit van een samengevoegde cel veranderen.","Cannot paste row merged cells into the table header":"Kan geen rij met samengevoegde cellen in de koptekst plakken."}),o.setLanguage(["zh","zh_CN"],{"Merge cells":"合并单元格","Unmerge cells":"取消合并单元格","Cannot change part of merged cell":"无法更改合并单元格的一部分。","Cannot paste row merged cells into the table header":"无法将行合并单元格粘贴到标题中。"}),o.setLanguage(["de","de_DE"],{"Merge cells":"Zellen zusammenführen","Unmerge cells":"Zusammenführen rückgängig machen","Cannot change part of merged cell":"Der Teil der verbundenen Zelle kann nicht geändert werden.","Cannot paste row merged cells into the table header":"Die Zeile der verbundenen Zellen kann nicht in die Kopfzeile eingefügt werden."}),o.setLanguage(["ru","ru_RU"],{"Merge cells":"Объединить ячейки","Unmerge cells":"Разъединить ячейки","Cannot change part of merged cell":"Вы не можете изменять часть комбинированной ячейки.","Cannot paste row merged cells into the table header":"Вы не можете вставлять объединенные ячейки в заголовок таблицы."}),o.setLanguage(["fr","fr_FR"],{"Merge cells":"Fusionner les cellules","Unmerge cells":"Séparer les cellules","Cannot change part of merged cell":"Impossible de modifier une partie de la cellule fusionnée.","Cannot paste row merged cells into the table header":"Impossible de coller les cellules fusionnées dans l'en-tête du tableau."}),o.setLanguage(["uk","uk_UA"],{"Merge cells":"Об'єднати комірки","Unmerge cells":"Роз'єднати комірки","Cannot change part of merged cell":"Ви не можете змінювати частину комбінованої комірки.","Cannot paste row merged cells into the table header":"Ви не можете вставляти об'єднані комірки в заголовок таблиці."}),o.setLanguage(["tr","tr_TR"],{"Merge cells":"Hücreleri birleştir","Unmerge cells":"Hücreleri ayır","Cannot change part of merged cell":"Birleştirilmiş hücrelerin bir kısmı değiştirelemez.","Cannot paste row merged cells into the table header":"Satırda birleştirilmiş hücreler sütun başlığına yapıştırılamaz"}),o.setLanguage(["fi","fi_FI"],{"Merge cells":"Yhdistä solut","Unmerge cells":"Jaa solut","Cannot change part of merged cell":"Yhdistettyjen solujen osaa ei voi muuttaa","Cannot paste row merged cells into the table header":"Soluja ei voi yhdistää taulukon otsikkoriviin"}),o.setLanguage(["cs","cs_CZ"],{"Merge cells":"Spojit buňky","Unmerge cells":"Rozpojit buňky","Cannot change part of merged cell":"Nelze měnit část spojené buňky","Cannot paste row merged cells into the table header":"Nelze vkládat spojené buňky do záhlaví tabulky"}),o.setLanguage(["ar","ar_AR"],{"Merge cells":"دمج الوحدات","Unmerge cells":"إلغاء دمج الوحدات","Cannot change part of merged cell":"لا يمكن تغيير جزء من الخلية المدموجة","Cannot paste row merged cells into the table header":"لا يمكن لصق الخلايا المدموجة من صف واحد في رأس الجدول"}),o.setLanguage(["pl","pl_PL"],{"Merge cells":"Scal komórki","Unmerge cells":"Rozłącz komórki","Cannot change part of merged cell":"Nie można zmienić części scalonej komórki.","Cannot paste row merged cells into the table header":"Nie można wkleić komórek o scalonym rzędzie w nagłówek tabeli."}),o.setLanguage(["zh","zh_TW"],{"Merge cells":"合併儲存格","Unmerge cells":"取消合併儲存格","Cannot change part of merged cell":"無法變更儲存格的一部分。","Cannot paste row merged cells into the table header":"無法將合併的儲存格貼上至表格標題中。"}))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=new RegExp("^((?:"+n+"=[0-9]+:)?)"+t+"=([0-9]+):(.*)"),i=r.exec(e),o=1;return i&&(o=parseInt(i[2],10),e=i[1]+i[3]),[o,e]}function o(e){var t=e.nodeName,n=e.align||"",r=e.innerHTML.trim(),o=null,a=null,l=i(r,"@cols","@rows");o=l[0],r=l[1];var s=i(r,"@rows","@cols");return a=s[0],r=s[1],{nodeName:t,colspan:o,rowspan:a,content:r,align:n}}function a(e){return e.find("tr").get().map(function(e){return(0,p.default)(e).find("td, th").get().map(o)})}function l(e,t){var n=-1;return v.default.forEach(e,function(e,r){var i=!0;return t(e,r)&&(n=r,i=!1),i}),n}function s(e){var t=l(e,function(e){return"TD"===e[0].nodeName});return[e.slice(0,t),e.slice(t)]}function u(e){e.forEach(function(e){var t=e.length,n=0;e.forEach(function(e){n+=e.colspan-1}),e.splice(t-n)})}function c(e){var t=e.map(function(e,t){return t}),n=t.map(function(){return 0});return e.forEach(function(e,r){var i=e.filter(function(e){return e.rowspan>1}),o=r+1;i.forEach(function(e){var r=e.colspan,i=o+(e.rowspan-1);t.slice(o,i).forEach(function(e){n[e]+=r})})}),n}function d(e){var t=c(e);e.forEach(function(e,n){e.splice(e.length-t[n])})}function f(e){var t=a((0,p.default)(e)),n=s(t),r=n[0],i=n[1];return u(r),u(i),d(i),(0,p.default)(y.default.createTableHtml(t))[0]}Object.defineProperty(t,"__esModule",{value:!0}),t._extractPropertiesForMerge=i,t._parseTableCell=o,t._createTableObjectFrom$Table=a,t._divideTrs=s,t._mergeByColspan=u,t._getRemovalTdCountsByRowspan=c,t._mergeByRowspan=d,t.default=f;var h=n(0),p=r(h),g=n(1),v=r(g),m=n(8),y=r(m)},function(e,t,n){"use strict";function r(e){var t=(0,a.default)(e),n=t.attr("colspan")||"",r=t.attr("rowspan")||"",i=t.html();n&&(i="@cols="+n+":"+i),r&&(i="@rows="+r+":"+i),i&&t.html(i)}function i(e){return(0,a.default)(e).find("td, th").get().forEach(r),e}Object.defineProperty(t,"__esModule",{value:!0}),t._prependMergeSyntaxToContent=r,t.default=i;var o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return d.default.range(0,t).map(function(){return e}).join("")}function o(e){var t=e.align,n=(e.textContent||e.innerText).replace(p,""),r=n.length,o="",a="";return t&&("left"===t?(o=":",r-=1):"right"===t?(a=":",r-=1):"center"===t&&(a=":",o=":",r-=2)),r=Math.max(r,3),o+i("-",r)+a}function a(e){var t=0;return e.filter(function(e){return(0,u.default)(e).attr("colspan")}).forEach(function(e){t+=parseInt((0,u.default)(e).attr("colspan"),10)-1}),t}function l(e,t){var n=(0,u.default)(e).find("th").get(),r=n.map(function(e){return" "+o(e)+" |"}).join("");return r+=i(" --- |",a(n)),t?t+"|"+r+"\n":""}Object.defineProperty(t,"__esModule",{value:!0}),t._getAdditionalThCount=a,t._createTheadMarkdown=l;var s=n(0),u=r(s),c=n(1),d=r(c),f=n(42),h=r(f),p=/@cols=[0-9]+:/g;t.default=h.default.Renderer.factory(h.default.gfmRenderer,{THEAD:l})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=!1;return f.default.forEach(e,function(e){return!(n=t(e))}),n}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=r(u),d=n(1),f=r(d),h=n(5),p=r(h),g=n(6),v=r(g),m=n(8),y=r(m),_=n(9),b=r(_),w=p.default.WwTableManager,k=p.default.i18n,E=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),s(t,[{key:"_updateCopyDataMergeWith",value:function(e,t){e.forEach(function(e){e.forEach(function(e){f.default.isExisty(e.rowMergeWith)&&(e.rowMergeWith-=t.rowIndex),f.default.isExisty(e.colMergeWith)&&(e.colMergeWith-=t.colIndex)})})}},{key:"_createCopyTableData",value:function(e,t,n){var r=e.slice(t.rowIndex,n.rowIndex+1);return r=r.map(function(e){return e.slice(t.colIndex,n.colIndex+1)}),this._updateCopyDataMergeWith(r,t),r}},{key:"updateTableHtmlOfClipboardIfNeed",value:function(e){var t=this.wwe.componentManager.getManager("tableSelection").getSelectedCells();if(t.length){var n=v.default.createTableData((0,c.default)(t[0]).closest("TABLE")),r=b.default.getTableSelectionRange(n,t),i=r.start,o=r.end,a=this._createCopyTableData(n,i,o),l=v.default.createCellIndexData(a),s=v.default.createRenderData(a,l);e.html(y.default.createTableHtml(s))}}},{key:"prepareToTableCellStuffing",value:function(e){var t=e[0].length,n=!1;return e.slice(1).forEach(function(e){var r=e.length;t!==r&&(n=!0,t<r&&(t=r))}),{maximumCellLength:t,needTableCellStuffingAid:n}}},{key:"tableCellAppendAidForTableElement",value:function(e){var t=(0,c.default)(e),n=v.default.createTableData(t),r=v.default.addTbodyOrTheadIfNeed(n),i=this.prepareToTableCellStuffing(n),o=i.needTableCellStuffingAid;o&&v.default.stuffCellsIntoIncompleteRow(n,i.maximumCellLength),(r||o)&&y.default.replaceTable(t,n)}},{key:"_findStartCell",value:function(e){return 1===e.length?e.get(0):this.wwe.getEditor().getSelection().startContainer}},{key:"_findStartCellIndex",value:function(e,t){var n=v.default.createCellIndexData(e);return v.default.findCellIndex(n,t)}},{key:"_hasRowMergedHeader",value:function(e,t,n){var r="TH"===t[n.rowIndex][n.colIndex].nodeName,i=l(e[0],function(e){return e.rowspan&&e.rowspan>1});return r&&i}},{key:"_isExactlyFit",value:function(e,t,n){return t%e.length==0&&n%e[0].length==0}},{key:"_updateClipboardTableData",value:function(e,t,n){var r=e.length,i=e[0].length,o=parseInt(t/r,10),a=parseInt(n/i,10);if(o>1){var l=JSON.parse(JSON.stringify(e));f.default.range(0,o-1).forEach(function(){var t=JSON.parse(JSON.stringify(l));e.push.apply(e,t)})}if(a>1){var s=JSON.parse(JSON.stringify(e));f.default.range(0,a-1).forEach(function(){var t=JSON.parse(JSON.stringify(s));e.forEach(function(e,n){e.push.apply(e,t[n])})})}}},{key:"_updateTableDataByClipboardData",value:function(e,t,n){var r=n.rowIndex,i=n.colIndex;e.forEach(function(e,n){var o=r+n;e.forEach(function(e,n){var r=i+n,a=t[o][r];e.nodeName=a.nodeName,t[o][r]=e})})}},{key:"_isPossibleToPaste",value:function(e,t,n){var r=t.rowIndex,i=t.colIndex,o=n.rowIndex,a=n.colIndex,s=e.slice(r,o+1),u=s[0].slice(i,a+1),c=!l(u,function(e){return f.default.isExisty(e.rowMergeWith)});if(c){c=!l(f.default.pluck(s,i),function(e){return f.default.isExisty(e.colMergeWith)})}if(c&&e.length>o+1){c=!l(e[o+1].slice(i,a+1),function(e){return f.default.isExisty(e.rowMergeWith)})}if(c&&e[0].length>a+1){c=!l(f.default.pluck(s,a+1),function(e){return f.default.isExisty(e.colMergeWith)})}return c}},{key:"_spliceClipboardData",value:function(e,t,n){e.splice(t),e.forEach(function(e){e.splice(n)})}},{key:"_bookmarkLastTd",value:function(e){var t=e.rowIndex,n=e.colIndex,r=this.wwe.getEditor(),i=r.get$Body().find(".tui-paste-table-bookmark"),o=v.default.createTableData(i),a=o[t][n];t=f.default.isExisty(a.rowMergeWith)?a.rowMergeWith:t,n=f.default.isExisty(a.colMergeWith)?a.colMergeWith:n;var l=o[t][n].elementIndex,s=i.find("tr").eq(l.rowIndex).children()[l.colIndex];i.removeClass("tui-paste-table-bookmark"),(0,c.default)(s).addClass("tui-paste-table-cell-bookmark")}},{key:"_updateClipboardDataForPasteToSamllerSelectedArea",value:function(e,t,n,r,i){var o=!0,a={rowIndex:0,colIndex:0},l={rowIndex:n-1,colIndex:r-1};return this._isPossibleToPaste(e,a,l)?(this._spliceClipboardData(e,n,r),this._updateTableDataByClipboardData(e,t,i)):o=!1,o}},{key:"_pasteToSelectedArea",value:function(e,t,n,r){var i=b.default.getTableSelectionRange(n,r),o=i.start,a=i.end,l=a.rowIndex-o.rowIndex+1,s=a.colIndex-o.colIndex+1,u=t.length,c=t[0].length,d=l>=u&&s>=c,f=k.get("Cannot change part of merged cell"),h=!0,p=void 0;this._hasRowMergedHeader(t,n,o)?(f=k.get("Cannot paste row merged cells into the table header"),h=!1):this._isExactlyFit(t,l,s)?(p=a,this._updateClipboardTableData(t,l,s),this._updateTableDataByClipboardData(t,n,o)):d?(p={rowIndex:o.rowIndex+u-1,colIndex:o.colIndex+c-1},this._isPossibleToPaste(n,o,p)?this._updateTableDataByClipboardData(t,n,o):h=!1):(p={rowIndex:o.rowIndex+l-1,colIndex:o.colIndex+s-1},h=this._updateClipboardDataForPasteToSamllerSelectedArea(t,n,l,s,o)),h?(n.className+=" tui-paste-table-bookmark",y.default.replaceTable(e,n),this._bookmarkLastTd(p)):(alert(f),this.wwe.focus())}},{key:"_findEndCellIndex",value:function(e,t){var n=t.rowIndex,r=t.colIndex;return{rowIndex:n+e.length-1,colIndex:r+e[0].length-1}}},{key:"_expandRow",value:function(e,t){var n=e.length,r=e[0].length,i=f.default.range(n,n+t).map(function(e){return f.default.range(0,r).map(function(t){return v.default.createBasicCell(e,t)})});e.push.apply(e,i)}},{key:"_expandCoumn",value:function(e,t){var n=e[0].length,r=f.default.range(n,n+t);e.forEach(function(e,t){var n=e[0].nodeName,i=r.map(function(e){return v.default.createBasicCell(t,e,n)});e.push.apply(e,i)})}},{key:"_expandTableDataIfNeed",value:function(e,t,n){var r=n.rowIndex-e.length+1,i=n.colIndex-e[0].length+1;r>0&&this._expandRow(e,r),i>0&&this._expandCoumn(e,i)}},{key:"_pasteAllClipboardTableData",value:function(e,t,n,r){var i=this._findEndCellIndex(t,r);if(this._hasRowMergedHeader(t,n,r))return alert(k.get("Cannot paste row merged cells into the table header")),void this.wwe.focus();this._expandTableDataIfNeed(n,r,i),this._isPossibleToPaste(n,r,i)?(this._updateTableDataByClipboardData(t,n,r),n.className+=" tui-paste-table-bookmark",y.default.replaceTable(e,n),this._bookmarkLastTd(i)):(alert(k.get("Cannot change part of merged cell")),this.wwe.focus())}},{key:"pasteTableData",value:function(e){var t=(0,c.default)(e),n=v.default.createTableData(t),r=this.wwe.componentManager.getManager("tableSelection"),i=r.getSelectedCells(),o=(0,c.default)(this._findStartCell(i)),a=o.closest("table"),l=v.default.createTableData(a),s=this._findStartCellIndex(l,o);i.length>1?this._pasteToSelectedArea(a,n,l,i):this._pasteAllClipboardTableData(a,n,l,s)}}]),t}(w);t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(1),d=r(c),f=n(5),h=r(f),p=n(6),g=r(p),v=n(9),m=r(v),y=h.default.WwTableSelectionManager,_=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._tableData=null,n.mergedTableSelectionManager=!0,n}return a(t,e),l(t,[{key:"_addClassToSelectedCells",value:function(e,t,n){var r=n.start,i=n.end,o=d.default.range(r.colIndex,i.colIndex+1),a=e.find("tr");d.default.range(r.rowIndex,i.rowIndex+1).forEach(function(e){var n=t[e],r=a.eq(e).find("td, th");return o.forEach(function(e){n[e].elementIndex&&r.eq(n[e].elementIndex.colIndex).addClass("te-cell-selected")})})}},{key:"onDragStart",value:function(e){var t=(0,u.default)(e).closest("[contenteditable=true] table");this._tableData=g.default.createTableData(t)}},{key:"onDragEnd",value:function(){this._tableData=null}},{key:"highlightTableCellsBy",value:function(e,t){var n=(0,u.default)(e),r=(0,u.default)(t),i=n.closest("[contenteditable=true] table"),o=m.default.findSelectionRange(this._tableData,n,r);this.removeClassAttrbuteFromAllCellsIfNeed(),this._addClassToSelectedCells(i,this._tableData,o)}},{key:"styleToSelectedCells",value:function(e,t){var n=this.wwe.getEditor(),r=n.getSelection().cloneRange();(0,u.default)(r.startContainer).closest("[contenteditable=true] table").find("tr").get().forEach(function(i){var o=(0,u.default)(i).find(".te-cell-selected"),a=o.first().get(0),l=o.last().get(0);o.length&&(r.setStart(a,0),r.setEnd(l,l.childNodes.length),n.setSelection(r),e(n,t))})}},{key:"hasSelectedBothThAndTd",value:function(e){return e=e||this.getSelectedCells(),e.first()[0].nodeName!==e.last()[0].nodeName}}]),t}(y);t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return{nodeName:"TD",rowMergeWith:e}}function o(e,t){var n=null;return e[t].map(function(r,o){var a=void 0;if(d.default.isExisty(r.rowMergeWith)){var l=r.rowMergeWith,s=e[l][o],u=l+s.rowspan-1;d.default.isExisty(s.colMergeWith)&&n?a=d.default.extend({},n):u>t&&(s.rowspan+=1,a=d.default.extend({},r))}else r.rowspan>1&&(r.rowspan+=1,a=i(t));return a||(a=g.default.createBasicCell(t+1,o)),n=a,a})}function a(e,t){var n=t.start.rowIndex,r=t.end,i=g.default.findRowMergedLastIndex(e,r.rowIndex,r.colIndex),a=d.default.range(n,i+1).map(function(){return o(e,i)});e.splice.apply(e,[i+1,0].concat(a))}function l(e,t,n){var r=g.default.createTableData(e),i=g.default.findRowMergedLastIndex(r,t,n)+1,o=g.default.findElementIndex(r,i,n);return e.find("tr").eq(o.rowIndex).find("td")[o.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewRow=o,t._addRow=a;var s=n(0),u=r(s),c=n(1),d=r(c),f=n(5),h=r(f),p=n(6),g=r(p),v=n(9),m=r(v),y=n(8),_=r(y),b=h.default.CommandManager,w=void 0;b&&(w=b.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,u.default)(n.startContainer),i=r.closest("table"),o=g.default.createTableData(i),s=e.componentManager.getManager("tableSelection").getSelectedCells(),c=m.default.getTableSelectionRange(o,s,r);t.saveUndoState(n),a(o,c);var d=_.default.replaceTable(i,o),f=l(d,c.end.rowIndex,c.start.colIndex);_.default.focusToCell(t,n,f)}}})),t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return{nodeName:t,colMergeWith:e}}function o(e,t,n,r){var o=e[n],a=void 0;if(f.default.isExisty(o.colMergeWith)){var l=o.colMergeWith,s=e[l],u=l+s.colspan-1;f.default.isExisty(s.rowMergeWith)&&r?a=f.default.extend({},r):u>n&&(s.colspan+=1,a=f.default.extend({},o))}else o.colspan>1&&(o.colspan+=1,a=i(n,o.nodeName));return a||(a=v.default.createBasicCell(t,n+1,o.nodeName)),a}function a(e,t,n){var r=f.default.range(t,n+1),i=[],a=null;return e.forEach(function(e,t){var l=r.map(function(r,i){var l=a?a[i-1]:null;return o(e,t,n,l)});a=l,i.push(l)}),i}function l(e,t){var n=t.end,r=v.default.findColMergedLastIndex(e,n.rowIndex,n.colIndex),i=a(e,t.start.colIndex,r),o=r+1;e.forEach(function(e,t){e.splice.apply(e,[o,0].concat(i[t]))})}function s(e,t,n){var r=v.default.createTableData(e),i=v.default.findColMergedLastIndex(r,t,n)+1,o=v.default.findElementIndex(r,t,i);return e.find("tr").eq(o.rowIndex).find("td, th")[o.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewColumns=a,t._addColumns=l;var u=n(0),c=r(u),d=n(1),f=r(d),h=n(5),p=r(h),g=n(6),v=r(g),m=n(9),y=r(m),_=n(8),b=r(_),w=p.default.CommandManager,k=void 0;w&&(k=w.command("wysiwyg",{name:"AddCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,c.default)(n.startContainer),i=r.closest("table"),o=v.default.createTableData(i),a=e.componentManager.getManager("tableSelection").getSelectedCells(),u=y.default.getTableSelectionRange(o,a,r);t.saveUndoState(n),l(o,u);var d=b.default.replaceTable(i,o),f=s(d,u.start.rowIndex,u.end.colIndex);b.default.focusToCell(t,n,f)}}})),t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){d.default.range(t,n+1).forEach(function(t){e[t].forEach(function(r,i){if(d.default.isExisty(r.rowMergeWith)){var o=e[r.rowMergeWith][i];o.rowspan&&(o.rowspan-=1)}else if(r.rowspan>1){var a=t+r.rowspan-1;r.rowspan-=n-t+1,a>n&&(e[n+1][i]=d.default.extend({},r))}})})}function o(e,t,n){e.slice(n+1).forEach(function(e){e.forEach(function(e){d.default.isExisty(e.rowMergeWith)&&e.rowMergeWith>=t&&(e.rowMergeWith=n+1)})})}function a(e,t){var n=t.start.rowIndex,r=t.end,a=g.default.findRowMergedLastIndex(e,r.rowIndex,r.colIndex);if(0!==n||0!==a){n=Math.max(n,1),a=Math.max(a,1);var l=a-n+1;e.length-l<2?e.splice(0,e.length):(i(e,n,a),o(e,n,a),e.splice(n,l))}}function l(e,t,n){var r=g.default.createTableData(e);r.length-1<t&&(t-=1);var i=g.default.findElementIndex(r,t,n);return e.find("tr").eq(i.rowIndex).find("th,td")[i.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._removeRow=a;var s=n(0),u=r(s),c=n(1),d=r(c),f=n(5),h=r(f),p=n(6),g=r(p),v=n(9),m=r(v),y=n(8),_=r(y),b=h.default.CommandManager,w=void 0;b&&(w=b.command("wysiwyg",{name:"RemoveRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,u.default)(n.startContainer),i=r.closest("table"),o=g.default.createTableData(i),s=o.length,c=e.componentManager.getManager("tableSelection").getSelectedCells(),d=m.default.getTableSelectionRange(o,c,r);if(t.saveUndoState(n),a(o,d),o.length<2)i.remove();else if(s!==o.length){var f=_.default.replaceTable(i,o),h=d.start.rowIndex,p=h<o.length?h:h-1,v=l(f,p,d.start.colIndex);_.default.focusToCell(t,n,v)}}}})),t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){e.forEach(function(e){d.default.range(t,n+1).forEach(function(t){var r=e[t];if(d.default.isExisty(r.colMergeWith)){var i=e[r.colMergeWith];i.colspan&&(i.colspan-=1)}else if(r.colspan>1){var o=t+r.colspan-1;r.colspan-=n-t+1,o>n&&(e[n+1]=d.default.extend({},r))}})})}function o(e,t,n){e.forEach(function(e){e.slice(n+1).forEach(function(e){d.default.isExisty(e.colMergeWith)&&e.colMergeWith>=t&&(e.colMergeWith=n+1)})})}function a(e,t){var n=t.start.colIndex,r=t.end,a=g.default.findColMergedLastIndex(e,r.rowIndex,r.colIndex),l=a-n+1;i(e,n,a),o(e,n,a),e.forEach(function(e){e.splice(n,l)})}function l(e,t,n){var r=g.default.createTableData(e);r[0].length-1<n&&(n-=1);var i=g.default.findElementIndex(r,t,n);return e.find("tr").eq(i.rowIndex).find("td, th")[i.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._removeColumns=a;var s=n(0),u=r(s),c=n(1),d=r(c),f=n(5),h=r(f),p=n(6),g=r(p),v=n(9),m=r(v),y=n(8),_=r(y),b=h.default.CommandManager,w=void 0;b&&(w=b.command("wysiwyg",{name:"RemoveCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,u.default)(n.startContainer),i=r.closest("table"),o=g.default.createTableData(i),s=e.componentManager.getManager("tableSelection").getSelectedCells(),c=m.default.getTableSelectionRange(o,s,r),d=o[0].length;if(t.saveUndoState(n),a(o,c),0===o[0].length)i.remove();else if(d!==o[0].length){var f=_.default.replaceTable(i,o),h=c.start.colIndex,p=h>=o[0].length?h-1:h,v=l(f,c.start.rowIndex,p);_.default.focusToCell(t,n,v)}}}})),t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n,r){u.default.range(t,n+1).forEach(function(t){var n=e[t];u.default.isExisty(n.colMergeWith)?e[n.colMergeWith].align=r:n.align=r})}function o(e,t){var n=h.default.findElementRowIndex(t),r=h.default.findElementColIndex(t);return e.find("tr").eq(n).find("td, th")[r]}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),s=n(1),u=r(s),c=n(5),d=r(c),f=n(6),h=r(f),p=n(9),g=r(p),v=n(8),m=r(v),y=d.default.CommandManager,_=void 0;y&&(_=y.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),r=n.getSelection().cloneRange();if(e.focus(),n.hasFormat("TABLE")){var a=(0,l.default)(r.startContainer),s=a.closest("table"),u=h.default.createTableData(s),c=e.componentManager.getManager("tableSelection").getSelectedCells(),d=g.default.getTableSelectionRange(u,c,a);i(u[0],d.start.colIndex,d.end.colIndex,t);var f=m.default.replaceTable(s,u),p=o(f,a);m.default.focusToCell(n,r,p)}}})),t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r,i=n+1,o=(r=[]).concat.apply(r,e.map(function(e){return e.slice(t,i)})),a=o.filter(function(e){var t=e.content;return t&&t!==E});return a.length?a[0].content:E}function o(e,t,n){var r,i=n+1,o=e.map(function(e){return e.slice(t,i)});(r=[]).concat.apply(r,o).slice(1).forEach(function(e){var t=e.nodeName;h.default.forEach(e,function(t,n){return delete e[n]}),e.nodeName=t})}function a(e,t,n,r){var i=n+1;e.forEach(function(e){e.slice(t,i).forEach(function(e){e.rowMergeWith=r})})}function l(e,t,n,r){var i=n+1;e.forEach(function(e){e.slice(t,i).forEach(function(e){e.colMergeWith=r})})}function s(e,t){var n=t.start,r=t.end,s=n.rowIndex,u=n.colIndex,c=r.rowIndex,d=r.colIndex,f=e[s][u],h=e.slice(s,c+1),p=c-s+1,g=d-u+1;f.rowspan=p,f.colspan=g,f.content=i(h,u,d),o(h,u,d),p>1&&a(h.slice(1),u,d,s),g>1&&l(h,u+1,d,u)}function u(e,t,n){var r=m.default.createTableData(e),i=m.default.findElementIndex(r,t,n);return e.find("tr").eq(i.rowIndex).find("td, th")[i.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._mergeCells=s;var c=n(0),d=r(c),f=n(1),h=r(f),p=n(5),g=r(p),v=n(6),m=r(v),y=n(9),_=r(y),b=n(8),w=r(b),k=g.default.CommandManager,E=h.default.browser.msie?"":"<br>",C=void 0;k&&(C=k.command("wysiwyg",{name:"MergeCells",exec:function(e){var t=e.getEditor();if(e.focus(),t.hasFormat("TABLE")){var n=e.componentManager.getManager("tableSelection"),r=n.getSelectedCells();if(!(r.length<2||n.hasSelectedBothThAndTd(r))){var i=t.getSelection().cloneRange(),o=(0,d.default)(i.startContainer),a=o.closest("table"),l=m.default.createTableData(a),c=_.default.getTableSelectionRange(l,r,o);s(l,c);var f=w.default.replaceTable(a,l),h=u(f,c.start.rowIndex,c.start.colIndex);w.default.focusToCell(t,i,h)}}}})),t.default=C},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n,r=t.start,i=t.end,o=r.colIndex,a=i.colIndex+1,l=e.slice(r.rowIndex,i.rowIndex+1),s=l.map(function(e){return e.slice(o,a)});return!!(n=[]).concat.apply(n,s).filter(function(e){return e.colspan>1||e.rowspan>1}).length}function o(e,t,n,r,i){var o=t+r,a=n+i,l=d.default.range(n,a);d.default.range(t,o).forEach(function(n){var r=e[n],i=n===t?1:0;l.slice(i).forEach(function(e){r[e]=g.default.createBasicCell(n,e,r[e].nodeName)})})}function a(e,t){var n=t.start,r=t.end,i=d.default.range(n.colIndex,r.colIndex+1);d.default.range(n.rowIndex,r.rowIndex+1).forEach(function(t){i.forEach(function(n){var r=e[t][n],i=r.colspan,a=r.rowspan;(i>1||a>1)&&(r.colspan=1,r.rowspan=1,o(e,t,n,a,i))})})}function l(e,t,n){var r=g.default.createTableData(e),i=g.default.findElementIndex(r,t,n);return e.find("tr").eq(i.rowIndex).find("td, th")[i.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._hasMergedCell=i,t._unmergeCells=a;var s=n(0),u=r(s),c=n(1),d=r(c),f=n(5),h=r(f),p=n(6),g=r(p),v=n(9),m=r(v),y=n(8),_=r(y),b=h.default.CommandManager,w=void 0;b&&(w=b.command("wysiwyg",{name:"UnmergeCells",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,u.default)(n.startContainer),o=r.closest("table"),s=g.default.createTableData(o),c=e.componentManager.getManager("tableSelection").getSelectedCells(),d=m.default.getTableSelectionRange(s,c,r);if(i(s,d)){a(s,d);var f=_.default.replaceTable(o,s),h=l(f,d.start.rowIndex,d.start.colIndex);_.default.focusToCell(t,n,h)}}}})),t.default=w},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=['<button type="button" class="te-table-add-row">'+d.get("Add row")+"</button>",'<button type="button" class="te-table-add-col">'+d.get("Add col")+"</button>",'<button type="button" class="te-table-remove-row">'+d.get("Remove row")+"</button>",'<button type="button" class="te-table-remove-col">'+d.get("Remove col")+"</button>","<hr/>",'<button type="button" class="te-table-merge">'+d.get("Merge cells")+"</button>",'<button type="button" class="te-table-unmerge">'+d.get("Unmerge cells")+"</button>","<hr/>",'<button type="button" class="te-table-col-align-left">'+d.get("Align left")+"</button>",'<button type="button" class="te-table-col-align-center">'+d.get("Align center")+"</button>",'<button type="button" class="te-table-col-align-right">'+d.get("Align right")+"</button>","<hr/>",'<button type="button" class="te-table-remove">'+d.get("Remove table")+"</button>"].join(""),n=(0,s.default)(t);e.setContent(n)}function o(e,t,n){var r=e.$content,i=(0,s.default)(r[5]),o=(0,s.default)(r[6]),a=(0,s.default)(r[7]);e.on("click .te-table-merge",function(){t.emit("command","MergeCells")}),e.on("click .te-table-unmerge",function(){t.emit("command","UnmergeCells")}),t.listen("openPopupTableUtils",function(){var e=n.getSelectedCells(),t=e.length;t?(t<2||n.hasSelectedBothThAndTd(e)?i.hide():i.show(),e.is("[rowspan], [colspan]")?o.show():o.hide(),a.show()):(i.hide(),o.hide(),a.hide())})}function a(e,t,n){i(e),o(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=r(l),u=n(5),c=r(u),d=c.default.i18n;t.default={updateContextMenu:a}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.options.colorSyntax,n=void 0===t?{}:t,r=n.preset,i=n.useCustomSyntax,u=void 0!==i&&i;e.eventManager.listen("convertorAfterMarkdownToHtmlConverted",function(e){return u?e.replace(_,function(e,t,n){return s(n,t).result}):e}),e.eventManager.listen("convertorAfterHtmlToMarkdownConverted",function(e){var t=u?w:b;return e.replace(t,function(e,t,n){return t.match(k)&&(t=c(t)),u?l(n,t).result:e.replace(/ ?class="colour" ?/g," ").replace(k,t)})}),e.isViewer()||"default"!==e.getUI().name||(e.addCommand("markdown",{name:"color",exec:function(e,t){var n=e.getEditor(),r=n.getCursor("from"),i=n.getCursor("to"),o=void 0,a=void 0;if(t){if(u){var c=l(n.getSelection(),t);o=c.result,a=c.from,n.replaceSelection(o)}else{var d=s(n.getSelection(),t);o=d.result,a=d.from,n.replaceSelection(o)}n.setSelection({line:r.line,ch:r.ch+a},{line:i.line,ch:r.line===i.line?i.ch+a:i.ch}),e.focus()}}}),e.addCommand("wysiwyg",{name:"color",exec:function(e,t){if(t){var n=e.getEditor(),r=e.componentManager.getManager("tableSelection");if(n.hasFormat("table")&&r.getSelectedCells().length){r.styleToSelectedCells(o,t);var i=n.getSelection();i.collapse(!0),n.setSelection(i)}else o(n,t)}}}),a(e,r))}function o(e,t){e.hasFormat("PRE")||(t===E?e.changeFormat(null,{class:"colour",tag:"span"}):e.setTextColour(t))}function a(e,t){var n=e.i18n,r=e.getUI().getToolbar(),i=e.options.usageStatistics;e.eventManager.addEventType("colorButtonClicked"),r.insertItem(3,{type:"button",options:{name:"colorSyntax",className:"tui-color",event:"colorButtonClicked",tooltip:n.get("Text color")}});var o=r.indexOfItem("colorSyntax"),a=r.getItem(o),l=a.$el,s=(0,p.default)("<div />"),u=(0,p.default)('<button type="button" class="te-apply-button">'+n.get("OK")+"</button>"),c={container:s[0],usageStatistics:i};t&&(c.preset=t);var d=v.default.create(c),f=d.getColor();s.append(u);var h=e.getUI().createPopup({header:!1,title:!1,content:s,className:"tui-popup-color",$target:e.getUI().getToolbar().$el,css:{width:"auto",position:"absolute"}});e.eventManager.listen("focus",function(){h.hide()}),e.eventManager.listen("colorButtonClicked",function(){if(h.isShow())return void h.hide();var t=l.get(0),n=t.offsetTop,r=t.offsetLeft;h.$el.css({top:n+l.outerHeight(),left:r}),d.slider.toggle(!0),e.eventManager.emit("closeAllPopup"),h.show()}),e.eventManager.listen("closeAllPopup",function(){h.hide()}),e.eventManager.listen("removeEditor",function(){d.off("selectColor"),h.$el.find(".te-apply-button").off("click"),h.remove()}),d.on("selectColor",function(t){f=t.color,"palette"===t.origin&&(e.exec("color",f),h.hide())}),h.$el.find(".te-apply-button").on("click",function(){e.exec("color",f)})}function l(e,t){return u("{color:"+t+"}",e,"{color}")}function s(e,t){return u('<span style="color:'+t+'">',e,"</span>")}function u(e,t,n){return{result:""+e+t+n,from:e.length,to:e.length+t.length}}function c(e){return e.replace(k,function(e,t,n,r){return"#"+d(t)+d(n)+d(r)})}function d(e){var t=parseInt(e,10);return t=t.toString(16),t=f(t)}function f(e){var t="00"+e;return t.substr(t.length-2)}Object.defineProperty(t,"__esModule",{value:!0});var h=n(0),p=r(h),g=n(201),v=r(g),m=n(5),y=r(m),_=/\{color:(.+?)}(.*?)\{color}/g,b=/<span (?:class="colour" )?style="color:(.+?)"(?: class="colour")?>(.*?)/g,w=/<span (?:class="colour" )?style="color:(.+?)"(?: class="colour")?>(.*?)<\/span>/g,k=/rgb\((\d+)[, ]+(\d+)[, ]+(\d+)\)/g,E="#181818";y.default.defineExtension("colorSyntax",i),t.default=i},function(e,t){e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){function t(e){var t=void 0;try{if(!a.default)throw new Error("plantuml-encoder dependency required");t='<img src="'+i+a.default.encode(e)+'" />'}catch(e){t="Error occurred on encoding uml: "+e.message}return t}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.rendererURL,i=void 0===r?c:r,o=e.options.codeBlockLanguages;d.forEach(function(e){o.indexOf(e)<0&&o.push(e),u.setReplacer(e,t)})}Object.defineProperty(t,"__esModule",{value:!0});var o=n(203),a=r(o),l=n(5),s=r(l),u=s.default.codeBlockManager,c="http://www.plantuml.com/plantuml/png/",d=["uml","plantuml"];s.default.defineExtension("uml",i),t.default=i},function(e,t){e.exports=u},function(e,t,n){"use strict";var r=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(29);i.default.fn.tuiEditor=function(){var e=void 0,t=void 0,n=this.get(0);if(n){for(var r=arguments.length,a=Array(r),l=0;l<r;l++)a[l]=arguments[l];if(e=a[0]||{},t=i.default.data(n,"tuiEditor")){if("string"==typeof e){var s;return(s=t)[e].apply(s,a.slice(1))}}else e.el=n,t=o.factory(e),i.default.data(n,"tuiEditor",t)}return this},e.exports=o}])});