/*! For license information please see LICENSES */ (window.webpackJsonp=window.webpackJsonp||[]).push([[13],[,,function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){var r=n(16),o=r.Buffer;function l(e,t){for(var n in e)t[n]=e[n]}function c(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(l(r,t),t.Buffer=c),c.prototype=Object.create(o.prototype),l(o,c),c.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},c.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},c.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},c.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},,,,,function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(object,e){return r.call(object,e)}function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function c(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var d=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,f=new RegExp(d.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),h=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,m=n(345);var _=/[&<>"]/,v=/[&<>"]/g,y={"&":"&","<":"<",">":">",'"':"""};function E(e){return y[e]}var S=/[.?*+^$[\]\\(){}|-]/g;var T=n(144);t.lib={},t.lib.mdurl=n(145),t.lib.ucmicro=n(335),t.assign=function(e){return Array.prototype.slice.call(arguments,1).forEach((function(source){if(source){if("object"!=typeof source)throw new TypeError(source+"must be object");Object.keys(source).forEach((function(t){e[t]=source[t]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(d,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(f,(function(e,t,n){return t||function(e,t){var code=0;return o(m,t)?m[t]:35===t.charCodeAt(0)&&h.test(t)&&l(code="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?c(code):e}(e,n)}))},t.isValidEntityCode=l,t.fromCodePoint=c,t.escapeHtml=function(e){return _.test(e)?e.replace(v,E):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(code){switch(code){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(code){if(code>=8192&&code<=8202)return!0;switch(code){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return T.test(e)},t.escapeRE=function(e){return e.replace(S,"\\$&")},t.normalizeReference=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(object,e){return r.call(object,e)}function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function c(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var d=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,f=new RegExp(d.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),h=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,m=n(333);var _=/[&<>"]/,v=/[&<>"]/g,y={"&":"&","<":"<",">":">",'"':"""};function E(e){return y[e]}var S=/[.?*+^$[\]\\(){}|-]/g;var T=n(144);t.lib={},t.lib.mdurl=n(145),t.lib.ucmicro=n(335),t.assign=function(e){return Array.prototype.slice.call(arguments,1).forEach((function(source){if(source){if("object"!=typeof source)throw new TypeError(source+"must be object");Object.keys(source).forEach((function(t){e[t]=source[t]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=o,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(d,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(f,(function(e,t,n){return t||function(e,t){var code=0;return o(m,t)?m[t]:35===t.charCodeAt(0)&&h.test(t)&&l(code="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?c(code):e}(e,n)}))},t.isValidEntityCode=l,t.fromCodePoint=c,t.escapeHtml=function(e){return _.test(e)?e.replace(v,E):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(code){switch(code){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(code){if(code>=8192&&code<=8202)return!0;switch(code){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return T.test(e)},t.escapeRE=function(e){return e.replace(S,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},,,,,,,function(e,t,n){"use strict";(function(e){var r=n(480),o=n(481),l=n(482);function c(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(c()=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|e}function E(e,t){if(f.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 K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return K(e).length;t=(""+t).toLowerCase(),r=!0}}function S(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))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function T(b,e,t){var i=b[e];b[e]=b[t],b[t]=i}function w(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=f.from(t,r)),f.isBuffer(t))return 0===t.length?-1:C(e,t,n,r,o);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function C(e,t,n,r,o){var i,l=1,c=e.length,d=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;l=2,c/=2,d/=2,n/=2}function f(e,i){return 1===l?e[i]:e.readUInt16BE(i*l)}if(o){var h=-1;for(i=n;ic&&(n=c-d),i=n;i>=0;i--){for(var m=!0,_=0;_o&&(r=o):r=o;var l=t.length;if(l%2!=0)throw new TypeError("Invalid hex string");r>l/2&&(r=l/2);for(var i=0;i>8,o=n%256,l.push(o),l.push(r);return l}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:f>223?3:f>191?2:1;if(i+m<=n)switch(m){case 1:f<128&&(h=f);break;case 2:128==(192&(o=e[i+1]))&&(d=(31&f)<<6|63&o)>127&&(h=d);break;case 3:o=e[i+1],l=e[i+2],128==(192&o)&&128==(192&l)&&(d=(15&f)<<12|(63&o)<<6|63&l)>2047&&(d<55296||d>57343)&&(h=d);break;case 4:o=e[i+1],l=e[i+2],c=e[i+3],128==(192&o)&&128==(192&l)&&128==(192&c)&&(d=(15&f)<<18|(63&o)<<12|(63&l)<<6|63&c)>65535&&d<1114112&&(h=d)}null===h?(h=65533,m=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=m}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},f.prototype.compare=function(e,t,n,r,o){if(!f.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(this===e)return 0;for(var l=(o>>>=0)-(r>>>=0),c=(n>>>=0)-(t>>>=0),d=Math.min(l,c),h=this.slice(r,o),m=e.slice(t,n),i=0;io)&&(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 l=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return M(this,e,t,n);case"ascii":return A(this,e,t,n);case"latin1":case"binary":return O(this,e,t,n);case"base64":return R(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,t,n);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),l=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function G(e,t,n,r,o,l){if(!f.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 H(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function z(e,t,n,r,o,l){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(e,t,n,r,l){return l||z(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,l){return l||z(e,0,n,8),o.write(e,t,n,r,52,8),n+8}f.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},f.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},f.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||G(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(o*=256);)this[t+i]=e/o&255;return t+n},f.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);G(this,e,t,n,o-1,-o)}var i=0,l=1,sub=0;for(this[t]=255&e;++i=0&&(l*=256);)e<0&&0===sub&&0!==this[t+i+1]&&(sub=1),this[t+i]=(e/l|0)-sub&255;return t+n},f.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||G(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,n){return Y(this,e,t,!0,n)},f.prototype.writeFloatBE=function(e,t,n){return Y(this,e,t,!1,n)},f.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},f.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},f.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;--i)e[i+t]=this[i+n];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&l.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&l.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&l.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&l.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;l.push(n)}else if(n<2048){if((t-=2)<0)break;l.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;l.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;l.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return l}function Q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(19))},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var content=e(t);return t[2]?"@media ".concat(t[2]," {").concat(content,"}"):content})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;it.parts.length&&(n.parts.length=t.parts.length)}else{var o=[];for(r=0;r(o>>1)-1?(o>>1)-d:d,l.isubn(c)):c=0,r[i]=c,l.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,o=0,l=0;e.cmpn(-o)>0||t.cmpn(-l)>0;){var c,d,f=e.andln(3)+o&3,h=t.andln(3)+l&3;3===f&&(f=-1),3===h&&(h=-1),c=1&f?3!==(r=e.andln(7)+o&7)&&5!==r||2!==h?f:-f:0,n[0].push(c),d=1&h?3!==(r=t.andln(7)+l&7)&&5!==r||2!==f?h:-h:0,n[1].push(d),2*o===c+1&&(o=1-o),2*l===d+1&&(l=1-l),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new o(e,"hex","le")}},,,,,,function(e,t,n){"use strict";var r=n(37),o=n(2);function l(e,i){return 55296==(64512&e.charCodeAt(i))&&(!(i<0||i+1>=e.length)&&56320==(64512&e.charCodeAt(i+1)))}function c(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function d(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,n[p++]=63&r|128):l(e,i)?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i)),n[p++]=r>>18|240,n[p++]=r>>12&63|128,n[p++]=r>>6&63|128,n[p++]=63&r|128):(n[p++]=r>>12|224,n[p++]=r>>6&63|128,n[p++]=63&r|128)}else for(i=0;i>>0}return c},t.split32=function(e,t){for(var n=new Array(4*e.length),i=0,r=0;i>>24,n[r+1]=o>>>16&255,n[r+2]=o>>>8&255,n[r+3]=255&o):(n[r+3]=o>>>24,n[r+2]=o>>>16&255,n[r+1]=o>>>8&255,n[r]=255&o)}return n},t.rotr32=function(e,b){return e>>>b|e<<32-b},t.rotl32=function(e,b){return e<>>32-b},t.sum32=function(a,b){return a+b>>>0},t.sum32_3=function(a,b,e){return a+b+e>>>0},t.sum32_4=function(a,b,e,t){return a+b+e+t>>>0},t.sum32_5=function(a,b,e,t,n){return a+b+e+t+n>>>0},t.sum64=function(e,t,n,r){var o=e[t],l=r+e[t+1]>>>0,c=(l>>0,e[t+1]=l},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,l,c,dl){var d=0,f=t;return d+=(f=f+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,o,l,c,dl){return t+r+l+dl>>>0},t.sum64_5_hi=function(e,t,n,r,o,l,c,dl,d,f){var h=0,m=t;return h+=(m=m+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,o,l,c,dl,d,f){return t+r+l+dl+f>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},,,,,function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function l(e,base,t){if(l.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==base&&"be"!==base||(t=base,base=10),this._init(e||0,base||10,t||"be"))}var c;"object"==typeof e?e.exports=l:t.BN=l,l.BN=l,l.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(538).Buffer}catch(e){}function d(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function f(e,t,n){var r=d(e,n);return n-1>=t&&(r|=d(e,n-1)<<4),r}function h(e,t,n,r){for(var o=0,l=Math.min(e.length,n),i=t;i=49?c-49+10:c>=17?c-17+10:c}return o}l.isBN=function(e){return e instanceof l||null!==e&&"object"==typeof e&&e.constructor.wordSize===l.wordSize&&Array.isArray(e.words)},l.max=function(e,t){return e.cmp(t)>0?e:t},l.min=function(e,t){return e.cmp(t)<0?e:t},l.prototype._init=function(e,base,t){if("number"==typeof e)return this._initNumber(e,base,t);if("object"==typeof e)return this._initArray(e,base,t);"hex"===base&&(base=16),r(base===(0|base)&&base>=2&&base<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=o<>>26-l&67108863,(l+=24)>=26&&(l-=26,n++);else if("le"===t)for(i=0,n=0;i>>26-l&67108863,(l+=24)>=26&&(l-=26,n++);return this.strip()},l.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)r=f(e,t,i)<=18?(o-=18,l+=1,this.words[l]|=r>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,l+=1,this.words[l]|=r>>>26):o+=8;this.strip()},l.prototype._parseBase=function(e,base,t){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=base)n++;n--,r=r/base|0;for(var o=e.length-t,l=o%n,c=Math.min(o,o-l)+t,d=0,i=t;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},l.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},l.prototype.inspect=function(){return(this.red?""};var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var a=0|e.words[0],b=0|t.words[0],o=a*b,l=67108863&o,c=o/67108864|0;n.words[0]=l;for(var d=1;d>>26,h=67108863&c,m=Math.min(d,t.length-1),_=Math.max(0,d-e.length+1);_<=m;_++){var i=d-_|0;f+=(o=(a=0|e.words[i])*(b=0|t.words[_])+h)/67108864|0,h=67108863&o}n.words[d]=0|h,c=0|f}return 0!==c?n.words[d]=0|c:n.length--,n.strip()}l.prototype.toString=function(base,e){var t;if(e=0|e||1,16===(base=base||10)||"hex"===base){t="";for(var n=0,o=0,i=0;i>>24-n&16777215)||i!==this.length-1?m[6-c.length]+c+t:c+t,(n+=2)>=26&&(n-=26,i--)}for(0!==o&&(t=o.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(base===(0|base)&&base>=2&&base<=36){var d=_[base],f=v[base];t="";var h=this.clone();for(h.negative=0;!h.isZero();){var y=h.modn(f).toString(base);t=(h=h.idivn(f)).isZero()?y+t:m[d-y.length]+y+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}r(!1,"Base should be between 2 and 36")},l.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},l.prototype.toJSON=function(){return this.toString(16)},l.prototype.toBuffer=function(e,t){return r(void 0!==c),this.toArrayLike(c,e,t)},l.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},l.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),l=n||Math.max(1,o);r(o<=l,"byte array longer than desired length"),r(l>0,"Requested array length <= 0"),this.strip();var b,i,c="le"===t,d=new e(l),q=this.clone();if(c){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),d[i]=b;for(;i=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},l.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},l.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},l.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,i=0;ie.length?this.clone().ior(e):e.clone().ior(this)},l.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},l.prototype.iuand=function(e){var b;b=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},l.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},l.prototype.iuxor=function(e){var a,b;this.length>e.length?(a=this,b=e):(a=e,b=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},l.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},l.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},l.prototype.notn=function(e){return this.clone().inotn(e)},l.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(a=this,b=e):(a=e,b=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},l.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,b,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,b=e):(a=e,b=this);for(var r=0,i=0;i>26,this.words[i]=67108863&t;for(;0!==r&&i>26,this.words[i]=67108863&t;if(0===r&&i>>13,_=0|a[1],v=8191&_,y=_>>>13,E=0|a[2],S=8191&E,T=E>>>13,w=0|a[3],C=8191&w,x=w>>>13,M=0|a[4],A=8191&M,O=M>>>13,R=0|a[5],N=8191&R,k=R>>>13,I=0|a[6],D=8191&I,L=I>>>13,P=0|a[7],B=8191&P,F=P>>>13,U=0|a[8],G=8191&U,H=U>>>13,j=0|a[9],z=8191&j,Y=j>>>13,V=0|b[0],W=8191&V,$=V>>>13,K=0|b[1],Q=8191&K,Z=K>>>13,X=0|b[2],J=8191&X,ee=X>>>13,te=0|b[3],ne=8191&te,re=te>>>13,ie=0|b[4],oe=8191&ie,ae=ie>>>13,se=0|b[5],le=8191&se,ue=se>>>13,ce=0|b[6],de=8191&ce,fe=ce>>>13,he=0|b[7],pe=8191&he,me=he>>>13,ge=0|b[8],_e=8191&ge,ve=ge>>>13,be=0|b[9],ye=8191&be,Ee=be>>>13;n.negative=e.negative^t.negative,n.length=19;var Se=(d+(r=Math.imul(h,W))|0)+((8191&(o=(o=Math.imul(h,$))+Math.imul(m,W)|0))<<13)|0;d=((l=Math.imul(m,$))+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(v,W),o=(o=Math.imul(v,$))+Math.imul(y,W)|0,l=Math.imul(y,$);var Te=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(o=(o=o+Math.imul(h,Z)|0)+Math.imul(m,Q)|0))<<13)|0;d=((l=l+Math.imul(m,Z)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(S,W),o=(o=Math.imul(S,$))+Math.imul(T,W)|0,l=Math.imul(T,$),r=r+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,Z)|0)+Math.imul(y,Q)|0,l=l+Math.imul(y,Z)|0;var we=(d+(r=r+Math.imul(h,J)|0)|0)+((8191&(o=(o=o+Math.imul(h,ee)|0)+Math.imul(m,J)|0))<<13)|0;d=((l=l+Math.imul(m,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(C,W),o=(o=Math.imul(C,$))+Math.imul(x,W)|0,l=Math.imul(x,$),r=r+Math.imul(S,Q)|0,o=(o=o+Math.imul(S,Z)|0)+Math.imul(T,Q)|0,l=l+Math.imul(T,Z)|0,r=r+Math.imul(v,J)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(y,J)|0,l=l+Math.imul(y,ee)|0;var Ce=(d+(r=r+Math.imul(h,ne)|0)|0)+((8191&(o=(o=o+Math.imul(h,re)|0)+Math.imul(m,ne)|0))<<13)|0;d=((l=l+Math.imul(m,re)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(A,W),o=(o=Math.imul(A,$))+Math.imul(O,W)|0,l=Math.imul(O,$),r=r+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(x,Q)|0,l=l+Math.imul(x,Z)|0,r=r+Math.imul(S,J)|0,o=(o=o+Math.imul(S,ee)|0)+Math.imul(T,J)|0,l=l+Math.imul(T,ee)|0,r=r+Math.imul(v,ne)|0,o=(o=o+Math.imul(v,re)|0)+Math.imul(y,ne)|0,l=l+Math.imul(y,re)|0;var xe=(d+(r=r+Math.imul(h,oe)|0)|0)+((8191&(o=(o=o+Math.imul(h,ae)|0)+Math.imul(m,oe)|0))<<13)|0;d=((l=l+Math.imul(m,ae)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(N,W),o=(o=Math.imul(N,$))+Math.imul(k,W)|0,l=Math.imul(k,$),r=r+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,Z)|0)+Math.imul(O,Q)|0,l=l+Math.imul(O,Z)|0,r=r+Math.imul(C,J)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(x,J)|0,l=l+Math.imul(x,ee)|0,r=r+Math.imul(S,ne)|0,o=(o=o+Math.imul(S,re)|0)+Math.imul(T,ne)|0,l=l+Math.imul(T,re)|0,r=r+Math.imul(v,oe)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,l=l+Math.imul(y,ae)|0;var Me=(d+(r=r+Math.imul(h,le)|0)|0)+((8191&(o=(o=o+Math.imul(h,ue)|0)+Math.imul(m,le)|0))<<13)|0;d=((l=l+Math.imul(m,ue)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(D,W),o=(o=Math.imul(D,$))+Math.imul(L,W)|0,l=Math.imul(L,$),r=r+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,Z)|0)+Math.imul(k,Q)|0,l=l+Math.imul(k,Z)|0,r=r+Math.imul(A,J)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(O,J)|0,l=l+Math.imul(O,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(x,ne)|0,l=l+Math.imul(x,re)|0,r=r+Math.imul(S,oe)|0,o=(o=o+Math.imul(S,ae)|0)+Math.imul(T,oe)|0,l=l+Math.imul(T,ae)|0,r=r+Math.imul(v,le)|0,o=(o=o+Math.imul(v,ue)|0)+Math.imul(y,le)|0,l=l+Math.imul(y,ue)|0;var Ae=(d+(r=r+Math.imul(h,de)|0)|0)+((8191&(o=(o=o+Math.imul(h,fe)|0)+Math.imul(m,de)|0))<<13)|0;d=((l=l+Math.imul(m,fe)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,W),o=(o=Math.imul(B,$))+Math.imul(F,W)|0,l=Math.imul(F,$),r=r+Math.imul(D,Q)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(L,Q)|0,l=l+Math.imul(L,Z)|0,r=r+Math.imul(N,J)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(k,J)|0,l=l+Math.imul(k,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(O,ne)|0,l=l+Math.imul(O,re)|0,r=r+Math.imul(C,oe)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(x,oe)|0,l=l+Math.imul(x,ae)|0,r=r+Math.imul(S,le)|0,o=(o=o+Math.imul(S,ue)|0)+Math.imul(T,le)|0,l=l+Math.imul(T,ue)|0,r=r+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(y,de)|0,l=l+Math.imul(y,fe)|0;var Oe=(d+(r=r+Math.imul(h,pe)|0)|0)+((8191&(o=(o=o+Math.imul(h,me)|0)+Math.imul(m,pe)|0))<<13)|0;d=((l=l+Math.imul(m,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(G,W),o=(o=Math.imul(G,$))+Math.imul(H,W)|0,l=Math.imul(H,$),r=r+Math.imul(B,Q)|0,o=(o=o+Math.imul(B,Z)|0)+Math.imul(F,Q)|0,l=l+Math.imul(F,Z)|0,r=r+Math.imul(D,J)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(L,J)|0,l=l+Math.imul(L,ee)|0,r=r+Math.imul(N,ne)|0,o=(o=o+Math.imul(N,re)|0)+Math.imul(k,ne)|0,l=l+Math.imul(k,re)|0,r=r+Math.imul(A,oe)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(O,oe)|0,l=l+Math.imul(O,ae)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(x,le)|0,l=l+Math.imul(x,ue)|0,r=r+Math.imul(S,de)|0,o=(o=o+Math.imul(S,fe)|0)+Math.imul(T,de)|0,l=l+Math.imul(T,fe)|0,r=r+Math.imul(v,pe)|0,o=(o=o+Math.imul(v,me)|0)+Math.imul(y,pe)|0,l=l+Math.imul(y,me)|0;var Re=(d+(r=r+Math.imul(h,_e)|0)|0)+((8191&(o=(o=o+Math.imul(h,ve)|0)+Math.imul(m,_e)|0))<<13)|0;d=((l=l+Math.imul(m,ve)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(z,W),o=(o=Math.imul(z,$))+Math.imul(Y,W)|0,l=Math.imul(Y,$),r=r+Math.imul(G,Q)|0,o=(o=o+Math.imul(G,Z)|0)+Math.imul(H,Q)|0,l=l+Math.imul(H,Z)|0,r=r+Math.imul(B,J)|0,o=(o=o+Math.imul(B,ee)|0)+Math.imul(F,J)|0,l=l+Math.imul(F,ee)|0,r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(L,ne)|0,l=l+Math.imul(L,re)|0,r=r+Math.imul(N,oe)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(k,oe)|0,l=l+Math.imul(k,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(O,le)|0,l=l+Math.imul(O,ue)|0,r=r+Math.imul(C,de)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(x,de)|0,l=l+Math.imul(x,fe)|0,r=r+Math.imul(S,pe)|0,o=(o=o+Math.imul(S,me)|0)+Math.imul(T,pe)|0,l=l+Math.imul(T,me)|0,r=r+Math.imul(v,_e)|0,o=(o=o+Math.imul(v,ve)|0)+Math.imul(y,_e)|0,l=l+Math.imul(y,ve)|0;var Ne=(d+(r=r+Math.imul(h,ye)|0)|0)+((8191&(o=(o=o+Math.imul(h,Ee)|0)+Math.imul(m,ye)|0))<<13)|0;d=((l=l+Math.imul(m,Ee)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(z,Q),o=(o=Math.imul(z,Z))+Math.imul(Y,Q)|0,l=Math.imul(Y,Z),r=r+Math.imul(G,J)|0,o=(o=o+Math.imul(G,ee)|0)+Math.imul(H,J)|0,l=l+Math.imul(H,ee)|0,r=r+Math.imul(B,ne)|0,o=(o=o+Math.imul(B,re)|0)+Math.imul(F,ne)|0,l=l+Math.imul(F,re)|0,r=r+Math.imul(D,oe)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(L,oe)|0,l=l+Math.imul(L,ae)|0,r=r+Math.imul(N,le)|0,o=(o=o+Math.imul(N,ue)|0)+Math.imul(k,le)|0,l=l+Math.imul(k,ue)|0,r=r+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(O,de)|0,l=l+Math.imul(O,fe)|0,r=r+Math.imul(C,pe)|0,o=(o=o+Math.imul(C,me)|0)+Math.imul(x,pe)|0,l=l+Math.imul(x,me)|0,r=r+Math.imul(S,_e)|0,o=(o=o+Math.imul(S,ve)|0)+Math.imul(T,_e)|0,l=l+Math.imul(T,ve)|0;var ke=(d+(r=r+Math.imul(v,ye)|0)|0)+((8191&(o=(o=o+Math.imul(v,Ee)|0)+Math.imul(y,ye)|0))<<13)|0;d=((l=l+Math.imul(y,Ee)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(z,J),o=(o=Math.imul(z,ee))+Math.imul(Y,J)|0,l=Math.imul(Y,ee),r=r+Math.imul(G,ne)|0,o=(o=o+Math.imul(G,re)|0)+Math.imul(H,ne)|0,l=l+Math.imul(H,re)|0,r=r+Math.imul(B,oe)|0,o=(o=o+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,l=l+Math.imul(F,ae)|0,r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(L,le)|0,l=l+Math.imul(L,ue)|0,r=r+Math.imul(N,de)|0,o=(o=o+Math.imul(N,fe)|0)+Math.imul(k,de)|0,l=l+Math.imul(k,fe)|0,r=r+Math.imul(A,pe)|0,o=(o=o+Math.imul(A,me)|0)+Math.imul(O,pe)|0,l=l+Math.imul(O,me)|0,r=r+Math.imul(C,_e)|0,o=(o=o+Math.imul(C,ve)|0)+Math.imul(x,_e)|0,l=l+Math.imul(x,ve)|0;var Ie=(d+(r=r+Math.imul(S,ye)|0)|0)+((8191&(o=(o=o+Math.imul(S,Ee)|0)+Math.imul(T,ye)|0))<<13)|0;d=((l=l+Math.imul(T,Ee)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(z,ne),o=(o=Math.imul(z,re))+Math.imul(Y,ne)|0,l=Math.imul(Y,re),r=r+Math.imul(G,oe)|0,o=(o=o+Math.imul(G,ae)|0)+Math.imul(H,oe)|0,l=l+Math.imul(H,ae)|0,r=r+Math.imul(B,le)|0,o=(o=o+Math.imul(B,ue)|0)+Math.imul(F,le)|0,l=l+Math.imul(F,ue)|0,r=r+Math.imul(D,de)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(L,de)|0,l=l+Math.imul(L,fe)|0,r=r+Math.imul(N,pe)|0,o=(o=o+Math.imul(N,me)|0)+Math.imul(k,pe)|0,l=l+Math.imul(k,me)|0,r=r+Math.imul(A,_e)|0,o=(o=o+Math.imul(A,ve)|0)+Math.imul(O,_e)|0,l=l+Math.imul(O,ve)|0;var De=(d+(r=r+Math.imul(C,ye)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ee)|0)+Math.imul(x,ye)|0))<<13)|0;d=((l=l+Math.imul(x,Ee)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(z,oe),o=(o=Math.imul(z,ae))+Math.imul(Y,oe)|0,l=Math.imul(Y,ae),r=r+Math.imul(G,le)|0,o=(o=o+Math.imul(G,ue)|0)+Math.imul(H,le)|0,l=l+Math.imul(H,ue)|0,r=r+Math.imul(B,de)|0,o=(o=o+Math.imul(B,fe)|0)+Math.imul(F,de)|0,l=l+Math.imul(F,fe)|0,r=r+Math.imul(D,pe)|0,o=(o=o+Math.imul(D,me)|0)+Math.imul(L,pe)|0,l=l+Math.imul(L,me)|0,r=r+Math.imul(N,_e)|0,o=(o=o+Math.imul(N,ve)|0)+Math.imul(k,_e)|0,l=l+Math.imul(k,ve)|0;var Le=(d+(r=r+Math.imul(A,ye)|0)|0)+((8191&(o=(o=o+Math.imul(A,Ee)|0)+Math.imul(O,ye)|0))<<13)|0;d=((l=l+Math.imul(O,Ee)|0)+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,r=Math.imul(z,le),o=(o=Math.imul(z,ue))+Math.imul(Y,le)|0,l=Math.imul(Y,ue),r=r+Math.imul(G,de)|0,o=(o=o+Math.imul(G,fe)|0)+Math.imul(H,de)|0,l=l+Math.imul(H,fe)|0,r=r+Math.imul(B,pe)|0,o=(o=o+Math.imul(B,me)|0)+Math.imul(F,pe)|0,l=l+Math.imul(F,me)|0,r=r+Math.imul(D,_e)|0,o=(o=o+Math.imul(D,ve)|0)+Math.imul(L,_e)|0,l=l+Math.imul(L,ve)|0;var Pe=(d+(r=r+Math.imul(N,ye)|0)|0)+((8191&(o=(o=o+Math.imul(N,Ee)|0)+Math.imul(k,ye)|0))<<13)|0;d=((l=l+Math.imul(k,Ee)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(z,de),o=(o=Math.imul(z,fe))+Math.imul(Y,de)|0,l=Math.imul(Y,fe),r=r+Math.imul(G,pe)|0,o=(o=o+Math.imul(G,me)|0)+Math.imul(H,pe)|0,l=l+Math.imul(H,me)|0,r=r+Math.imul(B,_e)|0,o=(o=o+Math.imul(B,ve)|0)+Math.imul(F,_e)|0,l=l+Math.imul(F,ve)|0;var Be=(d+(r=r+Math.imul(D,ye)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ee)|0)+Math.imul(L,ye)|0))<<13)|0;d=((l=l+Math.imul(L,Ee)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(z,pe),o=(o=Math.imul(z,me))+Math.imul(Y,pe)|0,l=Math.imul(Y,me),r=r+Math.imul(G,_e)|0,o=(o=o+Math.imul(G,ve)|0)+Math.imul(H,_e)|0,l=l+Math.imul(H,ve)|0;var Fe=(d+(r=r+Math.imul(B,ye)|0)|0)+((8191&(o=(o=o+Math.imul(B,Ee)|0)+Math.imul(F,ye)|0))<<13)|0;d=((l=l+Math.imul(F,Ee)|0)+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,r=Math.imul(z,_e),o=(o=Math.imul(z,ve))+Math.imul(Y,_e)|0,l=Math.imul(Y,ve);var Ue=(d+(r=r+Math.imul(G,ye)|0)|0)+((8191&(o=(o=o+Math.imul(G,Ee)|0)+Math.imul(H,ye)|0))<<13)|0;d=((l=l+Math.imul(H,Ee)|0)+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863;var Ge=(d+(r=Math.imul(z,ye))|0)+((8191&(o=(o=Math.imul(z,Ee))+Math.imul(Y,ye)|0))<<13)|0;return d=((l=Math.imul(Y,Ee))+(o>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,c[0]=Se,c[1]=Te,c[2]=we,c[3]=Ce,c[4]=xe,c[5]=Me,c[6]=Ae,c[7]=Oe,c[8]=Re,c[9]=Ne,c[10]=ke,c[11]=Ie,c[12]=De,c[13]=Le,c[14]=Pe,c[15]=Be,c[16]=Fe,c[17]=Ue,c[18]=Ge,0!==d&&(c[19]=d,n.length++),n};function S(e,t,n){return(new T).mulp(e,t,n)}function T(e,t){this.x=e,this.y=t}Math.imul||(E=y),l.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?E(this,e,t):r<63?y(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,l=0;l>>26)|0)>>>26,c&=67108863}n.words[l]=d,r=c,c=o}return 0!==r?n.words[l]=r:n.length--,n.strip()}(this,e,t):S(this,e,t),n},T.prototype.makeRBT=function(e){for(var t=new Array(e),n=l.prototype._countBits(e)-1,i=0;i>=1;return r},T.prototype.permute=function(e,t,n,r,o,l){for(var i=0;i>>=1)i++;return 1<>>=13,n[2*i+1]=8191&l,l>>>=13;for(i=2*t;i>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},l.prototype.muln=function(e){return this.clone().imuln(e)},l.prototype.sqr=function(){return this.mul(this)},l.prototype.isqr=function(){return this.imul(this.clone())},l.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new l(1);for(var n=this,i=0;i=0);var i,t=e%26,s=(e-t)/26,n=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(i=0;i>>26-t}o&&(this.words[i]=o,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0),o=t?(t-t%26)/26:0;var l=e%26,s=Math.min((e-l)/26,this.length),mask=67108863^67108863>>>l<s)for(this.length-=s,i=0;i=0&&(0!==d||i>=o);i--){var f=0|this.words[i];this.words[i]=d<<26-l|f>>>l,d=f&mask}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},l.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},l.prototype.shln=function(e){return this.clone().ishln(e)},l.prototype.ushln=function(e){return this.clone().iushln(e)},l.prototype.shrn=function(e){return this.clone().ishrn(e)},l.prototype.ushrn=function(e){return this.clone().iushrn(e)},l.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,s=(e-t)/26,q=1<=0);var t=e%26,s=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==t&&s++,this.length=Math.min(s,this.length),0!==t){var mask=67108863^67108863>>>t<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},l.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(d/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===c)return this.strip();for(r(-1===c),c=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},l.prototype._wordDiv=function(e,t){var n=(this.length,e.length),a=this.clone(),b=e,r=0|b.words[b.length-1];0!==(n=26-this._countBits(r))&&(b=b.ushln(n),a.iushln(n),r=0|b.words[b.length-1]);var q,o=a.length-b.length;if("mod"!==t){(q=new l(null)).length=o+1,q.words=new Array(q.length);for(var i=0;i=0;d--){var f=67108864*(0|a.words[b.length+d])+(0|a.words[b.length+d-1]);for(f=Math.min(f/r|0,67108863),a._ishlnsubmul(b,f,d);0!==a.negative;)f--,a.negative=0,a._ishlnsubmul(b,1,d),a.isZero()||(a.negative^=1);q&&(q.words[d]=f)}return q&&q.strip(),a.strip(),"div"!==t&&0!==n&&a.iushrn(n),{div:q||null,mod:a}},l.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new l(0),mod:new l(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(div=c.div.neg()),"div"!==t&&(o=c.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:div,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(div=c.div.neg()),{div:div,mod:c.mod}):this.negative&e.negative?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new l(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new l(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new l(this.modn(e.words[0]))}:this._wordDiv(e,t);var div,o,c},l.prototype.div=function(e){return this.divmod(e,"div",!1).div},l.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},l.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},l.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),l=n.cmp(r);return l<0||1===o&&0===l?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},l.prototype.modn=function(e){r(e<=67108863);for(var p=(1<<26)%e,t=0,i=this.length-1;i>=0;i--)t=(p*t+(0|this.words[i]))%e;return t},l.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},l.prototype.divn=function(e){return this.clone().idivn(e)},l.prototype.egcd=function(p){r(0===p.negative),r(!p.isZero());var e=this,t=p.clone();e=0!==e.negative?e.umod(p):e.clone();for(var n=new l(1),o=new l(0),c=new l(0),d=new l(1),g=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++g;for(var f=t.clone(),h=e.clone();!e.isZero();){for(var i=0,m=1;!(e.words[0]&m)&&i<26;++i,m<<=1);if(i>0)for(e.iushrn(i);i-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var _=0,v=1;!(t.words[0]&v)&&_<26;++_,v<<=1);if(_>0)for(t.iushrn(_);_-- >0;)(c.isOdd()||d.isOdd())&&(c.iadd(f),d.isub(h)),c.iushrn(1),d.iushrn(1);e.cmp(t)>=0?(e.isub(t),n.isub(c),o.isub(d)):(t.isub(e),c.isub(n),d.isub(o))}return{a:c,b:d,gcd:t.iushln(g)}},l.prototype._invmp=function(p){r(0===p.negative),r(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var e,t=new l(1),n=new l(0),o=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,c=1;!(a.words[0]&c)&&i<26;++i,c<<=1);if(i>0)for(a.iushrn(i);i-- >0;)t.isOdd()&&t.iadd(o),t.iushrn(1);for(var d=0,f=1;!(b.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(b.iushrn(d);d-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);a.cmp(b)>=0?(a.isub(b),t.isub(n)):(b.isub(a),n.isub(t))}return(e=0===a.cmpn(1)?t:n).cmpn(0)<0&&e.iadd(p),e},l.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var a=this.clone(),b=e.clone();a.negative=0,b.negative=0;for(var t=0;a.isEven()&&b.isEven();t++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var n=a.cmp(b);if(n<0){var r=a;a=b,b=r}else if(0===n||0===b.cmpn(1))break;a.isub(b)}return b.iushln(t)},l.prototype.invm=function(e){return this.egcd(e).a.umod(e)},l.prototype.isEven=function(){return!(1&this.words[0])},l.prototype.isOdd=function(){return!(1&~this.words[0])},l.prototype.andln=function(e){return this.words[0]&e},l.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,s=(e-t)/26,q=1<>>26,o&=67108863,this.words[i]=o}return 0!==n&&(this.words[i]=n,this.length++),this},l.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},l.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|e.words[i];if(a!==b){ab&&(t=1);break}}return t},l.prototype.gtn=function(e){return 1===this.cmpn(e)},l.prototype.gt=function(e){return 1===this.cmp(e)},l.prototype.gten=function(e){return this.cmpn(e)>=0},l.prototype.gte=function(e){return this.cmp(e)>=0},l.prototype.ltn=function(e){return-1===this.cmpn(e)},l.prototype.lt=function(e){return-1===this.cmp(e)},l.prototype.lten=function(e){return this.cmpn(e)<=0},l.prototype.lte=function(e){return this.cmp(e)<=0},l.prototype.eqn=function(e){return 0===this.cmpn(e)},l.prototype.eq=function(e){return 0===this.cmp(e)},l.red=function(e){return new R(e)},l.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},l.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},l.prototype._forceRed=function(e){return this.red=e,this},l.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},l.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},l.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},l.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},l.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},l.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},l.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},l.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},l.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},l.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},l.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},l.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},l.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},l.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function C(e,p){this.name=e,this.p=new l(p,16),this.n=this.p.bitLength(),this.k=new l(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=l._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function N(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new l(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}C.prototype._tmp=function(){var e=new l(null);return e.words=new Array(Math.ceil(this.n/13)),e},C.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},C.prototype.split=function(input,e){input.iushrn(this.n,0,e)},C.prototype.imulK=function(e){return e.imul(this.k)},o(x,C),x.prototype.split=function(input,output){for(var mask=4194303,e=Math.min(input.length,9),i=0;i>>22,t=n}t>>>=22,input.words[i-10]=t,0===t&&input.length>10?input.length-=10:input.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},l._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new M;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return w[e]=t,t},R.prototype._verify1=function(a){r(0===a.negative,"red works only with positives"),r(a.red,"red works only with red numbers")},R.prototype._verify2=function(a,b){r(!(a.negative|b.negative),"red works only with positives"),r(a.red&&a.red===b.red,"red works only with red numbers")},R.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},R.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},R.prototype.add=function(a,b){this._verify2(a,b);var e=a.add(b);return e.cmp(this.m)>=0&&e.isub(this.m),e._forceRed(this)},R.prototype.iadd=function(a,b){this._verify2(a,b);var e=a.iadd(b);return e.cmp(this.m)>=0&&e.isub(this.m),e},R.prototype.sub=function(a,b){this._verify2(a,b);var e=a.sub(b);return e.cmpn(0)<0&&e.iadd(this.m),e._forceRed(this)},R.prototype.isub=function(a,b){this._verify2(a,b);var e=a.isub(b);return e.cmpn(0)<0&&e.iadd(this.m),e},R.prototype.shl=function(a,e){return this._verify1(a),this.imod(a.ushln(e))},R.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},R.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},R.prototype.isqr=function(a){return this.imul(a,a.clone())},R.prototype.sqr=function(a){return this.mul(a,a)},R.prototype.sqrt=function(a){if(a.isZero())return a.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var t=this.m.add(new l(1)).iushrn(2);return this.pow(a,t)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);r(!q.isZero());var n=new l(1).toRed(this),o=n.redNeg(),c=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new l(2*d*d).toRed(this);0!==this.pow(d,c).cmp(o);)d.redIAdd(o);for(var f=this.pow(d,q),h=this.pow(a,q.addn(1).iushrn(1)),m=this.pow(a,q),_=s;0!==m.cmp(n);){for(var v=m,i=0;0!==v.cmp(n);i++)v=v.redSqr();r(i<_);var b=this.pow(f,new l(1).iushln(_-i-1));h=h.redMul(b),f=b.redSqr(),m=m.redMul(f),_=i}return h},R.prototype.invm=function(a){var e=a._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},R.prototype.pow=function(a,e){if(e.isZero())return new l(1).toRed(this);if(0===e.cmpn(1))return a.clone();var t=new Array(16);t[0]=new l(1).toRed(this),t[1]=a;for(var i=2;i=0;i--){for(var d=e.words[i],f=c-1;f>=0;f--){var h=d>>f&1;n!==t[0]&&(n=this.sqr(n)),0!==h||0!==r?(r<<=1,r|=h,(4===++o||0===i&&0===f)&&(n=this.mul(n,t[r]),o=0,r=0)):o=0}c=26}return n},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},l.mont=function(e){return new N(e)},o(N,R),N.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},N.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},N.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var e=a.imul(b),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=e.isub(t).iushrn(this.shift),n=u;return u.cmp(this.m)>=0?n=u.isub(this.m):u.cmpn(0)<0&&(n=u.iadd(this.m)),n._forceRed(this)},N.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new l(0)._forceRed(this);var e=a.mul(b),t=e.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=e.isub(t).iushrn(this.shift),n=u;return u.cmp(this.m)>=0?n=u.isub(this.m):u.cmpn(0)<0&&(n=u.iadd(this.m)),n._forceRed(this)},N.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(48)(e))},,,,,,,,,,function(e,t,n){var r=n(3).Buffer,o=n(134).Transform,l=n(106).StringDecoder;function c(e){o.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(2)(c,o),c.prototype.update=function(data,e,t){"string"==typeof data&&(data=r.from(data,e));var n=this._update(data);return this.hashMode?this:(t&&(n=this._toString(n,t)),n)},c.prototype.setAutoPadding=function(){},c.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},c.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},c.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},c.prototype._transform=function(data,e,t){var n;try{this.hashMode?this._update(data):this.push(this._update(data))}catch(e){n=e}finally{t(n)}},c.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},c.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},c.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new l(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=c},,,,,,,,,,,function(e,t,n){"use strict";var r=n(136),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=_;var l=Object.create(n(105));l.inherits=n(2);var c=n(273),d=n(183);l.inherits(_,c);for(var f=o(d.prototype),h=0;hl)throw new RangeError("requested too many random bytes");var n=c.allocUnsafe(e);if(e>0)if(e>o)for(var f=0;f2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,c,d;if("string"==typeof t&&(o="not ",t.substr(!c||c<0?0:+c,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))d="The ".concat(e," ").concat(r," ").concat(l(t,"type"));else{var f=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";d='The "'.concat(e,'" ').concat(f," ").concat(r," ").concat(l(t,"type"))}return d+=". Received type ".concat(typeof n)}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=h;var o=n(280),l=n(284);n(2)(h,o);for(var c=r(l.prototype),d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var l=this._hash();return e?l.toString(e):l},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){"use strict";var r={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(e,t){var n=t.parent,r=t.slots,o=t.props,l=r(),c=l.default;void 0===c&&(c=[]);var d=l.placeholder;return n._isMounted?c:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||d)?e(o.placeholderTag,{class:["no-ssr-placeholder"]},o.placeholder||d):c.length>0?c.map((function(){return e(!1)})):e(!1))}};e.exports=r},,,,,,,,,,,,,,function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,l=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var c=Number.isNaN||function(e){return e!=e};function d(){d.init.call(this)}e.exports=d,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,l),r(n)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}w(e,t,l,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&w(e,"error",t,n)}(e,o,{once:!0})}))},d.EventEmitter=d,d.prototype._events=void 0,d.prototype._eventsCount=0,d.prototype._maxListeners=void 0;var f=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function m(e){return void 0===e._maxListeners?d.defaultMaxListeners:e._maxListeners}function _(e,t,n,r){var o,l,c,d;if(h(n),void 0===(l=e._events)?(l=e._events=Object.create(null),e._eventsCount=0):(void 0!==l.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),l=e._events),c=l[t]),void 0===c)c=l[t]=n,++e._eventsCount;else if("function"==typeof c?c=l[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(o=m(e))>0&&c.length>o&&!c.warned){c.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=c.length,d=f,console&&console.warn&&console.warn(d)}return e}function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=v.bind(r);return o.listener=n,r.wrapFn=o,o}function E(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),i=0;i0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var d=r[e];if(void 0===d)return!1;if("function"==typeof d)l(d,this,t);else{var f=d.length,h=T(d,f);for(i=0;i=0;i--)if(n[i]===t||n[i].listener===t){l=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},d.prototype.listeners=function(e){return E(this,e,!0)},d.prototype.rawListeners=function(e){return E(this,e,!1)},d.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):S.call(e,t)},d.prototype.listenerCount=S,d.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(16).Buffer.isBuffer},function(e,t,n){"use strict";var r=n(487).Buffer,o=r.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}};function l(e){var t;switch(this.encoding=function(e){var t=function(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}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=h,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=m,this.end=_,t=3;break;default:return this.write=v,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function d(e){var p=this.lastTotal-this.lastNeed,t=function(e,t,p){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==t?t:this.lastNeed<=e.length?(e.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,p,0,e.length),void(this.lastNeed-=e.length))}function f(e,i){if((e.length-i)%2==0){var t=e.toString("utf16le",i);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",i,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 m(e,i){var t=(e.length-i)%3;return 0===t?e.toString("base64",i):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",i,e.length-t))}function _(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 y(e){return e&&e.length?this.write(e):""}t.StringDecoder=l,l.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return r>0&&(e.lastNeed=r-1),r;if(--n=0)return r>0&&(e.lastNeed=r-2),r;if(--n=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,i);if(!this.lastNeed)return e.toString("utf8",i);this.lastTotal=t;var n=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",i,n)},l.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";var r=n(2),o=n(184),l=n(186),c=n(187),d=n(59);function f(e){d.call(this,"digest"),this._hash=e}r(f,d),f.prototype._update=function(data){this._hash.update(data)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new o:"rmd160"===e||"ripemd160"===e?new l:new f(c(e))}},function(e,t,n){(function(t){e.exports=function(a,b){for(var e=Math.min(a.length,b.length),n=new t(e),i=0;i=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._command=new l.default.Map,this._mdCommand=new l.default.Map,this._wwCommand=new l.default.Map,this._options=o.default.extend({useCommandShortcut:!0},t),this.base=base,this.keyMapCommand={},this._initEvent()}return r(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?l-1:0),d=1;d=0&&(n=e.childNodes[t]),n},y=function(e,t,n){for(var r=e+"Sibling",o=void 0,l=void 0;t&&!t[r]&&(o=h(t.parentNode))!==n&&"BODY"!==o;)t=t.parentNode;return t[r]&&(l=t[r]),l},E=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},S=function(e,t){return o.default.isString(t)?E(e,(function(e){return t===h(e)})):E(e,(function(e){return t===e}))},T=function(e,t,n){var r=e+"Sibling",o=void 0;return(t=S(t,n))&&t[r]&&(o=t[r]),o},w=function(e){var path={};path.tagName=e.nodeName,e.id&&(path.id=e.id);var t=e.className.trim();return t&&(path.className=t),path},C=function(e,t,n){var r=t;if(r&&e===r.parentNode)for(;r!==n;){var o=r.nextSibling;e.removeChild(r),r=o}},x=function(e){return!!e&&("UL"===e.nodeName||"OL"===e.nodeName)},M=function(e,t){e.hasChildNodes()&&(o.default.forEachArray(e.childNodes,(function(){t.appendChild(e.firstChild)})),t.normalize()),e.parentNode&&e.parentNode.removeChild(e)},A=function(e,t){if("SPAN"!==e.nodeName)for(var n=e.parentNode,r=e;r.childNodes&&1===r.childNodes.length&&!d(r.firstChild)&&"SPAN"!==(r=r.firstChild).nodeName;)if(r.nodeName===t){var o=document.createElement(t);return M(r,r.parentNode),n.replaceChild(o,e),o.appendChild(e),o}return e},O=function(e,t,n){var r=A(e,n);if(r.nodeName===n)for(var o=A(t,n),l=r,c=r.nextSibling;c;){var d=c.nextSibling;if((c=A(c,n)).nodeName===n?l?M(c,l):l=c:l=null,c===o)break;c=d}};t.default={getNodeName:h,isTextNode:d,isElemNode:f,isBlockNode: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))},getTextLength:m,getOffsetLength:function(e){var t=void 0;return f(e)?t=e.childNodes.length:d(e)&&(t=e.nodeValue.replace(c,"").length),t},getPrevOffsetNodeUntil:function(e,t,n){return t>0?v(e,t-1):y("previous",e,n)},getNodeOffsetOfParent:_,getChildNodeByOffset:v,getNodeWithDirectionUntil:y,containsNode:function(e,t){for(var n=document.createTreeWalker(e,4,null,!1),r=e===t;!r&&n.nextNode();)r=n.currentNode===t;return r},getTopPrevNodeUnder:function(e,t){return T("previous",e,t)},getTopNextNodeUnder:function(e,t){return T("next",e,t)},getParentUntilBy:E,getParentUntil:S,getTopBlockNode:function(e){return S(e,"BODY")},getPrevTextNode:function(e){for(e=e.previousSibling||e.parentNode;!d(e)&&"BODY"!==h(e);)if(e.previousSibling)for(e=e.previousSibling;e.lastChild;)e=e.lastChild;else e=e.parentNode;return"BODY"===h(e)&&(e=null),e},findOffsetNode:function(e,t,n){var r=[],text="",l=0,c=void 0;if(!t.length)return r;for(var d=t.shift(),f=document.createTreeWalker(e,4,null,!1);f.nextNode();){for(text=f.currentNode.nodeValue||"",n&&(text=n(text)),c=l+text.length;c>=d;){if(r.push({container:f.currentNode,offsetInContainer:d-l,offset:d}),!t.length)return r;d=t.shift()}l=c}do{r.push({container:f.currentNode,offsetInContainer:text.length,offset:d}),d=t.shift()}while(!o.default.isUndefined(d));return r},getPath:function(e,t){for(var n=[];e&&e!==t;)f(e)&&n.unshift(w(e)),e=e.parentNode;return n},getNodeInfo:w,getTableCellByDirection:function(e,t){var n=null;return o.default.isUndefined(t)||"next"!==t&&"previous"!==t||(n="next"===t?e.nextElementSibling:e.previousElementSibling),n},getSiblingRowCellByDirection:function(e,t,n){var l=null,c=void 0,d=void 0,f=void 0,m=void 0,v=void 0,y=void 0;return o.default.isUndefined(t)||"next"!==t&&"previous"!==t||e&&(c=(0,r.default)(e),"next"===t?(f=c.parent().next(),y=(v=(m=c.parents("thead"))[0]&&m.next())&&"TBODY"===h(v[0]),d=0):(f=c.parent().prev(),y=(v=(m=c.parents("tbody"))[0]&&m.prev())&&"THEAD"===h(v[0]),d=e.parentNode.childNodes.length-1),!o.default.isUndefined(n)&&n||(d=_(e)),f[0]?l=f.children("td,th")[d]:m[0]&&y&&(l=v.find("td,th")[d])),l},isMDSupportInlineNode:function(e){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(e.nodeName)},isStyledNode: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)},removeChildFromStartToEndNode:C,removeNodesByDirection:function(e,t,n){for(var r=t;r!==e;){var o=r.parentNode,l=r,c=l.nextSibling,d=l.previousSibling;!n&&c?C(o,c,null):n&&d&&C(o,o.childNodes[0],r),r=o}},getLeafNode:function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t.firstChild;t=d(n)&&!m(n)&&n.nextSibling||n}return t},isInsideTaskBox:function(style,e,t){var n=parseInt(style.left,10),r=parseInt(style.top,10),o=parseInt(style.width,10),l=parseInt(style.height,10);return e>=n&&e<=n+o&&t>=r&&t<=r+l},isListNode:x,isFirstListItem:function(e){var t=e.nodeName,n=e.parentNode;return"LI"===t&&e===n.firstChild},isFirstLevelListItem:function(e){var t=e.nodeName,n=e.parentNode.parentNode;return"LI"===t&&!x(n)},mergeNode:M,createHorizontalRule:function(){var div=document.createElement("div"),hr=document.createElement("hr");return div.setAttribute("contenteditable",!1),hr.setAttribute("contenteditable",!1),div.appendChild(hr),div},createEmptyLine:function(){var div=document.createElement("div");return div.appendChild(document.createElement("br")),div},changeTagOrder:A,mergeSameNodes:O,optimizeRange:function(e,t){var n=e.collapsed,r=e.commonAncestorContainer,o=e.startContainer,l=e.endContainer;if(!n){var c=null;if(o!==l?(O(S(o,r),S(l,r),t),c=r):d(o)&&(c=o.parentNode),c&&c.nodeName===t){var f=c.previousSibling,h=void 0;f&&(h=A(f)).nodeName===t&&M(c,h);var m=c.nextSibling;m&&(h=A(m)).nodeName===t&&M(h,c)}}},getAllTextNode:function(e){for(var t=document.createTreeWalker(e,4,null,!1),n=[];t.nextNode();){var r=t.currentNode;d(r)&&n.push(r)}return n},isCellNode:function(e){return!!e&&("TD"===e.nodeName||"TH"===e.nodeName)},getLastNodeBy:function(e,t){for(var n=e&&e.lastChild;n&&t(n);)n=n.lastChild;return n},getParentNodeBy:function(e,t){for(;e&&t(e.parentNode,e);)e=e.parentNode;return e},getSiblingNodeBy:function(e,t,n){for(var r=t+"Sibling";e&&n(e[r],e);)e=e[r];return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i\n \n
\n \n
\n \n
',_='
\n
\n \n
\n \n
\n
\n
\n
',v=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=l.default.extend({header:!0,$target:(0,o.default)("body"),textContent:""},e);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:e.modal?f+"modal-background":f+"wrapper",rootElement:e.$el}));return n._initInstance(e),n._initDOM(e),n._initDOMEvent(e),n._initEditorEvent(e),n}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){this._$target=e.$target,e.$el&&(this.$el=e.$el,this._isExternalHtmlUse=!0),e.content?this.$content=(0,o.default)(e.content):this.$content=e.textContent,this.options=e}},{key:"_initDOM",value:function(){this._initLayout(),this._isExternalHtmlUse||(l.default.isExisty(this.options.title)&&this.setTitle(this.options.title),this.setContent(this.$content));var e=this.options.headerButtons;if(e){this.$el.find("."+f+"close-button").remove();var t=this.$el.find("."+f+"header-buttons");t.empty(),t.append((0,o.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,o.default)(n).on("click."+this._id,(function(){return e.show()})),r&&(0,o.default)(r).on("click."+this._id,(function(){return e.hide()})),this.on("click ."+f+"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?_:m;this.$el.html(t),this.$el.addClass(e.className),this.hide(),this._$target.append(this.$el),this.$body=this.$el.find("."+f+"body"),e.header||this.$el.find("."+f+"header").remove()}}},{key:"setContent",value:function(e){this.$body.empty(),this.$body.append(e)}},{key:"setTitle",value:function(title){var e=this.$el.find("."+f+"title");e.empty(),e.append(title)}},{key:"getTitleElement",value:function(){return this.$el.find("."+f+"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,o.default)(t).off("."+this._id),n&&(0,o.default)(n).off("."+this._id),this.$el.remove(),this.$el=null}},{key:"setFitToWindow",value:function(e){this.$el.toggleClass(h,e)}},{key:"isFitToWindow",value:function(){return this.$el.hasClass(h)}},{key:"toggleFitToWindow",value:function(){var e=!this.isFitToWindow();return this.setFitToWindow(e),e}}]),t}(c.default);t.default=v},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var r,o=function(){function e(e,t){for(var i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}(t,!1)}}],[{key:"getHighlightJSLanguages",value:function(){return c.default.listLanguages()}}]),e}();t.CodeBlockManager=d,t.default=new d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=l.default.extend({tagName:"div"},t),this.tagName=t.tagName,this.className=t.className,this._id=d+=1,this._setRootElement(t.rootElement)}return r(e,[{key:"on",value:function(e,t){var n=this;l.default.isObject(e)?l.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,o=n.selector;o?this.$el.on(r,o,t):this.$el.on(r,t)}},{key:"off",value:function(e,t){if(e){var n=this._parseEventType(e),r=n.event,o=n.selector;o?this.$el.off(r,o,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,o.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(),l.default.forEachOwnProperties(this,(function(t,n){e[n]=null}))}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(0)),o=l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=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"),d=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"),f={href:/^(javascript:).*/g};t.default=function(html,e){var t=(0,r.default)("
");return html=html.replace(//g,""),t.append(html),function(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title, embed, object, details, summary").remove()}(t),function(e){e.find("*").each((function(e,t){var n=t.attributes,r=o.default.toArray(n).filter((function(e){var t=e.name.match(c),n=e.name.match(d);return!t&&!n}));o.default.forEachArray(r,(function(e){n.getNamedItem(e.name)&&n.removeNamedItem(e.name)}))}))}(t),function(e){var t=function(t){f.hasOwnProperty(t)&&e.find("["+t+"]").each((function(e,n){var r=n.attributes,o=f[t],l=r.getNamedItem(t);o&&l&&l.value.toLowerCase().match(o)&&r.removeNamedItem(t)}))};for(var n in f)t(n)}(t),function(e,t){var n=void 0;if(t)n=e[0].innerHTML;else{for(var r=document.createDocumentFragment(),l=o.default.toArray(e[0].childNodes),c=l.length,i=0;i/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(text){return text.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(//g,"\\>")}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{name:t.name};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,o.default.extend({className:t.className},e)));return n._name=e.name,n}return function(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)}(t,e),r(t,[{key:"getName",value:function(){return this._name}}]),t}(l(n(8)).default);Object.defineProperty(c,"name",{enumerable:!0,writable:!0,value:"item"}),Object.defineProperty(c,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-item"}),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i4&&void 0!==arguments[4]?arguments[4]:800;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.eventManager=n,this.convertor=r,this.$el=t,this.isViewer=!!o,this._initContentSection(),this.lazyRunner=new l.default,this.lazyRunner.registerLazyRunFunction("refresh",this.refresh,c,this)}return r(e,[{key:"_initContentSection",value:function(){this._$previewContent=(0,o.default)('
'),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(html){this._$previewContent.html(html)}},{key:"render",value:function(html){var e=this._$previewContent;html=this.eventManager.emit("previewBeforeHook",html)||html,e.empty(),e.html(html)}},{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=d},function(e,t,n){"use strict";var r=/Mac/.test(navigator.platform);e.exports={isMac:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i=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=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i"===r.content?"":n.xhtmlOut?"
\n":"
\n"},M.block.ruler.at("code",_.default),M.block.ruler.at("table",y.default,{alt:["paragraph","reference"]}),M.block.ruler.at("blockquote",v.default,{alt:["paragraph","reference","blockquote","list"]}),M.block.ruler.at("html_block",E.default,{alt:["paragraph","reference","blockquote"]}),M.inline.ruler.at("backticks",S.default),M.use(h.default),M.use(m.default);var A=new RegExp("(\\\\<|<)([A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*)(\\/?>)","g"),O=function(){function e(em){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.eventManager=em}return r(e,[{key:"_markdownToHtmlWithCodeHighlight",value:function(e,t){return e=this._replaceImgAttrToDataProp(e),x.render(e,t)}},{key:"_markdownToHtml",value:function(e,t){return e=e.replace(A,(function(e,t,n,r){return"\\"!==e[0]?""+t+n+" data-tomark-pass "+r:e})),e=this._replaceImgAttrToDataProp(e),M.render(e,t)}},{key:"_replaceImgAttrToDataProp",value:function(e){for(var t=/(]*)(onerror\s*=\s*[\\"']?[^\\"']*[\\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");return e}},{key:"_removeBrToMarkPassAttributeInCode",value:function(e){var t=(0,o.default)("
");return t.html(e),t.find("code, pre").each((function(i,e){var t=(0,o.default)(e);t.html(t.html().replace(/\sdata-tomark-pass\s(\/?)>/g,"$1>"))})),e=t.html()}},{key:"toHTMLWithCodeHightlight",value:function(e){var html=this._markdownToHtmlWithCodeHighlight(e);return html=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",html)}},{key:"toHTML",value:function(e){var html=this._markdownToHtml(e);return html=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",html),html=this._removeBrToMarkPassAttributeInCode(html)}},{key:"initHtmlSanitizer",value:function(){this.eventManager.listen("convertorAfterMarkdownToHtmlConverted",(function(html){return(0,f.default)(html,!0)}))}},{key:"setLinkAttribute",value:function(e){var t=Object.keys(e),n=function(n,r){t.forEach((function(t){n[r].attrPush([t,e[t]])}))};x.use(T.linkAttribute,n),M.use(T.linkAttribute,n)}},{key:"toMarkdown",value:function(html,e){var t=[];html=this.eventManager.emitReduce("convertorBeforeHtmlToMarkdownConverted",html),html=this._appendAttributeForLinkIfNeed(html),html=this._appendAttributeForBrIfNeed(html);var n=(0,d.default)(html,e);return n=this.eventManager.emitReduce("convertorAfterHtmlToMarkdownConverted",n),n=this._removeNewlinesBeforeAfterAndBlockElement(n),l.default.forEach(n.split("\n"),(function(line,e){/^(
)+\||\|[^|]*\|/gi.test(line)?line=line.replace(/^(
)+\|/gi,(function(e){return e.replace(/
/gi,"
\n")})):/`[^`]*
[^`]*`/gi.test(line)||(line=line.replace(/
/gi,"
\n")),t[e]=line})),t.join("\n")}},{key:"_removeNewlinesBeforeAfterAndBlockElement",value:function(e){return e=(e=e.replace(/
\n\n(#{1,6} .*|```|\||(\*+|-+|\d+\.) .*| *>[^\n]+.*)/g,"
$1")).replace(/(#{1,6} .*|```|\|)\n\n
/g,"$1\n
")}},{key:"_appendAttributeForLinkIfNeed",value:function(html){return html.replace(/!?\[.*\]\(<\s*a[^>]*>(.*?)<\s*\/\s*a>\)/gi,(function(e){return e.replace(/]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|]*>)/.source+/

/.source,"g");return html=(html=(html=(html=(html=(html=(html=html.replace(/
/gi,"
")).replace(/

/gi,"

")).replace(/
/gi,"
")).replace(/

(.)/gi,"

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

")).replace(/(.)

(|
||
    |
      |
      )/g,"$1

      $2")).replace(/(<\/h[1-6]>|<\/pre>|<\/table>|<\/ul>|<\/ol>|<\/blockquote>)
      (.)/g,"$1
      $2")}}],[{key:"getMarkdownitHighlightRenderer",value:function(){return x}},{key:"getMarkdownitRenderer",value:function(){return M}}]),e}();t.default=O},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{tagName:"button",name:t.name};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(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 function(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)}(t,e),r(t,[{key:"setTooltip",value:function(text){this._tooltip=text}},{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()&&l.default.show(this.$el,this._tooltip)}},{key:"_onOut",value:function(){l.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}(o.default);Object.defineProperty(d,"name",{enumerable:!0,writable:!0,value:"button"}),Object.defineProperty(d,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-icons"}),t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i","?","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",""],l=void 0,c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._setSplitter(t)}return r(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 l||(l=new e),l}},{key:"keyCode",value:function(e){return o.indexOf(e)}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i3&&r(t,"data-backticks",o),t.info&&r(t,"data-language",(html=t.info.replace(" ",""),l=!0,html.replace(l?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"))))}))}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o,l,c=0;if(e.src.split("\n")[t].match(/ {0,3}(?:-|\*|\d\.) /)||e.sCount[t]-e.blkIndent<4)return!1;for(o=r=t+1;r=2&&"list"===e.parentType)break;r++}else{if(c=0,!(e.sCount[r]-e.blkIndent>=4))break;o=++r}return e.line=o,(l=e.push("code_block","code",0)).content=e.getLines(t,o,4+e.blkIndent,!0),l.map=[t,e.line],!0}},function(e,t,n){"use strict";function r(code){switch(code){case 9:case 32:return!0}return!1}e.exports=function(e,t,n,o){var l,c,i,d,f,h,m,_,v,y,E,S,T,w,C,x,M,A,O,R,N=e.lineMax,k=e.bMarks[t]+e.tShift[t],I=e.eMarks[t],D=e.src.split("\n")[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(k++))return!1;if(D.match(/(?:-|\*|\d+\.) {1,4}(?:> {0,3})[^>]*$/))return!1;if(o)return!0;for(d=v=e.sCount[t]+k-(e.bMarks[t]+e.tShift[t]),32===e.src.charCodeAt(k)?(k++,d++,v++,l=!1,x=!0):9===e.src.charCodeAt(k)?(x=!0,(e.bsCount[t]+v)%4==3?(k++,d++,v++,l=!1):l=!0):x=!1,y=[e.bMarks[t]],e.bMarks[t]=k;k=I,w=[e.sCount[t]],e.sCount[t]=v-d,C=[e.tShift[t]],e.tShift[t]=k-e.bMarks[t],A=e.md.block.ruler.getRules("blockquote"),T=e.parentType,e.parentType="blockquote",R=!1,_=t+1;_=(I=e.eMarks[_])));_++)if(62!==e.src.charCodeAt(k++)||R){if(h)break;for(M=!1,i=0,f=A.length;i=I,E.push(e.bsCount[_]),e.bsCount[_]=e.sCount[_]+1+(x?1:0),w.push(e.sCount[_]),e.sCount[_]=v-d,C.push(e.tShift[_]),e.tShift[_]=k-e.bMarks[_]}for(S=e.blkIndent,e.blkIndent=0,(O=e.push("blockquote_open","blockquote",1)).markup=">",O.map=m=[t,0],e.md.block.tokenize(e,t,_),(O=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=N,e.parentType=T,m[1]=e.line,i=0;in)return!1;if(h=t+1,e.sCount[h]=e.eMarks[h])return!1;if(124!==(c=e.src.charCodeAt(f))&&45!==c&&58!==c)return!1;if(d=r(e,t+1),!/^[-:| ]+$/.test(d))return!1;for(m=d.split("|"),y=[],i=0;iE)return!1;if(_|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^<("+["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"].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,o){var i,l,c,d,f=e.bMarks[t]+e.tShift[t],h=e.eMarks[t];if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(f))return!1;for(d=e.src.slice(f,h),i=0;i=0;t--)if("inline"===e.tokens[t].type)for(i=(o=e.tokens[t].children).length-1;i>=0;i--)o[i].type===n&&r(o,i)}))}(e,"url_attribute","link_open",t)}},function(e,t){e.exports=l},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var i=0;i=t&&(o={from:{line:n.line,ch:n.ch-t},to:{line:r.line,ch:r.ch+t}}),o}(t,n),c=!1;if(l){var d=l.from,f=l.to,h=e.getRange(d,f);r(h)&&(e.setSelection(d,f),e.replaceSelection(o(h),"around"),c=!0)}return c},c=t.replace=function(e,text,t,n){var r=!1;return t(text)&&(e.replaceSelection(n(text),"around"),r=!0),r};t.changeSyntax=function(e,t,symbol,n,d){var f=e.getCursor(),line=f.line,h=f.ch,m=e.getSelection(),_=symbol.length,v=function(e){return n.test(e)};if(!l(e,t,_,v,(function(e){return r(e,symbol)}))&&!c(e,m,v,(function(e){return r(e,symbol)}))){var y=m.replace(d,"$1");e.replaceSelection(o(y,symbol),"around")}var E=e.getSelection(),S=h;m||(v(E)?S+=_:S-=_,e.setCursor(line,S))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i
      '),this.$el.appendTo("body"),this.hide()}return o(e,[{key:"show",value:function(e,text){this.$el.css({top:e.offset().top+e.height()+13,left:e.offset().left+3}).find(".text").html(text).end().show()}},{key:"hide",value:function(){this.$el.hide()}},{key:"remove",value:function(){this.$el.remove()}}]),e}();t.default=new d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editorContainerEl=t,this.cm=null,this._init(n)}return r(e,[{key:"_init",value:function(e){var t=document.createElement("textarea");this.editorContainerEl.appendChild(t),e=o.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=l.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.doc.clearHistory(),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,style,n){n&&(e.ch+=n),this.cm.addWidget(e.end,t,!0,style)}},{key:"replaceSelection",value:function(content,e){e&&this.cm.setSelection(e.from,e.to),this.cm.replaceSelection(content),this.focus()}},{key:"replaceRelativeOffset",value:function(content,e,t){var cursor=this.cm.getCursor(),n={from:{line:cursor.line,ch:cursor.ch+e},to:{line:cursor.line,ch:cursor.ch+e+t}};this.replaceSelection(content,n)}},{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=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i",_="te-cell-selected",v=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="table",this._lastCellNode=null,this._init()}return r(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);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(html){return html.replace(/
      (<\/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,o.default)(e).html(m)})),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,o.default)(r).children().each((function(e,n){var r=(0,o.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,o.default)(n).closest("table").find("thead").remove()))})),e.append(r),e.find("."+_).removeClass(_)}}},{key:"pasteTableData",value:function(e){var t=(0,o.default)(e);this._expandTableIfNeed(t),this._pasteDataIntoTable(t)}},{key:"_initKeyHandler",value:function(){var e=this;this.keyEventHandlers={DEFAULT:function(t,n,r){var o=e.wwe.isInTable(n);o&&!e._isModifierKey(r)?(e._recordUndoStateIfNeed(n),e._removeContentsAndChangeSelectionIfNeed(n,r,t)):!o&&e._lastCellNode&&e._recordUndoStateAndResetCellNode(n),o&&!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._isInList(n.startContainer)&&e._isInStyledText(n)?e.wwe.defer((function(){e._removeBRinStyleText()})):e._isEmptyFirstLevelLI(n)&&e.wwe.defer((function(){var t=e.wwe.getRange().cloneRange(),div=t.startContainer,br=document.createElement("br");div.parentNode.replaceChild(br,div),t.setStartBefore(br),t.collapse(!0),e.wwe.getEditor().setSelection(t)})),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)}},l.default.forEach(this.keyEventHandlers,(function(t,n){return e.wwe.addKeyEventHandler(n,t)}))}},{key:"_isEmptyListItem",value:function(e){var t=e.childNodes;return"LI"===e.nodeName&&1===t.length&&"BR"===t[0].nodeName}},{key:"_isEmptyFirstLevelLI",value:function(e){var t=e.collapsed,n=e.startContainer,r=e.startOffset;return t&&0===r&&this._isEmptyListItem(n)&&c.default.isFirstLevelListItem(n)}},{key:"_isInStyledText",value:function(e){var t=e.startContainer,n=void 0;return n=c.default.isTextNode(t)?t.parentNode:t,e.collapsed&&c.default.isStyledNode(n)}},{key:"_removeBRinStyleText",value:function(){var e=this.wwe.getRange(),t=e.startContainer,n=e.startOffset,r=void 0,o=(r="TD"===t.nodeName?c.default.getChildNodeByOffset(t,n-1):c.default.getParentUntil(t,"TD")).querySelector("br");if(o){var l=r,d=l.parentNode,f=l.nodeName;if("CODE"!==f||o.previousSibling)if("CODE"!==f||o.nextSibling){var h=this._splitByBR(r,o);e.setStart(h,0)}else d.insertBefore(o,r.nextSibling),e.setStart(d,c.default.getNodeOffsetOfParent(o)+1);else d.insertBefore(o,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"),o=e.parentNode;c.default.removeNodesByDirection(e,t,!1),t.parentNode.removeChild(t);var l=n.querySelector("br");c.default.removeNodesByDirection(n,l,!0),l.parentNode.removeChild(l),o.insertBefore(n,e.nextSibling),o.insertBefore(r,n);var d=c.default.getLeafNode(n);return c.default.getTextLength(d)||(d.textContent="​"),d}},{key:"_isBeforeTable",value:function(e){return"TABLE"===c.default.getNodeName(c.default.getChildNodeByOffset(e.startContainer,e.startOffset))}},{key:"_isAfterTable",value:function(e){var t=c.default.getPrevOffsetNodeUntil(e.startContainer,e.startOffset);return"TABLE"===c.default.getNodeName(t)&&e.commonAncestorContainer===this.wwe.get$Body()[0]}},{key:"_handleBackspaceAndDeleteKeyEvent",value:function(e,t,n){var r="BACK_SPACE"===n,o=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),l=!0;if(t.collapsed){if(this.wwe.isInTable(t))r?this._tableHandlerOnBackspace(t,e):this._tableHandlerOnDelete(t,e),this._removeContentsAndChangeSelectionIfNeed(t,n,e),l=!1;else if(!r&&this._isBeforeTable(t)||r&&this._isAfterTable(t)){e.preventDefault();var d=r?t.startOffset-1:t.startOffset;this._removeTable(t,c.default.getChildNodeByOffset(t.startContainer,d)),l=!1}}else this.wwe.isInTable(t)&&o.length>0&&this._removeContentsAndChangeSelectionIfNeed(t,n,e)&&(e.preventDefault(),l=!1);return l}},{key:"_moveListItemToPreviousOfList",value:function(e,t){var n=e.parentNode,r=e.firstChild,o=document.createDocumentFragment();c.default.mergeNode(e,o),n.parentNode.insertBefore(o,n),t.setStart(r,0),t.collapse(!0),this.wwe.getEditor().setSelection(t),n.hasChildNodes()||n.parentNode.removeChild(n)}},{key:"_isInList",value:function(e){return c.default.getParentUntilBy(e,(function(e){return e&&(c.default.isListNode(e)||"LI"===e.nodeName)}),(function(e){return e&&("TD"===e.nodeName||"TH"===e.nodeName)}))}},{key:"_findListItem",value:function(e){return c.default.getParentUntilBy(e,(function(e){return e&&c.default.isListNode(e)}),(function(e){return e&&("TD"===e.nodeName||"TH"===e.nodeName)}))}},{key:"_tableHandlerOnBackspace",value:function(e,t){var n=e.startContainer,r=e.startOffset,l=this._findListItem(n);if(l&&0===r&&c.default.isFirstListItem(l)&&c.default.isFirstLevelListItem(l))this.wwe.getEditor().saveUndoState(e),this._moveListItemToPreviousOfList(l,e),t.preventDefault();else{var d=c.default.getPrevOffsetNodeUntil(n,r,"TR");"BR"===c.default.getNodeName(d)&&1!==d.parentNode.childNodes.length&&(t.preventDefault(),(0,o.default)(d).remove())}}},{key:"_isDeletingBR",value:function(e){var t=this._getCurrentNodeInCell(e),n=t&&t.nextSibling;return"BR"===c.default.getNodeName(t)&&!!n&&"BR"===c.default.getNodeName(n)}},{key:"_getCurrentNodeInCell",value:function(e){var t=e.startContainer,n=e.startOffset,r=void 0;return"TD"===c.default.getNodeName(t)?r=c.default.getChildNodeByOffset(t,n):c.default.getParentUntil(t,"TD")&&(r=t),r}},{key:"_isEndOfList",value:function(e,t){var n=t.startContainer,r=t.startOffset,o=!1;if(!e.nextSibling)if(e===n){var l=c.default.getOffsetLength(e);"BR"===e.lastChild.nodeName&&(l-=1),o=l===r}else{var d=c.default.getParentUntil(n,"li")||n,f=c.default.getOffsetLength(n),h=e.lastChild;"BR"===h.nodeName&&(h=h.previousSibling),o=h===d&&f===r}return o}},{key:"_getNextLineNode",value:function(e){for(var t=document.createDocumentFragment(),n=c.default.getParentUntil(e,"TD").nextSibling;n;){var r=n.nextSibling;if(t.appendChild(n),"BR"===n.nodeName)break;n=r}return t}},{key:"_tableHandlerOnDelete",value:function(e,t){var n=this._findListItem(e.startContainer);if(n&&this._isEndOfList(n,e))this.wwe.getEditor().saveUndoState(e),"BR"===n.lastChild.nodeName&&n.removeChild(n.lastChild),c.default.mergeNode(this._getNextLineNode(n),n),t.preventDefault();else if(this._isDeletingBR(e)){var r=this._getCurrentNodeInCell(e);r.parentNode.removeChild(r.nextSibling),t.preventDefault()}}},{key:"_appendBrIfTdOrThNotHaveAsLastChild",value:function(e){var t=c.default.getNodeName(e.startContainer),n=void 0;if("TD"===t||"TH"===t)n=e.startContainer;else{var r=(0,o.default)(e.startContainer).parentsUntil("tr");n=r[r.length-1]}var l=c.default.getNodeName(n.lastChild);"BR"===l||"DIV"===l||"UL"===l||"OL"===l||h||(0,o.default)(n).append((0,o.default)("
      ")[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"===c.default.getNodeName(t)){var n=c.default.getNodeName(t.parentNode),r=/TD|TH/.test(n),l=0===t.parentNode.textContent.length,d=t.parentNode.lastChild===t;("TR"===n||r&&!l&&d)&&(0,o.default)(t).remove()}else(0,o.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,o.default)("

      ").insertAfter(t)}))}},{key:"_removeTable",value:function(e,table){"TABLE"===table.tagName&&(this.wwe.getEditor().saveUndoState(e),this.wwe.saveSelection(e),(0,o.default)(table).remove(),this.wwe.restoreSavedSelection())}},{key:"_recordUndoStateIfNeed",value:function(e){var t=c.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().startContainer,n=this._getTableDataFromTable(e),r="TD"===t.tagName||"TH"===t.tagName,l=f?"":"
      ",d=void 0,td=void 0,tr=void 0,h=void 0;for(td=d=(d=r?t:(d=c.default.getParentUntilBy(t,(function(e){return"TD"===e.tagName||"TH"===e.tagName}),(function(e){return 0===(0,o.default)(e).closest("table").length})))?d.parentNode:null)||(0,o.default)(t).find("th,td").get(0);n.length;){for(tr=n.shift();td&&tr.length;)(h=tr.shift()).length?td.textContent=h:td.innerHTML=l,td=c.default.getTableCellByDirection(td,"next");d=td=c.default.getSiblingRowCellByDirection(d,"next",!1)}}},{key:"_getTableDataFromTable",value:function(e){var t=(0,o.default)(e),n=[];return t.find("tr").each((function(i,tr){var e=[];(0,o.default)(tr).children().each((function(t,n){e.push(n.textContent)})),e.length&&n.push(e)})),n}},{key:"_removeTableContents",value:function(e){this.wwe.getEditor().saveUndoState(),e.each((function(i,e){var t=f?"":"
      ";(0,o.default)(e).html(t)}))}},{key:"wrapDanglingTableCellsIntoTrIfNeed",value:function(e){var t=e.children("td,th"),tr=void 0;if(t.length){var n=(0,o.default)("
");t.each((function(i,e){n.append(e)})),tr=n.get(0)}return tr}},{key:"wrapTrsIntoTbodyIfNeed",value:function(e){var t=e.children("tr"),n=t.find("th"),tbody=void 0;if(n.length&&n.each((function(i,e){var t=(0,o.default)(e),td=(0,o.default)("");td.html(t.html()),td.insertBefore(e),t.detach()})),t.length){var r=(0,o.default)("");t.each((function(i,tr){r.append(tr)})),tbody=r.get(0)}return tbody}},{key:"wrapTheadAndTbodyIntoTableIfNeed",value:function(e){var t=e.children("thead"),n=e.children("tbody"),r=(0,o.default)("
"),table=void 0;return!n.length&&t.length?(r.append(t[0]),r.append(""),table=r.get(0)):n.length&&!t.length?(r.append(""),r.append(n[0]),table=r.get(0)):n.length&&t.length&&(r.append(t[0]),r.append(n[0]),table=r.get(0)),table}},{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,o.default)(n),l=r.find("th,td"),d="THEAD"===c.default.getNodeName(r.parent()[0])?"th":"td",f=l.length;f").get(0),e.prepend(r)):n&&(r=(0,o.default)("").get(0),e.append(r))}},{key:"tableCellAppendAidForTableElement",value:function(e){var t=(0,o.default)(e);this._addTbodyOrTheadIfNeed(t),this._addTrIntoContainerIfNeed(t);var n=t.find("tr"),r=this.prepareToTableCellStuffing(n),l=r.maximumCellLength;r.needTableCellStuffingAid&&this._stuffTableCellsIntoIncompleteRow(n,l)}},{key:"_generateTheadAndTbodyFromTbody",value:function(e){var tr=(0,o.default)(""),thead=(0,o.default)("");return tr.append(y((0,o.default)(e).find("tr").eq(0).find("td").length,"th")),thead.append(tr),{thead:thead[0],tbody:e}}},{key:"_generateTheadAndTbodyFromThead",value:function(e){var tr=(0,o.default)(""),tbody=(0,o.default)("");return tr.append(y((0,o.default)(e).find("th").length,"td")),tbody.append(tr),{thead:e,tbody:tbody[0]}}},{key:"_generateTheadAndTbodyFromTr",value:function(e){var t=(0,o.default)(e),thead=(0,o.default)(""),tbody=(0,o.default)(""),n=void 0,r=void 0;return"TH"===t.children()[0].tagName?(n=e,r=(0,o.default)(""+y(t.find("th").length,"td")+"").get(0)):(n=(0,o.default)(""+y(t.find("td").length,"th")+"").get(0),r=e),thead.append(n),tbody.append(r),{thead:thead[0],tbody:tbody[0]}}},{key:"_completeIncompleteTable",value:function(e){var t=e.tagName,table=void 0,n=void 0;"TABLE"===t?table=e:(table=document.createElement("table"),e.parentNode.insertBefore(table,e.nextSibling),"TBODY"===t?n=this._generateTheadAndTbodyFromTbody(e):"THEAD"===t?n=this._generateTheadAndTbodyFromThead(e):"TR"===t&&(n=this._generateTheadAndTbodyFromTr(e)),table.appendChild(n.thead),table.appendChild(n.tbody)),this._removeEmptyRows(table),this.tableCellAppendAidForTableElement(table)}},{key:"_removeEmptyRows",value:function(table){var e=table.querySelectorAll("tr");l.default.forEachArray(e,(function(tr){tr.cells.length||tr.parentNode.removeChild(tr)}))}},{key:"_completeTableIfNeed",value:function(){var e=this;this.wwe.getEditor().get$Body().children().each((function(t,n){var r=(0,o.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:"_isModifierKey",value:function(e){return/((META|SHIFT|ALT|CONTROL)\+?)/g.test(e)}},{key:"_isModifierKeyPushed",value:function(e){return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}},{key:"_addTrIntoContainerIfNeed",value:function(e){e.children().each((function(i,e){0===(0,o.default)(e).find("tr").length&&(0,o.default)(e).append((0,o.default)("")[0])}))}},{key:"_expandTableIfNeed",value:function(e){var t=this.wwe.getEditor().getSelection().cloneRange(),n=(0,o.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,l=n[0].length,d=(0,o.default)(t.startContainer).closest("th,td"),f=d.parent(),h=c.default.getNodeOffsetOfParent(d[0]),m=c.default.getNodeOffsetOfParent(d[0].parentNode),_=f.parents("table"),v=_.find("tr").eq(0).children().length,y=_.find("tr").length;return f.parents("tbody").length&&(m+=1),{row:y-(m+r),column:v-(h+l)}}},{key:"_appendCellForAllRow",value:function(e,t){var n=f?"":"
";e.find("tr").each((function(i,e){for(var r=void 0,l=t;l<0;l+=1)r=0===i?"th":"td",(0,o.default)(e).append((0,o.default)("<"+r+">"+n+"")[0])}))}},{key:"_appendRow",value:function(e,t){var n=e.find("tr").last().clone(),r=f?"":"
";for(n.find("td").html(r);t<0;t+=1)e.find("tbody").append(n.clone()[0])}},{key:"_changeSelectionToTargetCell",value:function(e,t,n,r){var l="next"===n,d="row"===r,f=void 0;d?f=c.default.getSiblingRowCellByDirection(e,n,!1):(f=c.default.getTableCellByDirection(e,n))||(f=c.default.getSiblingRowCellByDirection(e,n,!0)),f?(d&&!l?this._moveToCursorEndOfCell(f,t):t.setStart(f,0),t.collapse(!0)):(f=(0,o.default)(e).parents("table").get(0),l?t.setStart(f.nextElementSibling,0):f.previousElementSibling&&"TABLE"!==f.previousElementSibling.nodeName?t.setStart(f.previousElementSibling,1):t.setStartBefore(f),t.collapse(!0))}},{key:"_moveToCursorEndOfCell",value:function(e,t){var n=void 0;c.default.isListNode(e.lastChild)&&(n=c.default.getLastNodeBy(e.lastChild,(function(e){return"LI"!==e.nodeName||null!==e.nextSibling})));var r=c.default.getLastNodeBy(n||e,(function(e){return!c.default.isTextNode(e)})),o=r||n||e,l=r?r.length:o.childNodes.length-1;t.setStart(o,l)}},{key:"_moveCursorTo",value:function(e,t,n){var r=this.wwe.getEditor(),c=r.getSelection().cloneRange(),d=(0,o.default)(c.startContainer).closest("td,th").get(0),f=void 0;if(c.collapsed&&this.wwe.isInTable(c)&&d){if("row"===t&&!this._isMovedCursorToRow(c,e))return f;"previous"!==e&&"row"!==t||l.default.isUndefined(n)||n.preventDefault(),this._changeSelectionToTargetCell(d,c,e,t),r.setSelection(c),f=!1}return f}},{key:"_isMovedCursorToRow",value:function(e,t){var n=e.startContainer;return this._isInList(n)?this._isMovedCursorFromListToRow(n,t):this._isMovedCursorFromTextToRow(e,t)}},{key:"_isMovedCursorFromListToRow",value:function(e,t){var n=t+"Sibling",r=this._findListItem(e),o=c.default.getParentNodeBy(r,(function(e,t){var r=null===t[n]&&null===e[n];return!c.default.isCellNode(e)&&r})),l=c.default.isListNode(o)&&null===o[n];return c.default.isCellNode(o.parentNode)&&l}},{key:"_isMovedCursorFromTextToRow",value:function(e,t){var n=e.startContainer,r=e.startOffset,text=c.default.isCellNode(n)?n.childNodes[r]:n,o=c.default.getParentNodeBy(text,(function(e){return!c.default.isCellNode(e)&&!c.default.isTextNode(e)})),l=c.default.getSiblingNodeBy(o,t,(function(e){return null!==e&&"BR"!==e.nodeName}));return l&&null===l[t+"Sibling"]}},{key:"_removeContentsAndChangeSelectionIfNeed",value:function(e,t,n){var r=t.length<=1,o="BACK_SPACE"===t||"DELETE"===t,l=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),c=l.first().get(0),d=!1;return(r||o)&&!this._isModifierKeyPushed(n)&&l.length&&(o&&this._recordUndoStateIfNeed(e),this._removeTableContents(l),this._lastCellNode=c,e.setStart(c,0),e.collapse(!0),this.wwe.getEditor().setSelection(e),d=!0),d}},{key:"getTableIDClassName",value:function(){var e="te-content-table-"+this.tableID;return this.tableID+=1,e}},{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"),l.default.forEach(this.keyEventHandlers,(function(t,n){return e.wwe.removeKeyEventHandler(n,t)}))}}]),e}();function y(e,t){for(var n="<"+t+">
",r="",i=0;i0?(t.setStart(l,0),t.setEnd(r,1)):(t.setStart(r,0),t.setEnd(l,1)):h?(t.setStart(r,0),t.setEnd(l,1)):(t.setStart(l,0),t.setEnd(r,1)),t}},{key:"getSelectionRangeFromTable",value:function(e,t){var n=c.default.getNodeOffsetOfParent,r=n(e.parentNode),l=n(t.parentNode),d=n(e),f=n(t),h=c.default.getParentUntil(e,"TABLE"),m=c.default.getParentUntil(t,"TABLE"),_="TBODY"===c.default.getNodeName(h)&&"THEAD"===c.default.getNodeName(m),v=h!==m,y=!!(0,o.default)(e).parents("tbody").length&&!!(0,o.default)(t).parents("tbody").length,E={row:r,cell:d},S={row:l,cell:f},T=void 0,w=void 0;return _?E.row+=1:v?S.row+=1:y&&(E.row+=1,S.row+=1),r>l||r===l&&d>f?(T=S,w=E):(T=E,w=S),{from:T,to:w}}},{key:"highlightTableCellsBy",value:function(e,t){var n=(0,o.default)(e).parents("[contenteditable=true] table").find("tr"),r=this.getSelectionRangeFromTable(e,t),l=r.from.row,c=r.from.cell,d=r.to.row,h=r.to.cell;n.each((function(e,t){(0,o.default)(t).find("td,th").each((function(t,n){var r=(0,o.default)(n);e===l&&th||ed?r.removeClass(f):r.addClass(f)}))}))}},{key:"removeClassAttrbuteFromAllCellsIfNeed",value:function(){this.wwe.get$Body().find("td."+f+",th."+f).each((function(i,e){var t=(0,o.default)(e);t.removeClass(f),t.attr("class").length||t.removeAttr("class")}))}},{key:"getSelectedCells",value:function(){return this.wwe.get$Body().find("."+f)}},{key:"createRangeBySelectedCells",value:function(){var e=this.wwe.getEditor(),t=e.getSelection().cloneRange(),n=this.getSelectedCells(),r=n.first().get(0),o=n.last().get(0);n.length&&this.wwe.isInTable(t)&&(t.setStart(r,0),t.setEnd(o,o.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=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i",m={"&":"&","<":"<",">":">"},_=/\u200B/g,v=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="codeblock",this._init()}return r(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().startContainer,n=e._getCodeNode(t);n&&!c.default.getTextLength(n)&&n.parentNode.removeChild(n)}))}},l.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(html){return e._changePreToPreCode(html)}))}},{key:"prepareToPasteOnCodeblock",value:function(e){var t=this.wwe.getEditor().getDocument().createDocumentFragment(),text=this.convertNodesToText(e);return text=text.replace(/\n$/,""),t.appendChild(document.createTextNode(text)),t}},{key:"convertNodesToText",value:function(e){for(var t="",n=e.shift();l.default.isTruthy(n);)n.childNodes&&c.default.isBlockNode(n)?t+=this.convertNodesToText(l.default.toArray(n.childNodes)):"BR"===n.nodeName?t+="\n":t+=n.textContent,n=e.shift();return t}},{key:"_copyCodeblockTypeFromRangeCodeblock",value:function(element,e){var t=c.default.getParentUntil(e.commonAncestorContainer,this.wwe.get$Body()[0]);if("PRE"===c.default.getNodeName(t)){var n=(0,o.default)(t).prop("attributes");l.default.forEach(n,(function(e){(0,o.default)(element).attr(e.name,e.value)}))}return element}},{key:"_changePreToPreCode",value:function(html){return html.replace(/((.|\n)*?)<\/pre>/g,(function(e,t,code){return"
"+code+"
"}))}},{key:"modifyCodeBlockForWysiwyg",value:function(e){e||(e=this.wwe.get$Body()),(0,o.default)(e).find("pre").each((function(e,pre){var t=(0,o.default)(pre),n=t.find("code").attr("data-language"),r=t.find("code").attr("data-backticks");t.children().length>1&&t.children().each((function(e,t){"DIV"!==t.nodeName&&"P"!==t.nodeName||(0,o.default)(t).find("br").length||(0,o.default)(t).append("\n")})),t.find("br").replaceWith("\n");var code,l=t.text().replace(/\s+$/,"");t.empty(),t.html(l?(code=l)?code.replace(/[<>&]/g,(function(e){return m[e]||e})):"":h),n&&(t.attr("data-language",n),t.addClass("lang-"+n)),r&&t.attr("data-backticks",r),t.attr("data-te-codeblock","")}))}},{key:"_onBackspaceKeyEventHandler",value:function(e,t){var n=!0,r=this.wwe.getEditor(),o=t.commonAncestorContainer;if(this._isCodeBlockFirstLine(t)&&!this._isFrontCodeblock(t))this._removeCodeblockFirstLine(o),t.collapse(!0),n=!1;else if(t.collapsed&&this._isEmptyLine(o)&&this._isBetweenSameCodeblocks(o)){var l=o.previousSibling,c=o.nextSibling,d=l.textContent.length;r.saveUndoState(t),o.parentNode.removeChild(o),this._mergeCodeblocks(l,c),t.setStart(l.childNodes[0],d),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=f?""===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"===c.default.getNodeName(t)&&"PRE"===c.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=c.default.getParentUntil(e.startContainer,this.wwe.getEditor().getRoot()).previousSibling;return t&&"PRE"===t.nodeName}},{key:"_removeCodeblockFirstLine",value:function(e){var t=this.wwe.getEditor(),n="PRE"===e.nodeName?e:e.parentNode,r=n.textContent.replace(_,"");t.modifyBlocks((function(){var e=t.getDocument().createDocumentFragment(),o=r.split("\n"),l=document.createElement("div"),c=o.shift();if(l.innerHTML=""+c+h,e.appendChild(l),o.length){var d=n.cloneNode();d.textContent=o.join("\n"),e.appendChild(d)}return e}))}},{key:"isInCodeBlock",value:function(e){var t=void 0;return t=e.collapsed?e.startContainer:e.commonAncestorContainer,!!(0,o.default)(t).closest("pre").length}},{key:"destroy",value:function(){var e=this;this.eventManager.removeEventHandler("wysiwygSetValueAfter.codeblock"),this.eventManager.removeEventHandler("wysiwygProcessHTMLText.codeblock"),l.default.forEach(this._keyEventHandlers,(function(t,n){return e.wwe.removeKeyEventHandler(n,t)}))}}]),e}();t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:[];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(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}(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 function(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)}(t,e),r(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 f.default&&e.disable()}))}},{key:"enableAllButton",value:function(){this._items.forEach((function(e){e instanceof f.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;c.default.isString(t)?t=_.default.create(t):c.default.isString(t.type)&&(t=_.default.create(t.type,t.options));var r=this.$el.children();e>=0&&e1&&void 0!==arguments[1])||arguments[1],n=void 0,r=void 0;return(n=e instanceof h.default?this.indexOfItem(e):e)>=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(),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"addButton",value:function(button,e){if(c.default.isArray(button))for(var t=button.length-1;t>=0;t-=1)c.default.isNumber(e)?this._addButton(button[t],e):this._addButton(button);else this._addButton(button,e)}},{key:"_addButton",value:function(button,e){var t=this._setButton(button,e).$el;c.default.isNumber(e)?this.$el.find("."+f.default.className).eq(e-1).before(t):this.$el.append(t)}},{key:"addDivider",value:function(){var e=(0,l.default)('
');return this.$el.append(e),e}},{key:"_setButton",value:function(button,e){var t=this._eventManager;return button instanceof f.default||(button=new f.default(button)),button.on("command",(function(e,n){return t.emit("command",n)})),button.on("event",(function(e,n){return t.emit(n)})),c.default.isNumber(e)?this._items.splice(e,0,button):this._items.push(button),button}}]),t}(d.default);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(11),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:t.name,tagName:"div",className:t.className}))}return function(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)}(t,e),t}(((r=o)&&r.__esModule?r:{default:r}).default);Object.defineProperty(l,"name",{enumerable:!0,writable:!0,value:"divider"}),Object.defineProperty(l,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-divider"}),t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(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 function(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)}(t,e),r(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'+t[i]+"");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,o.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(d),this.sections&&this.sections[t].removeClass(d)}e.addClass(d),this._$activeButton=e;var n=e.attr("data-index");this.sections&&this.sections[n].addClass(d)}},{key:"_isActivatedButton",value:function(e){return this._$activeButton&&this._$activeButton.text()===e.text()}}]),t}(l.default);t.default=f},function(e,t,n){"use strict";var r,o=n(0),l=(r=o)&&r.__esModule?r:{default:r},c=n(46);l.default.fn.tuiEditor=function(){var e=void 0,t=void 0,n=this.get(0);if(n){for(var r=arguments.length,o=Array(r),d=0;d1&&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(html){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(html=html||"",this.wwEditor.setValue(html,e),this.isMarkdownMode()){var t=this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions);this.mdEditor.setValue(t,e),this.eventManager.emit("setMarkdownAfter",t)}}},{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(text){this.isMarkdownMode()?this.mdEditor.replaceSelection(text):this.wwEditor.insertText(text)}},{key:"addWidget",value:function(e,t,style,n){this.getCurrentModeEditor().addWidget(e,t,style,n)}},{key:"height",value:function(e){return l.default.isExisty(e)&&("auto"===e?((0,o.default)(this.options.el).addClass("auto-height"),this.minHeight(this.minHeight())):((0,o.default)(this.options.el).removeClass("auto-height"),this.minHeight(e)),l.default.isNumber(e)&&(e+="px"),this.options.el.style.height=e,this._height=e),this._height}},{key:"minHeight",value:function(e){if(l.default.isExisty(e)){var t=this._ui.getEditorHeight()-this._ui.getEditorSectionHeight();this._minHeight=e,e=parseInt(e,10),e=Math.max(e-t,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,i=Ee.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;i>=0;i-=1)Ee[i]===this&&Ee.splice(i,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 Ee}},{key:"defineExtension",value:function(e,t){y.default.defineExtension(e,t)}},{key:"factory",value:function(t){return t.viewer?new w.default(t):new e(t)}}]),e}();Te.isViewer=!1,Te.i18n=C.default,Te.domUtils=M.default,Te.codeBlockManager=N.default,Te.Button=c.default,Te.WwCodeBlockManager=S.default,Te.WwTableManager=A.default,Te.WwTableSelectionManager=O.default,Te.CommandManager=v.default,Te.markdownitHighlight=T.default.getMarkdownitHighlightRenderer(),Te.markdownit=T.default.getMarkdownitRenderer(),e.exports=Te},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0,codeBlock:-1===base.code,quote:!!base.quote,list:!!base.list,task:!!base.taskList,source:"markdown"};e._latestState&&!e._isStateChanged(e._latestState,t)||(e.eventManager.emit("stateChange",t),e._latestState=t)}))}},{key:"setValue",value:function(e,n){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e,n),this._emitMarkdownEditorContentChangedEvent()}},{key:"getTextObject",value:function(e){return new m.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 l.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}(c.default);t.default=y},function(e,t,n){"use strict";var r,o=n(6),l=(r=o)&&r.__esModule?r:{default:r},c=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/;function d(e,t,n,r){var o=void 0,l=void 0,text=void 0,f=void 0,h=n,m=r.getLine(e);do{var _=c.exec(m);if(o=_[1],l=_[4],text=_[5],(f=o.length)===t)r.replaceRange(""+o+h+l+text,{line:e,ch:0},{line:e,ch:m.length}),h+=1,e+=1;else{if(!(f>t))return e;e=d(e,f,1,r)}m=r.getLine(e)}while(c.test(m));return e}function f(e,t){for(var n=e,r=t.getLine(e);c.test(r);)n-=1,r=t.getLine(n);return e===n?n=-1:n+=1,n}l.default.commands.indentLessOrderedList=function(e){return e.getOption("disableInput")?l.default.Pass:(e.execCommand("indentLess"),e.execCommand("fixOrderedListNumber"),null)},l.default.commands.fixOrderedListNumber=function(e){if(e.getOption("disableInput"))return l.default.Pass;for(var t=e.listSelections(),i=0;i=0){var r=e.getLine(n),o=c.exec(r),h=o[1],m=o[3];d(n,h.length,parseInt(m,10),e)}}return null}},function(e,t,n){"use strict";var r,o=n(6),l=(r=o)&&r.__esModule?r:{default:r};l.default.overlayMode=function(base,e,t){return{startState:function(){return{base:l.default.startState(base),overlay:l.default.startState(e),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(t){return{base:l.default.copyState(base,t.base),overlay:l.default.copyState(e,t.overlay),basePos:t.basePos,baseCur:null,overlayPos:t.overlayPos,overlayCur:null}},token:function(n,r){return(n!=r.streamSeen||Math.min(r.basePos,r.overlayPos)` "'(~:]+/,y=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,E=/^\s*\[[^\]]+?\]:.*$/,S=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~]/;function T(e,t,n){return t.f=t.inline=n,n(e,t)}function w(e,t,n){return t.f=t.block=n,n(e,t)}function C(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==M){var t=r;if(!t){var o=l.default.innerMode(n,e.htmlState);t="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}t&&(e.f=N,e.block=x,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function x(n,r){var line,c=n.column()===r.indentation,v=!(line=r.prevLine.stream)||!/\S/.test(line.string),S=r.indentedCode,w=r.prevLine.hr,C=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var M=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,C)){for(r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,r.list=null;M=4&&(S||r.prevLine.fencedCodeEnd||r.prevLine.header||v))return n.skipToEnd(),r.indentedCode=!0,o.code;if(n.eatSpace())return null;if(c&&r.indentation<=x&&(k=n.match(m))&&k[1].length<=6)return r.quote=0,r.header=k[1].length,r.thisLine.header=!0,t.highlightFormatting&&(r.formatting="header"),r.f=r.inline,O(r);if(r.indentation<=x&&n.eat(">"))return r.quote=c?1:r.quote+1,t.highlightFormatting&&(r.formatting="quote"),n.eatSpace(),O(r);if(!N&&!r.setext&&c&&r.indentation<=x&&(k=n.match(f))){var I=k[1]?"ol":"ul";return r.indentation=M+n.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),t.taskLists&&n.match(h,!1)&&(r.taskList=!0),r.f=r.inline,t.highlightFormatting&&(r.formatting=["list","list-"+I]),O(r)}return c&&r.indentation<=x&&(k=n.match(y,!0))?(r.quote=0,r.fencedEndRE=new RegExp(k[1]+"+ *$"),r.localMode=t.fencedCodeBlockHighlighting&&function(t){if(l.default.findModeByName){var n=l.default.findModeByName(t);n&&(t=n.mime||n.mimes[0])}var r=l.default.getMode(e,t);return"null"==r.name?null:r}(k[2]),r.localMode&&(r.localState=l.default.startState(r.localMode)),r.f=r.block=A,t.highlightFormatting&&(r.formatting="code-block"),r.code=-1,O(r)):r.setext||!(R&&C||r.quote||!1!==r.list||r.code||N||E.test(n.string))&&(k=n.lookAhead(1))&&(k=k.match(_))?(r.setext?(r.header=r.setext,r.setext=0,n.skipToEnd(),t.highlightFormatting&&(r.formatting="header")):(r.header="="==k[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,O(r)):N?(n.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===n.peek()?T(n,r,L):T(n,r,r.inline)}function M(e,t){var style=n.token(e,t.htmlState);if(!r){var o=l.default.innerMode(n,t.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=N,t.block=x,t.htmlState=null)}return style}function A(e,n){var r,l=n.listStack[n.listStack.length-1]||0,c=n.indentation=e.quote?n.push(o.formatting+"-"+e.formatting[i]+"-"+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(o.linkHref,"url"):(e.strong&&n.push(o.strong),e.em&&n.push(o.em),e.strikethrough&&n.push(o.strikethrough),e.emoji&&n.push(o.emoji),e.linkText&&n.push(o.linkText),e.code&&n.push(o.code),e.image&&n.push(o.image),e.imageAltText&&n.push(o.imageAltText,"link"),e.imageMarker&&n.push(o.imageMarker)),e.header&&n.push(o.header,o.header+"-"+e.header),e.quote&&(n.push(o.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(o.quote+"-"+e.quote):n.push(o.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?n.push(o.list2):n.push(o.list3):n.push(o.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 R(e,t){if(e.match(v,!0))return O(t)}function N(e,r){var style=r.text(e,r);if(void 0!==style)return style;if(r.list)return r.list=null,O(r);if(r.taskList)return" "===e.match(h,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,t.highlightFormatting&&(r.formatting="task"),r.taskList=!1,O(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(r.formatting="header"),O(r);var c=e.next();if(r.linkTitle){r.linkTitle=!1;var d=c;"("===c&&(d=")");var f="^\\s*(?:[^"+(d=(d+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+d;if(e.match(new RegExp(f),!0))return o.linkHref}if("`"===c){var m=r.formatting;t.highlightFormatting&&(r.formatting="code"),e.eatWhile("`");var _=e.current().length;if(0!=r.code||r.quote&&1!=_){if(_==r.code){var v=O(r);return r.code=0,v}return r.formatting=m,O(r)}return r.code=_,O(r)}if(r.code)return O(r);if("\\"===c&&(e.next(),t.highlightFormatting)){var y=O(r),E=o.formatting+"-escape";return y?y+" "+E:E}if("!"===c&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,t.highlightFormatting&&(r.formatting="image"),O(r);if("["===c&&r.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,t.highlightFormatting&&(r.formatting="image"),O(r);if("]"===c&&r.imageAltText){t.highlightFormatting&&(r.formatting="image");var y=O(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=I,y}if("["===c&&!r.image)return r.linkText&&e.match(/^.*?\]/)||(r.linkText=!0,t.highlightFormatting&&(r.formatting="link")),O(r);if("]"===c&&r.linkText){t.highlightFormatting&&(r.formatting="link");var y=O(r);return r.linkText=!1,r.inline=r.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?I:N,y}if("<"===c&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=k,t.highlightFormatting&&(r.formatting="link"),(y=O(r))?y+=" ":y="",y+o.linkInline;if("<"===c&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=k,t.highlightFormatting&&(r.formatting="link"),(y=O(r))?y+=" ":y="",y+o.linkEmail;if(t.xml&&"<"===c&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var T=e.string.indexOf(">",e.pos);if(-1!=T){var C=e.string.substring(e.start,T);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(C)&&(r.md_inside=!0)}return e.backUp(1),r.htmlState=l.default.startState(n),w(e,r,M)}if(t.xml&&"<"===c&&e.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===c||"_"===c){for(var x=1,A=1==e.pos?" ":e.string.charAt(e.pos-2);x<3&&e.eat(c);)x++;var R=e.peek()||" ",D=!/\s/.test(R)&&(!S.test(R)||/\s/.test(A)||S.test(A)),L=!/\s/.test(A)&&(!S.test(A)||/\s/.test(R)||S.test(R)),P=null,B=null;if(x%2&&(r.em||!D||"*"!==c&&L&&!S.test(A)?r.em!=c||!L||"*"!==c&&D&&!S.test(R)||(P=!1):P=!0),x>1&&(r.strong||!D||"*"!==c&&L&&!S.test(A)?r.strong!=c||!L||"*"!==c&&D&&!S.test(R)||(B=!1):B=!0),null!=B||null!=P)return t.highlightFormatting&&(r.formatting=null==P?"strong":null==B?"em":"strong em"),!0===P&&(r.em=c),!0===B&&(r.strong=c),v=O(r),!1===P&&(r.em=!1),!1===B&&(r.strong=!1),v}else if(" "===c&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return O(r);e.backUp(1)}if(t.strikethrough)if("~"===c&&e.eatWhile(c)){if(r.strikethrough)return t.highlightFormatting&&(r.formatting="strikethrough"),v=O(r),r.strikethrough=!1,v;if(e.match(/^[^\s]/,!1))return r.strikethrough=!0,t.highlightFormatting&&(r.formatting="strikethrough"),O(r)}else if(" "===c&&e.match(/^~~/,!0)){if(" "===e.peek())return O(r);e.backUp(2)}if(t.emoji&&":"===c&&e.match(/^[a-z_\d+-]+:/)){r.emoji=!0,t.highlightFormatting&&(r.formatting="emoji");var F=O(r);return r.emoji=!1,F}return" "===c&&(e.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),O(r)}function k(e,n){if(">"===e.next()){n.f=n.inline=N,t.highlightFormatting&&(n.formatting="link");var r=O(n);return r?r+=" ":r="",r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function I(e,n){if(e.eatSpace())return null;var r,o=e.next();return"("===o||"["===o?(n.f=n.inline=(r="("===o?")":"]",function(e,n){if(e.next()===r){n.f=n.inline=N,t.highlightFormatting&&(n.formatting="link-string");var o=O(n);return n.linkHref=!1,o}return e.match(D[r]),n.linkHref=!0,O(n)}),t.highlightFormatting&&(n.formatting="link-string"),n.linkHref=!0,O(n)):"error"}var D={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(e,n){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(n.f=P,e.next(),t.highlightFormatting&&(n.formatting="link"),n.linkText=!0,O(n)):T(e,n,N)}function P(e,n){if(e.match(/^\]:/,!0)){n.f=n.inline=B,t.highlightFormatting&&(n.formatting="link");var r=O(n);return n.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function B(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=N,o.linkHref+" url")}var F={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:N,text:R,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(s){return{f:s.f,prevLine:s.prevLine,thisLine:s.thisLine,block:s.block,htmlState:s.htmlState&&l.default.copyState(n,s.htmlState),indentation:s.indentation,localMode:s.localMode,localState:s.localMode?l.default.copyState(s.localMode,s.localState):null,inline:s.inline,text:s.text,formatting:!1,linkText:s.linkText,linkTitle:s.linkTitle,linkHref:s.linkHref,code:s.code,em:s.em,strong:s.strong,strikethrough:s.strikethrough,emoji:s.emoji,header:s.header,setext:s.setext,hr:s.hr,taskList:s.taskList,list:s.list,listStack:s.listStack.slice(0),quote:s.quote,indentedCode:s.indentedCode,trailingSpace:s.trailingSpace,trailingSpaceNewLine:s.trailingSpaceNewLine,md_inside:s.md_inside,fencedEndRE:s.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 C(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!=M)){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==M?{state:e.htmlState,mode:n}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:F}},indent:function(e,t,line){return e.block==M&&n.indent?n.indent(e.htmlState,t,line):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,line):l.default.Pass},blankLine:C,getType:O,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F}),"xml"),l.default.defineMIME("text/markdown","markdown"),l.default.defineMIME("text/x-markdown","markdown")},function(e,t,n){"use strict";var r,o=n(6),l=(r=o)&&r.__esModule?r:{default:r};l.default.defineMode("gfm",(function(e,t){var n=0,r={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(s){return{code:s.code,codeBlock:s.codeBlock,ateSpace:s.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 r=e.pos;e.eatWhile("`");var o=1+e.pos-r;return t.code?o===n&&(t.code=!1):(n=o,t.code=!0),null}return t.code?(e.next(),null):e.eatSpace()?(t.ateSpace=!0,null):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},o={taskLists:!0,strikethrough:!0,emoji:!0};for(var c in t)o[c]=t[c];return o.name="markdown",l.default.overlayMode(l.default.getMode(e,o),r)}),"markdown"),l.default.defineMIME("text/x-gfm","gfm")},function(e,t,n){"use strict";var r,o=n(6),l=(r=o)&&r.__esModule?r:{default:r},c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,f=/[*+-]\s/;function h(e,t){var n=t.line,r=0,o=0,l=c.exec(e.getLine(n)),d=l[1];do{var f=n+(r+=1),h=e.getLine(f),m=c.exec(h);if(m){var _=m[1],v=parseInt(l[3],10)+r-o,y=parseInt(m[3],10),E=y;if(d!==_||isNaN(y)){if(d.length>_.length)return;if(d.length<_.length&&1===r)return;o+=1}else v===y&&(E=y+1),v>y&&(E=v+1),e.replaceRange(h.replace(c,_+E+m[4]+m[5]),{line:f,ch:0},{line:f,ch:h.length})}}while(m)}l.default.commands.indentOrderedList=function(e){if(e.getOption("disableInput"))return l.default.Pass;for(var t=e.listSelections(),i=0;i\s*$/.test(line)||e.replaceRange("",{line:r.line,ch:0},{line:r.line,ch:r.ch+1}),n[i]="\n";else{var S=y[1],T=y[5],w=!(f.test(y[2])||y[2].indexOf(">")>=0),C=w?parseInt(y[3],10)+1+y[4]:y[2].replace("x"," ");n[i]="\n"+S+C+T,w&&h(e,r)}}e.replaceSelections(n)}},function(e,t,n){"use strict";var r,o=n(6),l=(r=o)&&r.__esModule?r:{default:r};function c(e){return d(e)&&e.anchor.ch===e.head.ch}function d(e){return e.anchor.line===e.head.line}function f(e,t,n,r){var o=e.getLine(n.line),l=e.getLine(n.line+r),d={anchor:t,head:n};e.replaceRange(l,{line:n.line,ch:0},{line:n.line,ch:o.length},"+input"),e.replaceRange(o,{line:n.line+r,ch:0},{line:n.line+r,ch:l.length},"+input"),c(d)?e.setCursor({line:n.line+r,ch:n.ch}):e.setSelection({line:t.line+r,ch:t.ch},{line:n.line+r,ch:n.ch})}function h(e,t,n,r){var o=e.getRange({line:t.line,ch:0},{line:n.line,ch:e.getLine(n.line).length}),l=r>0?n:t,c=e.getLine(l.line+r),d=void 0;d=r>0?t:n,e.replaceRange(c,{line:d.line,ch:0},{line:d.line,ch:e.getLine(d.line).length},"+input"),e.replaceRange(o,{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})}l.default.commands.replaceLineTextToUpper=function(e){if(e.getOption("disableInput"))return l.default.Pass;for(var t=e.listSelections(),i=0;i0)f(e,r,o,-1);else if(!c(n)){var m=r.line0&&h(e,r.line===m?r:o,r.line===m?o:r,-1)}}},l.default.commands.replaceLineTextToLower=function(e){if(e.getOption("disableInput"))return l.default.Pass;for(var t=e.listSelections(),i=0;i?!@#$%^&*()_=+\\/'";: \r[\]]*\|+)+/i,E=/^#+\s/,S=/^ {0,3}(```|\||>)/,T=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cm=t.getEditor(),this.doc=this.cm.getDoc(),this.name="list"}return r(e,[{key:"_createSortedLineRange",value:function(e){var t=e.from.line>e.to.line,n={line:t?e.to.line:e.from.line,ch:0},r={line:t?e.from.line:e.to.line,ch:0};return{start:n.line,end:r.line}}},{key:"_calculateOrdinalNumber",value:function(e){for(var t=1,i=e-1;i>=0;i-=1){var n=this._getListDepth(i);if(1===n&&v.exec(this.doc.getLine(i))){t=parseInt(RegExp.$1,10)+1;break}if(0===n)break}return t}},{key:"_isListLine",value:function(e){return!!o.exec(this.doc.getLine(e))}},{key:"_isCanBeList",value:function(e){var line=this.doc.getLine(e);return!S.test(line)&&!y.test(line)&&!E.test(line)}},{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),o=r.start,l=r.end,c=this._getChangeFn(t),d=o;d<=l&&this._isCanBeList(d);d+=1)this._isListLine(d)||n.push(d),c(d);this._insertBlankLineForNewList(n),this.cm.focus()}},{key:"_replaceLineText",value:function(text,e){this.doc.replaceRange(text,{line:e,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){l.exec(this.doc.getLine(e))?this._replaceLineTextByRegexp(e,h,"$1"):this._isListLine(e)?this._replaceLineTextByRegexp(e,f,"$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(),o=[],i=e,l=void 0;n?i0;)if(i=n?i+1:i-1,(l=this._getListDepth(i))===t)o.push(i);else if(l0&&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=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i(
|
)<\/\1>/gi,N=/(?:
|
)<\/(.+?)>/gi,k=/\b(H[\d]|LI|P|BLOCKQUOTE|TD|PRE)\b/,I=/]*)>[\u0020]/g,D=/[\u0020]<\/span>/g,L=/^(TABLE|H[1-6])$/,P="tui-editor-contents-placeholder",B="undefined"!=typeof MutationObserver,F=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.componentManager=new x.default(this),this.eventManager=n,this.$editorContainerEl=t,this._height=0,this._silentChange=!1,this._keyEventHandlers={},this._managers={},this._linkAttribute={},this._initEvent(),this._initDefaultKeyEventHandler(),this.debouncedPostProcessForChange=l.default.debounce((function(){return r.postProcessForChange()}),0)}return r(e,[{key:"init",value:function(e){var t=(0,o.default)("
");this.$editorContainerEl.append(t),this.editor=new T.default(t[0],{blockTag:"DIV",leafNodeNames:{HR:!1},allowedBlocks:e?[]:["details","summary"]}),this.editor.blockCommandShortcuts(),this._clipboardManager=new d.default(this),this._initSquireEvent(),this._clipboardManager.init(),this.get$Body().addClass("tui-editor-contents"),this.$editorContainerEl.css("position","relative"),this._togglePlaceholder(),this.codeBlockGadget=new M.default({eventManager:this.eventManager,container:this.$editorContainerEl,wysiwygEditor:this})}},{key:"_initEvent",value:function(){var e=this;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"),l.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,o=void 0;(r=this._keyEventHandlers.DEFAULT)&&l.default.forEachArray(r,(function(r){return o=r(e,n,t)})),(r=this._keyEventHandlers[t])&&!1!==o&&l.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}),l.default.debounce((function(){e.isEditorValid()&&e.eventManager.emit("copyAfter",{source:"wysiwyg",data:t})}))()})),t.addEventListener(l.default.browser.msie?"beforecut":"cut",(function(t){e.eventManager.emit("cut",{source:"wysiwyg",data:t}),l.default.debounce((function(){e.isEditorValid()&&e.eventManager.emit("cutAfter",{source:"wysiwyg",data:t})}))()})),t.addEventListener(l.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",l.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)})),l.default.browser.firefox&&(t.addEventListener("keypress",(function(t){var r=t.keyCode;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(c.default.isTextNode(t.commonAncestorContainer)&&c.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(data){var t={bold:/(>B|>STRONG|^B$|^STRONG$)/.test(data.path),italic:/(>I|>EM|^I$|^EM$)/.test(data.path),strike:/(^S>|>S$|>S>|^S$)/.test(data.path),code:/CODE/.test(data.path),codeBlock:/PRE/.test(data.path),quote:/BLOCKQUOTE/.test(data.path),list:/LI(?!.task-list-item)/.test(e._getLastLiString(data.path)),task:/LI.task-list-item/.test(e._getLastLiString(data.path)),source:"wysiwyg"};e.eventManager.emit("stateChange",t)})),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(P):t.classList.add(P)}))}},{key:"_getLastLiString",value:function(path){var e=/LI[^UO]*$/.exec(path);return e?e[0]:""}},{key:"_onKeyDown",value:function(e){var t=O.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(),o=r.collapsed&&e._isCursorNotInRestrictedAreaOfTabAction(n),l=!r.collapsed&&c.default.isTextNode(r.commonAncestorContainer);return t.preventDefault(),!o&&!l||(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 o="BACK_SPACE"===n?"backspace":"delete";return r.removeAllFormatting(),r._keyHandlers[o](r,e,r.getSelection()),r.removeLastUndoStack(),!1}return!0}},{key:"_isStartHeadingOrTableAndContainsThem",value:function(e){var t=e.startContainer,n=e.startOffset,r=e.commonAncestorContainer,o=e.collapsed,l=this.getEditor().getRoot(),d=!1;return o||r!==l||(t===l?d=L.test(c.default.getChildNodeByOffset(t,n).nodeName):0===n&&(d=L.test(c.default.getParentUntil(t,l).nodeName))),d}},{key:"_wrapDefaultBlockToOrphanTexts",value:function(){this.get$Body().contents().filter(this.findTextNodeFilter).each((function(i,e){e.nextSibling&&"BR"===e.nextSibling.tagName&&(0,o.default)(e.nextSibling).remove(),(0,o.default)(e).wrap("
")}))}},{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();var t=(e=this.getRange()).startContainer,n=e.startOffset,r=this.getEditor().createDefaultBlock([e.startContainer]),o=c.default.getChildNodeByOffset(e.startContainer,e.startOffset);o?e.setStartBefore(o):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(i,r){e===r.previousSibling?(t.nodeValue+=r.nodeValue,n.push(r)):t=r,e=r})),(0,o.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 o=this.getEditor(),l=o.getSelection();return l.setStart(e,t),l.setEnd(n,r),o.setSelection(l),l}},{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:"setLinkAttribute",value:function(e){this._linkAttribute=e}},{key:"getLinkAttribute",value:function(){return this._linkAttribute}},{key:"setValue",value:function(html){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];html=this.eventManager.emitReduce("wysiwygSetValueBefore",html),this.editor.setHTML(html),this.eventManager.emit("wysiwygSetValueAfter",this),this.eventManager.emit("contentChangedFromWysiwyg",this),e&&this.moveCursorToEnd(),this.getEditor().preserveLastLine(),this.getEditor().removeLastUndoStack(),this.getEditor().saveUndoState()}},{key:"insertText",value:function(text){this.editor.insertPlainText(text)}},{key:"getValue",value:function(){this._prepareGetHTML();var html=this.editor.getHTML();return html=(html=(html=(html=(html=(html=html.replace(R,(function(e,t){return"li"===t?e:"td"===t||"th"===t?"<"+t+">":"
"}))).replace(I," ")).replace(D," ")).replace(N,"")).replace(/]*>/g,"")).replace(/<\/div>/g,"
"),html=this.eventManager.emitReduce("wysiwygProcessHTMLText",html)}},{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(){B&&!this.getEditor().isIgnoreChange()&&(this._silentChange=!0)}},{key:"getEditor",value:function(){return this.editor}},{key:"replaceSelection",value:function(content,e){this.getEditor().replaceSelection(content,e)}},{key:"replaceRelativeOffset",value:function(content,e,t){this.getEditor().replaceRelativeOffset(content,e,t)}},{key:"addWidget",value:function(e,t,style,n){var r=this.getEditor().getSelectionPosition(e,style,n),l=this.$editorContainerEl.offset();this.$editorContainerEl.append(t),(0,o.default)(t).css({position:"absolute",top:r.top-l.top+this.scrollTop(),left:r.left-l.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 div=this.editor.createDefaultBlock(),n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset)||c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),r=c.default.getParentUntil(n,this.get$Body()[0]);"before"===t?(0,o.default)(r).before(div):(0,o.default)(r).after(div),e.setStart(div,0),e.collapse(!0),this.setRange(e)}},{key:"replaceContentText",value:function(e,t,n){var r=(0,o.default)(e).html();(0,o.default)(e).html(r.replace(t,n))}},{key:"unwrapBlockTag",value:function(e){e||(e=function(e){return k.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,o=this.$editorContainerEl.get(0).getBoundingClientRect(),l=o.top,c=n-l,d=n+r-(l+o.height);c<0?this.scrollTop(e+c):d>0&&this.scrollTop(Math.ceil(e+d))}},{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 l.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,o.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,o.default)(t).closest("[contenteditable=true] table").length}},{key:"getTextObject",value:function(e){return new C.default(this,e)}},{key:"defer",value:function(e,t){var n=this;setTimeout((function(){n.isEditorValid()&&e(n)}),t||0)}},{key:"isEditorValid",value:function(){return this.getEditor()&&o.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 o=new e(t,n,r);return o.init(r.useDefaultHTMLSanitizer),o.componentManager.addManager(f.default),o.componentManager.addManager(h.default),o.componentManager.addManager(_.default),o.componentManager.addManager(m.default),o.componentManager.addManager(v.default),o.componentManager.addManager(y.default),o.componentManager.addManager(E.default),o.componentManager.addManager(S.default),o}}]),e}();t.default=F},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i");this._extendRange(l),c.append(l.cloneContents()),this._updateCopyDataForListTypeIfNeed(l,c),this.wwe.eventManager.emit("copyBefore",{source:"wysiwyg",$clipboardContainer:c}),this._setClipboardData(r,c.html(),c.text())}else t.createRangeBySelectedCells()}},{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:c.default.getParentUntil(e,"TR")}},{key:"_replaceNewLineToBr",value:function(e){c.default.getAllTextNode(e).forEach((function(e){/\n/.test(e.nodeValue)&&(e.parentNode.innerHTML=e.nodeValue.replace(/\n/g,"
"))}))}},{key:"_onWillPaste",value:function(e){var t=this,n=e.data,r=(0,o.default)("
").append(n.fragment.cloneNode(!0));this._preparePaste(r),this._setTableBookmark(r),n.fragment=document.createDocumentFragment(),r.contents().each((function(e,element){n.fragment.appendChild(element)})),this.wwe.getEditor().addEventListener("input",(function e(){t.wwe.getEditor().removeEventListener("input",e),t.wwe.eventManager.emit("wysiwygRangeChangeAfter",t),t._focusTableBookmark()}))}},{key:"_setClipboardData",value:function(e,t,n){l.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,o.default)("
").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,o.default)("<"+n+" />");r.append(t.html()),t.html(""),t.append(r)}}},{key:"_removeEmptyFontElement",value:function(e){e.children("font").each((function(e,element){var t=(0,o.default)(element);t.text().trim()||t.remove()}))}},{key:"_isFromMs",value:function(html){return/

"),f=void 0,h=void 0,m=void 0;this._pasteFirstAid(e);for(var _=l.default.toArray(e[0].childNodes);_.length;)h=_[0],m="LI"===(f=c.default.getNodeName(h))||"UL"===f||"OL"===f,n.isInCodeBlock(t)?d.append(n.prepareToPasteOnCodeblock(_)):m?(d.append(this._prepareToPasteList(_,t,r)),r=!0):d.append(_.shift());e.html(d.html())}},{key:"_wrapOrphanNodeWithDiv",value:function(e){var t=(0,o.default)("

"),n=l.default.toArray(e[0].childNodes),r=void 0;return l.default.forEachArray(n,(function(e){var n=3===e.nodeType,l=/^(SPAN|A|CODE|EM|I|STRONG|B|S|U|ABBR|ACRONYM|CITE|DFN|KBD|SAMP|VAR|BDO|Q|SUB|SUP)$/gi.test(e.tagName),c="BR"===e.nodeName;n||l||c?(r||(r=document.createElement("div"),t.append(r)),r.appendChild(e),c&&(r=null)):(r&&"BR"!==r.lastChild.tagName&&r.appendChild((0,o.default)("
")[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,d.default)(e.html(),!0)),e.find("*").each((function(i,e){t._removeStyles(e)})),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(i,e){var t=(0,o.default)(e).children("br");t.length&&"LI"!==e.nodeName&&"UL"!==e.nodeName&&t.eq(0).unwrap()}))}},{key:"_unwrapNestedBlocks",value:function(e,t){e.find(":not(:has(*))").not("b,s,i,em,code,span,hr").each((function(i,n){for(var r="BR"===n.nodeName?(0,o.default)(n.parentNode):(0,o.default)(n);r.parents(t).length;){var l=r.parent(t);l.length&&l[0]!==e[0]?r.unwrap():r=r.parent()}}))}},{key:"_removeUnnecessaryBlocks",value:function(e,t){e.find(t).each((function(e,n){var r=(0,o.default)(n),l="DIV"===n.tagName,c=0!==r.parent("li").length,d=0!==r.parent("blockquote").length,f=r.children(t).length;l&&(c||d||!f)||(n.lastChild&&"BR"!==n.lastChild.nodeName&&r.append(document.createElement("br")),r.replaceWith(r.html()))}))}},{key:"_removeStyles",value:function(e){var t=(0,o.default)(e),n=void 0;"SPAN"!==c.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=c.default.getNodeName(e[0]),l=e.shift(),d=this.wwe.getEditor().getDocument().createDocumentFragment();if("LI"!==r&&e.length&&"LI"===e[0].tagName&&(r="LI",l=this._makeNodeAndAppend({tagName:r},l)),"OL"===r||"UL"===r)!n&&this.wwe.getEditor().hasFormat("LI")?(0,o.default)(d).append(this._wrapCurrentFormat(l)):(0,o.default)(d).append(l);else if("LI"===r){var f=this.wwe.getEditor().getDocument().createDocumentFragment();for(f.appendChild(l);e.length&&"LI"===e[0].tagName;)f.appendChild(e.shift());!n&&this.wwe.getEditor().hasFormat("LI")?(0,o.default)(d).append(this._wrapCurrentFormat(f)):!t||"UL"!==t.commonAncestorName&&"OL"!==t.commonAncestorName?(0,o.default)(d).append(this._makeNodeAndAppend({tagName:"UL"},f)):(0,o.default)(d).append(this._makeNodeAndAppend({tagName:t.commonAncestorName},f))}return d}},{key:"_unwrapFragmentFirstChildForPasteAsInline",value:function(e){return(0,o.default)(e).find("br").remove(),e.childNodes}},{key:"_wrapCurrentFormat",value:function(e){var t=this,n=void 0;return this._eachCurrentPath((function(path){"DIV"!==path.tagName&&(n=c.default.isElemNode(e)?e.tagName:e.firstChild.tagName,path.tagName!==n&&(e=t._makeNodeAndAppend(path,e)))})),e}},{key:"_eachCurrentPath",value:function(e){for(var t=c.default.getPath(this.wwe.getEditor().getSelection().startContainer,this.wwe.get$Body()[0]),i=t.length-1;i>-1;i-=1)e(t[i])}},{key:"_makeNodeAndAppend",value:function(e,content){var t=(0,o.default)("<"+e.tagName+"/>");return t.append(content),e.id&&t.attr("id",e.id),e.className&&t.addClass(e.className),t[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 o=t.wrapTheadAndTbodyIntoTableIfNeed(e);o&&e.append(o)}},{key:"_updateTableIDClassName",value:function(e){var t=this.wwe.componentManager.getManager("table");e.find("table").each((function(e,table){(0,o.default)(table).removeClass((function(e,t){return t.replace(/.*\s*(te-content-table-\d+)\s*.*/,"$1")}))})),e.find("table").each((function(e,table){(0,o.default)(table).addClass(t.getTableIDClassName())}))}}]),e}();t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i-1&&r>-1&&(html=html.slice(n+20,r)),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(html)&&(html=""+html+""),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(html)&&(html=""+html+"
"),e.appendChild((0,c.default)(html)),this._pasteClipboardContainer(e)}},{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(),o=this._preparePasteDocumentFragment(e);t.saveUndoState(r),r.collapsed||this._deleteContentsRange(r),l.default.isTextNode(r.startContainer)?this._pasteIntoTextNode(r,o):this._pasteIntoElements(r,o),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=o.default.toArray(e.childNodes);n.length;){var r=n.shift();if(this._isPossibleInsertToTable(r))t.appendChild(r);else{t.appendChild(this._unwrapBlock(r));var l=t.lastChild;n.length&&l&&"BR"!==l.nodeName&&t.appendChild(document.createElement("br"))}}return t}},{key:"_isPossibleInsertToTable",value:function(e){var t=e.nodeName;return!("CODE"===t&&e.childNodes.length>1)&&("UL"===t||"OL"===t||l.default.isMDSupportInlineNode(e)||l.default.isTextNode(e))}},{key:"_pasteIntoElements",value:function(e,t){var n=e.startContainer,r=e.startOffset,o=l.default.getChildNodeByOffset(n,r);if(o)n.insertBefore(t,o),e.setStart(o,0);else if("TD"===n.nodeName)n.appendChild(t),e.setStart(n,n.childNodes.length);else{var c=n.parentNode,d=n.nextSibling;c.insertBefore(t,d),d?e.setStart(d,0):e.setStartAfter(c.lastChild)}e.collapse(!0)}},{key:"_pasteIntoTextNode",value:function(e,t){var n=e.startContainer,r=e.startOffset,c=n.parentNode,d=n.textContent,f=d.slice(0,r),h=d.slice(r,d.length),m=t.childNodes,_=m[0],v=1===m.length&&l.default.isTextNode(_);if(f)if(h)if(v){var y=_.textContent;n.textContent=""+f+y+h,e.setStart(n,f.length+y.length)}else{var E=document.createDocumentFragment();E.appendChild(document.createTextNode(f)),E.appendChild(t),E.appendChild(document.createTextNode(h)),c.replaceChild(E,n);var S=o.default.toArray(c.childNodes),T=0;S.forEach((function(e,i){e.textContent===h&&(T=i)})),e.setStart(c.childNodes[T],0)}else{var w=n.nextSibling;c.insertBefore(t,w),e.setStartAfter(w)}else c.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,o=e.endOffset;t===r?(this._deleteContentsByOffset(t,n,o),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,o=e.endOffset,c=e.commonAncestorContainer,d=this._getBlock(t,c,n),f=this._getBlock(r,c,o-1);if(d===f)this._removeInSameBlock(d,t,r,n,o),f=r!==f?null:f;else{var h=d.nextSibling;"TD"===t.nodeName?h=this._removeOneLine(d):(this._deleteContentsByOffset(t,n,l.default.getOffsetLength(t)),l.default.removeNodesByDirection(d,t,!1)),"TD"===r.nodeName?f=this._removeOneLine(f):(this._deleteContentsByOffset(r,0,o),l.default.removeNodesByDirection(f,r,!0)),l.default.removeChildFromStartToEndNode(c,h,f)}f?e.setStart(f,0):e.setStartAfter(d),e.collapse(!0)}},{key:"_removeInSameBlock",value:function(e,t,n,r,o){var c=t===e?r:0,d=n===e?o:l.default.getOffsetLength(e);this._deleteContentsByOffset(e,c,d)}},{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 l.default.getParentUntil(e,t)||l.default.getChildNodeByOffset(e,n)}},{key:"_deleteContentsByOffset",value:function(e,t,n){if(l.default.isTextNode(e)){var r=e.textContent,o=r.slice(0,t),c=r.slice(n,r.length);e.textContent=""+o+c}else{var d=l.default.getChildNodeByOffset(e,t),f=l.default.getChildNodeByOffset(e,n);d&&l.default.removeChildFromStartToEndNode(e,d,f||null)}}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i]*>)(.*?)(<\/(?:th|td)>)/g,v=/<(ul|ol|li)([^>]*)>/g,y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="list",this._init()}return r(e,[{key:"_init",value:function(){this._initEvent(),this._initKeyHandler()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",(function(html){return e._convertToArbitraryNestingList(html)})),this.eventManager.listen("wysiwygRangeChangeAfter",(function(){e._findAndRemoveEmptyList(),e._removeBranchListAll()})),this.eventManager.listen("wysiwygSetValueAfter",(function(){e._removeBranchListAll()})),this.eventManager.listen("wysiwygProcessHTMLText",(function(html){return html=e._convertFromArbitraryNestingList(html)})),this.eventManager.listen("convertorBeforeHtmlToMarkdownConverted",(function(html){return e._insertDataToMarkPassForListInTable(html)}))}},{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 l=(0,o.default)(n.startContainer).closest("li").children(m);e.eventManager.emit("command","Outdent"),l.length&&!l.prev().length&&e._removeBranchList(l),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,o.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(m).each((function(e,t){f.test(t.innerHTML)||(0,o.default)(t).remove()}))}},{key:"_removeBranchListAll",value:function(e){var t=this;(e=e?(0,o.default)(e):this.wwe.get$Body()).find("li ul, li ol").each((function(e,n){n&&!n.previousSibling&&t._removeBranchList(n)}))}},{key:"_removeBranchList",value:function(e){for(var t=(0,o.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:"_convertToArbitraryNestingList",value:function(html){var e="li > ul, li > ol",t=document.createElement("div");t.innerHTML=html;for(var n=t.querySelector(e);null!==n;){var r=n.parentNode;r.parentNode.insertBefore(n,r.nextElementSibling),n=t.querySelector(e)}return t.innerHTML}},{key:"_convertFromArbitraryNestingList",value:function(html){var e="ol > ol, ol > ul, ul > ol, ul > ul",t=document.createElement("div");t.innerHTML=html;for(var n=t.querySelector(e);null!==n;){for(var r=n.previousElementSibling;r&&"LI"!==r.tagName;)r=r.previousElementSibling;r?r.appendChild(n):this._unwrap(n),n=t.querySelector(e)}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:"_insertDataToMarkPassForListInTable",value:function(html){return html.replace(_,(function(e,t,n,r){return""+t+n.replace(v,'<$1 data-tomark-pass="" $2>')+r}))}},{key:"getLinesOfSelection",value:function(e,t){var n=[],r=!1,l=!0,d=void 0;c.default.isTextNode(e)&&(e=(0,o.default)(e).parents(h).first().get(0)),c.default.isTextNode(t)&&(t=(0,o.default)(t).parents(h).first().get(0));for(var line=e;l&&(0,o.default)(line).is(h);line=d)n.push(line),line===t?r=!0:d=this._getNextLine(line,t),l=d&&!r;return n}},{key:"_getNextLine",value:function(e,t){var n=e.nextElementSibling;return n?(0,o.default)(n).is(m)&&(n=n.querySelector("li")):n=e.parentNode.nextElementSibling,(0,o.default)(n).is(h)||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,o.default)(n).is(m)&&(this._mergeList(t,n),t=n),t.lastElementChild===e&&r&&(0,o.default)(r).is(m)&&this._mergeList(r,t)}},{key:"_mergeList",value:function(e,t){var n=e.firstElementChild;if(t&&(0,o.default)(t).is(m)){for(;n;){var r=n.nextElementSibling;t.appendChild(n),n=r}e.parentNode.removeChild(e)}}},{key:"isAvailableMakeListInTable",value:function(){var e=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),t=this.wwe.getEditor();return 0===e.length&&t.hasFormat("table")&&!t.hasFormat("OL")&&!t.hasFormat("UL")}},{key:"_getParentNodeBeforeTD",value:function(e,t){var n=c.default.getParentUntil(e,"TD");if(!n){var r=e.childNodes,o=r?r.length:0,l=t>0&&t===o?t-1:t;n=c.default.getChildNodeByOffset(e,l)}return n}},{key:"_findLINodeInsideTD",value:function(e,t){var n=null,r=c.default.getParentUntilBy(e,(function(e){return e&&c.default.isListNode(e)}),(function(e){return e&&"TD"===e.nodeName}));if(r)n=r;else if("LI"===e.nodeName)n=e;else if(c.default.isListNode(e)){var o=e.childNodes.length;n=e.childNodes[t>=o?o-1:t]}return n}},{key:"_getFirstNodeInLineOfTable",value:function(e,t){var n=this._findLINodeInsideTD(e,t);if(!n)for(var r=(n=this._getParentNodeBeforeTD(e,t)).previousSibling;r&&"BR"!==r.nodeName&&!c.default.isListNode(r);)r=(n=r).previousSibling;return n}},{key:"_getLastNodeInLineOfTable",value:function(e,t){var n=this._findLINodeInsideTD(e,t);if(!n)for(n=this._getParentNodeBeforeTD(e,t);n.nextSibling&&"BR"!==n.nodeName&&!c.default.isListNode(n);)n=n.nextSibling;return n}},{key:"_isLastNodeInLineOfTable",value:function(e){var t=e.nodeName;return"LI"===t||"BR"===t}},{key:"_getNextNodeInLineOfTable",value:function(e){var t=e.nextSibling;if("LI"!==e.nodeName||t)c.default.isListNode(t)&&(t=t.firstChild);else for(var n=e.parentNode;"TD"!==n.nodeName;){if(n.nextSibling){t=n.nextSibling;break}n=n.parentNode}return t}},{key:"_getLinesOfSelectionInTable",value:function(e){for(var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset,l=this._getFirstNodeInLineOfTable(t,r),c=this._getLastNodeInLineOfTable(n,o),d=[],f=[];l;){if(f.push(l),this._isLastNodeInLineOfTable(l)&&(d.push(f),f=[]),l===c){f.length&&d.push(f);break}l=this._getNextNodeInLineOfTable(l)}return d}},{key:"_createListElement",value:function(e){return document.createElement("TASK"===e?"UL":e)}},{key:"_createListItemElement",value:function(e,t){var n=document.createElement("li");return e.forEach((function(e){n.appendChild(e)})),"TASK"===t&&this.wwe.componentManager.getManager("task").formatTask(n),n}},{key:"_mergeListWithPreviousSibiling",value:function(e){var t=e.previousSibling,n=e;return t&&e.nodeName===t.nodeName&&(this._mergeList(e,t),n=t),n}},{key:"_mergeListWithNextSibiling",value:function(e){var t=e.nextSibling;return t&&e.nodeName===t.nodeName&&this._mergeList(t,e),e}},{key:"createListInTable",value:function(e,t){var n=this,r=this._getLinesOfSelectionInTable(e),o=r[r.length-1],c=o[o.length-1],d=c.nextSibling,f=c.parentNode,h=this._createListElement(t),m=h.nodeName,_=[];return r.forEach((function(e){var r=e[0],o=void 0;if("LI"===r.nodeName){var c=r.parentNode;if(o=r,c.nodeName!==m){var d=c.childNodes;l.default.forEachArray(d,(function(){h.appendChild(c.firstChild)})),c.parentNode.replaceChild(h,c)}h=o.parentNode}else o=n._createListItemElement(e,t),h.appendChild(o);_.push(o)})),h.parentNode||f.insertBefore(h,d),h=this._mergeListWithPreviousSibiling(h),this._mergeListWithNextSibiling(h),_}},{key:"adjustRange",value:function(e,t,n,r,o){var l=c.default.containsNode(o[0],e)?e:o[0],d=c.default.containsNode(o[o.length-1],t)?t:o[o.length-1],f="TD"===e.nodeName?0:n,h="TD"===t.nodeName?0:r;this.wwe.setSelectionByContainerAndOffset(l,f,d,h)}}]),e}();t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i");e.html(html),e.find("p").each((function(e,t){var n=t.innerHTML.split(/
/gi),r=n.length-1,o=t.nextElementSibling||t.nextSibling,l="";l=n.map((function(line,e){var t="";return e>0&&e"),line&&(t="
"+line+"
"),t})),o&&"P"===o.nodeName&&l.push("

"),(0,c.default)(t).replaceWith((0,c.default)(l.join("")))})),html=e.html()}return html}},{key:"_ensurePtagContentWrappedWithDiv",value:function(){this.wwe.get$Body().find("p").each((function(e,t){(0,c.default)(t).find("div").length<=0&&(0,c.default)(t).wrapInner("
"),(0,c.default)(t).next().is("p")&&(0,c.default)(t).append("

")}))}},{key:"_unwrapPtags",value:function(){this.wwe.get$Body().find("div").each((function(e,t){(0,c.default)(t).parent().is("p")&&(0,c.default)(t).unwrap()}))}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i")}))}},{key:"_unwrapHeading",value:function(){this.wwe.unwrapBlockTag((function(e){return d.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,o.default)("

").insertBefore(l.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,c=l.default.getTopPrevNodeUnder(r,this.wwe.get$Body()[0]),d=c&&0===c.textContent.length,f=this.wwe.getEditor();0===r.textContent.length?n=this._removeHedingAndChangeSelection(e,t,c):d&&(e.preventDefault(),f.saveUndoState(t),(0,o.default)(c).remove(),n=!0)}return n}},{key:"_removeHedingAndChangeSelection",value:function(e,t,n){var r=t.startContainer,c=this.wwe.getEditor(),f=this.wwe.get$Body(),h=d.test(l.default.getNodeName(r))?r:(0,o.default)(r).parents("h1,h2,h3,h4,h5,h6")[0],m=n,_=1;return e.defaultPrevented||(e.preventDefault(),c.saveUndoState(t)),(0,o.default)(h).remove(),n||(m=f.children("div").first().get(0),_=0),t.setStart(m,_),t.collapse(!0),c.setSelection(t),!0}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i1)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 o=void 0,c=void 0,f=void 0,h=void 0,m=void 0,_=void 0,v=void 0;if(r.childNodes.length?o=r.childNodes.item(0):(o=n.createDefaultBlock(),r.appendChild(o)),e){for(;o.firstChild;)o=o.firstChild;for(v=function(e){h.appendChild(e)};o!==r;){if(m=o.tagName,l.default.isFunction(e)?e(m):m===e){h=o.childNodes.item(0),(!d.default.isElemNode(h)||o.childNodes.length>1)&&(h=n.createDefaultBlock(),l.default.forEachArray(l.default.toArray(o.childNodes),v),(_=h.lastChild)&&"BR"===d.default.getNodeName(_)&&h.removeChild(_)),f=t?n.createElement(t,[h]):h,(c=n.getDocument().createDocumentFragment()).appendChild(f),r=c;break}o=o.parentNode}}return c&&e||!t||"DIV"!==d.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(content,e){e&&this.setSelection(e),this._ignoreChange=!0,this.insertHTML(content)}},{key:"replaceRelativeOffset",value:function(content,e,t){var n=this.getSelection().cloneRange();this._replaceRelativeOffsetOfSelection(content,e,t,n)}},{key:"_replaceRelativeOffsetOfSelection",value:function(content,e,t,n){var r=void 0,o=void 0,l=void 0,c=n.endContainer,f=n.endOffset;"TEXT"!==d.default.getNodeName(c)&&(c=this._getClosestTextNode(c,f))&&(f=d.default.isTextNode(c)?c.nodeValue.length:c.textContent.length),c?(r=this.getSelectionInfoByOffset(c,f+e),n.setStart(r.element,r.offset),l=f+(e+t),o=this.getSelectionInfoByOffset(c,l),n.setEnd(o.element,o.offset),this.replaceSelection(content,n)):this.replaceSelection(content)}},{key:"_getClosestTextNode",value:function(e,t){var n=d.default.getChildNodeByOffset(e,t-1);return"TEXT"!==d.default.getNodeName(n)&&(n=n.previousSibling),n}},{key:"getSelectionInfoByOffset",value:function(e,t){var n=void 0,r=void 0,o=void 0,l=void 0,c=t>=0?"next":"previous",f=Math.abs(t),h=n;for(n="next"===c?e:e.previousSibling,o=f,l=0;n&&!(f<=(l+=r=d.default.isTextNode(n)?n.nodeValue.length:n.textContent.length));)o-=r,d.default.getTextLength(n)>0&&(h=n),n=n[c+"Sibling"];return n||(n=h,o=d.default.getTextLength(n)),"previous"===c&&(o=d.default.getTextLength(n)-o),{element:n,offset:o}}},{key:"getSelectionPosition",value:function(e,style,t){var marker=this.createElement("INPUT"),n=e.cloneRange(),r=this.getSelectionInfoByOffset(e.endContainer,e.endOffset+(t||0));n.setStart(n.startContainer,n.startOffset),n.setEnd(r.element,r.offset),this._ignoreChange=!0,this.insertElement(marker,n);var l=(0,o.default)(marker).offset();return"over"!==style&&(l.top+=(0,o.default)(marker).outerHeight()),marker.parentNode.removeChild(marker),e.setStart(e.endContainer,e.endOffset),e.collapse(!0),this.setSelection(e),l}},{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,o.default)(e).closest(t);r.length&&(r.wrapInner("<"+n+"/>"),r.children().unwrap())}},{key:"preserveLastLine",value:function(){var e=this.get$Body().children().last();"DIV"!==d.default.getNodeName(e[0])&&(this._ignoreChange=!0,(0,o.default)(this.createDefaultBlock()).insertAfter(e))}},{key:"scrollTop",value:function(e){return l.default.isUndefined(e)?this.get$Body().scrollTop():this.get$Body().scrollTop(e)}},{key:"isIgnoreChange",value:function(){return this._ignoreChange}},{key:"focus",value:function(){c.default.prototype.focus.call(this)}},{key:"blockCommandShortcuts",value:function(){var e=this,meta=f.isMac?"meta":"ctrl";["b","i","u","shift-7","shift-5","shift-6","shift-8","shift-9","[","]","d"].forEach((function(t){e.setKeyHandler(meta+"-"+t,(function(e,t){t.preventDefault()}))}))}}]),t}(c.default);t.default=v},function(e,t){e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&e.setStart(e.startContainer,e.startOffset-1)}},{key:"expandEndOffset",value:function(){var e=this._range;l.default.isTextNode(e.endContainer)&&e.endOffsettext"),this.$el.append(this._$languageLabel),this._$buttonOpenModalEditor=(0,l.default)(''),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,l.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;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onShow",this).call(this),this._onAttachedElementChange=function(){return e._updateLanguage()},(0,l.default)(this.getAttachedElement()).on(f,this._onAttachedElementChange),this._updateLanguage()}},{key:"onHide",value:function(){(0,l.default)(this.getAttachedElement()).off(f,this._onAttachedElementChange),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onHide",this).call(this)}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i'),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&&c.default.contains(document,this._$attachedElement[0])?this.syncLayout():this.setVisibility(!1)}},{key:"_onMouseOver",value:function(e){var t=e.data,n=(0,c.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=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i','
','
','
','
',"
",'
','
',"
","
"].join(""),f=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$el=(0,c.default)(t.el),this.height=t.height,this.type=t.initialEditType,this.eventManager=n,this.init(),this._initEvent()}return o(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,c.default)(d).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(style){"tab"===style?this._tabStyle():"vertical"===style&&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=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i
\n
\n
\n
\n',N=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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 r(e,[{key:"_init",value:function(e){var t=e.el,n=e.toolbarItems,r=e.hideModeSwitch;this.$el=(0,o.default)(R).appendTo(t),this._container=t,this._editorSection=this.$el.find("."+A).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 l.default(e,t);this._toolbar=n,this.$el.find("."+x).append(n.$el)}},{key:"_initModeSwitch",value:function(e){var t=this,n=this.$el.find("."+O),r="markdown"===this._initialEditType?f.default.TYPE.MARKDOWN:f.default.TYPE.WYSIWYG,o=new f.default(n,r);this._modeSwitch=o,e&&o.hide(),o.on("modeSwitched",(function(e,n){return t._editor.changeMode(n)}))}},{key:"_initMarkdownTab",value:function(){var e=this._editor;this._markdownTab=new c.default({initName:T.default.get("Write"),items:[T.default.get("Write"),T.default.get("Preview")],sections:[e.layout.getMdEditorContainerEl(),e.layout.getPreviewEl()]}),this._$markdownTabSection=this.$el.find("."+M),this._$markdownTabSection.append(this._markdownTab.$el),this._markdownTab.on("itemClick",(function(t,n){n===T.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(T.default.get("Write"))):this._$markdownTabSection.hide()}},{key:"_initPopupAddLink",value:function(){this._popups.push(new h.default({$target:this.$el,editor:this._editor}))}},{key:"_initPopupAddImage",value:function(){this._popups.push(new m.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupAddTable",value:function(){this._popups.push(new v.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 y.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,o.default)(t.data.target).parents("[contenteditable=true] table").length>0&&(t.data.preventDefault(),e._editor.eventManager.emit("openPopupTableUtils",t.data))})),this._popups.push(new _.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupCodeBlockLanguages",value:function(){var e=this._editor;this._popups.push(new E.default({$target:this.$el,eventManager:e.eventManager,languages:e.options.codeBlockLanguages}))}},{key:"_initPopupCodeBlockEditor",value:function(){this._popups.push(new S.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 _.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=[],w.default.hide()}},{key:"createPopup",value:function(e){return new d.default(e)}}]),e}();t.default=N},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;in})).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&&o(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}(d.default);t.default=_},function(e,t,n){"use strict";n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),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){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),d?(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)},e.prototype.disconnect_=function(){r&&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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;c.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),h=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),A="undefined"!=typeof WeakMap?new WeakMap:new n,O=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=f.getInstance(),r=new M(t,n,this);A.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){O.prototype[e]=function(){var t;return(t=A.get(this))[e].apply(t,arguments)}}));var R=void 0!==o.ResizeObserver?o.ResizeObserver:O;t.default=R}.call(this,n(75))},function(e,t){var g;g=function(){return this}();try{g=g||new Function("return this")()}catch(e){"object"==typeof window&&(g=window)}e.exports=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(19),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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)}(t,e),t}(((r=o)&&r.__esModule?r:{default:r}).default);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i'+d.default.get("Markdown")+""),this._buttons.$wysiwyg=(0,o.default)('"),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(h)}},{key:"_changeWysiwyg",value:function(){this._switchType(m)}},{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}(c.default);Object.defineProperty(_,"TYPE",{enumerable:!0,writable:!0,value:{MARKDOWN:h,WYSIWYG:m}}),t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i\n \n \n \n
\n \n \n
\n ";return e=c.default.extend({header:!0,title:f.default.get("Insert link"),className:"te-popup-add-link tui-editor-popup",content:n},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(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(){o(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;o(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),n.focus()})),this.on("hidden",(function(){e._resetInputs()}))}},{key:"_initEditorEvent",value:function(){var e=this;o(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;this._clearValidationStyle(),n.length<1?(0,l.default)(this._inputText).addClass("wrong"):t.length<1?(0,l.default)(this._inputURL).addClass("wrong"):(this._eventManager.emit("command","AddLink",{linkText:n,url:t}),this.hide())}},{key:"_getValue",value:function(){return{url:this._inputURL.value,linkText:this._inputText.value}}},{key:"_clearValidationStyle",value:function(){(0,l.default)(this._inputURL).removeClass("wrong"),(0,l.default)(this._inputText).removeClass("wrong")}},{key:"_resetInputs",value:function(){this._inputText.value="",this._inputURL.value="",this._clearValidationStyle()}}]),t}(d.default);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i
\n
\n \n \n
\n
\n \n \n
\n \n \n
\n \n \n
\n ";return e=l.default.extend({header:!0,title:f.default.get("Insert image"),className:"te-popup-add-image tui-editor-popup",content:n},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOM",value:function(){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this);var e=this.$el;this._$imageUrlInput=e.find("."+m),this._$imageFileInput=e.find("."+_),this._$altTextInput=e.find("."+v);var n=e.find("."+S),r=e.find("."+T),l=this.$body.find("."+w);this.tab=new d.default({initName:f.default.get("File"),items:[f.default.get("File"),f.default.get("URL")],sections:[n,r]}),l.append(this.tab.$el)}},{key:"_initDOMEvent",value:function(){var e=this;o(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 ."+_,(function(){var t=e._$imageFileInput.val().split("\\").pop();e._$altTextInput.val(t)})),this.on("click ."+E,(function(){return e.hide()})),this.on("click ."+y,(function(){var t=e._$imageUrlInput.val(),n=e._$altTextInput.val();if(t)e._applyImage(t,n);else{var r=e._$imageFileInput.get(0).files;if(r.length){var o=r.item(0);e.eventManager.emit("addImageBlobHook",o,(function(t,text){return e._applyImage(t,text||n)}),"ui")}}e.hide()})),this.tab.on("itemClick",(function(){return e._resetInputs()}))}},{key:"_initEditorEvent",value:function(){var e=this;o(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(),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}}]),t}(c.default);t.default=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISABLED_MENU_CLASS_NAME=t.REMOVE_ROW_MENU_CLASS_NAME=void 0;var r=function(){function e(e,t){for(var i=0;i\n \n \n \n
\n \n \n \n
\n \n ";return e=c.default.extend({header:!1,className:"te-popup-table-utils",content:n},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOMEvent",value:function(){var e=this;o(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-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")})),this._bindClickEventOnRemoveRowMenu()}},{key:"_initEditorEvent",value:function(){var e=this;o(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,o=t.clientY-n.top+(0,l.default)(window).scrollTop();e._disableRemoveRowMenu(t.target),e.$el.css({position:"absolute",top:o+5,left:r+10}),e.eventManager.emit("closeAllPopup"),e.show()}))}},{key:"_bindClickEventOnRemoveRowMenu",value:function(){var e=this;this.on("click ."+m,(function(t){var n=t.target;(0,l.default)(n).hasClass(_)?t.preventDefault():e.eventManager.emit("command","RemoveRow")}))}},{key:"_disableRemoveRowMenu",value:function(e){var t=this.$el.find("."+m);"TH"===e.nodeName?t.addClass(_):t.removeClass(_)}}]),t}(d.default);t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i\n
\n
\n
\n
\n

\n',E=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=l.default.extend({header:!1,className:"te-popup-add-table",content:y},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(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(){o(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;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this,e),this.on("mousemove ."+f,(function(e){var t=e.pageX-n._selectionOffset.left,r=e.pageY-n._selectionOffset.top,o=n._getSelectionBoundByOffset(t,r);n._resizeTableBySelectionIfNeed(o.col,o.row),n._setSelectionAreaByBound(o.col,o.row),n._setDisplayText(o.col,o.row),n._setSelectedBound(o.col,o.row)})),this.on("click ."+f,(function(){var e=n._getSelectedTableSize();n._eventManager.emit("command","Table",e.col,e.row)}))}},{key:"_initEditorEvent",value:function(){var e=this;o(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,o=n.offsetLeft;e.$el.css({top:r+t.outerHeight(),left:o}),e._eventManager.emit("closeAllPopup"),e.show(),e._selectionOffset=e.$el.find("."+f).offset()}))}},{key:"_cacheElements",value:function(){this.$header=this.$el.find("."+h),this.$body=this.$el.find("."+m),this.$selection=this.$el.find("."+_),this.$desc=this.$el.find("."+v)}},{key:"_resizeTableBySelectionIfNeed",value:function(col,e){var t=this._getResizedTableBound(col,e);t&&this._setTableSizeByBound(t.col,t.row)}},{key:"_getResizedTableBound",value:function(col,e){var t=void 0,n=void 0,r=void 0;return col>=5&&col<9?t=col+1:col<5&&(t=5),e>=7&&e<14?n=e+1:e<7&&(n=7),this._isNeedResizeTable(t,n)&&(r={row:n||this._tableBound.row,col:t||this._tableBound.col}),r}},{key:"_isNeedResizeTable",value:function(col,e){return col&&col!==this._tableBound.col||e&&e!==this._tableBound.row}},{key:"_getBoundByOffset",value:function(e,t){return{row:parseInt(t/17,10),col:parseInt(e/25,10)}}},{key:"_getOffsetByBound",value:function(col,e){return{x:25*col+25,y:17*e+17}}},{key:"_setTableSizeByBound",value:function(col,e){var t=this._getOffsetByBound(col,e-1);this._setTableSize(t.x,t.y),this._tableBound.row=e,this._tableBound.col=col}},{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(col,e){var t=this._getOffsetByBound(col,e);this._setSelectionArea(t.x,t.y)}},{key:"_setSelectedBound",value:function(col,e){this._selectedBound.col=col,this._selectedBound.row=e}},{key:"_getSelectedTableSize",value:function(){return{row:this._selectedBound.row+1,col:this._selectedBound.col+1}}},{key:"_setDisplayText",value:function(col,e){this.$desc.html(col+1+" x "+(e+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}(c.default);E.CELL_WIDTH=25,E.CELL_HEIGHT=17,E.MIN_ROW_SELECTION_INDEX=1,E.MIN_COL_SELECTION_INDEX=1,t.default=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i\n
  • '+f.default.get("Heading")+' 2

  • \n
  • '+f.default.get("Heading")+' 3

  • \n
  • '+f.default.get("Heading")+' 4

  • \n
  • '+f.default.get("Heading")+' 5
  • \n
  • '+f.default.get("Heading")+' 6
  • \n
  • '+f.default.get("Paragraph")+"
  • \n \n ";return e=c.default.extend({header:!1,className:"te-heading-add",content:n},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(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;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click li",(function(t){var n=(0,l.default)(t.target).closest("li");e._eventManager.emit("command",n.data("type"),n.data("value"))}))}},{key:"_initEditorEvent",value:function(){var e=this;o(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,o=n.offsetLeft;e.$el.css({top:r+t.outerHeight(),left:o}),e._eventManager.emit("closeAllPopup"),e.show()}))}}]),t}(d.default);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i'+e+"")})),e=c.default.extend({header:!1,className:"te-popup-code-block-languages",content:n.join("")},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(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){o(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;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this);var n=function(t){var n=(0,l.default)(t.target).data("lang");e._onSelectedLanguage&&e._onSelectedLanguage(n),e.hide()};this._languages.forEach((function(t){return e.on("mousedown ."+h+t,n)}))}},{key:"_initEditorEvent",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("openPopupCodeBlockLanguages",(function(data){e.show(data.callback);var t=e.$el.get(0).style;return t.top=data.offset.top+"px",t.left=data.offset.left+"px",e.setCurrentLanguage(data.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,l.default)(this._currentButton).removeClass("active"),this._currentButton=this._$buttons.get(e),(0,l.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,l.default)(this._currentButton).data("lang")}},{key:"setCurrentLanguage",value:function(e){var t=this._$buttons.filter("."+h+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,o(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,o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(d.default);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i\n \n \n \n',C=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n='\n
    \n
    \n \n \n
    \n ";return e=c.default.extend({header:!0,title:"CodeBlock Editor",content:n,className:"tui-popup-code-block-editor",headerButtons:w,modal:!0},e),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return function(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)}(t,e),r(t,[{key:"_initInstance",value:function(e){o(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){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this,e);var n=this.$el.get(0);this._body=n.querySelector("."+E+"body"),this._toggleFitButton=n.querySelector("."+E+"toggle-fit"),this._togglePreviewButton=n.querySelector("."+E+"toggle-preview"),this._toggleScrollButton=n.querySelector("."+E+"toggle-scroll"),this._okButton=n.querySelector("."+S),this._closeButton=n.querySelector("."+T),this._codeMirrorWrapper=this._createCodeBlockEditor(),this._previewWrapper=this._createPreview(),this._scrollSyncSplit=new f.default(this._body,this._codeMirrorWrapper,this._previewWrapper),this._updateFitWindowButton(),this._updatePreviewButton(),this._updateScrollButton(),this._codeBlockLanguagesCombo=this._createCodeBlockLanguagesCombo()}},{key:"_initDOMEvent",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("scroll",(function(e){return e.preventDefault()})),this.on("click ."+E+"toggle-fit",(function(){return e._toggleFitToWindow()})),this.on("click ."+E+"toggle-preview",(function(){return e._togglePreview()})),this.on("click ."+E+"toggle-scroll",(function(){return e._toggleScroll()})),this.on("click ."+S,(function(){return e._save()})),this.on("click ."+T,(function(){return e.hide()})),this.on("click ."+E+"close",(function(){return e.hide()})),this.on("click ."+E+"editor-wrapper",(function(t){t.target===e._codeMirrorWrapper&&e._focusEditor(!0)}))}},{key:"_initEditorEvent",value:function(){var e=this;o(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=E+"editor-wrapper",this._codeBlockEditor=new h.default(e,this.eventManager),e}},{key:"_createPreview",value:function(){var e=document.createElement("div");return this._codeBlockPreview=new m.default((0,l.default)(e),this.eventManager,this.convertor,this._codeBlockEditor),e}},{key:"_createCodeBlockLanguagesCombo",value:function(){var e=this,t=this.getTitleElement(),n=new _.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,l.default)(this._toggleFitButton).toggleClass("active",this.isFitToWindow())}},{key:"_updatePreviewButton",value:function(){(0,l.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,l.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(o(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,o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(d.default);t.default=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o=l.default.extend({showScrollSyncButton:!1,scrollSync:!0,splitView:!0},o),this._baseElement=t,this._contentElements=[],this._initDom(n,r,o),this._initDomEvent()}return r(e,[{key:"_initDom",value:function(e,t,n){var r=document.createElement("div");r.className="tui-split-scroll",this._el=r;var o=document.createElement("div");o.className="tui-split-scroll-wrapper",this._scrollWrapper=o,this._setScrollSync(n.scrollSync),this.setSplitView(n.splitView);var l=document.createElement("div");l.className="tui-split-scroll-content",this._contentWrapper=l;var c=document.createElement("div");c.className="tui-splitter",this._baseElement.appendChild(r),r.appendChild(o),o.appendChild(l),o.appendChild(c),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,n,element=e.target,r=element.getBoundingClientRect(),l=r.top,c=r.bottom,d=void 0;if(this.isScrollSynced())d=this._contentWrapper;else if((0,o.default)(element).parents(this._contentElements.left).length)d=this._contentElements.left;else{if(!(0,o.default)(element).parents(this._contentElements.right).length)return;d=this._contentElements.right}var f=d.getBoundingClientRect();t=f.top,n=f.bottom,ln&&(d.scrollTop=d.scrollTop+c-n),this.sync()}},{key:"_setContentElement",value:function(element,e){var t=this,n=this._contentElements[e];n&&((0,o.default)(n).off(h),this._contentWrapper.removeChild(n)),(0,o.default)(element).addClass(m[e]),this._contentWrapper.appendChild(element),(0,o.default)(element).on(h,(function(e){return t._requireScrollIntoView(e)})),(0,o.default)(element).on("requireScrollSync",(function(){return t.sync()})),this._contentElements[e]=element,this.sync()}},{key:"_setLeft",value:function(element){this._setContentElement(element,"left")}},{key:"_setRight",value:function(element){this._setContentElement(element,"right")}},{key:"_setScrollSync",value:function(e){(0,o.default)(this._el).toggleClass(f,e)}},{key:"toggleScrollSync",value:function(){(0,o.default)(this._el).toggleClass(f)}},{key:"setSplitView",value:function(e){(0,o.default)(this._el).toggleClass(d,!e)}},{key:"toggleSplitView",value:function(){(0,o.default)(this._el).toggleClass(d)}},{key:"isScrollSynced",value:function(){return(0,o.default)(this._el).hasClass(f)}},{key:"isSplitView",value:function(){return!(0,o.default)(this._el).hasClass(d)}},{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,o=n.offsetHeight-e>0?n:r,l=o===n?r:n,c=o.offsetHeight,d=Math.max(c-e,0),f=c-Math.max(l.offsetHeight,e);o.style.top="0px",l.style.top=t/d*f+"px"}}},{key:"scrollTop",value:function(e){this._contentWrapper.scrollTop=e}}]),e}();t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"";this._language=e}},{key:"getEditorCodeText",value:function(){return this.getValue()}},{key:"setEditorCodeText",value:function(){var code=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setValue(code)}},{key:"refresh",value:function(){this.cm.refresh()}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var i=0;i').get(0),this._wrapper=(0,o.default)('').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,o.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,o.default)(this._wrapper).hasClass("active")?e.blur():e.focus()}},{key:"_onFocusOut",value:function(){(0,o.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 c.default.keyCode("UP"):this._popupCodeBlockLanguages.prev(),e.preventDefault();break;case c.default.keyCode("DOWN"):this._popupCodeBlockLanguages.next(),e.preventDefault();break;case c.default.keyCode("ENTER"):case c.default.keyCode("TAB"):var t=this._popupCodeBlockLanguages.getCurrentLanguage();this._inputLanguage.value=t,this._storeInputLanguage(),e.preventDefault();break;default:this._popupCodeBlockLanguages.hide()}else e.which!==c.default.keyCode("ENTER")&&e.which!==c.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=l(n(18)),o=l(n(4));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){var r=t.match(/^(\s*)((?:.|\n)*\S)(\s*)$/m),l=r[1],c=r[2],d=r[3],f=void 0;if(function(e){var t=o.default.isElemNode,n=o.default.isTextNode,r=n(e.previousSibling)&&t(e.firstChild),l=n(e.nextSibling)&&t(e.lastChild);return!r&&!l}(e))f=""+n+c+n;else{var h=e.nodeName.toLowerCase();f="<"+h+">"+c+""}return""+l+f+d}t.default=r.default.Renderer.factory(r.default.gfmRenderer,{"EM, I":function(e,t){return this.isEmptyText(t)?"":c(e,t,"*")},"STRONG, B":function(e,t){return this.isEmptyText(t)?"":c(e,t,"**")},"DEL, S":function(e,t){return this.isEmptyText(t)?"":c(e,t,"~~")}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=(r=o)&&r.__esModule?r:{default:r},c=n(34),d=/^(\*{2}|_{2}).*\1$/,f=/[*_]{2,}([^*_]*)[*_]{2,}/g,h=l.default.command("markdown",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getRange();(0,c.changeSyntax)(n,r,"**",d,f),t.focus()}});t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=(r=o)&&r.__esModule?r:{default:r},c=n(34),d=/^(\*{3}|_{3}).*\1$/,f=/^(\*{2}|_{2}).*\1$/,h=/^(\*|_).*\1$/,m=/([^*_])[*_]([^*_]+)[*_]([^*_])/g,_=function(e){return d.test(e)},v=function(e){return f.test(e)},y=function(e){return h.test(e)},E="*",S=function(text){return text?text.replace(m,"$1$2$3"):""},T=l.default.command("markdown",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=n.getCursor(),line=r.line,o=r.ch,l=e.getRange(),d=n.getSelection();if(d)(function(e,text,t){var n=c.expandReplace.bind(this,e,t);return n(3,_,(function(e){return(0,c.removeSyntax)(e,E)}))||n(2,v,(function(e){return(0,c.appendSyntax)(S(e),E)}))||n(1,y,(function(e){return(0,c.removeSyntax)(e,E)}))||(0,c.replace)(e,text,_,(function(e){return(0,c.removeSyntax)(e,E)}))||(0,c.replace)(e,text,v,(function(e){return(0,c.appendSyntax)(S(e),E)}))||(0,c.replace)(e,text,y,(function(e){return(0,c.removeSyntax)(e,E)}))})(n,d,l)||n.replaceSelection((0,c.appendSyntax)(S(d),E),"around");else{!function(e,t){(0,c.expandReplace)(e,t,3,_,(function(e){return(0,c.removeSyntax)(e,E)}))||(0,c.expandReplace)(e,t,2,v,(function(e){return(0,c.appendSyntax)(e,E)}))||(0,c.expandReplace)(e,t,1,y,(function(){return""}))||e.replaceSelection("**","around")}(n,l);var f=n.getSelection(),h=o;_(f)||y(f)&&!v(f)?h+=1:h-=1,n.setCursor(line,h)}t.focus()}});t.default=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=(r=o)&&r.__esModule?r:{default:r},c=n(34),d=/^~~.*~~$/,f=/~~([^~]*)~~/g,h=l.default.command("markdown",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r=e.getRange();(0,c.changeSyntax)(n,r,"~~",d,f),t.focus()}});t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=(r=o)&&r.__esModule?r:{default:r},c=/^> ?/,d=l.default.command("markdown",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],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},c=n.getRange(o,l).split("\n"),d=this._haveBlockquote(c),f=void 0;if(f=d?this._removeBlockquote(c):this._addBlockquote(c),n.replaceRange(f.join("\n"),o,l),d){var h=c.length;this._isBlockquoteWithSpace(c[h-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 i=0;i "+text}))},_removeBlockquote:function(e){return e.map((function(text){return text.replace(c,"")}))},_isBlockquoteWithSpace:function(text){return/^> /.test(text)}});t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(1)),o=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}var c=/^#+\s/g,d=o.default.command("markdown",{name:"Heading",exec:function(e,t){var n=e.getEditor(),o=n.getDoc(),l=e.getCurrentRange(),d={line:l.from.line,ch:0},f={line:l.to.line,ch:o.getLineHandle(l.to.line).text.length},h=o.getLine(f.line).length,m=o.getRange(d,f).split("\n");r.default.forEachArray(m,(function(line,e){m[e]=function(text,e){var t=text.match(c),n="";do{n+="#",e-=1}while(e>0);if(t){var r=text.split(t[0]);text=r[1]}return n+" "+text}(line,t)})),o.replaceRange(m.join("\n"),d,f),l.to.ch+=o.getLine(f.line).length-h,o.setSelection(d,l.to),n.focus()}});t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var l=o(n(2)).default.command("markdown",{name:"Paragraph",exec:function(e){var t=e.getEditor(),n=t.getDoc(),o=e.getCurrentRange(),l={line:o.from.line,ch:0},c={line:o.to.line,ch:n.getLineHandle(o.to.line).text.length},d=n.getLine(c.line).length,f=n.getRange(l,c).split("\n");r.default.forEachArray(f,(function(line,e){var t;f[e]=(t=/^(#{1,6}| *((?:\*|-|\d\.)(?: \[[ xX]])?)) /,line.replace(t,""))})),n.replaceRange(f.join("\n"),l,c),o.to.ch+=n.getLine(c.line).length-d,n.setSelection(l,c),t.focus()}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).default.command("markdown",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),r="",o=e.getCurrentRange(),l={line:o.from.line,ch:o.from.ch},c={line:o.to.line,ch:o.to.ch};o.collapsed&&(r=n.getLine(l.line),l.ch=0,c.ch=n.getLineHandle(o.to.line).text.length),n.getLine(l.line).length?r+="\n\n* * *\n\n":r+="\n* * *\n",n.replaceRange(r,l,c),t.focus()}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(2)),o=l(n(10));function l(e){return e&&e.__esModule?e:{default:e}}var c=o.default.decodeURIGraceful,d=o.default.encodeMarkdownCharacters,f=o.default.escapeMarkdownCharacters,h=r.default.command("markdown",{name:"AddLink",exec:function(e,data){var t=e.getEditor(),n=t.getDoc(),r=e.getCurrentRange(),o={line:r.from.line,ch:r.from.ch},l={line:r.to.line,ch:r.to.ch},h=data.linkText,m=data.url;h=c(h);var _="["+(h=f(h))+"]("+(m=d(m))+")";n.replaceRange(_,o,l),t.focus()}});t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(2)),o=l(n(10));function l(e){return e&&e.__esModule?e:{default:e}}var c=o.default.decodeURIGraceful,d=o.default.encodeMarkdownCharacters,f=o.default.escapeMarkdownCharacters,h=r.default.command("markdown",{name:"AddImage",exec:function(e,data){var t=e.getEditor(),n=t.getDoc(),r=e.getCurrentRange(),o={line:r.from.line,ch:r.from.ch},l={line:r.to.line,ch:r.to.ch},h=data.altText,m=data.imageUrl;h=c(h);var _="!["+(h=f(h))+"]("+(m=d(m))+")";n.replaceRange(_,o,l,"+addImage"),t.focus()}});t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).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=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).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=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).default.command("markdown",{name:"Indent",exec:function(e){e.getEditor().execCommand("indentOrderedList")}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).default.command("markdown",{name:"Outdent",exec:function(e){e.getEditor().execCommand("indentLessOrderedList")}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).default.command("markdown",{name:"Table",exec:function(e,col,t,data){var n=e.getEditor(),r=n.getDoc(),table="\n";n.getCursor().ch>0&&(table+="\n"),table+=function(col,data){for(var header="|",e="|",t=0;col;)data?(header+=" "+data[t]+" |",t+=1):header+=" |",e+=" --- |",col-=1;return header+"\n"+e+"\n"}(col,data),table+=function(col,e,data){for(var body="",t=col,n=0;n",l=(0,r.default)(n);if(l.is("DIV"))l.wrap(o);else{var c=(0,r.default)(o);c.insertBefore(n),c.html(l.html()),l.remove()}})),e}))}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}var l=o(n(2)).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,r.default)(document.createDocumentFragment());return(0,r.default)(e).children().each((function(e,n){n.nodeName.match(/h\d/i)?t.append((0,r.default)(n).children()):n.nodeName.match(/ul|ol/i)?(0,r.default)(n).find("li").each((function(i,e){t.append((0,r.default)(e).children())})):t.append(n)})),t[0]}))}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),l=((r=o)&&r.__esModule?r:{default:r}).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"),o=n.startContainer,l=n.endContainer,c=n.startOffset,d=n.endOffset,f=[];if(e.focus(),t.saveUndoState(n),r.isAvailableMakeListInTable())f=r.createListInTable(n,"UL");else for(var h=r.getLinesOfSelection(o,l),i=0;i',o+=function(col,data){for(var header="",e=0;col;)header+="",data&&(header+=data[e],e+=1),header+="",col-=1;return header+=""}(col,data),o+=function(col,e,data){for(var body="",t=col,n=0;n";for(var r=0;r",data&&(body+=data[t],t+=1),body+="";body+=""}return body+=""}(col,t-1,data),o+="",n.insertHTML(o),e.focus(),data||function(e,t){var n=e.getSelection();n.selectNodeContents(t.find("th")[0]),n.collapse(!0),e.setSelection(n)}(n,e.get$Body().find("."+r)))}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(0)),o=l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=l(n(2)).default.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),o=function(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),r=1;if(n.length>1){var o=n.first().get(0),l=n.last().get(0),c=t.getSelectionRangeFromTable(o,l);r=c.to.row-c.from.row+1}return r}(e),l=void 0,c=void 0;if(e.focus(),t.hasFormat("TD")){t.saveUndoState(n),l=(0,r.default)(n.startContainer).closest("tr");for(var i=0;i";return t.find("td").html(n),t}function f(e,t){var n=e.getSelection();n.selectNodeContents(t.find("td")[0]),n.collapse(!0),e.setSelection(n)}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(0)),o=d(n(1)),l=d(n(2)),c=d(n(4));function d(e){return e&&e.__esModule?e:{default:e}}var f=l.default.command("wysiwyg",{name:"AddCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),l=function(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),r=1;if(n.length>0){var o=n.get(0).parentNode.querySelectorAll("td, th").length;r=Math.min(o,n.length)}return r}(e),d=void 0;e.focus(),t.hasFormat("TR")&&(t.saveUndoState(n),d=function(e){var t=e.startContainer;return t="TD"===c.default.getNodeName(t)||"TH"===c.default.getNodeName(t)?(0,r.default)(t):(0,r.default)(t).parentsUntil("tr")}(n),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.index(),l=void 0;e.parents("table").find("tr").each((function(e,tr){for(var d="TBODY"===c.default.getNodeName(tr.parentNode),f=o.default.browser.msie,h=tr.children[n],i=0;i1){t.saveUndoState(n);var m=f.last().next()[0]?f.last().next():f.first().prev();m.length&&function(e,t,n,r){var o=n.find("td").get(0);t.setStart(o,0),t.collapse(!0),r.setLastCellNode(o),e.setSelection(t)}(t,n,m,d),f.remove()}l.removeClassAttrbuteFromAllCellsIfNeed()}});function c(e,t,n){var o=n.find("tbody tr").length,l=(0,r.default)(e).parents("thead").length,c=t.from.row,d=t.to.row;return l&&(c+=1),(1===c||l)&&d===o&&(d-=1),n.find("tr").slice(c,d+1)}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(0)),o=c(n(2)),l=c(n(4));function c(e){return e&&e.__esModule?e:{default:e}}var d=o.default.command("wysiwyg",{name:"RemoveCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),o=(0,r.default)(n.startContainer).parents("table"),c=e.componentManager.getManager("table"),d=e.componentManager.getManager("tableSelection"),h=(0,r.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)&&h){var m=o.find("tbody tr:first td").length,_=d.getSelectedCells();if(_.length1){var y=_.last(),E=_.first();v=y.next().length?y.next():E.prev(),function(e){for(var t=e.length,i=0;i0&&f(e.eq(i))}(_)}else{var S=function(e){var t=e.startContainer;return t="TD"===l.default.getNodeName(t)||"TH"===l.default.getNodeName(t)?(0,r.default)(t):(0,r.default)(t).parentsUntil("tr")}(n);v=S.next().length?S.next():S.prev(),f(S)}!function(e,t,n){var o=t.get(0);if(t.length&&r.default.contains(document,t)){var l=e.getSelection();l.selectNodeContents(t[0]),l.collapse(!0),e.setSelection(l),n.setLastCellNode(o)}}(t,v,c)}}}});function f(e){var t=e.index();e.parents("table").find("tr").each((function(e,tr){(0,r.default)(tr).children().eq(t).remove()}))}t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(0)),o=c(n(2)),l=c(n(4));function c(e){return e&&e.__esModule?e:{default:e}}var d=o.default.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),o=n.getSelection().cloneRange(),c=e.componentManager.getManager("tableSelection"),d=function(e,t){var n=t.getSelectedCells(),o=void 0,c=void 0;if(n.length)o=t.getSelectionRangeFromTable(n.first().get(0),n.last().get(0));else{var d=e.startContainer;c=l.default.isTextNode(d)?(0,r.default)(d).parent("td,th")[0]:d,o=t.getSelectionRangeFromTable(c,c)}return o}(o,c);if(e.focus(),n.hasFormat("TR")){n.saveUndoState(o);var f=(0,r.default)(o.startContainer).parents("table"),h=function(e,t){var n=e.find("tr").eq(0).find("td,th").length,r=t.from,o=t.to,l=void 0,c=void 0,d=void 0;return r.row===o.row?(l=r.cell,c=o.cell):r.row").append(n.prepareToPasteOnCodeblock(d)).html()}return l}(l,e);n.insertHTML("
    "+f+"
    "),function(e,t){var n=t.getEditor().getSelection().cloneRange();e.removeClass(d),n.setStartBefore(e.get(0).firstChild),n.collapse(!0),t.getEditor().setSelection(n)}(e.get$Body().find("."+d),e)}e.focus()}});t.default=f},function(e,t,n){"use strict";var r,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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,o=n(3);((r=o)&&r.__esModule?r:{default: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";var r,o=n(3);((r=o)&&r.__esModule?r:{default:r}).default.setLanguage(["gl","gl_ES"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Escribir",Preview:"Vista previa",Headings:"Encabezados",Paragraph:"Parágrafo",Bold:"Negriña",Italic:"Cursiva",Strike:"Riscado",Code:"Código",Line:"Liña",Blockquote:"Cita","Unordered list":"Lista desordenada","Ordered list":"Lista ordenada",Task:"Tarefa",Indent:"Sangría",Outdent:"Anular sangría","Insert link":"Inserir enlace","Insert CodeBlock":"Inserir bloque de código","Insert table":"Inserir táboa","Insert image":"Inserir imaxe",Heading:"Encabezado","Image URL":"URL da imaxe","Select image file":"Seleccionar arquivo da imaxe",Description:"Descrición",OK:"Aceptar",More:"Máis",Cancel:"Cancelar",File:"Arquivo",URL:"URL","Link text":"Texto do enlace","Add row":"Agregar fila","Add col":"Agregar columna","Remove row":"Eliminar fila","Remove col":"Eliminar columna","Align left":"Aliñar á esquerda","Align center":"Centrar","Align right":"Aliñar á dereita","Remove table":"Eliminar táboa","Would you like to paste as table?":"Desexa pegar como táboa?","Text color":"Cor do texto","Auto scroll enabled":"Desprazamento automático habilitado","Auto scroll disabled":"Desprazamento automático deshabilitado","Choose language":"Elixir idioma"})},function(e,t,n){"use strict";var r,o=n(3);((r=o)&&r.__esModule?r:{default:r}).default.setLanguage(["sv","sv_SE"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Skriv",Preview:"Förhandsgranska",Headings:"Överskrifter",Paragraph:"Paragraf",Bold:"Fet",Italic:"Kursiv",Strike:"Genomstruken",Code:"Kodrad",Line:"Linje",Blockquote:"Citatblock","Unordered list":"Punktlista","Ordered list":"Numrerad lista",Task:"Att göra",Indent:"Öka indrag",Outdent:"Minska indrag","Insert link":"Infoga länk","Insert CodeBlock":"Infoga kodblock","Insert table":"Infoga tabell","Insert image":"Infoga bild",Heading:"Överskrift","Image URL":"Bildadress","Select image file":"Välj en bildfil",Description:"Beskrivning",OK:"OK",More:"Mer",Cancel:"Avbryt",File:"Fil",URL:"Adress","Link text":"Länktext","Add row":"Infoga rad","Add col":"Infoga kolumn","Remove row":"Radera rad","Remove col":"Radera kolumn","Align left":"Vänsterjustera","Align center":"Centrera","Align right":"Högerjustera","Remove table":"Radera tabell","Would you like to paste as table?":"Vill du klistra in som en tabell?","Text color":"Textfärg","Auto scroll enabled":"Automatisk scroll aktiverad","Auto scroll disabled":"Automatisk scroll inaktiverad","Choose language":"Välj språk"})},function(e,t,n){"use strict";var r,o=n(3);((r=o)&&r.__esModule?r:{default:r}).default.setLanguage(["it","it_IT"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Scrivere",Preview:"Anteprima",Headings:"Intestazioni",Paragraph:"Paragrafo",Bold:"Grassetto",Italic:"Corsivo",Strike:"Barrato",Code:"Codice",Line:"Linea",Blockquote:"Blocco citazione","Unordered list":"Lista puntata","Ordered list":"Lista numerata",Task:"Attività",Indent:"Aggiungi indentazione",Outdent:"Rimuovi indentazione","Insert link":"Inserisci link","Insert CodeBlock":"Inserisci blocco di codice","Insert table":"Inserisci tabella","Insert image":"Inserisci immagine",Heading:"Intestazione","Image URL":"URL immagine","Select image file":"Seleziona file immagine",Description:"Descrizione",OK:"OK",More:"Più",Cancel:"Cancella",File:"File",URL:"URL","Link text":"Testo del collegamento","Add row":"Aggiungi riga","Add col":"Aggiungi colonna","Remove row":"Rimuovi riga","Remove col":"Rimuovi colonna","Align left":"Allinea a sinistra","Align center":"Allinea al centro","Align right":"Allinea a destra","Remove table":"Rimuovi tabella","Would you like to paste as table?":"Desideri incollare sotto forma di tabella?","Text color":"Colore del testo","Auto scroll enabled":"Scrolling automatico abilitato","Auto scroll disabled":"Scrolling automatico disabilitato","Choose language":"Scegli la lingua"})}])},e.exports=r(n(113),n(143),n(615),n(198),n(332),n(344),n(852))},function(e,t,n){var r;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(n,o){"use strict";var l=[],c=Object.getPrototypeOf,d=l.slice,f=l.flat?function(e){return l.flat.call(e)}:function(e){return l.concat.apply([],e)},h=l.push,m=l.indexOf,_={},v=_.toString,y=_.hasOwnProperty,E=y.toString,S=E.call(Object),T={},w=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},C=function(e){return null!=e&&e===e.window},x=n.document,M={type:!0,src:!0,nonce:!0,noModule:!0};function A(code,e,t){var i,n,script=(t=t||x).createElement("script");if(script.text=code,e)for(i in M)(n=e[i]||e.getAttribute&&e.getAttribute(i))&&script.setAttribute(i,n);t.head.appendChild(script).parentNode.removeChild(script)}function O(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?_[v.call(e)]||"object":typeof e}var R="3.7.1",N=/HTML$/i,k=function(e,t){return new k.fn.init(e,t)};function I(e){var t=!!e&&"length"in e&&e.length,n=O(e);return!w(e)&&!C(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}k.fn=k.prototype={jquery:R,constructor:k,length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?d.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,(function(t,i){return e.call(t,i,t)})))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(e,i){return(i+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(e,i){return i%2})))},eq:function(i){var e=this.length,t=+i+(i<0?e:0);return this.pushStack(t>=0&&t+~]|"+F+")"+F+"*"),$=new RegExp(F+"|>"),K=new RegExp(H),Q=new RegExp("^"+I+"$"),Z={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+G),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,ee=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,te=/[+~]/,ne=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),re=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=function(){me()},oe=be((function(e){return!0===e.disabled&&D(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{E.apply(l=d.call(j.childNodes),j.childNodes),l[j.childNodes.length].nodeType}catch(e){E={apply:function(e,t){z.apply(e,d.call(t))},call:function(e){z.apply(e,d.call(arguments,1))}}}function ae(e,t,n,r){var o,i,l,d,f,m,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return n;if(!r&&(me(t),t=t||c,h)){if(11!==w&&(f=ee.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return n;if(l.id===o)return E.call(n,l),n}else if(y&&(l=y.getElementById(o))&&ae.contains(t,l)&&l.id===o)return E.call(n,l),n}else{if(f[2])return E.apply(n,t.getElementsByTagName(e)),n;if((o=f[3])&&t.getElementsByClassName)return E.apply(n,t.getElementsByClassName(o)),n}if(!(O[e+" "]||_&&_.test(e))){if(v=e,y=t,1===w&&($.test(e)||W.test(e))){for((y=te.test(e)&&pe(t.parentNode)||t)==t&&T.scope||((d=t.getAttribute("id"))?d=k.escapeSelector(d):t.setAttribute("id",d=S)),i=(m=_e(e)).length;i--;)m[i]=(d?"#"+d:":scope")+" "+ve(m[i]);v=m.join(",")}try{return E.apply(n,y.querySelectorAll(v)),n}catch(t){O(e,!0)}finally{d===S&&t.removeAttribute("id")}}}return select(e.replace(U,"$1"),t,n,r)}function se(){var t=[];return function n(r,o){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=o}}function le(e){return e[S]=!0,e}function ue(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e){return function(t){return D(t,"input")&&t.type===e}}function de(e){return function(t){return(D(t,"input")||D(t,"button"))&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return le((function(t){return t=+t,le((function(n,r){for(var o,l=e([],n.length,t),i=l.length;i--;)n[o=l[i]]&&(n[o]=!(r[o]=n[o]))}))}))}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}function me(t){var n,l=t?t.ownerDocument||t:j;return l!=c&&9===l.nodeType&&l.documentElement?(f=(c=l).documentElement,h=!k.isXMLDoc(c),v=f.matches||f.webkitMatchesSelector||f.msMatchesSelector,f.msMatchesSelector&&j!=c&&(n=c.defaultView)&&n.top!==n&&n.addEventListener("unload",ie),T.getById=ue((function(e){return f.appendChild(e).id=k.expando,!c.getElementsByName||!c.getElementsByName(k.expando).length})),T.disconnectedMatch=ue((function(e){return v.call(e,"*")})),T.scope=ue((function(){return c.querySelectorAll(":scope")})),T.cssHas=ue((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),T.getById?(e.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}},e.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n=t.getElementById(e);return n?[n]:[]}}):(e.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},e.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),e.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},e.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&h)return t.getElementsByClassName(e)},_=[],ue((function(e){var input;f.appendChild(e).innerHTML="
    ",e.querySelectorAll("[selected]").length||_.push("\\["+F+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+S+"-]").length||_.push("~="),e.querySelectorAll("a#"+S+"+*").length||_.push(".#.+[+~]"),e.querySelectorAll(":checked").length||_.push(":checked"),(input=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(input).setAttribute("name","D"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&_.push(":enabled",":disabled"),(input=c.createElement("input")).setAttribute("name",""),e.appendChild(input),e.querySelectorAll("[name='']").length||_.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")")})),T.cssHas||_.push(":has"),_=_.length&&new RegExp(_.join("|")),R=function(a,b){if(a===b)return o=!0,0;var e=!a.compareDocumentPosition-!b.compareDocumentPosition;return e||(1&(e=(a.ownerDocument||a)==(b.ownerDocument||b)?a.compareDocumentPosition(b):1)||!T.sortDetached&&b.compareDocumentPosition(a)===e?a===c||a.ownerDocument==j&&ae.contains(j,a)?-1:b===c||b.ownerDocument==j&&ae.contains(j,b)?1:r?m.call(r,a)-m.call(r,b):0:4&e?-1:1)},c):c}for(i in ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(me(e),h&&!O[t+" "]&&(!_||!_.test(t)))try{var n=v.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){O(t,!0)}return ae(t,c,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=c&&me(e),k.contains(e,t)},ae.attr=function(t,n){(t.ownerDocument||t)!=c&&me(t);var r=e.attrHandle[n.toLowerCase()],o=r&&y.call(e.attrHandle,n.toLowerCase())?r(t,n,!h):void 0;return void 0!==o?o:t.getAttribute(n)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},k.uniqueSort=function(e){var t,n=[],l=0,i=0;if(o=!T.sortStable,r=!T.sortStable&&d.call(e,0),P.call(e,R),o){for(;t=e[i++];)t===e[i]&&(l=n.push(i));for(;l--;)B.call(e,n[l],1)}return r=null,e},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(d.apply(this)))},e=k.expr={cacheLength:50,createPseudo:le,match:Z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&K.test(n)&&(t=_e(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return D(e,t)}},CLASS:function(e){var pattern=x[e+" "];return pattern||(pattern=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&x(e,(function(e){return pattern.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=ae.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(Y," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var l="nth"!==e.slice(0,3),c="last"!==e.slice(-4),d="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,f){var h,m,_,v,y,E=l!==c?"nextSibling":"previousSibling",T=t.parentNode,C=d&&t.nodeName.toLowerCase(),x=!f&&!d,M=!1;if(T){if(l){for(;E;){for(_=t;_=_[E];)if(d?D(_,C):1===_.nodeType)return!1;y=E="only"===e&&!y&&"nextSibling"}return!0}if(y=[c?T.firstChild:T.lastChild],c&&x){for(M=(v=(h=(m=T[S]||(T[S]={}))[e]||[])[0]===w&&h[1])&&h[2],_=v&&T.childNodes[v];_=++v&&_&&_[E]||(M=v=0)||y.pop();)if(1===_.nodeType&&++M&&_===t){m[e]=[w,v,M];break}}else if(x&&(M=v=(h=(m=t[S]||(t[S]={}))[e]||[])[0]===w&&h[1]),!1===M)for(;(_=++v&&_&&_[E]||(M=v=0)||y.pop())&&(!(d?D(_,C):1===_.nodeType)||!++M||(x&&((m=_[S]||(_[S]={}))[e]=[w,M]),_!==t)););return(M-=o)===r||M%r==0&&M/r>=0}}},PSEUDO:function(t,n){var r,o=e.pseudos[t]||e.setFilters[t.toLowerCase()]||ae.error("unsupported pseudo: "+t);return o[S]?o(n):o.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?le((function(e,t){for(var r,l=o(e,n),i=l.length;i--;)e[r=m.call(e,l[i])]=!(t[r]=l[i])})):function(e){return o(e,0,r)}):o}},pseudos:{not:le((function(e){var input=[],t=[],n=we(e.replace(U,"$1"));return n[S]?le((function(e,t,r,o){for(var l,c=n(e,null,o,[]),i=e.length;i--;)(l=c[i])&&(e[i]=!(t[i]=l))})):function(e,r,o){return input[0]=e,n(input,null,o,t),input[0]=null,!t.pop()}})),has:le((function(e){return function(t){return ae(e,t).length>0}})),contains:le((function(text){return text=text.replace(ne,re),function(e){return(e.textContent||k.text(e)).indexOf(text)>-1}})),lang:le((function(e){return Q.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===f},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){return D(e,"input")&&!!e.checked||D(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(e){return J.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){return D(e,"input")&&"button"===e.type||D(e,"button")},text:function(e){var t;return D(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he((function(){return[0]})),last:he((function(e,t){return[t-1]})),eq:he((function(e,t,n){return[n<0?n+t:n]})),even:he((function(e,t){for(var i=0;it?t:n;--i>=0;)e.push(i);return e})),gt:he((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ee(e,map,filter,t,n){for(var r,o=[],i=0,l=e.length,c=null!=map;i-1&&(l[h]=!(c[h]=_))}}else v=Ee(v===c?v.splice(T,v.length):v),o?o(null,c,v,f):E.apply(c,v)}))}function Te(n){for(var r,o,l,c=n.length,d=e.relative[n[0].type],f=d||e.relative[" "],i=d?1:0,h=be((function(e){return e===r}),f,!0),_=be((function(e){return m.call(r,e)>-1}),f,!0),v=[function(e,n,o){var l=!d&&(o||n!=t)||((r=n).nodeType?h(e,n,o):_(e,n,o));return r=null,l}];i1&&ye(v),i>1&&ve(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(U,"$1"),o,i0,l=n.length>0,d=function(d,f,m,_,v){var y,S,T,C=0,i="0",x=d&&[],M=[],A=t,O=d||l&&e.find.TAG("*",v),R=w+=null==A?1:Math.random()||.1,N=O.length;for(v&&(t=f==c||f||v);i!==N&&null!=(y=O[i]);i++){if(l&&y){for(S=0,f||y.ownerDocument==c||(me(y),m=!h);T=n[S++];)if(T(y,f||c,m)){E.call(_,y);break}v&&(w=R)}o&&((y=!T&&y)&&C--,d&&x.push(y))}if(C+=i,o&&i!==C){for(S=0;T=r[S++];)T(x,M,f,m);if(d){if(C>0)for(;i--;)x[i]||M[i]||(M[i]=L.call(_));M=Ee(M)}E.apply(_,M),v&&!d&&M.length>0&&C+r.length>1&&k.uniqueSort(_)}return v&&(w=R,t=A),x};return o?le(d):d}(l,o)),d.selector=n}return d}function select(t,n,r,o){var i,l,c,d,f,m="function"==typeof t&&t,_=!o&&_e(t=m.selector||t);if(r=r||[],1===_.length){if((l=_[0]=_[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===n.nodeType&&h&&e.relative[l[1].type]){if(!(n=(e.find.ID(c.matches[0].replace(ne,re),n)||[])[0]))return r;m&&(n=n.parentNode),t=t.slice(l.shift().value.length)}for(i=Z.needsContext.test(t)?0:l.length;i--&&(c=l[i],!e.relative[d=c.type]);)if((f=e.find[d])&&(o=f(c.matches[0].replace(ne,re),te.test(l[0].type)&&pe(n.parentNode)||n))){if(l.splice(i,1),!(t=o.length&&ve(l)))return E.apply(r,o),r;break}}return(m||we(t,_))(o,n,!h,r,!n||te.test(t)&&pe(n.parentNode)||n),r}ge.prototype=e.filters=e.pseudos,e.setFilters=new ge,T.sortStable=S.split("").sort(R).join("")===S,me(),T.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),k.find=ae,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,ae.compile=we,ae.select=select,ae.setDocument=me,ae.tokenize=_e,ae.escape=k.escapeSelector,ae.getText=k.text,ae.isXML=k.isXMLDoc,ae.selectors=k.expr,ae.support=k.support,ae.uniqueSort=k.uniqueSort}();var Y=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&k(e).is(n))break;r.push(e)}return r},V=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},W=k.expr.match.needsContext,$=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function K(e,t,n){return w(t)?k.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?k.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?k.grep(e,(function(e){return m.call(t,e)>-1!==n})):k.filter(t,e,n)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,(function(e){return 1===e.nodeType})))},k.fn.extend({find:function(e){var i,t,n=this.length,r=this;if("string"!=typeof e)return this.pushStack(k(e).filter((function(){for(i=0;i1?k.uniqueSort(t):t},filter:function(e){return this.pushStack(K(this,e||[],!1))},not:function(e){return this.pushStack(K(this,e||[],!0))},is:function(e){return!!K(this,"string"==typeof e&&W.test(e)?k(e):e||[],!1).length}});var Q,Z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||Q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Z.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:x,!0)),$.test(r[1])&&k.isPlainObject(t))for(r in t)w(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=x.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):w(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,Q=k(x);var X=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};function ee(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter((function(){for(var i=0;i-1:1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?m.call(k(e),this[0]):m.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y(e,"parentNode")},parentsUntil:function(e,t,n){return Y(e,"parentNode",n)},next:function(e){return ee(e,"nextSibling")},prev:function(e){return ee(e,"previousSibling")},nextAll:function(e){return Y(e,"nextSibling")},prevAll:function(e){return Y(e,"previousSibling")},nextUntil:function(e,t,n){return Y(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y(e,"previousSibling",n)},siblings:function(e){return V((e.parentNode||{}).firstChild,e)},children:function(e){return V(e.firstChild)},contents:function(e){return null!=e.contentDocument&&c(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},(function(e,t){k.fn[e]=function(n,r){var o=k.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=k.filter(r,o)),this.length>1&&(J[e]||k.uniqueSort(o),X.test(e)&&o.reverse()),this.pushStack(o)}}));var te=/[^\x20\t\r\n\f]+/g;function ne(e){return e}function re(e){throw e}function ie(e,t,n,r){var o;try{e&&w(o=e.promise)?o.call(e).done(t).fail(n):e&&w(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(e){e="string"==typeof e?function(e){var object={};return k.each(e.match(te)||[],(function(e,t){object[t]=!0})),object}(e):k.extend({},e);var t,n,r,o,l=[],c=[],d=-1,f=function(){for(o=o||e.once,r=t=!0;c.length;d=-1)for(n=c.shift();++d-1;)l.splice(n,1),n<=d&&d--})),this},has:function(e){return e?k.inArray(e,l)>-1:l.length>0},empty:function(){return l&&(l=[]),this},disable:function(){return o=c=[],l=n="",this},disabled:function(){return!l},lock:function(){return o=c=[],n||t||(l=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],c.push(n),t||f()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},k.extend({Deferred:function(e){var t=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return l.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return k.Deferred((function(n){k.each(t,(function(t,r){var o=w(e[r[4]])&&e[r[4]];l[r[1]]((function(){var e=o&&o.apply(this,arguments);e&&w(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,o){var l=0;function c(e,t,r,o){return function(){var d=this,f=arguments,h=function(){var n,h;if(!(e=l&&(r!==re&&(d=void 0,f=[n]),t.rejectWith(d,f))}};e?m():(k.Deferred.getErrorHook?m.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(m.error=k.Deferred.getStackHook()),n.setTimeout(m))}}return k.Deferred((function(n){t[0][3].add(c(0,n,w(o)?o:ne,n.notifyWith)),t[1][3].add(c(0,n,w(e)?e:ne)),t[2][3].add(c(0,n,w(r)?r:re))})).promise()},promise:function(e){return null!=e?k.extend(e,o):o}},l={};return k.each(t,(function(i,e){var n=e[2],c=e[5];o[e[1]]=n.add,c&&n.add((function(){r=c}),t[3-i][2].disable,t[3-i][3].disable,t[0][2].lock,t[0][3].lock),n.add(e[3].fire),l[e[0]]=function(){return l[e[0]+"With"](this===l?void 0:this,arguments),this},l[e[0]+"With"]=n.fireWith})),o.promise(l),e&&e.call(l,l),l},when:function(e){var t=arguments.length,i=t,n=Array(i),r=d.call(arguments),o=k.Deferred(),l=function(i){return function(e){n[i]=this,r[i]=arguments.length>1?d.call(arguments):e,--t||o.resolveWith(n,r)}};if(t<=1&&(ie(e,o.done(l(i)).resolve,o.reject,!t),"pending"===o.state()||w(r[i]&&r[i].then)))return o.then();for(;i--;)ie(r[i],l(i),o.reject);return o.promise()}});var oe=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&oe.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){n.setTimeout((function(){throw e}))};var ae=k.Deferred();function se(){x.removeEventListener("DOMContentLoaded",se),n.removeEventListener("load",se),k.ready()}k.fn.ready=function(e){return ae.then(e).catch((function(e){k.readyException(e)})),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==e&&--k.readyWait>0||ae.resolveWith(x,[k]))}}),k.ready.then=ae.then,"complete"===x.readyState||"loading"!==x.readyState&&!x.documentElement.doScroll?n.setTimeout(k.ready):(x.addEventListener("DOMContentLoaded",se),n.addEventListener("load",se));var le=function(e,t,n,r,o,l,c){var i=0,d=e.length,f=null==n;if("object"===O(n))for(i in o=!0,n)le(e,t,i,n[i],!0,l,c);else if(void 0!==r&&(o=!0,w(r)||(c=!0),f&&(c?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(k(e),n)})),t))for(;i1,null,!0)},removeData:function(e){return this.each((function(){ge.remove(this,e)}))}}),k.extend({queue:function(e,t,data){var n;if(e)return t=(t||"fx")+"queue",n=me.get(e,t),data&&(!n||Array.isArray(data)?n=me.access(e,t,k.makeArray(data)):n.push(data)),n||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,o=n.shift(),l=k._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete l.stop,o.call(e,(function(){k.dequeue(e,t)}),l)),!r&&l&&l.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return me.get(e,n)||me.access(e,n,{empty:k.Callbacks("once memory").add((function(){me.remove(e,[t+"queue",n])}))})}}),k.fn.extend({queue:function(e,data){var t=2;return"string"!=typeof e&&(data=e,e="fx",t--),arguments.length\x20\t\r\n\f]*)/i,Ie=/^$|^module$|\/(?:java|ecma)script/i;div=x.createDocumentFragment().appendChild(x.createElement("div")),(input=x.createElement("input")).setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),T.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="",T.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue,div.innerHTML="",T.option=!!div.lastChild;var De={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function Le(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?k.merge([e],n):n}function Pe(e,t){for(var i=0,n=e.length;i",""]);var Be=/<|&#?\w+;/;function Fe(e,t,n,r,o){for(var l,c,d,f,h,m,_=t.createDocumentFragment(),v=[],i=0,y=e.length;i-1)o&&o.push(l);else if(h=we(l),c=Le(_.appendChild(l),"script"),h&&Pe(c),n)for(m=0;l=c[m++];)Ie.test(l.type||"")&&n.push(l);return _}var Ue=/^([^.]*)(?:\.(.+)|)/;function Ge(){return!0}function He(){return!1}function je(e,t,n,data,r,o){var l,c;if("object"==typeof t){for(c in"string"!=typeof n&&(data=data||n,n=void 0),t)je(e,c,n,data,t[c],o);return e}if(null==data&&null==r?(r=n,data=n=void 0):null==r&&("string"==typeof n?(r=data,data=void 0):(r=data,data=n,n=void 0)),!1===r)r=He;else if(!r)return e;return 1===o&&(l=r,r=function(e){return k().off(e),l.apply(this,arguments)},r.guid=l.guid||(l.guid=k.guid++)),e.each((function(){k.event.add(this,t,r,data,n)}))}function ze(e,t,n){n?(me.set(e,t,!1),k.event.add(e,t,{namespace:!1,handler:function(e){var n,r=me.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(k.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=d.call(arguments),me.set(this,t,r),this[t](),n=me.get(this,t),me.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(me.set(this,t,k.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ge)}})):void 0===me.get(e,t)&&k.event.add(e,t,Ge)}k.event={global:{},add:function(e,t,n,data,r){var o,l,c,d,f,h,m,_,v,y,E,S=me.get(e);if(he(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&k.find.matchesSelector(Te,r),n.guid||(n.guid=k.guid++),(d=S.events)||(d=S.events=Object.create(null)),(l=S.handle)||(l=S.handle=function(t){return void 0!==k&&k.event.triggered!==t.type?k.event.dispatch.apply(e,arguments):void 0}),f=(t=(t||"").match(te)||[""]).length;f--;)v=E=(c=Ue.exec(t[f])||[])[1],y=(c[2]||"").split(".").sort(),v&&(m=k.event.special[v]||{},v=(r?m.delegateType:m.bindType)||v,m=k.event.special[v]||{},h=k.extend({type:v,origType:E,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&k.expr.match.needsContext.test(r),namespace:y.join(".")},o),(_=d[v])||((_=d[v]=[]).delegateCount=0,m.setup&&!1!==m.setup.call(e,data,y,l)||e.addEventListener&&e.addEventListener(v,l)),m.add&&(m.add.call(e,h),h.handler.guid||(h.handler.guid=n.guid)),r?_.splice(_.delegateCount++,0,h):_.push(h),k.event.global[v]=!0)},remove:function(e,t,n,r,o){var l,c,d,f,h,m,_,v,y,E,S,T=me.hasData(e)&&me.get(e);if(T&&(f=T.events)){for(h=(t=(t||"").match(te)||[""]).length;h--;)if(y=S=(d=Ue.exec(t[h])||[])[1],E=(d[2]||"").split(".").sort(),y){for(_=k.event.special[y]||{},v=f[y=(r?_.delegateType:_.bindType)||y]||[],d=d[2]&&new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=l=v.length;l--;)m=v[l],!o&&S!==m.origType||n&&n.guid!==m.guid||d&&!d.test(m.namespace)||r&&r!==m.selector&&("**"!==r||!m.selector)||(v.splice(l,1),m.selector&&v.delegateCount--,_.remove&&_.remove.call(e,m));c&&!v.length&&(_.teardown&&!1!==_.teardown.call(e,E,T.handle)||k.removeEvent(e,y,T.handle),delete f[y])}else for(y in f)k.event.remove(e,y+t[h],n,r,!0);k.isEmptyObject(f)&&me.remove(e,"handle events")}},dispatch:function(e){var i,t,n,r,o,l,c=new Array(arguments.length),d=k.event.fix(e),f=(me.get(this,"events")||Object.create(null))[d.type]||[],h=k.event.special[d.type]||{};for(c[0]=d,i=1;i=1))for(;f!==this;f=f.parentNode||this)if(1===f.nodeType&&("click"!==e.type||!0!==f.disabled)){for(o=[],l={},i=0;i-1:k.find(r,this,null,[f]).length),l[r]&&o.push(n);o.length&&c.push({elem:f,handlers:o})}return f=this,d\s*$/g;function We(e,content){return D(e,"table")&&D(11!==content.nodeType?content:content.firstChild,"tr")&&k(e).children("tbody")[0]||e}function $e(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ke(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Qe(e,t){var i,n,r,o,l,c;if(1===t.nodeType){if(me.hasData(e)&&(c=me.get(e).events))for(r in me.remove(t,"handle events"),c)for(i=0,n=c[r].length;i1&&"string"==typeof y&&!T.checkClone&&qe.test(y))return e.each((function(o){var l=e.eq(o);E&&(t[0]=y.call(this,o,l.html())),Xe(l,t,n,r)}));if(_&&(l=(o=Fe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=l),l||r)){for(d=(c=k.map(Le(o,"script"),$e)).length;i<_;i++)h=o,i!==v&&(h=k.clone(h,!0,!0),d&&k.merge(c,Le(h,"script"))),n.call(e[i],h,i);if(d)for(m=c[c.length-1].ownerDocument,k.map(c,Ke),i=0;i0&&Pe(l,!d&&Le(e,"script")),c},cleanData:function(e){for(var data,t,n,r=k.event.special,i=0;void 0!==(t=e[i]);i++)if(he(t)){if(data=t[me.expando]){if(data.events)for(n in data.events)r[n]?k.event.remove(t,n):k.removeEvent(t,n,data.handle);t[me.expando]=void 0}t[ge.expando]&&(t[ge.expando]=void 0)}}}),k.fn.extend({detach:function(e){return Je(this,e,!0)},remove:function(e){return Je(this,e)},text:function(e){return le(this,(function(e){return void 0===e?k.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Xe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||We(this,e).appendChild(e)}))},prepend:function(){return Xe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=We(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Xe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Xe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,i=0;null!=(e=this[i]);i++)1===e.nodeType&&(k.cleanData(Le(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return k.clone(this,e,t)}))},html:function(e){return le(this,(function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ye.test(e)&&!De[(ke.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;i=0&&(d+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-l-d-c-.5))||0),d+f}function vt(e,t,n){var r=nt(e),o=(!T.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),l=o,c=at(e,t,r),d="offset"+t[0].toUpperCase()+t.slice(1);if(et.test(c)){if(!n)return c;c="auto"}return(!T.boxSizingReliable()&&o||!T.reliableTrDimensions()&&D(e,"tr")||"auto"===c||!parseFloat(c)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===k.css(e,"boxSizing",!1,r),(l=d in e)&&(c=e[d])),(c=parseFloat(c)||0)+_t(e,t,n||(o?"border":"content"),l,r,c)+"px"}function bt(e,t,n,r,o){return new bt.prototype.init(e,t,n,r,o)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=at(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,l,c,d=fe(t),f=tt.test(t),style=e.style;if(f||(t=ft(d)),c=k.cssHooks[t]||k.cssHooks[d],void 0===n)return c&&"get"in c&&void 0!==(o=c.get(e,!1,r))?o:style[t];"string"===(l=typeof n)&&(o=Ee.exec(n))&&o[1]&&(n=Me(e,t,o),l="number"),null!=n&&n==n&&("number"!==l||f||(n+=o&&o[3]||(k.cssNumber[d]?"":"px")),T.clearCloneStyle||""!==n||0!==t.indexOf("background")||(style[t]="inherit"),c&&"set"in c&&void 0===(n=c.set(e,n,r))||(f?style.setProperty(t,n):style[t]=n))}},css:function(e,t,n,r){var o,l,c,d=fe(t);return tt.test(t)||(t=ft(d)),(c=k.cssHooks[t]||k.cssHooks[d])&&"get"in c&&(o=c.get(e,!0,n)),void 0===o&&(o=at(e,t,r)),"normal"===o&&t in mt&&(o=mt[t]),""===n||n?(l=parseFloat(o),!0===n||isFinite(l)?l||0:o):o}}),k.each(["height","width"],(function(e,t){k.cssHooks[t]={get:function(e,n,r){if(n)return!ht.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?vt(e,t,r):it(e,pt,(function(){return vt(e,t,r)}))},set:function(e,n,r){var o,l=nt(e),c=!T.scrollboxSize()&&"absolute"===l.position,d=(c||r)&&"border-box"===k.css(e,"boxSizing",!1,l),f=r?_t(e,t,r,d,l):0;return d&&c&&(f-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(l[t])-_t(e,t,"border",!1,l)-.5)),f&&(o=Ee.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=k.css(e,t)),gt(0,n,f)}}})),k.cssHooks.marginLeft=st(T.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(at(e,"marginLeft"))||e.getBoundingClientRect().left-it(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),k.each({margin:"",padding:"",border:"Width"},(function(e,t){k.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+Se[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(k.cssHooks[e+t].set=gt)})),k.fn.extend({css:function(e,t){return le(this,(function(e,t,n){var r,o,map={},i=0;if(Array.isArray(t)){for(r=nt(e),o=t.length;i1)}}),k.Tween=bt,bt.prototype={constructor:bt,init:function(e,t,n,r,o,l){this.elem=e,this.prop=n,this.easing=o||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=l||(k.cssNumber[n]?"":"px")},cur:function(){var e=bt.propHooks[this.prop];return e&&e.get?e.get(this):bt.propHooks._default.get(this)},run:function(e){var t,n=bt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):bt.propHooks._default.set(this),this}},bt.prototype.init.prototype=bt.prototype,bt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[ft(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}},bt.propHooks.scrollTop=bt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},k.fx=bt.prototype.init,k.fx.step={};var yt,Et,St=/^(?:toggle|show|hide)$/,Tt=/queueHooks$/;function wt(){Et&&(!1===x.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(wt):n.setTimeout(wt,k.fx.interval),k.fx.tick())}function Ct(){return n.setTimeout((function(){yt=void 0})),yt=Date.now()}function xt(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=Se[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function Mt(e,t,n){for(var r,o=(At.tweeners[t]||[]).concat(At.tweeners["*"]),l=0,c=o.length;l1)},removeAttr:function(e){return this.each((function(){k.removeAttr(this,e)}))}}),k.extend({attr:function(e,t,n){var r,o,l=e.nodeType;if(3!==l&&8!==l&&2!==l)return void 0===e.getAttribute?k.prop(e,t,n):(1===l&&k.isXMLDoc(e)||(o=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?Ot:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!T.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(te);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),Ot={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Rt[t]||k.find.attr;Rt[t]=function(e,t,r){var o,l,c=t.toLowerCase();return r||(l=Rt[c],Rt[c]=o,o=null!=n(e,t,r)?c:null,Rt[c]=l),o}}));var Nt=/^(?:input|select|textarea|button)$/i,kt=/^(?:a|area)$/i;function It(e){return(e.match(te)||[]).join(" ")}function Dt(e){return e.getAttribute&&e.getAttribute("class")||""}function Lt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(te)||[]}k.fn.extend({prop:function(e,t){return le(this,k.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[k.propFix[e]||e]}))}}),k.extend({prop:function(e,t,n){var r,o,l=e.nodeType;if(3!==l&&8!==l&&2!==l)return 1===l&&k.isXMLDoc(e)||(t=k.propFix[t]||t,o=k.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):Nt.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),T.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){k.propFix[this.toLowerCase()]=this})),k.fn.extend({addClass:function(e){var t,n,r,o,i,l;return w(e)?this.each((function(t){k(this).addClass(e.call(this,t,Dt(this)))})):(t=Lt(e)).length?this.each((function(){if(r=Dt(this),n=1===this.nodeType&&" "+It(r)+" "){for(i=0;i-1;)n=n.replace(" "+o+" "," ");l=It(n),r!==l&&this.setAttribute("class",l)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,l=typeof e,c="string"===l||Array.isArray(e);return w(e)?this.each((function(i){k(this).toggleClass(e.call(this,i,Dt(this),t),t)})):"boolean"==typeof t&&c?t?this.addClass(e):this.removeClass(e):(n=Lt(e),this.each((function(){if(c)for(o=k(this),i=0;i-1)return!0;return!1}});var Pt=/\r/g;k.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=w(e),this.each((function(i){var n;1===this.nodeType&&(null==(n=r?e.call(this,i,k(this).val()):e)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=k.map(n,(function(e){return null==e?"":e+""}))),(t=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,n,"value")||(this.value=n))}))):o?(t=k.valHooks[o.type]||k.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(Pt,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:It(k.text(e))}},select:{get:function(e){var t,option,i,n=e.options,r=e.selectedIndex,o="select-one"===e.type,l=o?null:[],c=o?r+1:n.length;for(i=r<0?c:o?r:0;i-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],(function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=k.inArray(k(e).val(),t)>-1}},T.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Bt=n.location,Ft={guid:Date.now()},Ut=/\?/;k.parseXML=function(data){var e,t;if(!data||"string"!=typeof data)return null;try{e=(new n.DOMParser).parseFromString(data,"text/xml")}catch(e){}return t=e&&e.getElementsByTagName("parsererror")[0],e&&!t||k.error("Invalid XML: "+(t?k.map(t.childNodes,(function(e){return e.textContent})).join("\n"):data)),e};var Gt=/^(?:focusinfocus|focusoutblur)$/,Ht=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,data,t,r){var i,o,l,c,d,f,h,m,_=[t||x],v=y.call(e,"type")?e.type:e,E=y.call(e,"namespace")?e.namespace.split("."):[];if(o=m=l=t=t||x,3!==t.nodeType&&8!==t.nodeType&&!Gt.test(v+k.event.triggered)&&(v.indexOf(".")>-1&&(E=v.split("."),v=E.shift(),E.sort()),d=v.indexOf(":")<0&&"on"+v,(e=e[k.expando]?e:new k.Event(v,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=E.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=t),data=null==data?[e]:k.makeArray(data,[e]),h=k.event.special[v]||{},r||!h.trigger||!1!==h.trigger.apply(t,data))){if(!r&&!h.noBubble&&!C(t)){for(c=h.delegateType||v,Gt.test(c+v)||(o=o.parentNode);o;o=o.parentNode)_.push(o),l=o;l===(t.ownerDocument||x)&&_.push(l.defaultView||l.parentWindow||n)}for(i=0;(o=_[i++])&&!e.isPropagationStopped();)m=o,e.type=i>1?c:h.bindType||v,(f=(me.get(o,"events")||Object.create(null))[e.type]&&me.get(o,"handle"))&&f.apply(o,data),(f=d&&o[d])&&f.apply&&he(o)&&(e.result=f.apply(o,data),!1===e.result&&e.preventDefault());return e.type=v,r||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(_.pop(),data)||!he(t)||d&&w(t[v])&&!C(t)&&((l=t[d])&&(t[d]=null),k.event.triggered=v,e.isPropagationStopped()&&m.addEventListener(v,Ht),t[v](),e.isPropagationStopped()&&m.removeEventListener(v,Ht),k.event.triggered=void 0,l&&(t[d]=l)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,data){return this.each((function(){k.event.trigger(e,data,this)}))},triggerHandler:function(e,data){var t=this[0];if(t)return k.event.trigger(e,data,t,!0)}});var jt=/\[\]$/,zt=/\r?\n/g,Yt=/^(?:submit|button|image|reset|file)$/i,qt=/^(?:input|select|textarea|keygen)/i;function Vt(e,t,n,r){var o;if(Array.isArray(t))k.each(t,(function(i,t){n||jt.test(e)?r(e,t):Vt(e+"["+("object"==typeof t&&null!=t?i:"")+"]",t,n,r)}));else if(n||"object"!==O(t))r(e,t);else for(o in t)Vt(e+"["+o+"]",t[o],n,r)}k.param=function(a,e){var t,s=[],n=function(e,t){var n=w(t)?t():t;s[s.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==a)return"";if(Array.isArray(a)||a.jquery&&!k.isPlainObject(a))k.each(a,(function(){n(this.name,this.value)}));else for(t in a)Vt(t,a[t],e,n);return s.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&qt.test(this.nodeName)&&!Yt.test(e)&&(this.checked||!Ne.test(e))})).map((function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,(function(e){return{name:t.name,value:e.replace(zt,"\r\n")}})):{name:t.name,value:n.replace(zt,"\r\n")}})).get()}});var Wt=/%20/g,$t=/#.*$/,Kt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Zt=/^(?:GET|HEAD)$/,Xt=/^\/\//,Jt={},en={},tn="*/".concat("*"),nn=x.createElement("a");function rn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(te)||[];if(w(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function on(e,t,n,r){var o={},l=e===en;function c(d){var f;return o[d]=!0,k.each(e[d]||[],(function(e,d){var h=d(t,n,r);return"string"!=typeof h||l||o[h]?l?!(f=h):void 0:(t.dataTypes.unshift(h),c(h),!1)})),f}return c(t.dataTypes[0])||!o["*"]&&c("*")}function an(e,t){var n,r,o=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}nn.href=Bt.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?an(an(e,k.ajaxSettings),t):an(k.ajaxSettings,e)},ajaxPrefilter:rn(Jt),ajaxTransport:rn(en),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o,l,c,d,f,h,m,i,_,s=k.ajaxSetup({},t),v=s.context||s,y=s.context&&(v.nodeType||v.jquery)?k(v):k.event,E=k.Deferred(),S=k.Callbacks("once memory"),T=s.statusCode||{},w={},C={},M="canceled",A={readyState:0,getResponseHeader:function(e){var t;if(h){if(!c)for(c={};t=Qt.exec(l);)c[t[1].toLowerCase()+" "]=(c[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=c[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?l:null},setRequestHeader:function(e,t){return null==h&&(e=C[e.toLowerCase()]=C[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==h&&(s.mimeType=e),this},statusCode:function(map){var code;if(map)if(h)A.always(map[A.status]);else for(code in map)T[code]=[T[code],map[code]];return this},abort:function(e){var t=e||M;return r&&r.abort(t),O(0,t),this}};if(E.promise(A),s.url=((e||s.url||Bt.href)+"").replace(Xt,Bt.protocol+"//"),s.type=t.method||t.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(te)||[""],null==s.crossDomain){f=x.createElement("a");try{f.href=s.url,f.href=f.href,s.crossDomain=nn.protocol+"//"+nn.host!=f.protocol+"//"+f.host}catch(e){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=k.param(s.data,s.traditional)),on(Jt,s,t,A),h)return A;for(i in(m=k.event&&s.global)&&0==k.active++&&k.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!Zt.test(s.type),o=s.url.replace($t,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(Wt,"+")):(_=s.url.slice(o.length),s.data&&(s.processData||"string"==typeof s.data)&&(o+=(Ut.test(o)?"&":"?")+s.data,delete s.data),!1===s.cache&&(o=o.replace(Kt,"$1"),_=(Ut.test(o)?"&":"?")+"_="+Ft.guid+++_),s.url=o+_),s.ifModified&&(k.lastModified[o]&&A.setRequestHeader("If-Modified-Since",k.lastModified[o]),k.etag[o]&&A.setRequestHeader("If-None-Match",k.etag[o])),(s.data&&s.hasContent&&!1!==s.contentType||t.contentType)&&A.setRequestHeader("Content-Type",s.contentType),A.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+tn+"; q=0.01":""):s.accepts["*"]),s.headers)A.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(!1===s.beforeSend.call(v,A,s)||h))return A.abort();if(M="abort",S.add(s.complete),A.done(s.success),A.fail(s.error),r=on(en,s,t,A)){if(A.readyState=1,m&&y.trigger("ajaxSend",[A,s]),h)return A;s.async&&s.timeout>0&&(d=n.setTimeout((function(){A.abort("timeout")}),s.timeout));try{h=!1,r.send(w,O)}catch(e){if(h)throw e;O(-1,e)}}else O(-1,"No Transport");function O(e,t,c,f){var _,w,C,x,M,O=t;h||(h=!0,d&&n.clearTimeout(d),r=void 0,l=f||"",A.readyState=e>0?4:0,_=e>=200&&e<300||304===e,c&&(x=function(s,e,t){for(var n,r,o,l,c=s.contents,d=s.dataTypes;"*"===d[0];)d.shift(),void 0===n&&(n=s.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in c)if(c[r]&&c[r].test(n)){d.unshift(r);break}if(d[0]in t)o=d[0];else{for(r in t){if(!d[0]||s.converters[r+" "+d[0]]){o=r;break}l||(l=r)}o=o||l}if(o)return o!==d[0]&&d.unshift(o),t[o]}(s,A,c)),!_&&k.inArray("script",s.dataTypes)>-1&&k.inArray("json",s.dataTypes)<0&&(s.converters["text script"]=function(){}),x=function(s,e,t,n){var r,o,l,c,d,f={},h=s.dataTypes.slice();if(h[1])for(l in s.converters)f[l.toLowerCase()]=s.converters[l];for(o=h.shift();o;)if(s.responseFields[o]&&(t[s.responseFields[o]]=e),!d&&n&&s.dataFilter&&(e=s.dataFilter(e,s.dataType)),d=o,o=h.shift())if("*"===o)o=d;else if("*"!==d&&d!==o){if(!(l=f[d+" "+o]||f["* "+o]))for(r in f)if((c=r.split(" "))[1]===o&&(l=f[d+" "+c[0]]||f["* "+c[0]])){!0===l?l=f[r]:!0!==f[r]&&(o=c[0],h.unshift(c[1]));break}if(!0!==l)if(l&&s.throws)e=l(e);else try{e=l(e)}catch(e){return{state:"parsererror",error:l?e:"No conversion from "+d+" to "+o}}}return{state:"success",data:e}}(s,x,A,_),_?(s.ifModified&&((M=A.getResponseHeader("Last-Modified"))&&(k.lastModified[o]=M),(M=A.getResponseHeader("etag"))&&(k.etag[o]=M)),204===e||"HEAD"===s.type?O="nocontent":304===e?O="notmodified":(O=x.state,w=x.data,_=!(C=x.error))):(C=O,!e&&O||(O="error",e<0&&(e=0))),A.status=e,A.statusText=(t||O)+"",_?E.resolveWith(v,[w,O,A]):E.rejectWith(v,[A,O,C]),A.statusCode(T),T=void 0,m&&y.trigger(_?"ajaxSuccess":"ajaxError",[A,s,_?w:C]),S.fireWith(v,[A,O]),m&&(y.trigger("ajaxComplete",[A,s]),--k.active||k.event.trigger("ajaxStop")))}return A},getJSON:function(e,data,t){return k.get(e,data,t,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],(function(e,t){k[t]=function(e,data,n,r){return w(data)&&(r=r||n,n=data,data=void 0),k.ajax(k.extend({url:e,type:t,dataType:r,data:data,success:n},k.isPlainObject(e)&&e))}})),k.ajaxPrefilter((function(s){var i;for(i in s.headers)"content-type"===i.toLowerCase()&&(s.contentType=s.headers[i]||"")})),k._evalUrl=function(e,t,n){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t,n)}})},k.fn.extend({wrapAll:function(html){var e;return this[0]&&(w(html)&&(html=html.call(this[0])),e=k(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(html){return w(html)?this.each((function(i){k(this).wrapInner(html.call(this,i))})):this.each((function(){var e=k(this),t=e.contents();t.length?t.wrapAll(html):e.append(html)}))},wrap:function(html){var e=w(html);return this.each((function(i){k(this).wrapAll(e?html.call(this,i):html)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){k(this).replaceWith(this.childNodes)})),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var sn={0:200,1223:204},ln=k.ajaxSettings.xhr();T.cors=!!ln&&"withCredentials"in ln,T.ajax=ln=!!ln,k.ajaxTransport((function(e){var t,r;if(T.cors||ln&&!e.crossDomain)return{send:function(o,l){var i,c=e.xhr();if(c.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)c[i]=e.xhrFields[i];for(i in e.mimeType&&c.overrideMimeType&&c.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)c.setRequestHeader(i,o[i]);t=function(e){return function(){t&&(t=r=c.onload=c.onerror=c.onabort=c.ontimeout=c.onreadystatechange=null,"abort"===e?c.abort():"error"===e?"number"!=typeof c.status?l(0,"error"):l(c.status,c.statusText):l(sn[c.status]||c.status,c.statusText,"text"!==(c.responseType||"text")||"string"!=typeof c.responseText?{binary:c.response}:{text:c.responseText},c.getAllResponseHeaders()))}},c.onload=t(),r=c.onerror=c.ontimeout=t("error"),void 0!==c.onabort?c.onabort=r:c.onreadystatechange=function(){4===c.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{c.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),k.ajaxPrefilter((function(s){s.crossDomain&&(s.contents.script=!1)})),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return k.globalEval(text),text}}}),k.ajaxPrefilter("script",(function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")})),k.ajaxTransport("script",(function(s){var script,e;if(s.crossDomain||s.scriptAttrs)return{send:function(t,n){script=k("