/*! * tui-editor * @version 1.3.3 * @author NHN Ent. FE Development Lab (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("to-mark"),require("tui-chart"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","to-mark","tui-chart","markdown-it","highlight.js","tui-color-picker","plantuml-encoder"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("to-mark"),require("tui-chart"),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.toMark,e.tui&&e.tui.chart,e.markdownit,e.hljs,e.tui&&e.tui.colorPicker,e.plantumlEncoder))}("undefined"!=typeof self?self:this,function(e,t,n,r,o,a,i,l){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.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=27)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0;try{r=n(!function(){var e=new Error('Cannot find module "../editor"');throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}if(!r)try{r=n(16)}catch(e){}t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=(0,w.default)(e),o=r.attr("colspan"),a=r.attr("rowspan"),i=e.nodeName;if("TH"!==i&&"TD"!==i)return null;var l={nodeName:e.nodeName,colspan:o?parseInt(o,10):1,rowspan:a?parseInt(a,10):1,content:r.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(l.align=e.align),l}function a(e,t,n,r){var o=t.colspan,a=t.rowspan,i=t.nodeName,l=o>1,u=a>1;if(l||u){var s=n+a,c=r+o;E.default.range(n,s).forEach(function(t){e[t]=e[t]||[],E.default.range(r,c).forEach(function(o){var a={nodeName:i};t===n&&o===r||(l&&(a.colMergeWith=r),u&&(a.rowMergeWith=n),e[t][o]=a)})})}}function i(e){var t=[];return e.find("tr").each(function(e,n){var r=0;t[e]=t[e]||[],(0,w.default)(n).children().each(function(n,i){var l=o(i,e,n);if(l){for(var u=n+r;t[e][u];)u+=1,r+=1;t[e][u]=l,a(t,l,e,u)}})}),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){E.default.isUndefined(e.colMergeWith)&&E.default.isUndefined(e.rowMergeWith)&&r.push({rowIndex:n,colIndex:t})}),t.push(r)}),t}function u(e){var t=e[0];return t.map(function(e){return E.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align})}function s(e,t){var n=u(e),r=t.map(function(t){return t.map(function(t){var r=t.rowIndex,o=t.colIndex;return E.default.extend({align:n[o]},e[r][o])})});return e.className&&(r.className=e.className),r}function c(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:k,elementIndex:{rowIndex:e,colIndex:t}}}function f(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function d(e){return e.closest("td, th").prevAll().length}function h(e,t){var n=f(t),r=d(t);return e[n][r]}function p(e,t,n){var r=e[t][n],o=t;return r.rowspan>1&&(o+=r.rowspan-1),o}function g(e,t,n){var r=e[t][n],o=n;return r.colspan>1&&(o+=r.colspan-1),o}function v(e,t,n){var r=e[t][n];return t=E.default.isExisty(r.rowMergeWith)?r.rowMergeWith:t,n=E.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 o=e[0].nodeName;E.default.range(r,t).forEach(function(t){e.push(c(n,t,o))})}})}function b(e){var t=e[0],n=t.length,r=!0;if(!n&&e[1])E.default.range(0,e[1].length).forEach(function(e){t.push(c(0,e,"TH"))});else if("TH"!==e[0][0].nodeName){var o,a=E.default.range(0,n).map(function(e){return c(0,e,"TH")});(o=[]).concat.apply(o,e).forEach(function(e){e.elementIndex&&(e.elementIndex.rowIndex+=1)}),e.unshift(a)}else if(1===e.length){var i=E.default.range(0,n).map(function(e){return c(1,e,"TD")});e.push(i)}else r=!1;return r}Object.defineProperty(t,"__esModule",{value:!0}),t.createTableData=i,t.createCellIndexData=l;var y=n(0),w=r(y),_=n(1),E=r(_),k=E.default.browser.msie?"":"
";t.default={createTableData:i,createCellIndexData:l,createRenderData:s,findElementRowIndex:f,findElementColIndex:d,findCellIndex:h,createBasicCell:c,findRowMergedLastIndex:p,findColMergedLastIndex:g,findElementIndex:v,stuffCellsIntoIncompleteRow:m,addTbodyOrTheadIfNeed:b}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(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+""}function a(e,t){var n="";return e.length&&(n=e.map(function(e){return""+e.map(o).join("")+""}).join(""),n="<"+t+">"+n+""),n}function i(e){var t=[e[0]],n=e.slice(1),r=a(t,"THEAD"),o=a(n,"TBODY");return""+(r+o)+""}function l(e,t){var n=d.default.createCellIndexData(t),r=d.default.createRenderData(t,n),o=(0,c.default)(i(r));return e.replaceWith(o),o}function u(e,t,n){t.selectNodeContents(n),t.collapse(!0),e.setSelection(t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),c=r(s),f=n(3),d=r(f);t.default={createTableHtml:i,replaceTable:l,focusToCell:u}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=g.default.createCellIndexData(e),o=g.default.findCellIndex(r,t),a=g.default.findCellIndex(r,n),i=void 0,l=void 0,u=void 0,s=void 0;return o.rowIndex>a.rowIndex?(i=a.rowIndex,l=o.rowIndex):(i=o.rowIndex,l=a.rowIndex),o.colIndex>a.colIndex?(u=a.colIndex,s=o.colIndex):(u=o.colIndex,s=a.colIndex),{start:{rowIndex:i,colIndex:u},end:{rowIndex:l,colIndex:s}}}function a(e,t,n){var r=t[n].rowIndex,o=e[r];h.default.range(t.start.colIndex,t.end.colIndex+1).forEach(function(n){var a=o[n],i=a.rowMergeWith,l=-1;h.default.isExisty(i)?(i1&&(l=r+a.rowspan-1),l>t.end.rowIndex&&(t.end.rowIndex=l)})}function i(e,t,n,r){var o=e[n],a=o[r],i=a.colMergeWith,l=-1;h.default.isExisty(i)?(i1&&(l=r+a.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),a(e,t,"start"),a(e,t,"end"),h.default.range(t.start.rowIndex,t.end.rowIndex+1).forEach(function(n){i(e,t,n,t.start.colIndex),i(e,t,n,t.end.colIndex)});return t}function u(e,t,n){return l(e,o(e,t,n))}function s(e,t,n){var r=g.default.createCellIndexData(e),o={};if(t.length){var a=g.default.findCellIndex(r,t.first()),i=h.default.extend({},a);t.each(function(t,n){var o=g.default.findCellIndex(r,(0,f.default)(n)),a=e[o.rowIndex][o.colIndex],l=o.rowIndex+a.rowspan-1,u=o.colIndex+a.colspan-1;i.rowIndex=Math.max(i.rowIndex,l),i.colIndex=Math.max(i.colIndex,u)}),o.start=a,o.end=i}else{var l=g.default.findCellIndex(r,n);o.start=l,o.end=h.default.extend({},l)}return o}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),f=r(c),d=n(1),h=r(d),p=n(3),g=r(p);t.default={findSelectionRange:u,getTableSelectionRange:s}},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);s.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",o)}function o(){this.allowHalfOpen||this._writableState.ended||i(a,this)}function a(e){e.end()}var i=n(11),l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var u=n(9);u.inherits=n(7);var s=n(20),c=n(15);u.inherits(r,s);for(var f=l(c.prototype),d=0;d1)for(var n=1;n0&&this._events[e].length>o&&(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),o||(o=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,i,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(l=i;l-- >0;)if(n[l]===t||n[l].listener&&n[l].listener===t){o=l;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,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(20),t.Stream=t,t.Readable=t,t.Writable=n(15),t.Duplex=n(6),t.Transform=n(26),t.PassThrough=n(58)},function(e,t,n){"use strict";(function(t,r,o){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){T(t,e)}}function i(e){return P.from(e)}function l(e){return P.isBuffer(e)||e instanceof L}function u(){}function s(e,t){I=I||n(6),e=e||{},this.objectMode=!!e.objectMode,t instanceof I&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:o,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 i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){b(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 a(this)}function c(e){if(I=I||n(6),!(B.call(c,this)||this instanceof I))return new c(e);this._writableState=new s(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 f(e,t){var n=new Error("write after end");e.emit("error",n),S(t,n)}function d(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),S(r,a),o=!1),o}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,o,a){if(!n){var i=h(t,r,o);r!==i&&(n=!0,o="buffer",r=i)}var l=t.objectMode?1:r.length;t.length+=l;var u=t.length-1?r:S;c.WritableState=s;var A=n(9);A.inherits=n(7);var O={deprecate:n(57)},N=n(22),P=n(12).Buffer,L=o.Uint8Array||function(){},D=n(24);A.inherits(c,N),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:O.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var B;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(B=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!B.call(this,e)||e&&e._writableState instanceof s}})):B=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,o=!1,a=l(e)&&!r.objectMode;return a&&!P.isBuffer(e)&&(e=i(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=u),r.ended?f(this,n):(a||d(this,r,e,n))&&(r.pendingcb++,o=p(this,r,a,e,t,n)),o},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||_(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=D.destroy,c.prototype._undestroy=D.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,n(10),n(55).setImmediate,n(8))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n18;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}();x.isViewer=!0,x.domUtils=_.default,x.codeBlockManager=k.default,x.markdownitHighlight=y.default.getMarkdownitHighlightRenderer(),x.markdownit=y.default.getMarkdownitRenderer(),x.i18n=null,x.Button=null,x.WwCodeBlockManager=null,x.WwTableManager=null,x.WwTableSelectionManager=null,e.exports=x},function(e,t){e.exports=n},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 o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var a=function(){function e(e,t){for(var n=0;n0?("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===B.prototype||(t=o(t)),r?i.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,i,t,!0):i.ended?e.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?c(e,i,t,!1):b(e,i)):c(e,i,t,!1))):r||(i.reading=!1)}return d(i)}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)),b(e,t)}function f(e,t){var n;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function d(e){return!e.ended&&(e.needReadable||e.length=$?e=$:(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||(H("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?O(m,e):m(e))}function m(e){H("emit readable"),e.emit("readable"),x(e)}function b(e,t){t.readingMore||(t.readingMore=!0,O(y,e,t))}function y(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=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 ea.length?a.length:e;if(i===a.length?o+=a:o+=a.slice(0,e),0===(e-=i)){i===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(i));break}++r}return t.length-=r,o}function S(e,t){var n=B.allocUnsafe(e),r=t.head,o=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,i),0===(e-=i)){i===a.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(i));break}++o}return t.length-=o,n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,O(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function A(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return H("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&I(this),null;var r=t.needReadable;H("need readable",r),(0===t.length||t.length-e0?C(e,t):null,null===o?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==o&&this.emit("data",o),o},u.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(e,t){function n(e,t){H("onunpipe"),e===d&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function o(){H("onend"),e.end()}function a(){H("cleanup"),e.removeListener("close",s),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",u),e.removeListener("unpipe",n),d.removeListener("end",o),d.removeListener("end",f),d.removeListener("data",l),m=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function l(t){H("ondata"),b=!1,!1!==e.write(t)||b||((1===h.pipesCount&&h.pipes===e||h.pipesCount>1&&-1!==A(h.pipes,e))&&!m&&(H("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,b=!0),d.pause())}function u(t){H("onerror",t),f(),e.removeListener("error",u),0===L(e,"error")&&e.emit("error",t)}function s(){e.removeListener("finish",c),f()}function c(){H("onfinish"),e.removeListener("close",s),f()}function f(){H("unpipe"),d.unpipe(e)}var d=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,H("pipe count=%d opts=%j",h.pipesCount,t);var p=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,g=p?o:f;h.endEmitted?O(g):d.once("end",g),e.on("unpipe",n);var v=w(d);e.on("drain",v);var m=!1,b=!1;return d.on("data",l),i(e,"error",u),e.once("close",s),e.once("finish",c),e.emit("pipe",d),h.flowing||(H("pipe resume"),d.resume()),e},u.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,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=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),a.alloc(+e)}function v(e,t){if(a.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 Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return Y(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 O(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return T(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 b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){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=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,o);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,o){function a(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}var i=1,l=e.length,u=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;i=2,l/=2,u/=2,n/=2}var s;if(o){var c=-1;for(s=n;sl&&(n=l-u),s=n;s>=0;s--){for(var f=!0,d=0;do&&(r=o):r=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var i=0;i239?4:a>223?3:a>191?2:1;if(o+l<=n){var u,s,c,f;switch(l){case 1:a<128&&(i=a);break;case 2:u=e[o+1],128==(192&u)&&(f=(31&a)<<6|63&u)>127&&(i=f);break;case 3:u=e[o+1],s=e[o+2],128==(192&u)&&128==(192&s)&&(f=(15&a)<<12|(63&u)<<6|63&s)>2047&&(f<55296||f>57343)&&(i=f);break;case 4:u=e[o+1],s=e[o+2],c=e[o+3],128==(192&u)&&128==(192&s)&&128==(192&c)&&(f=(15&a)<<18|(63&u)<<12|(63&s)<<6|63&c)>65535&&f<1114112&&(i=f)}}null===i?(i=65533,l=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=l}return I(r)}function I(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function B(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function U(e,t,n,r,o,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return o||U(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,n,r,23,4),n+4}function W(e,t,n,r,o){return o||U(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,n,r,52,8),n+8}function H(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 q(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var n,r=e.length,o=null,a=[],i=0;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.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;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function z(e){for(var t=[],n=0;n>8,o=n%256,a.push(o),a.push(r);return a}function V(e){return J.toByteArray(H(e))}function G(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function X(e){return e!==e}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var J=n(51),K=n(52),Z=n(21);t.Buffer=a,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,a.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(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return i(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return u(null,e,t,n)},a.allocUnsafe=function(e){return s(null,e)},a.allocUnsafeSlow=function(e){return s(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},a.prototype.compare=function(e,t,n,r,o){if(!a.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===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var i=o-r,l=n-t,u=Math.min(i,l),s=this.slice(r,o),c=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.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),t0&&(o*=256);)r+=this[e+--t]*o;return r},a.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},a.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]},a.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])},a.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,a=0;++a=o&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.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},a.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},a.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},a.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]},a.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),K.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),K.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),K.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),K.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}var o=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+o]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):B(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):B(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var a=0,i=1,l=0;for(this[t]=255&e;++a>0)-l&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var a=n-1,i=1,l=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):B(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):B(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return W(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return W(this,e,t,!1,n)},a.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=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=0;--o)e[o+t]=this[o+n];else if(i<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i>5==6?2:e>>4==14?3:e>>3==30?4:-1}function l(e,t,n){var r=t.length-1;if(r=0?(o>0&&(e.lastNeed=o-1),o):--r=0?(o>0&&(e.lastNeed=o-2),o):--r=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function s(e){var t=this.lastTotal-this.lastNeed,n=u(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 f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function d(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 b=n(12).Buffer,y=b.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=a,a.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 n0}).reduce(function(e,t){return e||!g(t)},!1),o=r?n.shift():[],a=n.slice(1).reduce(function(e,t){return e||!g(t[0])},!1),i=a?n.map(function(e){return e.shift()}):[];return a&&o.shift(),n=n[0].map(function(e,t){return n.map(function(e){return parseFloat(e[t])})}),{categories:i,series:n.map(function(e,t){return r?{name:o[t],data:e}:{data:e}})}}function d(e,t){var n=function(e){var n=f(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 S.default.isUndefined(e)?n:(e.split(U).forEach(function(e){var r=e.split(W),o=r[0],a=r.slice(1),i=a.join(W);if(o=o.trim(),0!==i.length){try{i=JSON.parse(i.trim())}catch(e){i=i.trim()}var l=o.split("."),u=l.slice(0),s=u[0];S.default.inArray(s,t)>=0?u.unshift("editorChart"):1===u.length?u.unshift("chart"):"x"!==s&&"y"!==s||(u[0]=s+"Axis");for(var c=n,f=0;f';return setTimeout(function(){var r=document.querySelector("#"+n);try{l(e,function(e){var n=e.data,o=e.options;o=v(o,t,r);var a=o.editorChart.type;H.indexOf(a)<0?r.innerHTML="invalid chart type. type: bar, column, line, area, pie":F.indexOf(a)>-1&&n.categories.length!==n.series[0].data.length?r.innerHTML="invalid chart data":R.default[a](r,n,o)})}catch(e){r.innerHTML="invalid chart data"}},0),r}function b(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 y(e){var t=e.wwEditor.componentManager;t.removeManager("codeblock"),t.addManager(function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),k(t,[{key:"convertNodesToText",value:function(e){if(1!==e.length||"TABLE"!==e[0].tagName)return x(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"convertNodesToText",this).call(this,e);var n=e.shift(),r="";return r+=b([].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}(L))}function w(e,t,n){var r="markdown"===t&&e.getTokenAt(n.from).state.overlay.codeBlock;return r=r||"codeblock"===t,r=r&&"wysiwyg"!==t}function _(e,t){var n=t.source,r=t.data;if(w(e,n,r)){var o=r.text.join("\n");if(0===c(o,"\t")){P.default.COLUMN_SEPARATOR="\t";var a=b(P.default.parse(o));r.update(r.from,r.to,a)}}}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.options.codeBlockLanguages;n&&n.indexOf(B)<0&&n.push(B),t=S.default.extend({usageStatistics:e.options.usageStatistics},t),D.setReplacer(B,function(e){return m(e,t)}),e.isViewer()||(y(e),e.eventManager.listen("pasteBefore",function(t){return _(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 k=function(){function e(e,t){for(var n=0;n\n/g,"
"))}),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}(s.default);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n'),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,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=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=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this._command=new s.default.Map,this._mdCommand=new s.default.Map,this._wwCommand=new s.default.Map,this._options=l.default.extend({useCommandShortcut:!0},n),this.base=t,this.keyMapCommand={},this._initEvent()}return a(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),o=1;o1?a-1:0),l=1;l/gi,"
");for(var t=/(]*)(onerror\s*=\s*[\"']?[^\"']*[\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");var n=O.render(e);return n=this._removeBrToMarkPassAttributeInCode(n)}},{key:"_markdownToHtml",value:function(e){e=e.replace(/
/gi,"
");for(var t=/(]*)(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)("
");return t.html(e),t.find("code, pre").each(function(e,t){var n=(0,l.default)(t);n.html(n.html().replace(/<br data-tomark-pass>/,"<br>"))}),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),s.default.forEach(r.split("\n"),function(e,t){var r=/^\|[^|]*\|/gi;/`[^`]*
[^`]*`/gi.test(e)||r.test(e)||(e=e.replace(/
/gi,"
\n")),n[t]=e}),n.join("\n")}},{key:"_appendAttributeForBrIfNeed",value:function(e){var t=/
/gi,n=/

/gi,r=/

(.)/gi,o=/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|]*>)/,a=/

/,i=new RegExp(o.source+a.source,"g");e=e.replace(t,"
"),e=e.replace(n,"

");var u=document.createElement("div"),s=(0,l.default)(u);return s.html(e),s.find("pre br,code br").each(function(e,t){t.hasAttribute("data-tomark-pass")&&t.removeAttribute("data-tomark-pass")}),e=s.html().replace(/
/gi,"
"),e=e.replace(t,"
"),e=e.replace(r,"

$1"),e=e.replace(i,"$1

")}}],[{key:"getMarkdownitHighlightRenderer",value:function(){return O}},{key:"getMarkdownitRenderer",value:function(){return N}}]),e}();t.default=P},function(e,t){e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=(0,s.default)("
");return e=e.replace(//g,""),n.append(e),a(n),i(n),l(n,t)}function a(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title").remove()}function i(e){e.find("*").each(function(e,t){var n=t.attributes,r=f.default.toArray(n).filter(function(e){var t=e.name.match(d),n=e.name.match(h);return!t&&!n});f.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(),o=f.default.toArray(e[0].childNodes),a=o.length,i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}var i=function(e){e.core.ruler.after("block","tui-code-block",function(e){var t,n,i,l=e.tokens;for(n=0;n3&&r(t,"data-backticks",i),t.info&&r(t,"data-language",a(t.info.replace(" ",""),!0)))})};e.exports=i},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,a,i=/ {0,3}(?:-|\*|\d\.) /,l=e.src.split("\n"),u=l[t],s=0;if(u.match(i)||e.sCount[t]-e.blkIndent<4)return!1;for(o=r=t+1;r=2&&"list"===e.parentType)break;r++}else{if(s=0,!(e.sCount[r]-e.blkIndent>=4))break;r++,o=r}return e.line=o,a=e.push("code_block","code",0),a.content=e.getLines(t,o,4+e.blkIndent,!0),a.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,o){var a,i,l,u,s,c,f,d,h,p,g,v,m,b,y,w,_,E,k,x,C=e.lineMax,M=e.bMarks[t]+e.tShift[t],T=e.eMarks[t],S=/(?:-|\*|\d+\.) {1,4}(?:> {0,3})[^>]*$/,I=e.src.split("\n"),R=I[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(M++))return!1;if(R.match(S))return!1;if(o)return!0;for(u=h=e.sCount[t]+M-(e.bMarks[t]+e.tShift[t]),32===e.src.charCodeAt(M)?(M++,u++,h++,a=!1,w=!0):9===e.src.charCodeAt(M)?(w=!0,(e.bsCount[t]+h)%4==3?(M++,u++,h++,a=!1):a=!0):w=!1,p=[e.bMarks[t]],e.bMarks[t]=M;M=T,b=[e.sCount[t]],e.sCount[t]=h-u,y=[e.tShift[t]],e.tShift[t]=M-e.bMarks[t],E=e.md.block.ruler.getRules("blockquote"),m=e.parentType,e.parentType="blockquote",x=!1,d=t+1;d=T));d++)if(62!==e.src.charCodeAt(M++)||x){if(c)break;for(_=!1,l=0,s=E.length;l=T,g.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(w?1:0),b.push(e.sCount[d]),e.sCount[d]=h-u,y.push(e.tShift[d]),e.tShift[d]=M-e.bMarks[d]}for(v=e.blkIndent,e.blkIndent=0,k=e.push("blockquote_open","blockquote",1),k.markup=">",k.map=f=[t,0],e.md.block.tokenize(e,t,d),k=e.push("blockquote_close","blockquote",-1),k.markup=">",e.lineMax=C,e.parentType=m,f[1]=e.line,l=0;ln)return!1;if(c=t+1,e.sCount[c]=e.eMarks[c])return!1;if(124!==(i=e.src.charCodeAt(u))&&45!==i&&58!==i)return!1;if(l=r(e,t+1),!/^[-:| ]+$/.test(l))return!1;for(f=l.split("|"),p=[],s=0;sg)return!1;if(d|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^<("+r.join("|")+")","i"),/^\/?>$/,!0],[new RegExp("^|$))","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 a,i,l,u,s=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(s))return!1;for(u=e.src.slice(s,c),a=0;a=0&&(n=e.childNodes[t]),n},m=function(e,t,n){for(var r=e+"Sibling",o=void 0,a=void 0;t&&!t[r]&&(o=d(t.parentNode))!==n&&"BODY"!==o;)t=t.parentNode;return t[r]&&(a=t[r]),a},b=function(e,t,n){return t>0?v(e,t-1):m("previous",e,n)},y=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},w=function(e,t){return l.default.isString(t)?y(e,function(e){return t===d(e)}):y(e,function(e){return t===e})},_=function(e,t,n){var r=e+"Sibling",o=void 0;return t=w(t,n),t&&t[r]&&(o=t[r]),o},E=function(e,t){return _("previous",e,t)},k=function(e,t){return _("next",e,t)},x=function(e){return w(e,"BODY")},C=function(e){for(e=e.previousSibling||e.parentNode;!s(e)&&"BODY"!==d(e);)if(e.previousSibling)for(e=e.previousSibling;e.lastChild;)e=e.lastChild;else e=e.parentNode;return"BODY"===d(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},T=function(e,t,n){var r=[],o="",a=0,i=void 0;if(!t.length)return r;for(var u=t.shift(),s=document.createTreeWalker(e,4,null,!1);s.nextNode();){for(o=s.currentNode.nodeValue||"",n&&(o=n(o)),i=a+o.length;i>=u;){if(r.push({container:s.currentNode,offsetInContainer:u-a,offset:u}),!t.length)return r;u=t.shift()}a=i}do{r.push({container:s.currentNode,offsetInContainer:o.length,offset:u}),u=t.shift()}while(!l.default.isUndefined(u));return r},S=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},I=function(e,t){for(var n=[];e&&e!==t;)c(e)&&n.unshift(S(e)),e=e.parentNode;return n},R=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)},A=function(e,t,n){var r=!0,o=null,i=void 0,u=void 0,s=void 0,c=void 0,f=void 0,h=void 0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t?null:("previous"===t&&(r=!1),e?(i=(0,a.default)(e),r?(s=i.parent().next(),c=i.parents("thead"),f=c[0]&&c.next(),h=f&&"TBODY"===d(f[0]),u=0):(s=i.parent().prev(),c=i.parents("tbody"),f=c[0]&&c.prev(),h=f&&"THEAD"===d(f[0]),u=e.parentNode.childNodes.length-1),!l.default.isUndefined(n)&&n||(u=g(e)),s[0]?o=s.children("td,th")[u]:c[0]&&h&&(o=f.find("td,th")[u]),o):null)},O=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 o=r.nextSibling;e.removeChild(r),r=o}},L=function(e,t,n){for(var r=t;r!==e;){var o=r.parentNode,a=r,i=a.nextSibling,l=a.previousSibling;!n&&i?P(o,i,null):n&&l&&P(o,o.childNodes[0],r),r=o}},D=function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t,r=n.firstChild;t=s(r)&&!h(r)?r.nextSibling||r:r}return t};t.default={getNodeName:d,isTextNode:s,isElemNode:c,isBlockNode:f,getTextLength:h,getOffsetLength:p,getPrevOffsetNodeUntil:b,getNodeOffsetOfParent:g,getChildNodeByOffset:v,containsNode:M,getTopPrevNodeUnder:E,getTopNextNodeUnder:k,getParentUntilBy:y,getParentUntil:w,getTopBlockNode:x,getPrevTextNode:C,findOffsetNode:T,getPath:I,getNodeInfo:S,getTableCellByDirection:R,getSiblingRowCellByDirection:A,isMDSupportInlineNode:O,isStyledNode:N,removeChildFromStartToEndNode:P,removeNodesByDirection:L,getLeafNode:D}},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;!function(r){var o={};o.RELAXED=!1,o.IGNORE_RECORD_LENGTH=!1,o.IGNORE_QUOTES=!1,o.LINE_FEED_OK=!0,o.CARRIAGE_RETURN_OK=!0,o.DETECT_TYPES=!0,o.IGNORE_QUOTE_WHITESPACE=!0,o.DEBUG=!1,o.COLUMN_SEPARATOR=",",o.ERROR_EOF="UNEXPECTED_END_OF_FILE",o.ERROR_CHAR="UNEXPECTED_CHARACTER",o.ERROR_EOL="UNEXPECTED_END_OF_RECORD",o.WARN_SPACE="UNEXPECTED_WHITESPACE";o.parse=function(e){var t=o.result=[];o.COLUMN_SEPARATOR=o.COLUMN_SEPARATOR instanceof RegExp?new RegExp("^"+o.COLUMN_SEPARATOR.source):o.COLUMN_SEPARATOR,o.offset=0,o.str=e,o.record_begin(),o.debug("parse()",e);for(var n;;){if(n=e[o.offset++],o.debug("c",n),null==n){o.escaped&&o.error(o.ERROR_EOF),o.record&&(o.token_end(),o.record_end()),o.debug("...bail",n,o.state,o.record),o.reset();break}if(null==o.record){if(o.RELAXED&&("\n"==n||"\r"==n&&"\n"==e[o.offset+1]))continue;o.record_begin()}if(0==o.state){if((" "===n||"\t"===n)&&'"'==o.next_nonspace()){if(o.RELAXED||o.IGNORE_QUOTE_WHITESPACE)continue;o.warn(o.WARN_SPACE)}if('"'==n&&!o.IGNORE_QUOTES){o.debug("...escaped start",n),o.escaped=!0,o.state=1;continue}o.state=1}1==o.state&&o.escaped?'"'==n?'"'==e[o.offset]?(o.debug("...escaped quote",n),o.token+='"',o.offset++):(o.debug("...escaped end",n),o.escaped=!1,o.state=2):(o.token+=n,o.debug("...escaped add",n,o.token)):"\r"==n?("\n"==e[o.offset]?o.offset++:o.CARRIAGE_RETURN_OK||o.error(o.ERROR_CHAR),o.token_end(),o.record_end()):"\n"==n?(o.LINE_FEED_OK||o.RELAXED||o.error(o.ERROR_CHAR),o.token_end(),o.record_end()):o.test_regex_separator(e)||o.COLUMN_SEPARATOR==n?o.token_end():1==o.state?(o.token+=n,o.debug("...add",n,o.token)):" "===n||"\t"===n?o.IGNORE_QUOTE_WHITESPACE||o.error(o.WARN_SPACE):o.RELAXED||o.error(o.ERROR_CHAR)}return t},o.stream=function(){var e=n(19),t=new e.Transform({objectMode:!0});return t.EOL="\n",t.prior="",t.emitter=function(e){return function(t){e.push(o.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},o.test_regex_separator=function(e){if(!(o.COLUMN_SEPARATOR instanceof RegExp))return!1;var t;return e=e.slice(o.offset-1),t=o.COLUMN_SEPARATOR.exec(e),t&&(o.offset+=t[0].length-1),null!==t},o.stream.json=function(){var e=n(63),t=(n(19),new streamTransform({objectMode:!0}));return t._transform=function(n,r,o){t.push(JSON.stringify(n.toString())+e.EOL),o()},t},o.reset=function(){o.state=null,o.token=null,o.escaped=null,o.record=null,o.offset=null,o.result=null,o.str=null},o.next_nonspace=function(){for(var e,t=o.offset;t0&&o.record.length!=o.result[0].length&&o.error(o.ERROR_EOL),o.result.push(o.record),o.debug("record end",o.record),o.record=null},o.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},o.token_begin=function(){o.state=0,o.token=""},o.token_end=function(){o.DETECT_TYPES&&(o.token=o.resolve_type(o.token)),o.record.push(o.token),o.debug("token end",o.token),o.token_begin()},o.debug=function(){o.DEBUG&&console.log(arguments)},o.dump=function(e){return[e,"at char",o.offset,":",o.str.substr(o.offset-50,50).replace(/\r/gm,"\\r").replace(/\n/gm,"\\n").replace(/\t/gm,"\\t")].join(" ")},o.error=function(e){var t=o.dump(e);throw o.reset(),t},o.warn=function(e){if(o.DEBUG){var t=o.dump(e);try{return void console.warn(t)}catch(e){}try{console.log(t)}catch(e){}}},void 0!==e&&e.exports?e.exports=o:t.CSV=o}()},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 o(e){return 3*e.length/4-r(e)}function a(e){var t,n,o,a,i,l=e.length;a=r(e),i=new f(3*l/4-a),n=a>0?l-4:l;var u=0;for(t=0;t>16&255,i[u++]=o>>8&255,i[u++]=255&o;return 2===a?(o=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,i[u++]=255&o):1===a&&(o=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,i[u++]=o>>8&255,i[u++]=255&o),i}function i(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function l(e,t,n){for(var r,o=[],a=t;au?u:i+16383));return 1===r?(t=e[n-1],o+=s[t>>2],o+=s[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=s[t>>10],o+=s[t>>4&63],o+=s[t<<2&63],o+="="),a.push(o),a.join("")}t.byteLength=o,t.toByteArray=a,t.fromByteArray=u;for(var s=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=d.length;h>1,c=-7,f=n?o-1:0,d=n?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=l;c>0;a=256*a+e[t+f],f+=d,c-=8);for(i=a&(1<<-c)-1,a>>=-c,c+=r;c>0;i=256*i+e[t+f],f+=d,c-=8);if(0===a)a=1-s;else{if(a===u)return i?NaN:1/0*(h?-1:1);i+=Math.pow(2,r),a-=s}return(h?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,l,u,s=8*a-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-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,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),t+=i+f>=1?d/u:d*Math.pow(2,1-f),t*u>=2&&(i++,u/=2),i+f>=c?(l=0,i=c):i+f>=1?(l=(t*u-1)*Math.pow(2,o),i+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=255&l,h+=p,l/=256,o-=8);for(i=i<0;e[n+h]=255&i,h+=p,i/=256,s-=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 o(e,t,n){e.copy(t,n)}var a=n(12).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 a.alloc(0);if(1===this.length)return this.head.data;for(var t=a.allocUnsafe(e>>>0),n=this.head,r=0;n;)o(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 o=Function.prototype.apply;t.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(o.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(56),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"+e+"
"),r=n.find("table");return r.length&&(r.get().forEach(function(e){var n=t(e);(0,f.default)(e).replaceWith(n)}),e=n.html()),e}function u(e){var t=e.command;if(t.isWWType())switch(t.getName()){case"AddRow":e.command=C.default;break;case"AddCol":e.command=T.default;break;case"RemoveRow":e.command=I.default;break;case"RemoveCol":e.command=A.default;break;case"AlignCol":e.command=N.default}}function s(e){e.listen("convertorAfterMarkdownToHtmlConverted",function(e){return l(e,g.default)}),e.listen("convertorBeforeHtmlToMarkdownConverted",function(e){return l(e,m.default)}),e.listen("addCommandBefore",u)}var c=n(0),f=r(c),d=n(2),h=r(d);n(65);var p=n(66),g=r(p),v=n(67),m=r(v),b=n(68),y=r(b),w=n(69),_=r(w),E=n(70),k=r(E),x=n(71),C=r(x),M=n(72),T=r(M),S=n(73),I=r(S),R=n(74),A=r(R),O=n(75),N=r(O),P=n(76),L=r(P),D=n(77),B=r(D),U=n(78),j=r(U);h.default.defineExtension("table",o)},function(e,t,n){"use strict";var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=o.default.i18n;a&&(a.setLanguage(["ko","ko_KR"],{"Merge cells":"셀 병합","Unmerge cells":"셀 병합해제","Cannot change part of merged cell":"병합 된 셀의 일부를 변경할 수 없습니다.","Cannot paste row merged cells into the table header":"테이블 헤더에는 행 병합된 셀을 붙여넣을 수 없습니다."}),a.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."}),a.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."}),a.setLanguage(["ja","ja_JP"],{"Merge cells":"セルの結合","Unmerge cells":"セルの結合を解除","Cannot change part of merged cell":"結合されたセルの一部を変更することはできません。","Cannot paste row merged cells into the table header":"行にマージされたセルをヘッダーに貼り付けることはできません。"}),a.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."}),a.setLanguage(["zh","zh_CN"],{"Merge cells":"合并单元格","Unmerge cells":"取消合并单元格","Cannot change part of merged cell":"无法更改合并单元格的一部分。","Cannot paste row merged cells into the table header":"无法将行合并单元格粘贴到标题中。"}),a.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."}),a.setLanguage(["ru","ru_RU"],{"Merge cells":"Объединить ячейки","Unmerge cells":"Разъединить ячейки","Cannot change part of merged cell":"Вы не можете изменять часть комбинированной ячейки.","Cannot paste row merged cells into the table header":"Вы не можете вставлять объединенные ячейки в заголовок таблицы."}),a.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."}),a.setLanguage(["uk","uk_UA"],{"Merge cells":"Об'єднати комірки","Unmerge cells":"Роз'єднати комірки","Cannot change part of merged cell":"Ви не можете змінювати частину комбінованої комірки.","Cannot paste row merged cells into the table header":"Ви не можете вставляти об'єднані комірки в заголовок таблиці."}),a.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"}),a.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"}),a.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"}),a.setLanguage(["ar","ar_AR"],{"Merge cells":"دمج الوحدات","Unmerge cells":"إلغاء دمج الوحدات","Cannot change part of merged cell":"لا يمكن تغيير جزء من الخلية المدموجة","Cannot paste row merged cells into the table header":"لا يمكن لصق الخلايا المدموجة من صف واحد في رأس الجدول"}),a.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."}),a.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 o(e,t,n){var r=new RegExp("^((?:"+n+"=[0-9]+:)?)"+t+"=([0-9]+):(.*)"),o=r.exec(e),a=1;return o&&(a=parseInt(o[2],10),e=o[1]+o[3]),[a,e]}function a(e){var t=e.nodeName,n=e.align||"",r=e.innerHTML.trim(),a=null,i=null,l=o(r,"@cols","@rows");a=l[0],r=l[1];var u=o(r,"@rows","@cols");return i=u[0],r=u[1],{nodeName:t,colspan:a,rowspan:i,content:r,align:n}}function i(e){return e.find("tr").get().map(function(e){return(0,p.default)(e).find("td, th").get().map(a)})}function l(e,t){var n=-1;return v.default.forEach(e,function(e,r){var o=!0;return t(e,r)&&(n=r,o=!1),o}),n}function u(e){var t=l(e,function(e){return"TD"===e[0].nodeName});return[e.slice(0,t),e.slice(t)]}function s(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 o=e.filter(function(e){return e.rowspan>1}),a=r+1;o.forEach(function(e){var r=e.colspan,o=a+(e.rowspan-1);t.slice(a,o).forEach(function(e){n[e]+=r})})}),n}function f(e){var t=c(e);e.forEach(function(e,n){e.splice(e.length-t[n])})}function d(e){var t=i((0,p.default)(e)),n=u(t),r=n[0],o=n[1];return s(r),s(o),f(o),(0,p.default)(b.default.createTableHtml(t))[0]}Object.defineProperty(t,"__esModule",{value:!0}),t._extractPropertiesForMerge=o,t._parseTableCell=a,t._createTableObjectFrom$Table=i,t._divideTrs=u,t._mergeByColspan=s,t._getRemovalTdCountsByRowspan=c,t._mergeByRowspan=f,t.default=d;var h=n(0),p=r(h),g=n(1),v=r(g),m=n(4),b=r(m)},function(e,t,n){"use strict";function r(e){var t=(0,i.default)(e),n=t.attr("colspan")||"",r=t.attr("rowspan")||"",o=t.html();n&&(o="@cols="+n+":"+o),r&&(o="@rows="+r+":"+o),o&&t.html(o)}function o(e){return(0,i.default)(e).find("td, th").get().forEach(r),e}Object.defineProperty(t,"__esModule",{value:!0}),t._prependMergeSyntaxToContent=r,t.default=o;var a=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return f.default.range(0,t).map(function(){return e}).join("")}function a(e){var t=e.align,n=(e.textContent||e.innerText).replace(p,""),r=n.length,a="",i="";return t&&("left"===t?(a=":",r-=1):"right"===t?(i=":",r-=1):"center"===t&&(i=":",a=":",r-=2)),r=Math.max(r,3),a+o("-",r)+i}function i(e){var t=0;return e.filter(function(e){return(0,s.default)(e).attr("colspan")}).forEach(function(e){t+=parseInt((0,s.default)(e).attr("colspan"),10)-1}),t}function l(e,t){var n=(0,s.default)(e).find("th").get(),r=n.map(function(e){return" "+a(e)+" |"}).join("");return r+=o(" --- |",i(n)),t?t+"|"+r+"\n":""}Object.defineProperty(t,"__esModule",{value:!0}),t._getAdditionalThCount=i,t._createTheadMarkdown=l;var u=n(0),s=r(u),c=n(1),f=r(c),d=n(17),h=r(d),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 o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 i(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 d.default.forEach(e,function(e){return!(n=t(e))}),n}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n1});return r&&o}},{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,o=e[0].length,a=parseInt(t/r,10),i=parseInt(n/o,10);if(a>1){var l=JSON.parse(JSON.stringify(e));d.default.range(0,a-1).forEach(function(){var t=JSON.parse(JSON.stringify(l));e.push.apply(e,t)})}if(i>1){var u=JSON.parse(JSON.stringify(e));d.default.range(0,i-1).forEach(function(){var t=JSON.parse(JSON.stringify(u));e.forEach(function(e,n){e.push.apply(e,t[n])})})}}},{key:"_updateTableDataByClipboardData",value:function(e,t,n){var r=n.rowIndex,o=n.colIndex;e.forEach(function(e,n){var a=r+n;e.forEach(function(e,n){var r=o+n,i=t[a][r];e.nodeName=i.nodeName,t[a][r]=e})})}},{key:"_isPossibleToPaste",value:function(e,t,n){var r=t.rowIndex,o=t.colIndex,a=n.rowIndex,i=n.colIndex,u=e.slice(r,a+1),s=u[0].slice(o,i+1),c=!l(s,function(e){return d.default.isExisty(e.rowMergeWith)});if(c){c=!l(d.default.pluck(u,o),function(e){return d.default.isExisty(e.colMergeWith)})}if(c&&e.length>a+1){c=!l(e[a+1].slice(o,i+1),function(e){return d.default.isExisty(e.rowMergeWith)})}if(c&&e[0].length>i+1){c=!l(d.default.pluck(u,i+1),function(e){return d.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(),o=r.get$Body().find(".tui-paste-table-bookmark"),a=v.default.createTableData(o),i=a[t][n];t=d.default.isExisty(i.rowMergeWith)?i.rowMergeWith:t,n=d.default.isExisty(i.colMergeWith)?i.colMergeWith:n;var l=a[t][n].elementIndex,u=o.find("tr").eq(l.rowIndex).children()[l.colIndex];o.removeClass("tui-paste-table-bookmark"),(0,c.default)(u).addClass("tui-paste-table-cell-bookmark")}},{key:"_updateClipboardDataForPasteToSamllerSelectedArea",value:function(e,t,n,r,o){var a=!0,i={rowIndex:0,colIndex:0},l={rowIndex:n-1,colIndex:r-1};return this._isPossibleToPaste(e,i,l)?(this._spliceClipboardData(e,n,r),this._updateTableDataByClipboardData(e,t,o)):a=!1,a}},{key:"_pasteToSelectedArea",value:function(e,t,n,r){var o=w.default.getTableSelectionRange(n,r),a=o.start,i=o.end,l=i.rowIndex-a.rowIndex+1,u=i.colIndex-a.colIndex+1,s=t.length,c=t[0].length,f=l>=s&&u>=c,d=E.get("Cannot change part of merged cell"),h=!0,p=void 0;this._hasRowMergedHeader(t,n,a)?(d=E.get("Cannot paste row merged cells into the table header"),h=!1):this._isExactlyFit(t,l,u)?(p=i,this._updateClipboardTableData(t,l,u),this._updateTableDataByClipboardData(t,n,a)):f?(p={rowIndex:a.rowIndex+s-1,colIndex:a.colIndex+c-1},this._isPossibleToPaste(n,a,p)?this._updateTableDataByClipboardData(t,n,a):h=!1):(p={rowIndex:a.rowIndex+l-1,colIndex:a.colIndex+u-1},h=this._updateClipboardDataForPasteToSamllerSelectedArea(t,n,l,u,a)),h?(n.className+=" tui-paste-table-bookmark",b.default.replaceTable(e,n),this._bookmarkLastTd(p)):(alert(d),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,o=d.default.range(n,n+t).map(function(e){return d.default.range(0,r).map(function(t){return v.default.createBasicCell(e,t)})});e.push.apply(e,o)}},{key:"_expandCoumn",value:function(e,t){var n=e[0].length,r=d.default.range(n,n+t);e.forEach(function(e,t){var n=e[0].nodeName,o=r.map(function(e){return v.default.createBasicCell(t,e,n)});e.push.apply(e,o)})}},{key:"_expandTableDataIfNeed",value:function(e,t,n){var r=n.rowIndex-e.length+1,o=n.colIndex-e[0].length+1;r>0&&this._expandRow(e,r),o>0&&this._expandCoumn(e,o)}},{key:"_pasteAllClipboardTableData",value:function(e,t,n,r){var o=this._findEndCellIndex(t,r);if(this._hasRowMergedHeader(t,n,r))return alert(E.get("Cannot paste row merged cells into the table header")),void this.wwe.focus();this._expandTableDataIfNeed(n,r,o),this._isPossibleToPaste(n,r,o)?(this._updateTableDataByClipboardData(t,n,r),n.className+=" tui-paste-table-bookmark",b.default.replaceTable(e,n),this._bookmarkLastTd(o)):(alert(E.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"),o=r.getSelectedCells(),a=(0,c.default)(this._findStartCell(o)),i=a.closest("table"),l=v.default.createTableData(i),u=this._findStartCellIndex(l,a);o.length>1?this._pasteToSelectedArea(i,n,l,o):this._pasteAllClipboardTableData(i,n,l,u)}}]),t}(_);t.default=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 i(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;nt&&(u.rowspan+=1,i=f.default.extend({},r))}else r.rowspan>1&&(r.rowspan+=1,i=o(t));return i||(i=g.default.createBasicCell(t+1,a)),n=i,i})}function i(e,t){var n=t.start.rowIndex,r=t.end,o=g.default.findRowMergedLastIndex(e,r.rowIndex,r.colIndex),i=f.default.range(n,o+1).map(function(){return a(e,o)});e.splice.apply(e,[o+1,0].concat(i))}function l(e,t,n){var r=g.default.createTableData(e),o=g.default.findRowMergedLastIndex(r,t,n)+1,a=g.default.findElementIndex(r,o,n);return e.find("tr").eq(a.rowIndex).find("td")[a.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewRow=a,t._addRow=i;var u=n(0),s=r(u),c=n(1),f=r(c),d=n(2),h=r(d),p=n(3),g=r(p),v=n(5),m=r(v),b=n(4),y=r(b),w=h.default.CommandManager,_=void 0;w&&(_=w.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,s.default)(n.startContainer),o=r.closest("table"),a=g.default.createTableData(o),u=e.componentManager.getManager("tableSelection").getSelectedCells(),c=m.default.getTableSelectionRange(a,u,r);t.saveUndoState(n),i(a,c);var f=y.default.replaceTable(o,a),d=l(f,c.end.rowIndex,c.start.colIndex);y.default.focusToCell(t,n,d)}}})),t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return{nodeName:t,colMergeWith:e}}function a(e,t,n,r){var a=e[n],i=void 0;if(d.default.isExisty(a.colMergeWith)){var l=a.colMergeWith,u=e[l],s=l+u.colspan-1;d.default.isExisty(u.rowMergeWith)&&r?i=d.default.extend({},r):s>n&&(u.colspan+=1,i=d.default.extend({},a))}else a.colspan>1&&(a.colspan+=1,i=o(n,a.nodeName));return i||(i=v.default.createBasicCell(t,n+1,a.nodeName)),i}function i(e,t,n){var r=d.default.range(t,n+1),o=[],i=null;return e.forEach(function(e,t){var l=r.map(function(r,o){var l=i?i[o-1]:null;return a(e,t,n,l)});i=l,o.push(l)}),o}function l(e,t){var n=t.end,r=v.default.findColMergedLastIndex(e,n.rowIndex,n.colIndex),o=i(e,t.start.colIndex,r),a=r+1;e.forEach(function(e,t){e.splice.apply(e,[a,0].concat(o[t]))})}function u(e,t,n){var r=v.default.createTableData(e),o=v.default.findColMergedLastIndex(r,t,n)+1,a=v.default.findElementIndex(r,t,o);return e.find("tr").eq(a.rowIndex).find("td, th")[a.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewColumns=i,t._addColumns=l;var s=n(0),c=r(s),f=n(1),d=r(f),h=n(2),p=r(h),g=n(3),v=r(g),m=n(5),b=r(m),y=n(4),w=r(y),_=p.default.CommandManager,E=void 0;_&&(E=_.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),o=r.closest("table"),a=v.default.createTableData(o),i=e.componentManager.getManager("tableSelection").getSelectedCells(),s=b.default.getTableSelectionRange(a,i,r);t.saveUndoState(n),l(a,s);var f=w.default.replaceTable(o,a),d=u(f,s.start.rowIndex,s.end.colIndex);w.default.focusToCell(t,n,d)}}})),t.default=E},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){f.default.range(t,n+1).forEach(function(t){e[t].forEach(function(r,o){if(f.default.isExisty(r.rowMergeWith)){var a=e[r.rowMergeWith][o];a.rowspan&&(a.rowspan-=1)}else if(r.rowspan>1){var i=t+r.rowspan-1;r.rowspan-=n-t+1,i>n&&(e[n+1][o]=f.default.extend({},r))}})})}function a(e,t,n){e.slice(n+1).forEach(function(e){e.forEach(function(e){f.default.isExisty(e.rowMergeWith)&&e.rowMergeWith>=t&&(e.rowMergeWith=n+1)})})}function i(e,t){var n=t.start.rowIndex,r=t.end,i=g.default.findRowMergedLastIndex(e,r.rowIndex,r.colIndex);if(0!==n||0!==i){n=Math.max(n,1),i=Math.max(i,1);var l=i-n+1;e.length-l<2?e.splice(0,e.length):(o(e,n,i),a(e,n,i),e.splice(n,l))}}function l(e,t,n){var r=g.default.createTableData(e);r.length-11){var a=t+r.colspan-1;r.colspan-=n-t+1,a>n&&(e[n+1]=f.default.extend({},r))}})})}function a(e,t,n){e.forEach(function(e){e.slice(n+1).forEach(function(e){f.default.isExisty(e.colMergeWith)&&e.colMergeWith>=t&&(e.colMergeWith=n+1)})})}function i(e,t){var n=t.start.colIndex,r=t.end,i=g.default.findColMergedLastIndex(e,r.rowIndex,r.colIndex),l=i-n+1;o(e,n,i),a(e,n,i),e.forEach(function(e){e.splice(n,l)})}function l(e,t,n){var r=g.default.createTableData(e);r[0].length-1=a[0].length?h-1:h,v=l(d,c.start.rowIndex,p);y.default.focusToCell(t,n,v)}}}})),t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,r){s.default.range(t,n+1).forEach(function(t){var n=e[t];s.default.isExisty(n.colMergeWith)?e[n.colMergeWith].align=r:n.align=r})}function a(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 i=n(0),l=r(i),u=n(1),s=r(u),c=n(2),f=r(c),d=n(3),h=r(d),p=n(5),g=r(p),v=n(4),m=r(v),b=f.default.CommandManager,y=void 0;b&&(y=b.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),r=n.getSelection().cloneRange();if(e.focus(),n.hasFormat("TABLE")){var i=(0,l.default)(r.startContainer),u=i.closest("table"),s=h.default.createTableData(u),c=e.componentManager.getManager("tableSelection").getSelectedCells(),f=g.default.getTableSelectionRange(s,c,i);o(s[0],f.start.colIndex,f.end.colIndex,t);var d=m.default.replaceTable(u,s),p=a(d,i);m.default.focusToCell(n,r,p)}}})),t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r,o=n+1,a=(r=[]).concat.apply(r,e.map(function(e){return e.slice(t,o)})),i=a.filter(function(e){var t=e.content;return t&&t!==k});return i.length?i[0].content:k}function a(e,t,n){var r,o=n+1,a=e.map(function(e){return e.slice(t,o)});(r=[]).concat.apply(r,a).slice(1).forEach(function(e){var t=e.nodeName;h.default.forEach(e,function(t,n){return delete e[n]}),e.nodeName=t})}function i(e,t,n,r){var o=n+1;e.forEach(function(e){e.slice(t,o).forEach(function(e){e.rowMergeWith=r})})}function l(e,t,n,r){var o=n+1;e.forEach(function(e){e.slice(t,o).forEach(function(e){e.colMergeWith=r})})}function u(e,t){var n=t.start,r=t.end,u=n.rowIndex,s=n.colIndex,c=r.rowIndex,f=r.colIndex,d=e[u][s],h=e.slice(u,c+1),p=c-u+1,g=f-s+1;d.rowspan=p,d.colspan=g,d.content=o(h,s,f),a(h,s,f),p>1&&i(h.slice(1),s,f,u),g>1&&l(h,s+1,f,s)}function s(e,t,n){var r=m.default.createTableData(e),o=m.default.findElementIndex(r,t,n);return e.find("tr").eq(o.rowIndex).find("td, th")[o.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._mergeCells=u;var c=n(0),f=r(c),d=n(1),h=r(d),p=n(2),g=r(p),v=n(3),m=r(v),b=n(5),y=r(b),w=n(4),_=r(w),E=g.default.CommandManager,k=h.default.browser.msie?"":"
",x=void 0;E&&(x=E.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 o=t.getSelection().cloneRange(),a=(0,f.default)(o.startContainer),i=a.closest("table"),l=m.default.createTableData(i),c=y.default.getTableSelectionRange(l,r,a);u(l,c);var d=_.default.replaceTable(i,l),h=s(d,c.start.rowIndex,c.start.colIndex);_.default.focusToCell(t,o,h)}}}})),t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n,r=t.start,o=t.end,a=r.colIndex,i=o.colIndex+1,l=e.slice(r.rowIndex,o.rowIndex+1),u=l.map(function(e){return e.slice(a,i)});return!!(n=[]).concat.apply(n,u).filter(function(e){return e.colspan>1||e.rowspan>1}).length}function a(e,t,n,r,o){var a=t+r,i=n+o,l=f.default.range(n,i);f.default.range(t,a).forEach(function(n){var r=e[n],o=n===t?1:0;l.slice(o).forEach(function(e){r[e]=g.default.createBasicCell(n,e,r[e].nodeName)})})}function i(e,t){var n=t.start,r=t.end,o=f.default.range(n.colIndex,r.colIndex+1);f.default.range(n.rowIndex,r.rowIndex+1).forEach(function(t){o.forEach(function(n){var r=e[t][n],o=r.colspan,i=r.rowspan;(o>1||i>1)&&(r.colspan=1,r.rowspan=1,a(e,t,n,i,o))})})}function l(e,t,n){var r=g.default.createTableData(e),o=g.default.findElementIndex(r,t,n);return e.find("tr").eq(o.rowIndex).find("td, th")[o.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._hasMergedCell=o,t._unmergeCells=i;var u=n(0),s=r(u),c=n(1),f=r(c),d=n(2),h=r(d),p=n(3),g=r(p),v=n(5),m=r(v),b=n(4),y=r(b),w=h.default.CommandManager,_=void 0;w&&(_=w.command("wysiwyg",{name:"UnmergeCells",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var r=(0,s.default)(n.startContainer),a=r.closest("table"),u=g.default.createTableData(a),c=e.componentManager.getManager("tableSelection").getSelectedCells(),f=m.default.getTableSelectionRange(u,c,r);if(o(u,f)){i(u,f);var d=y.default.replaceTable(a,u),h=l(d,f.start.rowIndex,f.start.colIndex);y.default.focusToCell(t,n,h)}}}})),t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=['",'",'",'","
",'",'","
",'",'",'","
",'"].join(""),n=(0,u.default)(t);e.setContent(n)}function a(e,t,n){var r=e.$content,o=(0,u.default)(r[5]),a=(0,u.default)(r[6]),i=(0,u.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)?o.hide():o.show(),e.is("[rowspan], [colspan]")?a.show():a.hide(),i.show()):(o.hide(),a.hide(),i.hide())})}function i(e,t,n){o(e),a(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),u=r(l),s=n(2),c=r(s),f=c.default.i18n;t.default={updateContextMenu:i}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.options.colorSyntax,n=void 0===t?{}:t,r=n.preset,o=n.useCustomSyntax,s=void 0!==o&&o;e.eventManager.listen("convertorAfterMarkdownToHtmlConverted",function(e){return s?e.replace(y,function(e,t,n){return u(n,t).result}):e}),e.eventManager.listen("convertorAfterHtmlToMarkdownConverted",function(e){var t=s?_:w;return e.replace(t,function(e,t,n){return t.match(E)&&(t=c(t)),s?l(n,t).result:e.replace(/ ?class="colour" ?/g," ").replace(E,t)})}),e.isViewer()||"default"!==e.getUI().name||(e.addCommand("markdown",{name:"color",exec:function(e,t){var n=e.getEditor(),r=n.getCursor("from"),o=n.getCursor("to"),a=void 0,i=void 0;if(t){if(s){var c=l(n.getSelection(),t);a=c.result,i=c.from,n.replaceSelection(a)}else{var f=u(n.getSelection(),t);a=f.result,i=f.from,n.replaceSelection(a)}n.setSelection({line:r.line,ch:r.ch+i},{line:o.line,ch:r.line===o.line?o.ch+i:o.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(a,t);var o=n.getSelection();o.collapse(!0),n.setSelection(o)}else a(n,t)}}}),i(e,r))}function a(e,t){e.hasFormat("PRE")||(t===k?e.changeFormat(null,{class:"colour",tag:"span"}):e.setTextColour(t))}function i(e,t){var n=e.i18n,r=e.getUI().getToolbar(),o=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 a=r.indexOfItem("colorSyntax"),i=r.getItem(a),l=i.$el,u=(0,p.default)("
"),s=(0,p.default)('"),c={container:u[0],usageStatistics:o};t&&(c.preset=t);var f=v.default.create(c),d=f.getColor();u.append(s);var h=e.getUI().createPopup({header:!1,title:!1,content:u,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}),f.slider.toggle(!0),e.eventManager.emit("closeAllPopup"),h.show()}),e.eventManager.listen("closeAllPopup",function(){h.hide()}),e.eventManager.listen("removeEditor",function(){f.off("selectColor"),h.$el.find(".te-apply-button").off("click"),h.remove()}),f.on("selectColor",function(t){d=t.color,"palette"===t.origin&&(e.exec("color",d),h.hide())}),h.$el.find(".te-apply-button").on("click",function(){e.exec("color",d)})}function l(e,t){return s("{color:"+t+"}",e,"{color}")}function u(e,t){return s('',e,"")}function s(e,t,n){return{result:""+e+t+n,from:e.length,to:e.length+t.length}}function c(e){return e.replace(E,function(e,t,n,r){return"#"+f(t)+f(n)+f(r)})}function f(e){var t=parseInt(e,10);return t=t.toString(16),t=d(t)}function d(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(80),v=r(g),m=n(2),b=r(m),y=/\{color:(.+?)}(.*?)\{color}/g,w=/(.*?)/g,_=/(.*?)<\/span>/g,E=/rgb\((\d+)[, ]+(\d+)[, ]+(\d+)\)/g,k="#181818";b.default.defineExtension("colorSyntax",o),t.default=o},function(e,t){e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){function t(e){var t=void 0;try{if(!i.default)throw new Error("plantuml-encoder dependency required");t=''}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,o=void 0===r?c:r,a=e.options.codeBlockLanguages;f.forEach(function(e){a.indexOf(e)<0&&a.push(e),s.setReplacer(e,t)})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(82),i=r(a),l=n(2),u=r(l),s=u.default.codeBlockManager,c="http://www.plantuml.com/plantuml/png/",f=["uml","plantuml"];u.default.defineExtension("uml",o),t.default=o},function(e,t){e.exports=l},function(e,t,n){"use strict";var r=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=n(16);o.default.fn.tuiEditor=function(){var e=void 0,t=void 0,n=this.get(0);if(n){for(var r=arguments.length,i=Array(r),l=0;l