(self["webpackChunk_object_Object_"]=self["webpackChunk_object_Object_"]||[]).push([[705],{50206:function(e,t,n){"use strict";var r=n(1702);e.exports=r([].slice)},89363:function(e){"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},6833:function(e,t,n){"use strict";var r=n(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268:function(e,t,n){"use strict";var r=n(17854),i=n(84326);e.exports="process"===i(r.process)},22104:function(e,t,n){"use strict";var r=n(34374),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},49974:function(e,t,n){"use strict";var r=n(21470),i=n(19662),o=n(34374),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},21470:function(e,t,n){"use strict";var r=n(84326),i=n(1702);e.exports=function(e){if("Function"===r(e))return i(e)}},60490:function(e,t,n){"use strict";var r=n(35005);e.exports=r("document","documentElement")},67066:function(e,t,n){"use strict";var r=n(19670);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},17152:function(e,t,n){"use strict";var r=n(17854),i=n(22104),o=n(60614),a=n(89363),s=n(88113),l=n(50206),c=n(48053),A=r.Function,u=/MSIE .\./.test(s)||a&&function(){var e=r.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}();e.exports=function(e,t){var n=t?2:1;return u?function(r,a){var s=c(arguments.length,1)>n,u=o(r)?r:A(r),d=s?l(arguments,n):[],h=s?function(){i(u,this,d)}:u;return t?e(h,a):e(h)}:e}},20261:function(e,t,n){"use strict";var r,i,o,a,s=n(17854),l=n(22104),c=n(49974),A=n(60614),u=n(92597),d=n(47293),h=n(60490),p=n(50206),f=n(80317),g=n(48053),m=n(6833),v=n(35268),b=s.setImmediate,y=s.clearImmediate,w=s.process,x=s.Dispatch,k=s.Function,C=s.MessageChannel,B=s.String,_=0,E={},S="onreadystatechange";d((function(){r=s.location}));var F=function(e){if(u(E,e)){var t=E[e];delete E[e],t()}},T=function(e){return function(){F(e)}},M=function(e){F(e.data)},I=function(e){s.postMessage(B(e),r.protocol+"//"+r.host)};b&&y||(b=function(e){g(arguments.length,1);var t=A(e)?e:k(e),n=p(arguments,1);return E[++_]=function(){l(t,void 0,n)},i(_),_},y=function(e){delete E[e]},v?i=function(e){w.nextTick(T(e))}:x&&x.now?i=function(e){x.now(T(e))}:C&&!m?(o=new C,a=o.port2,o.port1.onmessage=M,i=c(a.postMessage,a)):s.addEventListener&&A(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!d(I)?(i=I,s.addEventListener("message",M,!1)):i=S in f("script")?function(e){h.appendChild(f("script"))[S]=function(){h.removeChild(this),F(e)}}:function(e){setTimeout(T(e),0)}),e.exports={set:b,clear:y}},92087:function(e,t,n){"use strict";var r=n(17854),i=n(19781),o=n(47045),a=n(67066),s=n(47293),l=r.RegExp,c=l.prototype,A=i&&s((function(){var e=!0;try{l(".","d")}catch(A){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(o.hasIndices="d"),o)i(a,o[a]);var s=Object.getOwnPropertyDescriptor(c,"flags").get.call(t);return s!==r||n!==r}));A&&o(c,"flags",{configurable:!0,get:a})},11091:function(e,t,n){"use strict";var r=n(82109),i=n(17854),o=n(20261).clear;r({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==o},{clearImmediate:o})},84633:function(e,t,n){"use strict";n(11091),n(12986)},12986:function(e,t,n){"use strict";var r=n(82109),i=n(17854),o=n(20261).set,a=n(17152),s=i.setImmediate?a(o,!1):o;r({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==s},{setImmediate:s})},32515:function(){},657:function(e,t,n){"use strict";n.d(t,{_u:function(){return Wp},lA:function(){return Vp},GJ:function(){return Gp},Gr:function(){return Kp}});var r=n(13087),i=n(62833),o=n(93806),a=n(24343),s=n(43629),l=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"execute",value:function(){var e=this.editor;(0,s.iC)(e)&&(e.readonly||e.history.redo())}},{key:"queryState",value:function(){var e=this.editor;if((0,s.iC)(e)&&!e.readonly)return e.history.hasRedo()}},{key:"hotkey",value:function(){return this.options.hotkey||["mod+y","shift+mod+y"]}}],[{key:"pluginName",get:function(){return"redo"}}]),n}(s.Sy),c=l,A=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"execute",value:function(){var e=this.editor;(0,s.iC)(e)&&(e.readonly||e.history.undo())}},{key:"queryState",value:function(){var e=this.editor;if((0,s.iC)(e)&&!e.readonly)return e.history.hasUndo()}},{key:"hotkey",value:function(){return this.options.hotkey||["mod+z","shift+mod+z"]}}],[{key:"pluginName",get:function(){return"undo"}}]),n}(s.Sy),u=A,d=n(26334),h=n(62040),p="markdown-it",f=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a")),i=t["background"];return delete t["background"],t["background-color"]=i,r.css(t),Object.keys(n).forEach((function(e){r.attributes(e,n[e])})),r}}]}},{key:"isTrigger",value:function(e,t){return void 0===t||e!==t}},{key:"hotkey",value:function(){return this.options.hotkey||[]}}],[{key:"pluginName",get:function(){return"backcolor"}}]),n}(s.Rw),C=k,B=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:this.defaultSize;return e!==t}},{key:"hotkey",value:function(){return this.options.hotkey||[]}},{key:"convertToPX",value:function(e){var t=/([\d\.]+)(pt|px)$/i.exec(e);return t&&"pt"===t[2]?String(Math.round(96*parseInt(t[1],10)/72))+"px":e}},{key:"destroy",value:function(){var e=this.editor;(0,s.iC)(e)&&e.off(T,this.pasteEach)}}],[{key:"pluginName",get:function(){return"fontsize"}}]),n}(s.Rw),N=I,U="markdown-it",L=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a"));return n["text-decoration"]=n["text-decoration"].split(/\s+/).filter((function(e){return"underline"!==e})).join(" ").trim(),i.css(n),i.attributes(r),i}}]}}],[{key:"pluginName",get:function(){return"underline"}}]),n}(s.Rw),H=D;n(57658);function O(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var z=".am-engine .card-hr,.am-engine-view .card-hr {\r\n border: 1px solid transparent;\r\n padding: 18px 0;\r\n border-radius: 2px 2px;\r\n}\r\n\r\n.am-engine .card-hr hr,.am-engine-view .card-hr hr {\r\n box-sizing: border-box;\r\n position: absolute;\r\n top: 50%;\r\n left: 0;\r\n margin-top: -1px;\r\n width: 100%;\r\n height: 2px;\r\n background-color: #e8e8e8;\r\n padding: 0;\r\n border: 1px solid transparent;\r\n}\r\n\r\n.am-engine .card-hr:hover , .am-engine .card-hr.hr-activated {\r\n background-color: #f4f4f4;\r\n}";O(z);var Z=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"toolbar",value:function(){var e,t=this.editor,n=function(){return!(0,s.iC)(t)||t.readonly?[]:[{key:"dnd",type:"dnd"},{key:"copy",type:"copy"},{key:"delete",type:"delete"}]},r=null===(e=t.plugin.findPlugin("hr"))||void 0===e?void 0:e.options;return(null===r||void 0===r?void 0:r.cardToolbars)?r.cardToolbars(n(),this.editor):n()}},{key:"onActivate",value:function(e){(0,d.Z)((0,h.Z)(n.prototype),"onActivate",this).call(this,e);var t="hr-activated",r=this.getCenter();e?r.addClass(t):r.removeClass(t)}},{key:"onSelectByOther",value:function(e,t){(0,d.Z)((0,h.Z)(n.prototype),"onSelectByOther",this).call(this,e,t),this.getCenter().find("hr").css("background-color",e?t.rgb:"")}},{key:"onActivateByOther",value:function(e,t){this.onSelectByOther(e,t)}},{key:"render",value:function(){return this.getCenter().addClass("card-hr"),"
"}}],[{key:"cardName",get:function(){return"hr"}},{key:"cardType",get:function(){return s.eT.BLOCK}},{key:"autoActivate",get:function(){return!1}},{key:"selectStyleType",get:function(){return s.dw.BACKGROUND}}]),n}(s.Zb),R="parse:html",P="paste:schema",q="paste:each",K="markdown-it",W=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a");if(o.css({"background-color":"#e8e8e8",border:"1px solid transparent",margin:"18px 0"}),n){var a=e.editor.card.find(i),l=(null===a||void 0===a?void 0:a.getValue())||(0,s.RW)(i.attributes(s.TM));o=n(o,l)}i.replaceWith(o),r.push(o)})),r},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.on(R,this.parseHtml),e.on(P,this.pasteSchema),e.on(q,this.pasteHtml),(0,s.iC)(e)&&e.on(K,this.markdownIt)}},{key:"execute",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.card;t.insert(Z.cardName)}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+e"}},{key:"destroy",value:function(){var e=this.editor;e.off(R,this.parseHtml),e.off(P,this.pasteSchema),e.off(q,this.pasteHtml),(0,s.iC)(e)&&e.off(K,this.markdownIt)}}],[{key:"pluginName",get:function(){return"hr"}}]),n}(s.Sy),j=W,V=n(54621),G=["[ ] ","[x] ","[X] "];function $(e,t){t||(t={checkStrings:G}),t.checkStrings=t.checkStrings||G,e.core.ruler.after("inline","task-list",(function(e){for(var n=e.tokens,r=2;r=0;r--)if(e[r].level===n)return r;return-1}function J(e,t,n){return oe(e[t])&&ae(e[t-1])&&le(e[t],!1,n)&&se(e[t-2])}function ee(e,t,n){return oe(e[t])&&ae(e[t-1])&&le(e[t],!0,n)&&(t-2<0||!se(e[t-2]))}function te(e,t,n,r){var i=e[t],o=e[t-2];r.itemClass&&Y(o,"class",r.itemClass),r.rootClass&&Y(e[X(e,t-2)],"class",r.rootClass);var a=re(i,r.checkStrings),s=a.markup,l=a.content,c=a.checked;o.markup=s,i.content=l,i.children&&i.children.length>0&&(i.children[0].content=i.content),o.info=c?"true":"false";var A=ie(c,n.Token),u=(0,V.Z)(A,2),d=u[0],h=u[1];e.splice(t,0,d),e.splice(t+1,0,h)}function ne(e,t,n,r){var i=e[t],o=e[t-1],a=e[t-2];a.tag="ul",a.type="task_list_open",r.rootClass&&Y(a,"class",r.rootClass);var s=new n.Token("task_list_item_open","li",1);r.itemClass&&Y(s,"class",r.itemClass),e.splice(t-1,0,s);var l=re(o,r.checkStrings),c=l.markup,A=l.content,u=l.checked;s.markup=c,o.content=A,o.children&&o.children.length>0&&(o.children[0].content=o.content),s.info=u?"true":"false";var d=ie(u,n.Token),h=(0,V.Z)(d,2),p=h[0],f=h[1];e.splice(t,0,p),e.splice(t+1,0,f);var g=new n.Token("task_list_item_close","li",-1);e.splice(t+3,0,g),i.tag="ul",i.type="task_list_close"}function re(e,t){for(var n="",r="",i=!1,o=function(o){var a=t[o],s=function(t){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?t.trim():a;return!!e.content.startsWith(s)&&(n=s,r=e.content.replace(s,""),i="x"===s.substring(1,2).trim().toLowerCase(),!0)},l=s(a);if(l||(l=s(a,!0)),l)return"break"},a=0;a1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return n.checkStrings.some((function(n){return 0===e.content.indexOf(t?n.trim():n)}))}function ce(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Ae=".data-checkbox {\r\n\tfont-size: 14px;\r\n\tfont-variant: tabular-nums;\r\n\tcolor: rgba(0, 0, 0, 0.65);\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\twidth: 16px;\r\n\theight: 16px;\r\n\tmax-width: 16px !important;\r\n\tlist-style: none;\r\n\twhite-space: nowrap;\r\n\tcursor: pointer;\r\n\toutline: none;\r\n\tdisplay: inline-block;\r\n\tline-height: 1;\r\n\tposition: relative;\r\n}\r\n\r\n.data-checkbox-checked:after {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder-radius: 2px;\r\n\tborder: 1px solid #347eff;\r\n\tcontent: \"\";\r\n\tvisibility: hidden;\r\n}\r\n\r\n.data-checkbox:not(.data-checkbox-mobile):focus .data-checkbox-inner,.data-checkbox:not(.data-checkbox-mobile) .data-checkbox-inner {\r\n border-color: #347eff\r\n}\r\n\r\n.data-checkbox:hover:after{\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-checkbox-inner {\r\n\tposition: relative;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n display: inline-block;\r\n\tborder: 1px solid #d9d9d9;\r\n\tborder-radius: 2px;\r\n\tbackground-color: #fff;\r\n\t-webkit-transition: all 0.3s;\r\n\ttransition: all 0.3s;\r\n\tborder-collapse: separate;\r\n}\r\n\r\n.data-checkbox-inner:after {\r\n\t-webkit-transform: rotate(45deg) scale(0);\r\n\t-ms-transform: rotate(45deg) scale(0);\r\n\ttransform: rotate(45deg) scale(0);\r\n\tposition: absolute;\r\n\tleft: 4.57142857px;\r\n\ttop: 1.14285714px;\r\n\tdisplay: table;\r\n\twidth: 5.71428571px;\r\n\theight: 9.14285714px;\r\n\tborder: 2px solid #fff;\r\n\tborder-top: 0;\r\n\tborder-left: 0;\r\n\tcontent: ' ';\r\n\t-webkit-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6), opacity 0.1s;\r\n\ttransition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6), opacity 0.1s;\r\n\topacity: 0;\r\n}\r\n\r\n.data-checkbox-checked .data-checkbox-inner:after {\r\n\t-webkit-transform: rotate(45deg) scale(1);\r\n\t-ms-transform: rotate(45deg) scale(1);\r\n\ttransform: rotate(45deg) scale(1);\r\n\tposition: absolute;\r\n\tdisplay: table;\r\n\tborder: 2px solid #fff;\r\n\tborder-top: 0;\r\n\tborder-left: 0;\r\n\tcontent: ' ';\r\n\t-webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\r\n\ttransition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\r\n\topacity: 1;\r\n}\r\n\r\n.data-checkbox-checked .data-checkbox-inner {\r\n\tbackground-color: #347eff;\r\n border-color: #347eff;\r\n}\r\n\r\n.data-checkbox-disabled {\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-checkbox-disabled.data-checkbox-checked .data-checkbox-inner:after {\r\n\t-webkit-animation-name: none;\r\n\tanimation-name: none;\r\n\tborder-color: rgba(0, 0, 0, 0.25);\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-input {\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-inner {\r\n\tborder-color: #d9d9d9 !important;\r\n\tbackground-color: #f5f5f5;\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-inner:after {\r\n\t-webkit-animation-name: none;\r\n\tanimation-name: none;\r\n\tborder-color: #f5f5f5;\r\n\tborder-collapse: separate;\r\n}\r\n\r\n.data-checkbox-disabled + span {\r\n\tcolor: rgba(0, 0, 0, 0.25);\r\n\tcursor: not-allowed;\r\n}\r\n";ce(Ae);var ue="data-checkbox",de="data-checkbox-inner",he="data-checkbox-checked",pe=(0,F.Z)("container"),fe=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a\n \n '),t=this.getValue();(0,S.Z)(this,pe)[pe]?(0,S.Z)(this,pe)[pe]=this.getCenter().first():((0,S.Z)(this,pe)[pe]=(0,s.$)(e),this.getCenter().append((0,S.Z)(this,pe)[pe]));var n=this.editor;this.update(!(null===t||void 0===t?void 0:t.checked)),(0,s.iC)(n)&&!n.readonly&&(0,S.Z)(this,pe)[pe].on("mousedown",this.onClick)}},{key:"destroy",value:function(){var e;null===(e=(0,S.Z)(this,pe)[pe])||void 0===e||e.off("mousedown",this.onClick)}}],[{key:"cardName",get:function(){return"checkbox"}},{key:"cardType",get:function(){return s.eT.INLINE}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}},{key:"collab",get:function(){return!1}},{key:"focus",get:function(){return!1}}]),n}(s.Zb),ge='.am-engine .data-list-item [data-card-key="checkbox"],.am-engine-view .data-list-item [data-card-key="checkbox"] {\r\n\tmargin-left: 0;\r\n}\r\n\r\n.am-engine .data-list-task,.am-engine-view .data-list-task {\r\n\tlist-style: none;\r\n\ttext-indent: 0;\r\n}\r\n\r\n.am-engine .data-list-task [data-card-key="checkbox"],.am-engine-view .data-list-task [data-card-key="checkbox"] {\r\n margin-left: -22px;\r\n height: 16px;\r\n display: inline-block;\r\n width: 22px;\r\n vertical-align: middle;\r\n height: 100%;\r\n}\r\n\r\n.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="center"],.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="body"],.am-engine-view .data-list-task [data-card-key="checkbox"] [data-card-element="center"]{\r\n height: 16px;\r\n width: 16px;\r\n vertical-align: unset;\r\n}';ce(ge);var me="data-list-task",ve="parse:html",be="markdown-it",ye="paste:each",we="paste:each-after",xe=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&void 0!==arguments[0]?arguments[0]:"";return'').concat(e,"")},i=[];return t.find("[".concat(s.Jr,'="checkbox"]')).each((function(t){var o=(0,s.$)(t),a=(0,s.$)("".concat(o.find(".data-checkbox-checked").length>0?r(''):r(),""));if(a.css({margin:"3px 0.5ex","vertical-align":"middle",width:"16px",height:"16px",color:"rgba(0, 0, 0, 0.65)"}),o.empty(),n){var l=e.editor.card.find(o),c=(null===l||void 0===l?void 0:l.getValue())||(0,s.RW)(o.attributes(s.TM));c&&(a=n(a,c))}o.append(a),i.push(o)})),t.find(".".concat(me)).css({"list-style":"none"}),i},e.markdownIt=function(t){var n=e.editor;!1!==e.options.markdown&&(t.use($,{itemClass:n.list.CUSTOMZIE_LI_CLASS,rootClass:"".concat(n.list.CUSTOMZIE_UL_CLASS," ").concat(me)}),t.enable("task-list"))},e.pasteHtml=function(t){if((0,s.iC)(e.editor)){if(t.isElement()){var n,r=t.attributes(),i=r[s.Jr]||r[s.mV];if(i&&i===fe.cardName&&"li"!==(null===(n=t.parent())||void 0===n?void 0:n.name))return t.remove(),!1}return!0}},e.pasteEachAfter=function(t){var n=e.editor,r=t.find("li.".concat(n.list.CUSTOMZIE_LI_CLASS));r.each((function(e,t){var i=r.eq(t);if(i){var o=i.first();if(o&&o.name===fe.cardName){var a=n.card.find(o);if(a){var s=i.parent();null===s||void 0===s||s.addClass(me);var l=a.getValue();l&&l.checked?null===s||void 0===s||s.attributes("checked","true"):null===s||void 0===s||s.removeAttributes("checked")}}}}))},e}return(0,i.Z)(n,[{key:"init",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this);var e=this.editor;e.on(ve,this.parseHtml),(0,s.iC)(e)&&(e.on(be,this.markdownIt),e.on(we,this.pasteEachAfter),e.on(ye,this.pasteHtml))}},{key:"schema",value:function(){var e=(0,d.Z)((0,h.Z)(n.prototype),"schema",this).call(this);return[e,{name:"li",type:"block",attributes:{class:{required:!0,value:this.editor.list.CUSTOMZIE_LI_CLASS},checked:["true","false"]},allowIn:["ul"]}]}},{key:"isCurrent",value:function(e){var t;return"li"===e.name?e.hasClass(this.editor.list.CUSTOMZIE_LI_CLASS)&&"checkbox"===(null===(t=e.first())||void 0===t?void 0:t.attributes(s.Jr)):e.hasClass("data-list")&&e.hasClass(me)}},{key:"execute",value:function(e){var t=this.editor;if((0,s.iC)(t)){var n=t.change,r=t.list,i=t.block;r.split();var o=n.range.get(),a=i.findBlocks(o);if(a){var l,c=o.createSelection("tasklist-execute");if(r.isSpecifiedType(a,"ul","checkbox"))r.unwrap(a);else{var A=r.toCustomize(a,"checkbox",e);A.forEach((function(e){t.node.isList(e)&&e.addClass(me)}))}c.move();var u=null!==(l=o.startContainer.parentElement)&&void 0!==l?l:o.startContainer.parentNode;if(o.collapsed&&o.startContainer.nodeType===Node.ELEMENT_NODE&&0===o.startContainer.childNodes.length&&u){var d=document.createElement("br");o.startNode.before(d),u.removeChild(o.startContainer),o.select(d),o.collapse(!1)}n.apply(o),r.merge()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+9"}},{key:"destroy",value:function(){var e=this.editor;e.off(ve,this.parseHtml),(0,s.iC)(e)&&(e.off(be,this.markdownIt),e.off(we,this.pasteEachAfter),e.off(ye,this.pasteHtml))}}],[{key:"pluginName",get:function(){return"tasklist"}}]),n}(s.BX),ke=xe,Ce=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&void 0!==arguments[0]?arguments[0]:1,t=this.editor;if((0,s.iC)(t)){var n=t.change,r=t.list,i=t.block;r.split();var o=n.range.get(),a=i.findBlocks(o);if(a){var l=o.createSelection();"orderedlist"===r.getPluginNameByNodes(a)?r.unwrap(a):r.toNormal(a,"ol",e),l.move(),n.range.select(o),r.merge()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+7"}},{key:"destroy",value:function(){this.editor.off("markdown-it",this.markdownIt)}}],[{key:"pluginName",get:function(){return"orderedlist"}}]),n}(s.BX),Be=Ce,_e="markdown-it",Ee=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a1)return;if(!l.collapsed)return}return e.queryState()?(t.preventDefault(),n.command.execute(e.constructor.pluginName,"out"),!1):void 0}}},e.onTab=function(t){var n=e.editor;if((0,s.iC)(n)){var r=n.change,i=n.list,o=n.block,a=r.range.get();return a.collapsed&&i.isFirst(a)?(t.preventDefault(),n.command.execute(e.constructor.pluginName,"in"),!1):!a.collapsed||o.isFirstOffset(a,"start")?(t.preventDefault(),n.command.execute(e.constructor.pluginName,"in",!0),!1):void 0}},e.onShiftTab=function(t){var n=e.editor;if((0,s.iC)(n))return t.preventDefault(),n.command.execute(e.constructor.pluginName,"out"),!1},e.pasteEach=function(t){var n=e.editor;if(t.isElement()&&!t.isCard()&&n.node.isBlock(t)){var r=t.css(),i=r[Te];if(i&&i.endsWith("pt")){var o=e.convertToPX(i);if(o){var a=e.options.maxPadding||50,l=(0,s.ZQ)(o),c=t.width();c=0===c?n.root.width():c;var A=t.css("font-size");A=!A||A.endsWith("em")?n.root.css("font-size"):A,A.endsWith("em")&&(A=(0,s.$)(document.body).css("font-size")),A.endsWith("px")||(A="16px");var u=c>0?c/(0,s.ZQ)(A):a;l=Math.min(o.endsWith("px")?l/(0,s.ZQ)(A):l,a,u),l<=0?t.css(Te,""):t.css(Te,(0,s.Nn)(l>0?l:0,"em"))}}}},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.schema.add(this.schema()),this.conversion().forEach((function(t){var n=t.from,r=t.to;e.conversion.add(n,r)})),e.on(Me,this.onBackspace),e.on(Ie,this.onTab),e.on(Ne,this.onShiftTab),(0,s.iC)(e)&&e.on(Ue,this.pasteEach)}},{key:"execute",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"in",n=this.editor;if((0,s.iC)(n)){var r=n.change,i=n.list,o=n.block;i.split();var a=r.range.get(),l=o.findBlocks(a);if(l){var c=this.options.maxPadding||50;l.forEach((function(n){e.addPadding(n,"in"===t?2:-2,c)})),i.merge()}}}},{key:"queryState",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.change,n=e.list,r=e.node,i=t.range.get();if(!i.startNode.inEditor())return 0;var o=e.block.closest(i.startNode);return"li"===o.name?n.getIndent(o.closest("ul,ol")):r.isRootBlock(o)||r.isNestedBlock(o)?(0,s.ZQ)(o.css(Te)):0}}},{key:"addPadding",value:function(e,t,n){var r=this.editor,i=r.list,o=r.node;if("li"!==e.name)if(o.isList(e))i.addIndent(e,t,n);else if(o.isRootBlock(e)||o.isNestedBlock(e))if(t>0)if((0,s.ZQ)(e.css(Te))){var a=e.css(Te),l=(0,s.ZQ)(a)+t,c=e.width();c=0===c?r.root.width():c;var A=e.css("font-size");A=!A||A.endsWith("em")?r.root.css("font-size"):A,A.endsWith("em")&&(A=(0,s.$)(document.body).css("font-size")),A.endsWith("px")||(A="16px");var u=c>0?c/(0,s.ZQ)(A):n;l=Math.min(a.endsWith("px")?l/(0,s.ZQ)(A):l,n,u),l<=0?e.css(Te,""):e.css(Te,(0,s.Nn)(l>0?l:0,"em"))}else e.css(Te,"".concat(t,"em"));else{var d=e.css(Te),h=(0,s.ZQ)(d)+t;h<=0?e.css(Te,""):e.css(Te,(0,s.Nn)(h>0?h:0,"em"))}}},{key:"hotkey",value:function(){var e,t,n=(null===(e=this.options.hotkey)||void 0===e?void 0:e.in)||"mod+]",r=(null===(t=this.options.hotkey)||void 0===t?void 0:t.out)||"mod+[";return[{key:n,args:"in"},{key:r,args:"out"}]}},{key:"schema",value:function(){return{type:"block",attributes:{style:(0,Fe.Z)({},Te,"@length")}}}},{key:"conversion",value:function(){var e=this;return[{from:function(e,t,n){return!!t["padding-left"]||!!n[Te]},to:function(t,n,r){var i=(0,s.$)("<".concat(t," />")),o=n["padding-left"]||r[Te];if(o.endsWith("pt")&&(o=e.convertToPX(o)),o.endsWith("px")){var a=n["font-size"];a=!a||a.endsWith("em")?e.editor.root.css("font-size"):a,a.endsWith("em")&&(a=(0,s.$)(document.body).css("font-size")),a.endsWith("px")||(a="16px");var l=(0,s.ZQ)(o)/(0,s.ZQ)(a);n[Te]="".concat(l,"em")}else o.endsWith("em")&&(n[Te]=o);return delete n["padding-left"],delete r[Te],i.css(n),Object.keys(r).forEach((function(e){i.attributes(e,r[e])})),i}}]}},{key:"convertToPX",value:function(e){var t=/([\d\.]+)(pt|px)$/i.exec(e);return t&&"pt"===t[2]?String(Math.round(96*parseInt(t[1],10)/72))+"px":e}},{key:"destroy",value:function(){var e=this.editor;e.off(Me,this.onBackspace),e.off(Ie,this.onTab),e.off(Ne,this.onShiftTab),(0,s.iC)(e)&&e.off(Ue,this.pasteEach)}}],[{key:"pluginName",get:function(){return"indent"}}]),n}(s.Sy),Qe=Le,De=n(7279),He="markdown-it",Oe=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a"));return n["text-decoration"]=n["text-decoration"].split(/\s+/).filter((function(e){return"line-through"!==e})).join(" ").trim(),i.css(n),i.attributes(r),i}},{from:"s",to:this.tagName},{from:"strike",to:this.tagName}]}},{key:"destroy",value:function(){this.editor.off(He,this.markdownIt)}}],[{key:"pluginName",get:function(){return"strikethrough"}}]),n}(s.Rw),ze=Oe,Ze=n(10082),Re=n.n(Ze),Pe="markdown-it",qe=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a"));return delete n["vertical-align"],i.css(n),i.attributes(r),i}}]}},{key:"execute",value:function(){for(var e,t=this.editor.command.queryState("sub"),r=arguments.length,i=new Array(r),o=0;o"));return delete n["vertical-align"],i.css(n),i.attributes(r),i}}]}},{key:"execute",value:function(){for(var e,t=this.editor.command.queryState("sup"),r=arguments.length,i=new Array(r),o=0;o1)){var a=n.command,l=e.queryState();return"center"===l?(t.preventDefault(),a.execute(e.constructor.pluginName,"left"),!1):"right"===l?(t.preventDefault(),a.execute(e.constructor.pluginName,"center"),!1):void 0}}},e}return(0,i.Z)(n,[{key:"init",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this),this.editor.on(Ye,this.onBackspace)}},{key:"execute",value:function(e){var t=this.editor;if((0,s.iC)(t)&&!t.readonly){var n=t.change,r=t.block;r.setBlocks({style:{"text-align":!e||["left"].indexOf(e)>-1?"":e}}),n.blocks.forEach((function(n){"li"===n.name&&t.list.addAlign(n,e)}))}}},{key:"queryState",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.change,n=e.schema,r=t.blocks;if(0!==r.length){var i=r[0],o=n.getAllowInTags();o.indexOf(i.name)>-1&&(i=r[1]||i.first()||i);var a=i.css("text-align");return"start"===a&&(a="left"),"end"===a&&(a="right"),a}}}},{key:"hotkey",value:function(){var e,t,n,r,i=(null===(e=this.options.hotkey)||void 0===e?void 0:e.left)||"mod+shift+l",o=(null===(t=this.options.hotkey)||void 0===t?void 0:t.center)||"mod+shift+c",a=(null===(n=this.options.hotkey)||void 0===n?void 0:n.right)||"mod+shift+r",s=(null===(r=this.options.hotkey)||void 0===r?void 0:r.justify)||"mod+shift+j";return[{key:i,args:"left"},{key:o,args:"center"},{key:a,args:"right"},{key:s,args:"justify"}]}},{key:"destroy",value:function(){this.editor.off(Ye,this.onBackspace)}}],[{key:"pluginName",get:function(){return"alignment"}}]),n}(s.YX),Je=Xe,et=n(84462),tt=n.n(et);function nt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var rt=".am-engine mark,\r\n.am-engine-view mark {\r\n padding: 0;\r\n background: #ff0;\r\n}";nt(rt);var it="markdown-it",ot=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a

"))},e.markdownIt=function(t){!1!==e.options.markdown&&t.enable("blockquote")},e.onBackspace=function(t){var n=e.editor;if((0,s.iC)(n)){var r=n.change,i=n.node,o=r.range.get(),a=n.block,l=a.isLastOffset(o,"end");if(l&&!o.collapsed){var c=a.closest(o.startNode),A=a.closest(o.endNode),u=c.parent(),d=A.parent();if(u&&d&&"blockquote"===d.name&&!u.equal(d))return void d.remove()}if(o.collapsed){var h=a.isFirstOffset(o,"start");if(h){var p=a.closest(o.startNode),f=p.parent();if(f&&"blockquote"===f.name&&i.isBlock(p)){if(t.preventDefault(),p.prevElement())r.mergeAfterDelete(p);else if(i.isEmpty(f)){var g=(0,s.$)("


");f.replaceWith(g),o.select(g,!0).collapse(!1),r.apply(o)}else a.unwrap("
");return!1}}}}},e.onEnter=function(t){var n=e.editor;if((0,s.iC)(n)){var r=n.change,i=n.block,o=r.range.get(),a=i.closest(o.endNode),l=a.parent();return(null===l||void 0===l?void 0:l.name)===e.tagName&&"p"===a.name&&a.nextElement()?(t.preventDefault(),i.insertOrSplit(o,a),!1):void 0}},e.parseHtml=function(e){e.find("blockquote").css({"margin-top":"5px","margin-bottom":"5px","padding-left":"1em","margin-left":"0px","border-left":"3px solid #eee",opacity:"0.6"})},e.pasteHtml=function(t){var n=e.editor;if((0,s.iC)(n)){if(t.name===e.tagName){var r=n.node;return t.css("padding-left",""),t.css("text-indent",""),r.isEmpty(t)&&t.empty().append("


"),n.normalize(t),!1}return!0}},e}return(0,i.Z)(n,[{key:"init",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this);var e=this.editor;e.schema.addAllowIn(this.tagName),e.on(ct,this.parseHtml),(0,s.iC)(e)&&(e.on(dt,this.pasteHtml),e.on(At,this.onBackspace),e.on(ut,this.onEnter),e.on(dt,this.pasteEach),e.on(ht,this.markdownIt))}},{key:"execute",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.change,n=e.block,r=e.node;if(this.queryState()){var i=t.range.get(),o=t.blocks[0].closest(this.tagName),a=i.createSelection();return r.unwrap(o),a.move(),void t.range.select(i)}n.wrap("<".concat(this.tagName," />"))}}},{key:"queryState",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.change,n=t.blocks;if(0===n.length)return!1;var r=n[0].closest(this.tagName);return this.isSelf(r)}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+u"}},{key:"destroy",value:function(){var e=this.editor;e.off(ct,this.parseHtml),(0,s.iC)(e)&&(e.off(dt,this.pasteHtml),e.off(At,this.onBackspace),e.off(ut,this.onEnter),e.off(dt,this.pasteEach),e.off(ht,this.markdownIt))}}],[{key:"pluginName",get:function(){return"quote"}}]),n}(s.AT),ft=pt;function gt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var mt=".am-engine.data-paintformat-mode,\r\n.am-engine-view.data-paintformat-mode {\r\n cursor: text;\r\n cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAUCAYAAACTQC2+AAAABGdBTUEAALGPC/xhBQAAATtJREFUSA3dlTFLA0EQhU+jlSkEG63EYGdlZZFG7QUbSyG/QP/C/Q0rqzQWQX+BwUKwtrexEFRQtFSI35NZWDa3soOHhQ8eM/v2zWw2N9xVVVUdwXUYoFxaq5il2wa8hvtG5dJaxYx16xFvLN8i3lmehiFC6Y94wbsTGsxZosajKA/7aewjrKZiyTocJO9DSYHT82r+YXyQs0eRfYBrD/Y1DB58OMyfeM/hrWq8N9qlZkmFBXiPPd6D7ikWUxwjrKWirTeJkzDeNYttKIxhDUuxiFGjfAnfMkUX3hs19emYqFt9P48mU6zVLEQPFjCfwgk8gyuwEd6pS5t0EQYmHhCXLZ8Kvz1oqmFO+H8HxVOXfZC5vwNd46y3xbx5ni1mQ4+dJ6NyDw4xX0GN9484YfcRhg+fcmmt408+5V99wSyVTWN94gAAAABJRU5ErkJggg==) 5 10, text;\r\n}";gt(mt);var vt="data-paintformat-mode",bt=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a'));l.insertNode(A[0]);var u=a.closest(l.startNode);l.select(u,!0),i.range.select(l),"function"===typeof c?c(l):o.execute(c),this.paintMarks(e);var d=a.getBlocks(l);t&&d.forEach((function(e){n.paintBlocks(e,t)})),A=u.find('img[role="format-dummy"]'),l.select(A),l.collapse(!0),A.remove(),i.apply(l)}else{"function"===typeof c?c(l):o.execute(c),this.paintMarks(e);var h=a.getBlocks(l);t&&h.forEach((function(e){n.paintBlocks(e,t)}))}r.mark.merge(l)}}},{key:"paintMarks",value:function(e){for(var t=this.editor,n=t.mark,r=e.length-1;r>=0;r--){var i=e[r];n.wrap(t.node.clone(i,!1,!1))}}},{key:"paintBlocks",value:function(e,t){var n=this,r=this.editor;if((0,s.iC)(r)&&e.inEditor()){var i=r.node,o=r.change,a=r.block,l=o.range.get(),c=l.createSelection("removeformat");t.forEach((function(t){if(e.inEditor()){if(n.options.paintBlock){var r=n.options.paintBlock(e,t);if(!1===r)return}if(t.name!==e.name)if(l.select(e).shrinkToElementNode(),o.blocks=[e],"p"===t.name){var s=a.findPlugin(e);s&&s.execute(t.name)}else if(i.isRootBlock(t)){var c=a.findPlugin(t);c&&c.execute(t.name)}else if(i.isList(t)&&"li"!==t.name){var A=a.findPlugin(t),u=a.findPlugin("li"===e.name?e.parent():e);A&&u!==A&&A.execute()}var d=t.css();Object.keys(d).length>0&&a.setBlocks({style:d})}})),c.move()}}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"single",t=this.editor;if((0,s.iC)(t))if(this.activeMarks)this.removeActiveNodes(t.container);else{this.type=e,this.bindEvent(t.container);var n=t.change,r=t.mark,i=t.block,o=n.range.get();this.activeMarks=r.findMarks(o),this.activeBlocks=i.findBlocks(o),t.trigger("select"),t.container.addClass("data-paintformat-mode")}}},{key:"queryState",value:function(){return!!this.activeMarks}},{key:"destroy",value:function(){var e=this.editor;e.off("beforeCommandExecute",this.onBeforeCommandExecute),e.container.off("mouseup",this.onContainerMouseUp)}}],[{key:"pluginName",get:function(){return"paintformat"}}]),n}(s.Sy),yt=bt,wt=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"execute",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.change,n=e.block,r=e.mark,i=e.inline,o=n,a=t.range.get(),l=o.getBlocks(a),c=r.findMarks(a),A=i.findInlines(a);if(c.length>0)r.unwrap();else if(A.length>0)i.unwrap();else{var u=a.createSelection("removeformat");l.forEach((function(e){var t=o.findPlugin("li"===e.name?e.parent():e);t&&(a.select(e).shrinkToElementNode(),t.execute()),e.removeAttributes("style")})),u.move()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+\\"}}],[{key:"pluginName",get:function(){return"removeformat"}}]),n}(s.Sy),xt=wt,kt="keydown:all",Ct=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0?n.select(r,!0):n.select(e.container,!0),t.range.select(n),e.trigger("select")}}},{key:"destroy",value:function(){this.editor.off(kt,this.onSelectAll)}}],[{key:"pluginName",get:function(){return"selectall"}}]),n}(s.Sy),Bt=Ct,_t=n(48534),Et=n(78305),St=n.n(Et),Ft=n(73396),Tt=n(44870),Mt=n(87139),It=n(49242),Nt=n(44339),Ut=n(73886),Lt=n(30898),Qt=n(30670),Dt=(0,Ft.aZ)({name:"am-link-editor",components:{AConfigProvider:Nt.ZP,AInput:Ut.ZP,AButton:Lt.Z},props:{language:{type:Object,required:!0},defaultText:String,defaultLink:String,className:String,onLoad:Function,onOk:Function},setup(e){const t=(0,Tt.iH)(e.defaultText),n=(0,Tt.iH)(e.defaultLink),r=(0,Tt.iH)(null),i=e.language.get("link","text"),o=e.language.get("link","text_placeholder"),a=e.language.get("link","link"),s=e.language.get("link","link_placeholder"),l=e.language.get("link","ok_button"),c=e=>{t.value=e},A=e=>{n.value=e};return(0,Ft.bv)((()=>{r.value&&r.value.focus(),setTimeout((()=>{e.onLoad&&e.onLoad()}),200)})),{text:t,link:n,textTitle:i,textPlaceholder:o,linkTitle:a,linkPlaceholder:s,buttonTitle:l,onTextChange:c,onLinkChange:A,linkRef:r}}});function Ht(e,t,n,r,i,o){const a=(0,Ft.up)("a-input"),s=(0,Ft.up)("a-button"),l=(0,Ft.up)("a-config-provider");return(0,Ft.wg)(),(0,Ft.j4)(l,{"auto-insert-space-in-button":!1},{default:(0,Ft.w5)((()=>[(0,Ft._)("div",{"data-element":"ui",class:(0,Mt.C_)(["data-link-editor",e.className])},[(0,Ft._)("p",null,(0,Mt.zw)(e.textTitle),1),(0,Ft._)("p",null,[(0,Ft.Wm)(a,{class:"data-link-input",value:e.text,placeholder:e.textPlaceholder,onChange:t[0]||(t[0]=t=>e.onTextChange(t.target.value))},null,8,["value","placeholder"])]),(0,Ft._)("p",null,(0,Mt.zw)(e.linkTitle),1),(0,Ft._)("p",null,[(0,Ft.Wm)(a,{ref:"linkRef",class:"data-link-input",value:e.link,placeholder:e.linkPlaceholder,onChange:t[1]||(t[1]=t=>e.onLinkChange(t.target.value))},null,8,["value","placeholder"])]),(0,Ft._)("p",null,[(0,Ft.Wm)(s,{class:"data-link-button",onClick:t[2]||(t[2]=t=>e.onOk(e.text,e.link)),disabled:""===e.link.trim()},{default:(0,Ft.w5)((()=>[(0,Ft.Uk)((0,Mt.zw)(e.buttonTitle),1)])),_:1},8,["disabled"])])],2)])),_:1})}Dt.render=Ht,Dt.__file="src/toolbar/editor.vue";var Ot=(0,Ft.aZ)({name:"am-link-preview",components:{ATooltip:Qt.Z},props:{language:{type:Object,required:!0},readonly:{type:Boolean,required:!0},href:String,className:String,onEdit:Function,onRemove:Function,onLoad:Function},setup(e){const t=e.language.get("link","link_open"),n=e.language.get("link","link_edit"),r=e.language.get("link","link_remove");return(0,Ft.bv)((()=>{e.onLoad&&e.onLoad()})),{openTitle:t,editTitle:n,removeTitle:r,isMobile:s.tq}}});const zt={class:"data-link-preview","data-element":"ui"},Zt=["href"],Rt={key:0,class:"data-link-op"};function Pt(e,t,n,r,i,o){const a=(0,Ft.up)("a-tooltip");return(0,Ft.wg)(),(0,Ft.iD)("div",zt,[(0,Ft.Wm)(a,{title:e.openTitle},{default:(0,Ft.w5)((()=>[(0,Ft._)("a",{class:"data-icon data-icon-link data-link-preview-open",href:e.href,target:"_blank"},(0,Mt.zw)(e.href),9,Zt)])),_:1},8,["title"]),e.readonly?(0,Ft.kq)("v-if",!0):((0,Ft.wg)(),(0,Ft.iD)("div",Rt,[e.isMobile?(0,Ft.kq)("v-if",!0):((0,Ft.wg)(),(0,Ft.j4)(a,{key:0,title:e.editTitle},{default:(0,Ft.w5)((()=>[(0,Ft._)("a",{class:"data-icon data-icon-edit",onClick:t[0]||(t[0]=(...t)=>e.onEdit&&e.onEdit(...t))})])),_:1},8,["title"])),e.isMobile?((0,Ft.wg)(),(0,Ft.iD)("a",{key:1,class:"data-icon data-icon-edit",onClick:t[1]||(t[1]=(...t)=>e.onEdit&&e.onEdit(...t))})):(0,Ft.kq)("v-if",!0),e.isMobile?(0,Ft.kq)("v-if",!0):((0,Ft.wg)(),(0,Ft.j4)(a,{key:2,title:e.removeTitle},{default:(0,Ft.w5)((()=>[(0,Ft._)("a",{class:"data-icon data-icon-unlink",onClick:t[2]||(t[2]=(...t)=>e.onRemove&&e.onRemove(...t))})])),_:1},8,["title"])),e.isMobile?((0,Ft.wg)(),(0,Ft.iD)("a",{key:3,class:"data-icon data-icon-unlink",onClick:t[3]||(t[3]=(...t)=>e.onRemove&&e.onRemove(...t))})):(0,Ft.kq)("v-if",!0)]))])}Ot.render=Pt,Ot.__file="src/toolbar/preview.vue";var qt=function(){function e(t,n){var i=this;(0,r.Z)(this,e),this.engine=void 0,this.root=void 0,this.target=void 0,this.options=void 0,this.mouseInContainer=!1,this.vm=void 0,this.position=void 0,this.engine=t;var o=this.engine.change;this.options=n,this.position=new s.Ly(this.engine),o.event.onWindow("mousedown",(function(e){if(e.target){var t=(0,s.$)(e.target),n=t.closest(".data-link-container");i.mouseInContainer=n&&n.length>0,t.inEditor()||i.mouseInContainer||i.hide()}}))}return(0,i.Z)(e,[{key:"create",value:function(){var e;if(this.target){var t=(0,s.$)(".data-link-container");0===t.length&&(t=(0,s.$)("'))),this.root=t;var n=null===(e=this.target.get())||void 0===e?void 0:e.getBoundingClientRect();n&&this.root.css({top:"".concat(window.pageYOffset+n.bottom+4,"px"),left:"".concat(window.pageXOffset,"px"),position:"absolute","z-index":125})}}},{key:"onOk",value:function(){var e=(0,_t.Z)(St().mark((function e(t,n){var r,i,o,a,s,l,c,A,u,d,h;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.target){e.next=2;break}return e.abrupt("return");case 2:if(r=this.engine.change,i=r.range.get(),r.rangePathBeforeCommand||(i.startNode.inEditor()||(i.select(this.target,!0),r.range.select(i)),r.cacheRangeBeforeCommand()),o=this.options||{},a=o.onConfirm,!a){e.next=12;break}return e.next=9,a(t,n);case 9:s=e.sent,t=s.text,n=s.link;case 12:if(this.target.attributes("href",n),t=""===t.trim()?n:t,l=this.target.text(),l===t){e.next=45;break}if(A=this.target.children(),!(A.length<3)){e.next=21;break}this.target.text(t),e.next=45;break;case 21:if(3!==A.length||!(null===(c=A.eq(1))||void 0===c?void 0:c.isText())){e.next=25;break}this.target.text(t),e.next=45;break;case 25:if(3!==A.length){e.next=44;break}u=A.eq(1);case 27:if(!u){e.next=42;break}if(h=u.children(),!(h.length>1||0===h.length)){e.next=34;break}return u.text(t),e.abrupt("break",42);case 34:if(!(null===(d=h.eq(0))||void 0===d?void 0:d.isText())){e.next=39;break}return u.text(t),e.abrupt("break",42);case 39:u=h;case 40:e.next=27;break;case 42:e.next=45;break;case 44:this.target.text(t);case 45:this.engine.inline.repairCursor(this.target),i.setStart(this.target.next(),1),i.setEnd(this.target.next(),1),r.apply(i),this.mouseInContainer=!1,this.hide();case 51:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()},{key:"editor",value:function(e,t,n){var r=this,i=(0,It.ri)(Dt,{language:this.engine.language,defaultText:e,defaultLink:t,onLoad:function(){r.mouseInContainer=!0,n&&n()},onOk:function(e,t){return r.onOk(e,t)}});return i}},{key:"preview",value:function(e,t){var n=this,r=this.engine,i=r.change,o=r.inline,a=r.language,s=(0,It.ri)(Ot,{language:a,href:e,readonly:this.engine.readonly,onLoad:function(){t&&t()},onEdit:function(){n.target&&(n.mouseInContainer=!1,n.hide(void 0,!1),n.show(n.target,!0))},onRemove:function(){if(n.target){var e=i.range.get();e.select(n.target,!0),o.repairRange(e),i.range.select(e),i.cacheRangeBeforeCommand(),o.unwrap(),n.mouseInContainer=!1,n.target=void 0,n.hide()}}});return s}},{key:"show",value:function(e,t){var n,r,i,o=this;if(!(null===(n=this.target)||void 0===n?void 0:n.equal(e))||!(null===(r=this.root)||void 0===r||null===(i=r.parent())||void 0===i?void 0:i.length)){this.target=e,this.create();var a,s=e.text().replace(/\u200B/g,""),l=e.attributes("href"),c=this.root.get(),A=l&&!t||this.engine.readonly?"am-link-preview":"am-link-editor";if(this.vm&&this.vm._component.name===A){var u,d;if(!this.root||!this.target)return;return null===(u=this.position)||void 0===u||u.destroy(),void(null===(d=this.position)||void 0===d||d.bind(this.root,this.target))}this.vm&&(this.vm.unmount(),this.vm=void 0,null===(a=this.position)||void 0===a||a.destroy()),setTimeout((function(){var e,n;null===(e=o.position)||void 0===e||e.destroy(),null===(n=o.position)||void 0===n||n.bind(o.root,o.target),o.vm=l&&!t||o.engine.readonly?o.preview(l,(function(){var e;null===(e=o.position)||void 0===e||e.update()})):o.editor(s,l,(function(){var e;null===(e=o.position)||void 0===e||e.update()})),o.vm.mount(c)}),20)}}},{key:"hide",value:function(e,t){var n;if(!(e&&this.target&&e.equal(this.target))){var r=null===(n=this.root)||void 0===n?void 0:n.get();if(r&&!this.mouseInContainer){var i;if(this.vm)this.vm.unmount(),this.vm=void 0,null===(i=this.position)||void 0===i||i.destroy();if(this.root=void 0,this.target&&!this.target.attributes("href")){var o=this.engine,a=o.change,s=o.inline,l=a.range.get();l.select(this.target,!0),s.unwrap(l),a.apply(l.collapse(!0))}!1!==t&&(this.target=void 0)}}}}]),e}(),Kt={link:{text:"Text",link:"Link",text_placeholder:"Description text",link_placeholder:"Link address",link_open:"Open link",link_edit:"Edit link",link_remove:"Remove link",ok_button:"OK"}},Wt={link:{text:"文本",link:"链接",text_placeholder:"描述文本",link_placeholder:"链接地址",link_open:"打开链接",link_edit:"编辑链接",link_remove:"移除链接",ok_button:"确定"}},jt={"en-US":Kt,"zh-CN":Wt};function Vt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Gt=".data-link-container {\r\n max-width: 398px;\r\n display: inline-block;\r\n border: 1px solid #E8E8E8;\r\n border-radius: 4px;\r\n box-shadow: rgba(221, 221, 221, 0.5) 0px 1px 3px;\r\n background: white;\r\n}\r\n\r\n.data-link-container-mobile {\r\n max-width: calc(100vw - 20px);;\r\n}\r\n\r\n.data-link-container .data-link-editor {\r\n min-width: 365px;\r\n padding: 16px 12px;\r\n padding-bottom: 4px;\r\n}\r\n\r\n.data-link-container-mobile .data-link-editor {\r\n min-width: calc(100vw - 40px);\r\n padding: 8px 6px;\r\n}\r\n\r\n.data-link-container p {\r\n margin-top: 0;\r\n margin-bottom: 14px;\r\n}\r\n\r\n.data-link-container .itellyou-icon {\r\n color: #8590A6;\r\n font-size: 16px;\r\n}\r\n.data-link-preview {\r\n line-height: 16px;\r\n padding: 6px 8px;\r\n vertical-align: middle;\r\n white-space: nowrap;\r\n display: flex;\r\n justify-content:space-between;\r\n}\r\n.data-link-preview > * {\r\n display: block;\r\n}\r\n\r\n.data-link-preview a {\r\n display: inline-block;\r\n color: #595959;\r\n margin: 0px 0px 0px 8px;\r\n padding: 4px;\r\n}\r\n.data-link-preview a:hover {\r\n background: #F4F4F4;\r\n cursor: pointer;\r\n}\r\n.data-link-preview a.data-link-preview-open {\r\n color: #1890FF;\r\n max-width: 292px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n text-decoration: none;\r\n font-size: 14px;\r\n letter-spacing: 1.2px;\r\n vertical-align: middle;\r\n margin: 0;\r\n}\r\n.data-link-container-mobile .data-link-preview a.data-link-preview-open {\r\n max-width: 70%;\r\n}\r\n.data-link-preview a.data-link-preview-open::before\r\n{\r\n vertical-align: middle;\r\n margin-right: 2px;\r\n}\r\n\r\n.data-link-preview a.data-link-preview-open:hover{\r\n background: transparent;\r\n}";Vt(Gt);var $t="paste:each",Yt="markdown-it",Xt="parse:html",Jt="select",en=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&!i.isCard()){var o,a,l=r.range.get();if(l.collapsed||i.contains(l.startNode)&&i.contains(l.endNode))return null===(o=e.toolbar)||void 0===o||o.show(i),!0;null===(a=e.toolbar)||void 0===a||a.hide()}return!1}},e.markdownIt=function(t){!1!==e.options.markdown&&(t.enable("link"),t.enable("linkify"))},e.pasteHtml=function(t){if(t.isText()){var n=t.text(),r=e.editor,i=r.node,o=r.inline;if(/^https?:\/\/\S+$/.test(n.toLowerCase().trim())&&o.closest(t).equal(t)){var a=i.wrap(t,(0,s.$)("<".concat(e.tagName,' target="_blank" href="').concat(decodeURI(n).trim().replace(/\u200b/g,""),'">')));return o.repairCursor(a),!1}}else if("a"===t.name){var l=t.attributes("href");t.attributes("target","_blank"),t.attributes("href",decodeURI(l).trim().replace(/\u200b/g,""))}return!0},e.parseHtml=function(t){t.find(e.tagName).css({"font-family":"monospace","font-size":"inherit","background-color":"rgba(0,0,0,.06)",padding:"0 2px",border:"1px solid rgba(0,0,0,.08)","border-radius":"2px 2px","line-height":"inherit","overflow-wrap":"break-word","text-indent":"0"})},e}return(0,i.Z)(n,[{key:"init",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this);var e=this.editor;(0,s.iC)(e)&&(!1!==this.options.enableToolbar&&(this.toolbar=new qt(e,{onConfirm:this.options.onConfirm})),e.container.on("click",this.handleClick),e.on(Yt,this.markdownIt),e.on($t,this.pasteHtml)),e.on(Xt,this.parseHtml),e.on(Jt,this.bindQuery),e.language.add(jt)}},{key:"hotkey",value:function(){return this.options.hotkey||{key:"mod+k",args:["_blank"]}}},{key:"execute",value:function(){var e=this,t=this.editor;if((0,s.iC)(t)){var n=t.inline,r=t.change;if(this.queryState()){var i=r.inlines.find((function(t){return e.isSelf(t)}));i&&i.length>0&&n.unwrap(i)}else{var o=(0,s.$)("<".concat(this.tagName," />"));this.setStyle.apply(this,[o].concat(Array.prototype.slice.call(arguments))),this.setAttributes.apply(this,[o].concat(Array.prototype.slice.call(arguments)));var a=arguments.length>2?arguments[2]:"";a?(o.text(a),n.insert(o)):n.wrap(o);var l,c=r.range.get();if(!c.collapsed&&r.inlines.length>0)null===(l=this.toolbar)||void 0===l||l.show(r.inlines[0])}}}},{key:"queryState",value:function(){return this.query()}},{key:"destroy",value:function(){var e=this.editor;e.container.off("click",this.handleClick),e.off($t,this.pasteHtml),e.off(Xt,this.parseHtml),e.off(Jt,this.bindQuery),e.off(Yt,this.markdownIt)}}],[{key:"pluginName",get:function(){return"link"}}]),n}(s.Cy),tn=en,nn=n(95082),rn=n(69767),on=n.n(rn),an=n(73738),sn=n.n(an),ln=n(44274),cn=(n(32515),n(67462),n(8365),n(16880),n(30029),n(44258),n(48314),n(69150),n(3341),n(18511),n(42797),n(62470),n(16107),n(59228),n(70189),n(36608),n(86788),n(152),n(14240),n(91909),n(89099),n(38722),n(4668),n(72989),n(33991),n(14040),n(84984),n(12492),n(70284),n(53810),n(43004),n(61804),n(37406),n(63348),["c","cpp","csharp","erlang","go","groovy","java","kotlin","makefile","objectivec","perl","python","rust","swift","vbnet"]),An={header:"color: blue;font-weight: bold;",quote:"color: #090;",negative:"color: #d44;",positive:"color: #292;",strong:"font-weight: bold;",em:"font-style: italic;",link:"text-decoration: underline;color: #00c;",strikethrough:"text-decoration: line-through;",keyword:"color: #d73a49;",atom:"color: #905;",number:"color: #005cc5;",def:"color: #005cc5;",variable:"","variable-2":"color: #005cc5;","variable-3":"color: #22863a;",type:"color: #22863a;",comment:"color: #6a737d;",string:"color: #690","string-2":"color: #690;",meta:"color: #1f7f9a;",qualifier:"color: #555;",builtin:"color: #6f42c1;",bracket:"color: #997;",tag:"color: #22863a;",attribute:"color: #6f42c1;",hr:"color: #999;",error:"color: #f00;",invalidchar:"color: #f00;",operator:"color: #d73a49;",property:"color: #005cc5;"},un=function(){function e(t,n){(0,r.Z)(this,e),this.editor=void 0,this.options=void 0,this.styleMap=void 0,this.codeMirror=void 0,this.mode="plain",this.container=void 0,this.editor=t,this.options=n,this.styleMap=(0,nn.Z)((0,nn.Z)({},An),n.styleMap),this.container=n.container||(0,s.$)(this.renderTemplate())}return(0,i.Z)(e,[{key:"renderTemplate",value:function(){return'
'}},{key:"getConfig",value:function(e,t){var n=this.codeMirror,r=this.editor,i=n?n.getOption("indentUnit"):cn.indexOf(t||"")>-1?4:2,o=e?e.match(/^ {2,4}(?=[^\s])/gm):null;return o&&(i=o.reduce((function(e,t){return Math.min(e,t.length)}),1/0)),{tabSize:i,indentUnit:i,scrollbarStyle:"simple",readOnly:!(0,s.iC)(r)||r.readonly,viewportMargin:1/0}}},{key:"getSyntax",value:function(e){return this.options.synatxMap[e]||e}},{key:"create",value:function(e,t,n){var r=this;this.mode=e;var i=this.getSyntax(e),o=on()(this.container.find(".data-codeblock-content").get(),(0,nn.Z)((0,nn.Z)({value:t,mode:i,lineNumbers:!0,lineWrapping:!1,autofocus:!1,dragDrop:!1},this.getConfig(t,i)),n));return o.on("focus",(function(){var e=r.options.onFocus;e&&e()})),o.on("blur",(function(){var e=r.options.onBlur;e&&e()})),s.tq?o.on("touchstart",(function(e,t){var n=r.options.onMouseDown;n&&n(t)})):o.on("mousedown",(function(e,t){var n=r.options.onMouseDown;2===t.button&&t.stopPropagation(),n&&n(t)})),o.on("change",sn()((function(){(0,s.iC)(r.editor)&&r.save()}),50)),o.setOption("extraKeys",{Enter:function(e){var t=r.getConfig(e.getValue());Object.keys(t).forEach((function(n){return e.setOption(n,t[n])})),e.execCommand("newlineAndIndent")}}),o.on("keydown",(function(e,t){((0,s.P6)("mod+z",t)||(0,s.P6)("mod+y",t)||(0,s.P6)("mod+shift+z",t))&&t.stopPropagation();var n=e.lineCount(),i=e.getCursor(),o=i.line,a=i.ch,l=r.options,c=l.onUpFocus,A=l.onDownFocus,u=l.onLeftFocus,d=l.onRightFocus,h=e.getLine(o);if(o===n-1&&a===h.length){if((0,s.P6)("down",t)||(0,s.P6)("ctrl+n",t))return void(A&&A(t));if((0,s.P6)("right",t)||(0,s.P6)("shift+right",t)||(0,s.P6)("ctrl+e",t)||(0,s.P6)("ctrl+f",t))return void(d&&d(t))}0===o&&0===a&&((0,s.P6)("up",t)||(0,s.P6)("ctrl+p",t)?c&&c(t):((0,s.P6)("left",t)||(0,s.P6)("shift+left",t)||(0,s.P6)("ctrl+b",t)||(0,s.P6)("ctrl+a",t))&&u&&u(t))})),this.container.on("mousedown",(function(e){(null===o||void 0===o?void 0:o.hasFocus())||setTimeout((function(){null===o||void 0===o||o.focus()}),0)})),this.codeMirror=o,this.codeMirror}},{key:"setAutoWrap",value:function(e){var t;null===(t=this.codeMirror)||void 0===t||t.setOption("lineWrapping",e)}},{key:"update",value:function(e,t){this.mode=e;var n=this.codeMirror,r=this.editor;void 0!==t&&(null===n||void 0===n||n.setValue(t)),null===n||void 0===n||n.setOption("mode",this.getSyntax(e)),null===n||void 0===n||n.setOption("readOnly",!((0,s.iC)(r)&&!r.readonly)),this.save()}},{key:"render",value:function(e,t,n){var r=this.container.find(".data-codeblock-content");e=this.getSyntax(e);var i=(0,s.$)('
');r.append(i);var o=i.find("pre")[0];this.runMode(t||"",e,o,(0,nn.Z)((0,nn.Z)({},this.getConfig(t,e)),n))}},{key:"save",value:function(){var e=this.codeMirror,t=this.editor;if((0,s.iC)(t)&&e&&!t.change.isComposing()){var n=e.getValue(),r=this.options.onSave;r&&r(this.mode,n)}}},{key:"focus",value:function(){var e=this.codeMirror;e&&e.focus()}},{key:"select",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.codeMirror;if(t)if(t.focus(),e)t.setSelection({line:0,ch:0});else{var n=t.lineCount()-1,r=t.getLine(n);t.setSelection({line:n,ch:r.length})}}},{key:"toHtml",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i=i||on().defaults.tabSize;for(var o="",a="",l=0;;){var c=t.indexOf("\t",l);if(-1===c){a+=t.slice(l),e+=t.length-l;break}e+=c-l,a+=t.slice(l,c);var A=i-e%i;e+=A;for(var u=0;u").concat((0,s.YU)(a),"");o+=h}else o+=a;return o}},{key:"runMode",value:function(e,t,n,r){var i=on().getMode(on().defaults,t),o=r&&r.tabSize||on().defaults.tabSize,a=n,s=0;a.innerHTML="";for(var l="",c=on().splitLines(e),A=r&&r.state||on().startState(i),u=0,d=c.length;u",s=0);var h=new(on().StringStream)(c[u]);!h.string&&i.blankLine&&i.blankLine(A);while(!h.eol()){var p=i.token?i.token(h,A):"";l+=this.toHtml(s,h.current(),p||"",o),h.start=h.pos}}a.innerHTML=l}},{key:"destroy",value:function(){this.container.remove()}}]),e}();const dn=ln.ZP.Option;var hn=(0,Ft.aZ)({name:"am-codeblock-select",components:{ASelect:ln.ZP,ASelectOption:dn},props:{modeDatas:Array,defaultValue:String,getContainer:Function,onSelect:Function},methods:{filter(e,t){e=e.toLowerCase();const n=t.key||"";let r=t.name||"";return r=r.toLowerCase(),n.includes(e)||r.includes(e)}}});function pn(e,t,n,r,i,o){const a=(0,Ft.up)("a-select-option"),s=(0,Ft.up)("a-select");return(0,Ft.wg)(),(0,Ft.j4)(s,{"show-search":!0,size:"small",bordered:!1,style:{"min-width":"128px"},"default-value":e.defaultValue,"get-popup-container":e.getContainer,onSelect:e.onSelect,"filter-option":e.filter},{default:(0,Ft.w5)((()=>[((0,Ft.wg)(!0),(0,Ft.iD)(Ft.HY,null,(0,Ft.Ko)(e.modeDatas,(e=>((0,Ft.wg)(),(0,Ft.j4)(a,{name:e.name,value:e.value,key:e.value},{default:(0,Ft.w5)((()=>[(0,Ft.Uk)((0,Mt.zw)(e.name),1)])),_:2},1032,["name","value"])))),128))])),_:1},8,["default-value","get-popup-container","onSelect","filter-option"])}hn.render=pn,hn.__file="src/component/select/component.vue";var fn=function(e,t,n,r){var i=(0,It.ri)(hn,{modeDatas:t,defaultValue:n,getContainer:e?function(){return e}:void 0,onSelect:r});return i.mount(e),i},gn=[{value:"plain",syntax:"simplemode",name:"Plain Text"},{value:"bash",syntax:"shell",name:"Bash"},{value:"basic",syntax:"vbscript",name:"Basic"},{value:"c",syntax:"text/x-csrc",name:"C"},{value:"cpp",syntax:"text/x-c++src",alias:["c++"],name:"C++"},{value:"csharp",syntax:"text/x-csharp",alias:["c#"],name:"C#"},{value:"css",syntax:"css",name:"CSS"},{value:"dart",syntax:"dart",name:"Dart"},{value:"diff",syntax:"diff",name:"Diff"},{value:"dockerfile",syntax:"dockerfile",name:"Dockerfile"},{value:"erlang",syntax:"erlang",name:"Erlang"},{value:"git",syntax:"shell",name:"Git"},{value:"go",syntax:"go",alias:["golang"],name:"Go"},{value:"graphql",syntax:"simplemode",name:"GraphQL"},{value:"groovy",syntax:"groovy",name:"Groovy"},{value:"html",syntax:"htmlmixed",name:"HTML",alias:["html5"]},{value:"http",syntax:"http",name:"HTTP"},{value:"java",syntax:"text/x-java",name:"Java"},{value:"javascript",syntax:"text/javascript",name:"JavaScript",alias:["js"]},{value:"json",syntax:"application/json",name:"JSON"},{value:"jsx",syntax:"jsx",name:"JSX"},{value:"katex",syntax:"simplemode",name:"KaTeX"},{value:"kotlin",syntax:"text/x-kotlin",name:"Kotlin"},{value:"less",syntax:"css",name:"Less"},{value:"makefile",syntax:"cmake",name:"Makefile"},{value:"markdown",syntax:"markdown",name:"Markdown"},{value:"matlab",syntax:"octave",name:"MATLAB"},{value:"nginx",syntax:"nginx",name:"Nginx"},{value:"objectivec",syntax:"text/x-objectivec",name:"Objective-C"},{value:"pascal",syntax:"pascal",name:"Pascal"},{value:"perl",syntax:"perl",name:"Perl"},{value:"php",syntax:"php",name:"PHP"},{value:"powershell",syntax:"powershell",name:"PowerShell"},{value:"protobuf",syntax:"protobuf",name:"Protobuf"},{value:"python",syntax:"python",name:"Python",alias:["py"]},{value:"r",syntax:"r",name:"R"},{value:"ruby",syntax:"ruby",name:"Ruby"},{value:"rust",syntax:"rust",name:"Rust"},{value:"scala",syntax:"text/x-scala",name:"Scala"},{value:"shell",syntax:"shell",name:"Shell"},{value:"sql",syntax:"text/x-sql",name:"SQL"},{value:"swift",syntax:"swift",name:"Swift"},{value:"typescript",syntax:"text/typescript",name:"TypeScript",alias:["ts"]},{value:"vbnet",syntax:"vb",name:"VB.net"},{value:"velocity",syntax:"velocity",name:"Velocity"},{value:"xml",syntax:"xml",name:"XML"},{value:"yaml",syntax:"yaml",name:"YAML"}];function mn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var vn=".data-codeblock-container {\r\n position: relative;\r\n padding: 0;\r\n overflow: visible;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 2px 2px;\r\n text-indent: 0;\r\n }\r\n \r\n .data-codeblock-container .am-embed-toolbar-item {\r\n float: right;\r\n line-height: 32px;\r\n }\r\n \r\n .data-codeblock-content {\r\n background: #f9f9f9;\r\n overflow: auto;\r\n }\r\n \r\n .am-engine .CodeMirror,\r\n .am-engine-view .CodeMirror {\r\n font-family: monospace;\r\n font-size: 13px;\r\n line-height: 21px;\r\n color: #595959;\r\n direction: ltr;\r\n height: auto;\r\n overflow: hidden;\r\n background: transparent;\r\n }\r\n \r\n .am-engine .CodeMirror-lines,\r\n .am-engine-view .CodeMirror-lines {\r\n padding: 8px 0;\r\n }\r\n \r\n .am-engine .CodeMirror-scrollbar-filler,\r\n .am-engine-view .CodeMirror-scrollbar-filler,\r\n .am-engine .CodeMirror-gutter-filler,\r\n .am-engine-view .CodeMirror-gutter-filler {\r\n background-color: white;\r\n \r\n /* The little square between H and V scrollbars */\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutters,\r\n .am-engine-view .CodeMirror-gutters {\r\n border: 0;\r\n white-space: nowrap;\r\n padding: 0 8px;\r\n background-color: unset;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-linenumber,\r\n .am-engine-view .CodeMirror-linenumber {\r\n padding: 0;\r\n min-width: 20px;\r\n text-align: right;\r\n color: #BFBFBF;\r\n white-space: nowrap;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-guttermarker,\r\n .am-engine-view .CodeMirror-guttermarker {\r\n color: black;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-guttermarker-subtle,\r\n .am-engine-view .CodeMirror-guttermarker-subtle {\r\n color: #999;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-cursor,\r\n .am-engine-view .CodeMirror-cursor {\r\n border-left: 1px solid black;\r\n border-right: none;\r\n width: 0;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror div.CodeMirror-secondarycursor,\r\n .am-engine-view .CodeMirror div.CodeMirror-secondarycursor {\r\n border-left: 1px solid silver;\r\n \r\n }\r\n \r\n .am-engine .cm-fat-cursor .CodeMirror-cursor,\r\n .am-engine-view .cm-fat-cursor .CodeMirror-cursor {\r\n width: auto;\r\n border: 0 !important;\r\n background: #7e7;\r\n \r\n }\r\n \r\n .am-engine .cm-fat-cursor div.CodeMirror-cursors,\r\n .am-engine-view .cm-fat-cursor div.CodeMirror-cursors {\r\n z-index: 1;\r\n \r\n }\r\n \r\n .am-engine .cm-fat-cursor-mark,\r\n .am-engine-view .cm-fat-cursor-mark {\r\n background-color: rgba(20, 255, 20, 0.5);\r\n -webkit-animation: blink 1.06s steps(1) infinite;\r\n animation: blink 1.06s steps(1) infinite;\r\n \r\n }\r\n \r\n .am-engine .cm-animate-fat-cursor,\r\n .am-engine-view .cm-animate-fat-cursor {\r\n width: auto;\r\n border: 0;\r\n -webkit-animation: blink 1.06s steps(1) infinite;\r\n animation: blink 1.06s steps(1) infinite;\r\n background-color: #7e7;\r\n \r\n }\r\n \r\n @-webkit-keyframes blink {\r\n 50% {\r\n background-color: transparent;\r\n \r\n }\r\n \r\n \r\n }\r\n \r\n @keyframes blink {\r\n 50% {\r\n background-color: transparent;\r\n \r\n }\r\n \r\n \r\n }\r\n \r\n .am-engine .cm-tab,\r\n .am-engine-view .cm-tab {\r\n display: inline-block;\r\n text-decoration: inherit;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-rulers,\r\n .am-engine-view .CodeMirror-rulers {\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: -50px;\r\n bottom: -20px;\r\n overflow: hidden;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-ruler,\r\n .am-engine-view .CodeMirror-ruler {\r\n border-left: 1px solid #ccc;\r\n top: 0;\r\n bottom: 0;\r\n position: absolute;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-header,\r\n .am-engine-view .cm-s-default .cm-header {\r\n color: blue;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-quote,\r\n .am-engine-view .cm-s-default .cm-quote {\r\n color: #090;\r\n \r\n }\r\n \r\n .am-engine .cm-negative,\r\n .am-engine-view .cm-negative {\r\n color: #d44;\r\n \r\n }\r\n \r\n .am-engine .cm-positive,\r\n .am-engine-view .cm-positive {\r\n color: #292;\r\n \r\n }\r\n \r\n .am-engine .cm-header,\r\n .am-engine-view .cm-header,\r\n .am-engine .cm-strong,\r\n .am-engine-view .cm-strong {\r\n font-weight: bold;\r\n \r\n }\r\n \r\n .am-engine .cm-em,\r\n .am-engine-view .cm-em {\r\n font-style: italic;\r\n \r\n }\r\n \r\n .am-engine .cm-link,\r\n .am-engine-view .cm-link {\r\n text-decoration: underline;\r\n \r\n }\r\n \r\n .am-engine .cm-strikethrough,\r\n .am-engine-view .cm-strikethrough {\r\n text-decoration: line-through;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-keyword,\r\n .am-engine-view .cm-s-default .cm-keyword {\r\n color: #d73a49;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-atom,\r\n .am-engine-view .cm-s-default .cm-atom {\r\n color: #905;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-number,\r\n .am-engine-view .cm-s-default .cm-number {\r\n color: #005cc5;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-def,\r\n .am-engine-view .cm-s-default .cm-def {\r\n color: #005cc5;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-variable-2,\r\n .am-engine-view .cm-s-default .cm-variable-2 {\r\n color: #005cc5;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-variable-3,\r\n .am-engine-view .cm-s-default .cm-variable-3,\r\n .am-engine .cm-s-default .cm-type,\r\n .am-engine-view .cm-s-default .cm-type {\r\n color: #22863a;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-comment,\r\n .am-engine-view .cm-s-default .cm-comment {\r\n color: #6a737d;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-string,\r\n .am-engine-view .cm-s-default .cm-string {\r\n color: #690;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-string-2,\r\n .am-engine-view .cm-s-default .cm-string-2 {\r\n color: #690;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-meta,\r\n .am-engine-view .cm-s-default .cm-meta {\r\n color: #1f7f9a;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-qualifier,\r\n .am-engine-view .cm-s-default .cm-qualifier {\r\n color: #555;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-builtin,\r\n .am-engine-view .cm-s-default .cm-builtin {\r\n color: #6f42c1;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-bracket,\r\n .am-engine-view .cm-s-default .cm-bracket {\r\n color: #997;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-tag,\r\n .am-engine-view .cm-s-default .cm-tag {\r\n color: #22863a;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-attribute,\r\n .am-engine-view .cm-s-default .cm-attribute {\r\n color: #6f42c1;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-hr,\r\n .am-engine-view .cm-s-default .cm-hr {\r\n color: #999;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-link,\r\n .am-engine-view .cm-s-default .cm-link {\r\n color: #00c;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-error,\r\n .am-engine-view .cm-s-default .cm-error {\r\n color: #f00;\r\n \r\n }\r\n \r\n .am-engine .cm-invalidchar,\r\n .am-engine-view .cm-invalidchar {\r\n color: #f00;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-operator,\r\n .am-engine-view .cm-s-default .cm-operator {\r\n color: #d73a49;\r\n \r\n }\r\n \r\n .am-engine .cm-s-default .cm-property,\r\n .am-engine-view .cm-s-default .cm-property {\r\n color: #005cc5;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-composing,\r\n .am-engine-view .CodeMirror-composing {\r\n border-bottom: 2px solid;\r\n \r\n }\r\n \r\n .am-engine div.CodeMirror span.CodeMirror-matchingbracket,\r\n .am-engine-view div.CodeMirror span.CodeMirror-matchingbracket {\r\n color: #0b0;\r\n \r\n }\r\n \r\n .am-engine div.CodeMirror span.CodeMirror-nonmatchingbracket,\r\n .am-engine-view div.CodeMirror span.CodeMirror-nonmatchingbracket {\r\n color: #a22;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-matchingtag,\r\n .am-engine-view .CodeMirror-matchingtag {\r\n background: rgba(255, 150, 0, 0.3);\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-activeline-background,\r\n .am-engine-view .CodeMirror-activeline-background {\r\n background: transparent;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-scroll,\r\n .am-engine-view .CodeMirror-scroll {\r\n overflow: scroll !important;\r\n \r\n /* Things will break if this is overridden */\r\n \r\n /* 30px is the magic margin used to hide the element's real scrollbars */\r\n \r\n /* See overflow: hidden in .CodeMirror */\r\n margin-bottom: -50px;\r\n margin-right: -50px;\r\n padding-bottom: 50px;\r\n outline: none;\r\n \r\n /* Prevent dragging from highlighting the element */\r\n position: relative;\r\n z-index: 0;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-sizer,\r\n .am-engine-view .CodeMirror-sizer {\r\n position: relative;\r\n border-right: 50px solid transparent;\r\n min-height: auto !important;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-vscrollbar,\r\n .am-engine-view .CodeMirror-vscrollbar,\r\n .am-engine .CodeMirror-hscrollbar,\r\n .am-engine-view .CodeMirror-hscrollbar,\r\n .am-engine .CodeMirror-scrollbar-filler,\r\n .am-engine-view .CodeMirror-scrollbar-filler,\r\n .am-engine .CodeMirror-gutter-filler,\r\n .am-engine-view .CodeMirror-gutter-filler {\r\n position: absolute;\r\n z-index: 6;\r\n display: none;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-vscrollbar,\r\n .am-engine-view .CodeMirror-vscrollbar {\r\n right: 0;\r\n top: 0;\r\n overflow-x: hidden;\r\n overflow-y: scroll;\r\n display: none;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-hscrollbar,\r\n .am-engine-view .CodeMirror-hscrollbar {\r\n bottom: 0;\r\n left: 0;\r\n overflow-y: hidden;\r\n overflow-x: scroll;\r\n display: none;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-scrollbar-filler,\r\n .am-engine-view .CodeMirror-scrollbar-filler {\r\n right: 0;\r\n bottom: 0;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-filler,\r\n .am-engine-view .CodeMirror-gutter-filler {\r\n left: 0;\r\n bottom: 0;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutters,\r\n .am-engine-view .CodeMirror-gutters {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n min-height: 100%;\r\n background: #f9f9f9;\r\n z-index: 3;\r\n }\r\n \r\n .am-engine .CodeMirror-gutter,\r\n .am-engine-view .CodeMirror-gutter {\r\n white-space: normal;\r\n height: 100%;\r\n display: inline-block;\r\n vertical-align: top;\r\n margin-bottom: -30px;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-wrapper,\r\n .am-engine-view .CodeMirror-gutter-wrapper {\r\n position: absolute;\r\n z-index: 4;\r\n background: none !important;\r\n border: none !important;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-background,\r\n .am-engine-view .CodeMirror-gutter-background {\r\n position: absolute;\r\n top: 0;\r\n bottom: 0;\r\n z-index: 4;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-elt,\r\n .am-engine-view .CodeMirror-gutter-elt {\r\n position: absolute;\r\n cursor: default;\r\n z-index: 4;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-wrapper ::-moz-selection,\r\n .am-engine-view .CodeMirror-gutter-wrapper ::-moz-selection {\r\n background-color: transparent;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-wrapper ::selection,\r\n .am-engine-view .CodeMirror-gutter-wrapper ::selection {\r\n background-color: transparent;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-gutter-wrapper ::-moz-selection,\r\n .am-engine-view .CodeMirror-gutter-wrapper ::-moz-selection {\r\n background-color: transparent;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-lines,\r\n .am-engine-view .CodeMirror-lines {\r\n cursor: text;\r\n min-height: 40px;\r\n \r\n /* prevents collapsing before first draw */\r\n \r\n }\r\n \r\n .am-engine .CodeMirror pre,\r\n .am-engine-view .CodeMirror pre {\r\n \r\n /* Reset some styles that the rest of the page might have set */\r\n border-radius: 0;\r\n border-width: 0;\r\n background: transparent;\r\n font-family: inherit;\r\n font-size: inherit;\r\n margin: 0;\r\n white-space: pre;\r\n word-wrap: normal;\r\n line-height: inherit;\r\n color: inherit;\r\n z-index: 2;\r\n position: relative;\r\n overflow: visible;\r\n -webkit-tap-highlight-color: transparent;\r\n font-variant-ligatures: contextual;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-wrap pre,\r\n .am-engine-view .CodeMirror-wrap pre {\r\n word-wrap: break-word;\r\n white-space: pre-wrap;\r\n word-break: normal;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-linebackground,\r\n .am-engine-view .CodeMirror-linebackground {\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n bottom: 0;\r\n z-index: 0;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-linewidget,\r\n .am-engine-view .CodeMirror-linewidget {\r\n position: relative;\r\n z-index: 2;\r\n padding: 0.1px;\r\n \r\n /* Force widget margins to stay inside of the container */\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-rtl pre,\r\n .am-engine-view .CodeMirror-rtl pre {\r\n direction: rtl;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-code,\r\n .am-engine-view .CodeMirror-code {\r\n outline: none;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-scroll,\r\n .am-engine-view .CodeMirror-scroll,\r\n .am-engine .CodeMirror-sizer,\r\n .am-engine-view .CodeMirror-sizer,\r\n .am-engine .CodeMirror-gutter,\r\n .am-engine-view .CodeMirror-gutter,\r\n .am-engine .CodeMirror-gutters,\r\n .am-engine-view .CodeMirror-gutters,\r\n .am-engine .CodeMirror-linenumber,\r\n .am-engine-view .CodeMirror-linenumber {\r\n box-sizing: content-box;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-simplescroll-horizontal, .am-engine-view .CodeMirror-simplescroll-horizontal {\r\n bottom: 4px;\r\n cursor: pointer;\r\n }\r\n \r\n .am-engine .CodeMirror-measure,\r\n .am-engine-view .CodeMirror-measure {\r\n position: absolute;\r\n width: 100%;\r\n height: 0;\r\n overflow: hidden;\r\n visibility: hidden;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-cursor,\r\n .am-engine-view .CodeMirror-cursor {\r\n position: absolute;\r\n pointer-events: none;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-measure pre,\r\n .am-engine-view .CodeMirror-measure pre {\r\n position: static;\r\n \r\n }\r\n \r\n .am-engine div.CodeMirror-cursors,\r\n .am-engine-view div.CodeMirror-cursors {\r\n visibility: hidden;\r\n position: relative;\r\n z-index: 3;\r\n \r\n }\r\n \r\n .am-engine div.CodeMirror-dragcursors,\r\n .am-engine-view div.CodeMirror-dragcursors {\r\n visibility: visible;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-focused div.CodeMirror-cursors,\r\n .am-engine-view .CodeMirror-focused div.CodeMirror-cursors {\r\n visibility: visible;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-selected,\r\n .am-engine-view .CodeMirror-selected {\r\n background: #e8e8e8;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-focused .CodeMirror-selected,\r\n .am-engine-view .CodeMirror-focused .CodeMirror-selected {\r\n background: #b3d7fd;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-crosshair,\r\n .am-engine-view .CodeMirror-crosshair {\r\n cursor: crosshair;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-line::-moz-selection,\r\n .am-engine-view .CodeMirror-line::-moz-selection,\r\n .am-engine .CodeMirror-line>span::-moz-selection,\r\n .am-engine-view .CodeMirror-line>span::-moz-selection,\r\n .am-engine .CodeMirror-line>span>span::-moz-selection,\r\n .am-engine-view .CodeMirror-line>span>span::-moz-selection {\r\n background: #b3d7fd;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-line::selection,\r\n .am-engine-view .CodeMirror-line::selection,\r\n .am-engine .CodeMirror-line>span::selection,\r\n .am-engine-view .CodeMirror-line>span::selection,\r\n .am-engine .CodeMirror-line>span>span::selection,\r\n .am-engine-view .CodeMirror-line>span>span::selection {\r\n background: #b3d7fd;\r\n \r\n }\r\n \r\n .am-engine .CodeMirror-line::-moz-selection,\r\n .am-engine-view .CodeMirror-line::-moz-selection,\r\n .am-engine .CodeMirror-line>span::-moz-selection,\r\n .am-engine-view .CodeMirror-line>span::-moz-selection,\r\n .am-engine .CodeMirror-line>span>span::-moz-selection,\r\n .am-engine-view .CodeMirror-line>span>span::-moz-selection {\r\n background: #b3d7fd;\r\n \r\n }\r\n \r\n .am-engine .cm-searching,\r\n .am-engine-view .cm-searching {\r\n background-color: #ffa;\r\n background-color: rgba(255, 255, 0, 0.4);\r\n \r\n }\r\n \r\n .am-engine .cm-force-border,\r\n .am-engine-view .cm-force-border {\r\n padding-right: 0.1px;\r\n \r\n }\r\n \r\n @media print {\r\n \r\n /* .am-engine,\r\n .am-engine-view { */\r\n \r\n /* Hide the cursor when printing */\r\n \r\n /* } */\r\n \r\n .am-engine .CodeMirror div.CodeMirror-cursors,\r\n .am-engine-view .CodeMirror div.CodeMirror-cursors {\r\n visibility: hidden;\r\n \r\n }\r\n \r\n \r\n }\r\n \r\n .am-engine .cm-tab-wrap-hack:after,\r\n .am-engine-view .cm-tab-wrap-hack:after {\r\n content: '';\r\n \r\n }\r\n \r\n .am-engine span.CodeMirror-selectedtext,\r\n .am-engine-view span.CodeMirror-selectedtext {\r\n background: none;\r\n \r\n }\r\n \r\n .am-engine-view .data-codeblock-container {\r\n margin: 5px 0;\r\n \r\n }\r\n \r\n .am-content-editor .am-engine .data-codeblock-container .CodeMirror-lines {\r\n min-height: 40px;\r\n }";mn(vn);var bn=(0,F.Z)("modeNameMap"),yn=(0,F.Z)("modeSynatxMap"),wn=(0,F.Z)("viewAutoWrap"),xn=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a"),didMount:function(e){setTimeout((function(){fn(e.get(),t.constructor.getModes(),(0,S.Z)(t,bn)[bn][t.codeEditor.mode]||t.codeEditor.mode||"plain",(function(e){setTimeout((function(){t.focusEditor(),t.codeEditor&&(0,Tt.IU)(t.codeEditor).update(e)}),100)}))}),100)}},{key:"autoWrap",type:"switch",content:r.language.get(n.cardName,"autoWrap"),getState:function(){var e;return!!(null===(e=t.getValue())||void 0===e?void 0:e.autoWrap)},onClick:function(){var e,n=t.getValue(),r=!(null===n||void 0===n?void 0:n.autoWrap);t.setValue({autoWrap:r}),null===(e=t.codeEditor)||void 0===e||e.setAutoWrap(r)}}]},o=null===(e=r.plugin.findPlugin("codeblock"))||void 0===e?void 0:e.options;return(null===o||void 0===o?void 0:o.cardToolbars)?o.cardToolbars(i(),this.editor):i()}},{key:"focusEditor",value:function(){var e;null===(e=this.codeEditor)||void 0===e||e.focus(),this.editor.card.activate(this.root)}},{key:"onSelectLeft",value:function(e){var t;this.codeEditor&&(e.preventDefault(),this.codeEditor.select(!1),this.activate(!0),null===(t=this.toolbarModel)||void 0===t||t.show())}},{key:"onSelectRight",value:function(e){var t;this.codeEditor&&(e.preventDefault(),this.codeEditor.select(!0),this.activate(!0),null===(t=this.toolbarModel)||void 0===t||t.show())}},{key:"onSelectDown",value:function(e){var t;this.codeEditor&&(e.preventDefault(),this.codeEditor.select(!0),this.activate(!0),null===(t=this.toolbarModel)||void 0===t||t.show())}},{key:"onSelectUp",value:function(e){var t;this.codeEditor&&(e.preventDefault(),this.codeEditor.select(!1),this.activate(!0),null===(t=this.toolbarModel)||void 0===t||t.show())}},{key:"render",value:function(){if(this.codeEditor){this.codeEditor.container.inEditor()||(this.codeEditor.container=(0,s.$)(this.codeEditor.renderTemplate()),this.mirror=void 0,this.getCenter().empty().append(this.codeEditor.container));var e=this.getValue(),t=(null===e||void 0===e?void 0:e.mode)||"plain",n=(null===e||void 0===e?void 0:e.code)||"";if((0,s.iC)(this.editor)){var r;if(this.mirror)return this.codeEditor.update(t,n),void this.codeEditor.setAutoWrap(!!(null===e||void 0===e?void 0:e.autoWrap));this.mirror=null===(r=this.codeEditor)||void 0===r?void 0:r.create(t,n,{lineWrapping:!!(null===e||void 0===e?void 0:e.autoWrap)})}else{var i;null===(i=this.codeEditor)||void 0===i||i.create(t,n,{lineWrapping:!!(null===e||void 0===e?void 0:e.autoWrap)})}}}}],[{key:"cardName",get:function(){return"codeblock"}},{key:"cardType",get:function(){return s.eT.BLOCK}},{key:"autoSelected",get:function(){return!1}},{key:"singleSelectable",get:function(){return!1}},{key:"getModes",value:function(){return gn}},{key:"lazyRender",get:function(){return!0}}]),n}(s.Zb),kn={codeblock:{autoWrap:"Auto Wrap"}},Cn={codeblock:{autoWrap:"自动换行"}},Bn={"en-US":kn,"zh-CN":Cn},_n="data-syntax",En="parse:html",Sn="paste:schema",Fn="paste:each",Tn="markdown-it",Mn=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&(i=a.attributes(_n)||a.attributes("language"),i||(i=o(a)))}var l=new s._b(t,r).toText(void 0,void 0,!1);return l=(0,s.AK)(l.replace(/\u200b/g,"")),l.endsWith("\n")&&(l=l.slice(0,-1)),r.card.replaceNode(t,"codeblock",{mode:i||"plain",code:l,autoWrap:"true"===t.attributes("auto-wrap")}),t.remove(),!1}return!0}},e.parseHtml=function(t,n){var r=e.editor,i=[],o={};xn.getModes().forEach((function(e){o[e.value]=e.syntax}));var a=new un(r,{synatxMap:o,styleMap:e.options.styleMap}),l="data-codeblock-content",c=a.container.find(".".concat(l));return c.css({border:"1px solid #e8e8e8",padding:"8px"}),c.addClass(s.S),c.css("background","#f9f9f9"),t.find("[".concat(s.Jr,'="').concat(xn.cardName,'"],[').concat(s.mV,'="').concat(xn.cardName,'"]')).each((function(e){var t=(0,s.$)(e),o=r.card.find(t),A=(null===o||void 0===o?void 0:o.getValue())||(0,s.RW)(t.attributes(s.TM));if(A){t.empty(),c.empty(),a.render(A.mode||"plain",A.code||"");var u=c.clone(!0);t.append(u),t.removeAttributes(s.Jr),t.removeAttributes(s.W9),t.removeAttributes(s.TM),t.attributes(_n,A.mode||"plain"),t.attributes("auto-wrap",A.autoWrap?"true":"false"),u.removeClass(s.S).removeClass(l);var d=t;n&&(d=n(t,A),t.replaceWith(d)),i.push(d)}else t.remove()})),a.destroy(),i},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.language.add(Bn),e.on(En,this.parseHtml),e.on(Sn,this.pasteSchema),e.on(Fn,this.pasteHtml),(0,s.iC)(e)&&e.on(Tn,this.markdownIt)}},{key:"execute",value:function(e,t){var n=this.editor;if((0,s.iC)(n)){var r=n.card;if(!t){var i=n.getSelectionData();i&&(t=i.text)}var o=r.insert(xn.cardName,{mode:e,code:t});setTimeout((function(){o.focusEditor()}),200)}}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"destroy",value:function(){var e=this.editor;e.off(En,this.parseHtml),e.off(Sn,this.pasteSchema),e.off(Fn,this.pasteHtml),(0,s.iC)(e)&&e.off(Tn,this.markdownIt)}}],[{key:"pluginName",get:function(){return"codeblock"}}]),n}(s.Sy),In=Mn,Nn=(n(82801),n(1439),n(87585),n(55315),n(40255)),Un=n.n(Nn),Ln=n(82718),Qn=n(76711),Dn=n.n(Qn),Hn=n(77209),On=n.n(Hn);class zn{constructor(e,t){(0,Fe.Z)(this,"pswp",void 0),(0,Fe.Z)(this,"editor",void 0),(0,Fe.Z)(this,"prevStatus","default"),(0,Fe.Z)(this,"nextStatus","default"),(0,Fe.Z)(this,"zoomInStatus","default"),(0,Fe.Z)(this,"zoomOutStatus","default"),(0,Fe.Z)(this,"originSizeStatus","default"),(0,Fe.Z)(this,"bestSizeStatus","default"),this.editor=e,this.pswp=t}init(){this.pswp.on("afterzoom",(()=>{this.afterZoom()})),this.pswp.on("afterchange",(()=>{this.afterChange()})),this.pswp.on("resize",(()=>{setTimeout((()=>{this.afterChange(),this.afterZoom()}),333)})),this.render()}renderTemplate(){const e=(0,s.$)('\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n '),t=e.find(".pswp-toolbar-content"),n=this.editor.language.get("image");return t.append(this.renderBtn("arrow-left",n["prev"],this.prevStatus,(()=>{"disable"!==this.prevStatus&&this.pswp.prev()}))),t.append(''),t.append(this.renderBtn("arrow-right",n["next"],this.nextStatus,(()=>{"disable"!==this.nextStatus&&this.pswp.next()}))),t.append(''),t.append(this.renderBtn("zoom-in",n["zoomIn"],this.zoomInStatus,(()=>{"disable"!==this.zoomInStatus&&this.pswp.zoomIn()}))),t.append(this.renderBtn("zoom-out",n["zoomOut"],this.zoomOutStatus,(()=>{"disable"!==this.zoomOutStatus&&this.pswp.zoomOut()}))),t.append(this.renderBtn("origin-size",n["originSize"],this.originSizeStatus,(()=>{"disable"!==this.originSizeStatus&&this.pswp.zoomToOriginSize()}))),t.append(this.renderBtn("best-size",n["bestSize"],this.bestSizeStatus,(()=>{"disable"!==this.bestSizeStatus&&this.pswp.zoomToBestSize()}))),e}afterZoom(){const e=this.pswp.getCurrentZoomLevel(),t=this.pswp.getInitialZoomLevel();let n="default";e===t&&(n="activated"),1===t&&(n="disable"),this.zoomOutStatus=.05===e?"disable":"default",this.zoomInStatus=5===e?"disable":"default",this.originSizeStatus=1===e?"activated":"default",this.bestSizeStatus=n,this.render()}afterChange(){const e=this.pswp.getCount();this.nextStatus=1===e?"disable":"default",this.prevStatus=1===e?"disable":"default",this.render()}renderBtn(e,t,n,r){const i=(0,s.$)(``);return i.on("mouseenter",(()=>{s.u.show(i,t)})),i.on("mouseleave",(()=>{s.u.hide()})),i.on("mousedown",(e=>{e.stopPropagation(),s.u.hide()})),i.on("click",r),i}render(){this.pswp.barUI.empty(),this.pswp.barUI.append(this.renderTemplate())}}var Zn=zn;class Rn extends Ln.EventEmitter2{constructor(e,t){super(),(0,Fe.Z)(this,"editor",void 0),(0,Fe.Z)(this,"options",void 0),(0,Fe.Z)(this,"timeouts",[]),(0,Fe.Z)(this,"pswpUI",void 0),(0,Fe.Z)(this,"zoom",void 0),(0,Fe.Z)(this,"isDestroy",!0),(0,Fe.Z)(this,"zoomUI",void 0),(0,Fe.Z)(this,"root",void 0),(0,Fe.Z)(this,"barUI",void 0),(0,Fe.Z)(this,"closeUI",void 0),(0,Fe.Z)(this,"reset",(()=>{this.root.removeClass(s.tq?"data-pswp-mobile":"data-pswp-pc"),this.root.addClass(s.tq?"data-pswp-mobile":"data-pswp-pc"),this.unbindKeyboardEvnet(),this.unbindControllerFadeInAndOut(),s.tq||(this.bindKeyboardEvnet(),this.bindControllerFadeInAndOut())})),(0,Fe.Z)(this,"onBarMouseEnter",(()=>{this.removeFadeOut(this.barUI,"barFadeInAndOut"),this.removeFadeOut(this.closeUI,"closeFadeInAndOut")})),(0,Fe.Z)(this,"onBarMouseLeave",(()=>{this.fadeOut(this.barUI,"barFadeInAndOut"),this.fadeOut(this.closeUI,"closeFadeInAndOut")})),(0,Fe.Z)(this,"onCloseMouseEnter",(()=>{this.removeFadeOut(this.barUI,"barFadeInAndOut"),this.removeFadeOut(this.closeUI,"closeFadeInAndOut")})),(0,Fe.Z)(this,"onCloseMouseLeave",(()=>{this.fadeOut(this.barUI,"barFadeInAndOut"),this.fadeOut(this.closeUI,"closeFadeInAndOut")})),(0,Fe.Z)(this,"onKeyboardEvent",(e=>{(e.metaKey||e.ctrlKey)&&187===e.keyCode&&(e.preventDefault(),this.zoomIn()),(0,s.P6)("mod+-",e)&&(e.preventDefault(),this.zoomOut())})),(0,Fe.Z)(this,"close",(()=>{this.pswpUI?.close()})),this.editor=e,this.options={shareEl:!1,fullscreenEl:!1,zoomEl:!1,history:!1,closeOnScroll:!1,preloaderEl:!1,captionEl:!1,counterEl:!1,clickToCloseNonZoomable:!1,showAnimationDuration:0,hideAnimationDuration:0,closeOnVerticalDrag:s.tq,tapToClose:!0,bgOpacity:.8,barsSize:{top:44,bottom:80},...t},this.isDestroy=!0,this.root=this.renderTemplate(),this.barUI=this.root.find(".data-pswp-custom-top-bar"),this.closeUI=this.root.find(".data-pswp-button-close"),(0,s.$)(document.body).append(this.root),this.zoomUI=new Zn(e,this),this.zoomUI.render(),this.reset(),this.bindClickEvent(),window.addEventListener("resize",this.reset)}renderTemplate(){const e=(0,s.$)('\n\t\t\t');return e}bindControllerFadeInAndOut(){this.barUI.on("mouseenter",this.onBarMouseEnter),this.barUI.on("mouseleave",this.onBarMouseLeave),this.closeUI.on("mouseenter",this.onCloseMouseEnter),this.closeUI.on("mouseleave",this.onCloseMouseLeave)}unbindControllerFadeInAndOut(){this.barUI.off("mouseenter",this.onBarMouseEnter),this.barUI.off("mouseleave",this.onBarMouseLeave),this.closeUI.off("mouseenter",this.onCloseMouseEnter),this.closeUI.off("mouseleave",this.onCloseMouseLeave)}removeFadeOut(e,t){this.timeouts[t]&&clearTimeout(this.timeouts[t]),e.removeClass("pswp-fade-out")}fadeOut(e,t){this.timeouts[t]&&clearTimeout(this.timeouts[t]),this.timeouts[t]=setTimeout((()=>{e.addClass("pswp-fade-out")}),3e3)}bindClickEvent(){const e=e=>{const t=window.TouchEvent&&e instanceof TouchEvent?(0,s.$)(e.touches[0].target):(0,s.$)(e.target||[]);t.hasClass("pswp__img")&&setTimeout((()=>{this.zoom=void 0,this.afterZoom()}),366),(t.hasClass("pswp__bg")||t.hasClass("data-pswp-tool-bar"))&&this.close()};this.root.on("click",e,{passive:!0}),this.closeUI.on("click",this.close)}prev(){this.pswpUI?.prev()}next(){this.pswpUI?.next()}renderCounter(){this.barUI.find(".data-pswp-counter").html(`${(this.pswpUI?.getCurrentIndex()||0)+1} / ${this.pswpUI?.items.length||""}`)}getCurrentZoomLevel(){return this.zoom&&+this.zoom.toFixed(2)||this.pswpUI&&+this.pswpUI.getZoomLevel().toFixed(2)||0}zoomTo(e){this.pswpUI&&(this.pswpUI.zoomTo(e,{x:this.pswpUI.viewportSize.x/2,y:this.pswpUI.viewportSize.y/2},100),this.zoom=e,this.afterZoom())}zoomIn(){const e=this.getCurrentZoomLevel();let t=(e||0)+.2;5!==e&&(t>5&&(t=5),this.zoomTo(t))}zoomOut(){const e=this.getCurrentZoomLevel();if(.05!==e&&void 0!==e){let t=e-.2;.05>t&&(t=.05),this.zoomTo(t)}}bindKeyboardEvnet(){this.root.on("keydown",this.onKeyboardEvent)}unbindKeyboardEvnet(){this.root.off("keydown",this.onKeyboardEvent)}zoomToOriginSize(){this.zoomTo(1)}zoomToBestSize(){const e=this.getInitialZoomLevel();e&&this.zoomTo(e)}updateCursor(){const{root:e}=this,t=this.getCurrentZoomLevel(),n=this.getInitialZoomLevel();1===t?e.addClass("pswp--zoomed-in"):n===n&&e.removeClass("pswp--zoomed-in")}getInitialZoomLevel(){return this.pswpUI?+(this.pswpUI.currItem.initialZoomLevel?.toFixed(2)||0):0}afterZoom(){this.updateCursor(),this.emit("afterzoom")}getCount(){return this.pswpUI?.items.length||0}afterChange(){if(!s.tq){const e=this.getInitialZoomLevel();this.renderCounter(),this.zoom=e,setTimeout((()=>{this.afterZoom()}),100),this.emit("afterchange"),this.zoom=this.getInitialZoomLevel()}this.setWhiteBackground()}bindPswpEvent(){this.pswpUI?.listen("afterChange",(()=>{this.afterChange()})),this.pswpUI?.listen("destroy",(()=>{this.isDestroy=!0})),this.pswpUI?.listen("resize",(()=>{this.emit("resize")})),this.pswpUI?.listen("imageLoadComplete",(()=>{this.setWhiteBackground()}))}setWhiteBackground(){this.root.find(".pswp__img").each((e=>{const t=e;t.complete?(t.style.background="white",t.style["boxShadow"]="0 0 10px rgba(0, 0, 0, 0.5)"):t.onload=()=>{t.style.background="white",t.style["boxShadow"]="0 0 10px rgba(0, 0, 0, 0.5)"}}))}open(e,t){if(!0===this.isDestroy){const{root:n}=this,r=new(Dn())(this.root.get(),On(),e,{index:t,...this.options});r.items=e,r.init(),this.pswpUI=r,this.isDestroy=!1,s.tq||(this.barUI.removeClass("pswp-fade-out"),this.fadeOut(this.barUI,"barFadeInAndOut"),this.closeUI.removeClass("pswp-fade-out"),this.fadeOut(this.closeUI,"closeFadeInAndOut")),n.removeClass("pswp-fade-in"),n.addClass("pswp-fade-in"),this.afterChange(),this.bindPswpEvent()}}destroy(){window.removeEventListener("resize",this.reset),this.close()}}var Pn=Rn;const qn=window.devicePixelRatio;let Kn;class Wn{constructor(e,t){(0,Fe.Z)(this,"editor",void 0),(0,Fe.Z)(this,"options",void 0),(0,Fe.Z)(this,"root",void 0),(0,Fe.Z)(this,"progress",void 0),(0,Fe.Z)(this,"image",void 0),(0,Fe.Z)(this,"detail",void 0),(0,Fe.Z)(this,"meta",void 0),(0,Fe.Z)(this,"maximize",void 0),(0,Fe.Z)(this,"bg",void 0),(0,Fe.Z)(this,"resizer",void 0),(0,Fe.Z)(this,"pswp",void 0),(0,Fe.Z)(this,"src",void 0),(0,Fe.Z)(this,"status",void 0),(0,Fe.Z)(this,"size",void 0),(0,Fe.Z)(this,"maxWidth",void 0),(0,Fe.Z)(this,"maxHeight",void 0),(0,Fe.Z)(this,"rate",1),(0,Fe.Z)(this,"isLoad",!1),(0,Fe.Z)(this,"message",void 0),(0,Fe.Z)(this,"cropper",void 0),(0,Fe.Z)(this,"onWindowResize",(()=>{if(!(0,s.iC)(this.editor))return;this.maxWidth=this.getMaxWidth(),this.resetSize();const e=this.image.get();if(!e)return;const{clientWidth:t,clientHeight:n}=e;this.resizer&&(this.resizer.maxWidth=this.maxWidth,this.resizer.setSize(t,n))})),(0,Fe.Z)(this,"getSrc",(()=>{const{onBeforeRender:e}=this.options;return e&&"error"!==this.status?e(this.status,this.src,this.editor):this.src})),(0,Fe.Z)(this,"openZoom",(e=>{e.preventDefault(),e.stopPropagation();const t=this.editor,n=[],r=t.card.closest(this.root);let i=0;t.container.find('[data-card-key="image"]').toArray().filter((e=>e.find("img").length>0)).forEach(((e,o)=>{const a=t.card.find(e),s=a?.getValue();if(!a||!s)return;const l=a.getCenter().find("img"),c=parseInt(l.css("width")),A=parseInt(l.css("height")),u=s.size,d=u?u.naturalWidth||this.size.naturalWidth:c*qn,h=u?u.naturalHeight||this.size.naturalHeight:A*qn;let p=s["src"];const{onBeforeRender:f}=this.options;f&&(p=f("done",p,this.editor));const g=l.attributes("src");n.push({src:p,msrc:g,w:d,h:h}),r?.equal(e)&&(i=o)})),this.pswp.open(n,i)})),(0,Fe.Z)(this,"focus",(()=>{(0,s.iC)(this.editor)&&(this.root.addClass("data-image-active"),"done"===this.status&&(this.destroyEditor(),this.renderEditor()))})),(0,Fe.Z)(this,"blur",(()=>{(0,s.iC)(this.editor)&&(this.root.removeClass("data-image-active"),"done"===this.status&&(this.destroyEditor(),this.cropImageSave()))})),this.editor=e,this.options=t,this.src=this.options.src,this.size=this.options.size||{width:0,height:0,naturalHeight:0,naturalWidth:0},this.maxHeight=this.options.maxHeight,this.status=this.options.status,this.root=(0,s.$)(this.renderTemplate()),this.progress=this.root.find(".data-image-progress"),this.image=this.root.find("img"),this.detail=this.root.find(".data-image-detail"),this.meta=this.root.find(".data-image-meta"),this.maximize=this.root.find(".data-image-maximize"),this.bg=this.root.find(".data-image-bg"),this.maxWidth=this.getMaxWidth(),this.pswp=Kn||new Pn(e),this.message=this.options.message,Kn=this.pswp}renderTemplate(e){const{link:t,percent:n,className:r,onBeforeRender:i}=this.options;if("error"===this.status)return`\n\t\t\t\t\n\t\t\t\t${e||this.options.message}\n\t\t\t\t\n\t\t\t`;const o=i?i(this.status,this.options.src,this.editor):this.options.src,a=`\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t${n||0}%\n\t\t\t\t\t\t\t\t\t\t\t`,l=(0,s.YU)(this.options.alt||""),c=l?` alt="${l}" title="${l}" `:"";let A=``;if(t&&!(0,s.iC)(this.editor)){const e=t.target||"_blank";A=`${A}`}const u='';return`\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${A}\n\t\t\t\t\t\t\t${a}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t${u}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`}bindErrorEvent(e){const t=this.editor,n=e.find(".data-icon-copy");n.on("mouseenter",(()=>{s.u.show(n,t.language.get("image","errorMessageCopy").toString())})),n.on("mouseleave",(()=>{s.u.hide()})),n.on("click",(e=>{e.stopPropagation(),e.preventDefault(),s.u.hide(),t.clipboard.copy(this.message||this.options.message||"Error message"),t.messageSuccess("copy",t.language.get("copy","success").toString())}))}setProgressPercent(e){this.progress.find(".percent").html(`${e}%`)}imageLoadCallback(){const e=this.editor,t=e.card.closest(this.root);if(!t||"uploading"===this.status)return;if("done"===this.status){const e=this.root.find(".data-image-content");e.addClass("data-image-loaded"),e.removeClass("data-image-loading")}const n=this.image.get();if(!n)return;const{naturalWidth:r,naturalHeight:i}=n;this.rate=i/r,this.size.naturalWidth=r,this.size.naturalHeight=i,this.size.width||(this.size.width=r),this.size.height||(this.size.height=i),this.resetSize(),this.image.css("visibility","visible"),this.detail.css("height",""),this.detail.css("width","");const{onChange:o}=this.options;(0,s.iC)(e)&&o&&o(this.size,!0),window.removeEventListener("resize",this.onWindowResize),window.addEventListener("resize",this.onWindowResize),e.off("editor:resize",this.onWindowResize),e.on("editor:resize",this.onWindowResize),this.resizer&&this.resizer.setSize(n.clientWidth,n.clientHeight),this.isLoad=!0,this.options.onLoad&&this.options.onLoad()}imageLoadError(){if("uploading"===this.status)return;this.status="error";const{container:e}=this.options;e.empty(),e.append(this.renderTemplate(this.editor.language.get("image","loadError").toString())),this.detail.css("width",""),this.detail.css("height",""),this.bindErrorEvent(e);const{onError:t}=this.options;t&&t(),this.isLoad=!0}getMaxWidth(e=this.options.root){const t=this.editor.block.closest(e).get();return t?t.clientWidth-6:0}resetSize(){this.meta.css({"background-color":"",width:""}),this.image.css({width:""});const e=this.image.get();if(!e)return;let{width:t,height:n}=this.size;if(n)if(t)if(t&&n)n=Math.round(this.rate*t),this.size.height=n;else{const{clientWidth:r,clientHeight:i}=e;t=r,n=i;const{naturalWidth:o,naturalHeight:a}=this.size;this.isSvg()&&o&&a&&(t=o,n=a)}else t=Math.round(n/this.rate);else n=Math.round(this.rate*t);t>this.maxWidth&&(t=this.maxWidth,n=Math.round(t*this.rate)),!1===this.options.enableResizer?this.image.css("width",""):this.image.css("width",`${t}px`)}changeSize(e,t){e<24&&(e=24,t=e*this.rate),e>this.maxWidth&&(e=this.maxWidth,t=e*this.rate),t<24&&(t=24,e=t/this.rate),e=Math.round(e),t=Math.round(t),this.size.width=e,this.size.height=t,this.image.css({width:`${e}px`});const{onChange:n}=this.options;n&&n(this.size),this.destroyEditor(),this.renderEditor()}changeUrl(e){this.src!==e&&(this.src=e,this.isLoad=!1,this.image.attributes("src",this.getSrc()))}isSvg(){return this.src.split("?")[0].endsWith(".svg")||this.src.startsWith("data:image/svg+xml")}closeZoom(){this.pswp?.close()}cropImage(){"done"===this.status&&this.destroyEditor();const e=this.image.get();this.cropper=new(Un())(e,{autoCropArea:1})}async cropImageSave(){if(this.cropper){const e=this.cropper.getCroppedCanvas(),t=e?.toDataURL(),n=this.dataURIToFile(t),r=(0,s.Ym)(n),i=r?"image.".concat(r):"image",o=new globalThis.File([n],i,{type:"image/jpeg"});o.uid=(new Date).getTime()+"-"+(0,s.ZU)();const a=await this.uploadImage([o]),{onChangeSrc:l}=this.options;this.changeUrl(a),l&&l(a),this.size.naturalWidth=e?.width,this.size.naturalHeight=e?.height;const{width:c,height:A}=this.cropper?.getCropBoxData();this.changeSize(c,A),this.cropper.destroy(),this.cropper=void 0}}async rotateImage(){console.log("rotateImage",this.editor);const e=document.createElement("canvas");e.width=this.size.naturalHeight,e.height=this.size.naturalWidth;const t=e.getContext("2d");t?.save(),t?.fillRect(0,0,e.width,e.height),t?.rotate(90*Math.PI/180);const n=this.image.get();t?.drawImage(n,0,-e.width);const r=e.toDataURL("image/png"),i=this.dataURIToFile(r),o=(0,s.Ym)(i),a=o?"image.".concat(o):"image",l=new globalThis.File([i],a,{type:"image/jpeg"});l.uid=(new Date).getTime()+"-"+(0,s.ZU)();const c=await this.uploadImage([l]),{onChangeSrc:A}=this.options;this.changeUrl(c),A&&A(c);const u={width:this.size.height,height:this.size.width,naturalWidth:this.size.naturalHeight,naturalHeight:this.size.naturalWidth};this.size.naturalWidth=u.naturalWidth,this.size.naturalHeight=u.naturalHeight,this.changeSize(u.width,u.height)}dataURIToFile(e){let t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);const n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(let i=0;it.upload({url:i,crossOrigin:o,headers:a,onSuccess:(e,t)=>{const r=s(e);return n(r.data)},onError:(e,t)=>r(e)},e,"file")))}renderEditor(){const e=this.image.get();if(!e)return;const{clientWidth:t,clientHeight:n}=e;if(!t||!n)return;const r=this.editor;if(this.maxWidth=this.getMaxWidth(),this.rate=n/t,s.tq||!(0,s.iC)(r)||r.readonly)return;if(!1===this.options.enableResizer)return;const i=new s.w_({imgUrl:this.getSrc(),width:t,height:n,rate:this.rate,maxWidth:this.maxWidth,onChange:({width:e,height:t})=>this.changeSize(e,t)}),o=i.render();this.root.find(".data-image-detail").append(o),this.resizer=i,this.resizer.on("dblclick",this.openZoom)}destroyEditor(){this.resizer?.off("dblclick",this.openZoom),this.resizer?.destroy()}destroy(){window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize),this.destroyEditor(),this.image.off("click",this.openZoom),this.image.off("dblclick",this.openZoom),this.maximize.off("click",this.openZoom)}render(e){const{container:t,display:n,enableResizer:r}=this.options;n===s.eT.BLOCK&&this.root.addClass("data-image-blcok");const i=this.editor;if(!1===r&&this.root.addClass("data-image-disable-resize"),"error"===this.status&&(0,s.iC)(i))return this.root=(0,s.$)(this.renderTemplate(this.message||i.language.get("image","uploadError"))),this.bindErrorEvent(this.root),t.empty().append(this.root),void this.progress.remove();if("uploading"===this.status?(this.progress.show(),t.empty().append(this.root)):this.progress.remove(),"done"===this.status&&this.isLoad){const e=this.root.find(".data-image-content");e.addClass("data-image-loaded"),e.removeClass("data-image-loading")}"done"!==this.status||this.isLoad||this.root.inEditor()||t.empty().append(this.root),this.maxWidth=this.getMaxWidth();let{width:o,height:a}=this.size;if(o&&a||!this.src){if(o>this.maxWidth?(o=this.maxWidth,a=Math.round(o*a/this.size.width)):this.src||o||a||(o=this.maxWidth,a=this.maxWidth/2),this.src){!1===this.options.enableResizer?this.image.css({width:"100%"}):this.image.css({width:o+"px"});const{onChange:e}=this.options;o>0&&a>0&&(this.size={...this.size,width:o,height:a},e&&e(this.size))}!1===this.options.enableResizer?this.bg.css({width:"100%"}):this.bg.css({width:o+"px",height:a+"px"}),e&&this.bg.css("background-image",`url(${e})`)}if(this.image.on("load",(()=>this.imageLoadCallback())),this.image.on("error",(()=>this.imageLoadError())),s.tq||(this.root.on("mouseenter",(()=>{this.maximize.show()})),this.root.on("mouseleave",(()=>{this.maximize.hide()}))),!(0,s.iC)(i)||i.readonly){const e=this.image.closest("a");0===e.length&&this.image.on("click",this.openZoom)}this.maximize.on("click",this.openZoom),!(0,s.iC)(i)&&this.root.inEditor()||this.image.on("dblclick",this.openZoom)}}var jn=Wn;class Vn extends s.Zb{constructor(...e){super(...e),(0,Fe.Z)(this,"image",void 0),(0,Fe.Z)(this,"widthInput",void 0),(0,Fe.Z)(this,"heightInput",void 0),(0,Fe.Z)(this,"isLocalError",void 0)}static get cardName(){return"image"}static get cardType(){return s.eT.INLINE}static get collab(){return!1}setProgressPercent(e){this.image?.setProgressPercent(e),this.setValue({percent:e})}setSize(e,t){if(!e.width||!e.height)return;const n=this.getValue();t&&n.size&&n.size.height&&n.size.width&&n.size.naturalWidth&&n.size.naturalHeight||this.setValue({size:e}),this.widthInput&&(this.widthInput.get().value=e.width.toString()),this.heightInput&&(this.heightInput.get().value=e.height.toString())}onInputChange(e,t){const n=this.getValue();"string"===typeof e&&(!/^[1-9]+(\d+)?$/.test(e)&&this.widthInput&&(e=n?.size?.width||n?.size?.naturalWidth||0,this.widthInput.get().value=e.toString()),e=parseInt(e.toString(),10)),"string"===typeof t&&(!/^[1-9]+(\d+)?$/.test(t)&&this.heightInput&&(t=n?.size?.height||n?.size?.naturalHeight||0,this.heightInput.get().value=t.toString()),t=parseInt(t.toString(),10)),this.image?.changeSize(parseInt(e.toString(),10),t)}toolbar(){const e=this.editor,t=()=>{if(!(0,s.iC)(e)||e.readonly)return[];const{language:t}=e;let n=this.getValue();if(!0===this.isLocalError||"done"!==n?.status)return[{key:"delete",type:"delete"}];const r=[{key:"copy",type:"copy"},{key:"delete",type:"delete"}];if(s.tq)return r;const i=[{key:"button",type:"button",content:'',title:"旋转",onClick:()=>{this.image?.rotateImage()}}],o=[{key:"button",type:"button",content:'',title:"裁剪",onClick:()=>{this.image?.cropImage()}}],a=[{key:"width",type:"input",placeholder:t.get("image","toolbbarWidthTitle").toString(),prefix:"宽:",value:n?.size?.width||0,didMount:e=>{this.widthInput=e.find("input[type=input]")},onChange:e=>{const t=Math.round(parseInt(e,10)*(this.image?.rate||1));this.onInputChange(e,t)}},{key:"height",type:"input",placeholder:t.get("image","toolbbarHeightTitle").toString(),prefix:"高:",value:n?.size?.height||0,didMount:e=>{this.heightInput=e.find("input[type=input]")},onChange:e=>{const t=Math.round(parseInt(e,10)/(this.image?.rate||1));this.onInputChange(t,e)}},{key:"resize",type:"button",content:'',title:t.get("image","toolbarReductionTitle"),onClick:()=>{n=this.getValue(),this.onInputChange(n?.size?.naturalWidth||0,n?.size?.naturalHeight||0)}}],l=[{key:"block",type:"button",content:'',title:t.get("image","displayBlockTitle"),onClick:()=>{this.type=s.eT.BLOCK}},{key:"inline",type:"button",content:'',title:t.get("image","displayInlineTitle"),onClick:()=>{this.type=s.eT.INLINE}}],c=e.plugin.findPlugin("image");return r.concat([...!1===c?.options?.enableRotate?[]:i,...!1===c?.options?.enableCropper?[]:o,...!1===c?.options?.enableResizer?[]:a,...!1===c?.options?.enableTypeSwitch?[]:l])},n=e.plugin.findPlugin("image")?.options;return n?.cardToolbars?n.cardToolbars(t(),this.editor):t()}onActivate(e){super.onActivate(e),e&&!this.selectedByOther?this.image?.focus():this.image?.blur()}onSelectByOther(e,t){this.image?.root?.css("outline",e?"2px solid "+t.color:"");const n="card-selected-other";return e?this.root.addClass(n):this.root.removeClass(n),this.image?.root}writeHistoryOnValueChange(){if(this.loading)return!1}render(e){const t=this.getValue();if(!t)return;const n=this.editor;if(this.image&&0!==this.image.root.length)this.image.changeUrl(t.src),this.image.status=t.status||"done",this.image.message=t.message,this.image.size.width=t.size?.width||0,this.image.size.height=t.size?.height||0,t.percent&&this.image.setProgressPercent(t.percent),this.image.resizer?.destroy();else{const e=n.plugin.findPlugin("image");this.image=new jn(n,{root:this.root,container:this.getCenter(),status:t.status||"done",src:t.src,size:t.size,alt:t.alt,link:t.link,display:this.type,percent:t.percent,message:t.message,enableResizer:e?.options?.enableResizer,onBeforeRender:(e,t)=>{const r=n.plugin.findPlugin("image");if(r){const{onBeforeRender:n}=r.options||{};if(n)return n(e,t,this.editor)}return t},onChangeSrc:e=>{if((0,s.iC)(n)&&!n.readonly&&e){const t=this.getValue();console.log("value",t),this.setValue({...t,src:e})}},onChange:(e,t)=>{(0,s.iC)(n)&&!n.readonly&&e&&this.setSize(e,t)},onError:()=>{this.isLocalError=!0,this.didUpdate()},onLoad:()=>{if(this.image?.size&&(!t.size?.naturalHeight||!t.size?.naturalWidth)){const{naturalHeight:e,naturalWidth:n}=this.image.size;this.setSize({...t.size,naturalHeight:e,naturalWidth:n},!0)}this.activated&&this.image?.focus()},maxHeight:e?.options?.maxHeight})}this.image.render(e)}didUpdate(){super.didUpdate(),this.toolbarModel?.getContainer()?.remove(),this.toolbarModel?.create(),this.toolbarModel?.setDefaultAlign("top")}didRender(){const e=this.getValue();"done"===e.status&&super.didRender(),this.toolbarModel?.setDefaultAlign("top")}}var Gn=Vn;const $n="drop:files",Yn="paste:event",Xn="paste:schema",Jn="paste:each",er="paste:after",tr="markdown-it";var nr=class extends s.Sy{constructor(...e){super(...e),(0,Fe.Z)(this,"cardComponents",{}),(0,Fe.Z)(this,"loadCounts",{}),(0,Fe.Z)(this,"extensionNames",{svg:"image/svg+xml",png:"image/png",bmp:"image/bmp",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tif:"image/tiff",tiff:"image/tiff",emf:"image/emf",webp:"image/webp"}),(0,Fe.Z)(this,"dropFiles",(e=>{const t=this.editor;if((0,s.iC)(t)&&(e=e.filter((e=>this.isImage(e))),0!==e.length))return t.command.execute("image-uploader",e),!1})),(0,Fe.Z)(this,"pasteSchema",(e=>{e.add({type:"inline",name:"img",isVoid:!0,attributes:{src:{required:!0,value:"@url"},width:"@number",height:"@number",style:{"max-width":"@length","max-height":"@length",width:"@length",height:"@length"},alt:"*",title:"*","data-type":"*","data-size":"@number","data-width":"@number","data-height":"@number"}})})),(0,Fe.Z)(this,"pasteFiles",(({files:e})=>{const t=this.editor;if((0,s.iC)(t)&&(e=e.filter((e=>this.isImage(e))),0!==e.length))return t.command.execute("image-uploader",e),!1})),(0,Fe.Z)(this,"pasteEach",(e=>{const t=this.editor,{isRemote:n}=this.options;if(e.isCard()&&e.attributes(s.mV)){if("image"!==e.attributes(s.mV))return;const r=(0,s.RW)(e.attributes(s.TM));return r&&r.src?void(n&&n(r.src)?(r.status="uploading",r.percent=0,t.card.replaceNode(e,"image",r)):"uploading"===r.status&&(r.percent=0,e.attributes(s.TM,(0,s.it)({...r,status:"done"})))):void e.remove()}if("img"===e.name){const r=e.attributes(),i=r["src"]||r["data-src"],o=r["alt"];if(!i)return void e.remove();const a=t.plugin.findPlugin("image"),l=r["width"],c=r["height"],A=l||e.css("width"),u=c||e.css("height"),d=r["data-type"]||a?.options.defaultType;let h=s.eT.INLINE;if("block"===d){const n=e.parent();n&&"p"===n.name&&t.node.unwrap(n),h=s.eT.BLOCK}t.card.replaceNode(e,"image",{type:h,src:i,status:n&&n(i)||/^data:image\//i.test(i)?"uploading":"done",alt:o,percent:0,size:{width:(0,s.ZQ)(A),height:(0,s.ZQ)(u)}}),e.remove()}})),(0,Fe.Z)(this,"pasteAfter",(()=>{const e=this.editor;e.container.find("[data-card-key=image]").each(((t,n)=>{const r=e.card.find(t);if(!r||!(0,s.iC)(e))return;const i=r.getValue();if("uploading"!==i?.status||Object.keys(this.cardComponents).find((e=>this.cardComponents[e].id===r.id)))return;const{src:o}=i;if(/^data:image\//i.test(o)){const t=this.dataURIToFile(o),n=(0,s.Ym)(t),i=n?"image.".concat(n):"image",a=new globalThis.File([t],i);return a.uid=(new Date).getTime()+"-"+(0,s.ZU)(),e.command.execute("image-uploader",[a]),void(this.cardComponents[a.uid]=r)}const{isRemote:a}=this.options;a&&a(o)&&this.uploadAddress(o,r)}))})),(0,Fe.Z)(this,"markdownIt",(e=>{!1!==this.options.markdown&&(e.enable("image"),e.enable("reference"))}))}static get pluginName(){return"image-uploader"}init(){const e=this.editor;(0,s.iC)(this.editor)&&(e.on($n,this.dropFiles),e.on(Yn,this.pasteFiles),e.on(Xn,this.pasteSchema),e.on(Jn,this.pasteEach),e.on(er,this.pasteAfter),e.on(tr,this.markdownIt));let{accept:t}=this.options.file||{};if("string"===typeof t&&(t=t.split(",")),Array.isArray(t)){const e=[];(t||[]).forEach((t=>{t=t.trim();const n=t.split(".").pop();n&&e.push(n)})),e.length>0&&(this.extensionNames=e)}else"object"===typeof t&&(this.extensionNames=t)}isImage(e){const t=(0,s.Ym)(e),n=Array.isArray(this.extensionNames)?this.extensionNames:Object.keys(this.extensionNames);return n.indexOf("*")>=0||n.indexOf(t)>=0}dataURIToFile(e){let t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);const n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(let i=0;i{delete this.loadCounts[e],r.card.update(e,t)},n.onerror=()=>{this.loadCounts[e]<=3?setTimeout((()=>{this.loadCounts[e]++,this.loadImage(e,t)}),500):(delete this.loadCounts[e],t.status="error",t.message=r.language.get("image","loadError"),r.card.update(e,t))}}async execute(e){const t=this.editor;if(!(0,s.iC)(t))return;const{request:n,card:r,language:i}=t,{action:o,data:a,type:l,contentType:c,multiple:A,crossOrigin:u,withCredentials:d,headers:h,name:p}=this.options.file,{parse:f}=this.options,g=this.options.file.limitSize||5242880;if(Array.isArray(e)||"string"===typeof e){if("string"===typeof e)return void this.insertRemote(e)}else{const t=Array.isArray(this.extensionNames)?"."+this.extensionNames.join(",."):Object.values(this.extensionNames).join(",");e=await n.getFiles({event:e,accept:s.Dt?"image/*":t.length>0?t:"",multiple:A})}0!==e.length&&n.upload({url:o,crossOrigin:u,withCredentials:d,headers:h,data:a,type:l,contentType:c,onBefore:e=>!(e.size>g)||(t.messageError("upload-limit",i.get("image","uploadLimitError").toString().replace("$size",(g/1024/1024).toFixed(0)+"M")),!1),onReady:e=>{if(!(0,s.iC)(t)||this.cardComponents[e.uid])return;const n=e.src||"",i="string"!==typeof n?window.btoa(String.fromCharCode(...new Uint8Array(n))):n,o=n=>{const o=t.plugin.findPlugin("image"),a=r.insert("image",{...n,status:"uploading",type:n.type||o?.options?.defaultType},i);this.cardComponents[e.uid]=a};return new Promise((e=>{const n=new Image;n.src=i;const r=t.plugin.findPlugin("image");n.onload=()=>{const{naturalWidth:t,naturalHeight:i,height:a,width:s}=n;let l=s,c=a;const A=r?.options?.maxHeight;A&&i>t&&a>A&&(c=A,l=t*(A/i)),o({src:"",size:{width:l,height:c,naturalHeight:n.naturalHeight,naturalWidth:n.naturalWidth}}),e()},n.onerror=()=>{o({src:"",status:"error"}),e()}}))},onUploading:(e,{percent:t})=>{const n=this.cardComponents[e.uid||""];n&&n.setProgressPercent(t)},onSuccess:(e,t)=>{const n=this.cardComponents[t.uid||""];if(!n)return;let o=e.url||e.data&&e.data.url||e.src||e.data&&e.data.src;const a=f?f(e):o?{result:!0,data:o}:{result:!1};a.result?o=a.data:r.update(n.id,{status:"error",message:a.data||i.get("image","uploadError")});const s={status:"done"};o&&(s.src=o,this.loadImage(n.id,s)),delete this.cardComponents[t.uid||""]},onError:(e,t)=>{const n=this.cardComponents[t.uid||""];n&&(r.update(n.id,{status:"error",message:e.message||i.get("image","uploadError")}),delete this.cardComponents[t.uid||""])}},e,p)}async uploadAddress(e,t){const n=this.editor;if(!(0,s.iC)(n))return;const{action:r,type:i,contentType:o,crossOrigin:a,withCredentials:l,headers:c,name:A,data:u}=this.options.remote,{parse:d}=this.options,h=A||"url";n.request.ajax({url:r,method:"POST",contentType:o||"application/json",type:void 0===i?"json":i,crossOrigin:a,withCredentials:l,headers:c,data:"function"===typeof u?async()=>{const t=await u();return{...t,[h]:e}}:{...u,[h]:e},success:e=>{let r=e.url||e.data&&e.data.url||e.src||e.data&&e.data.src;const i=d?d(e):r?{result:!0,data:r}:{result:!1};i.result?r=i.data:n.card.update(t.id,{status:"error",message:i.data||n.language.get("image","uploadError")});const o={status:"done"};r&&(o.src=r,this.loadImage(t.id,o))},error:e=>{n.card.update(t.id,{status:"error",message:e.message||n.language.get("image","uploadError")})}})}insertRemote(e,t){const n=this.editor,r=n.plugin.findPlugin("image"),i={src:e,alt:t,status:"uploading",type:r?.options.defaultType||s.eT.INLINE},{isRemote:o}=this.options;if(o&&o(e)){const t=n.card.insert("image",i);this.uploadAddress(e,t)}else i.status="done",n.card.insert("image",i)}destroy(){const e=this.editor;(0,s.iC)(e)&&(e.off($n,this.dropFiles),e.off(Yn,this.pasteFiles),e.off(Xn,this.pasteSchema),e.off(Jn,this.pasteEach),e.off(er,this.pasteAfter),e.off(tr,this.markdownIt))}},rr={image:{next:"Next",prev:"Previous",zoomIn:"Zoom In",zoomOut:"Zoom Out",originSize:"Origin Size",bestSize:"Best Size",errorMessageCopy:"Copy error message",loadError:"The picture failed to load!",uploadError:"The picture failed to upload!",uploadLimitError:"Upload image size is limited to $size",toolbarReductionTitle:"Reduction size",toolbarWidthTitle:"Width",toolbarHeightTitle:"Height",displayBlockTitle:"Block",displayInlineTitle:"In line"}},ir={image:{next:"下一张",prev:"上一张",zoomIn:"放大",zoomOut:"缩小",originSize:"实际尺寸",bestSize:"适应屏幕",errorMessageCopy:"复制错误信息",loadError:"图片加载失败!",uploadError:"上传图片失败!",uploadLimitError:"上传图片大小限制为 $size",toolbarReductionTitle:"还原",toolbarWidthTitle:"宽度",toolbarHeightTitle:"宽度",displayBlockTitle:"独占一行",displayInlineTitle:"嵌入行内"}},or={"en-US":rr,"zh-CN":ir};const ar="parse:html";var sr=class extends s.Sy{constructor(...e){super(...e),(0,Fe.Z)(this,"parseHtml",((e,t)=>{const n=[],r=this.editor;return e.find(`[${s.Jr}="${Gn.cardName}"],[${s.mV}="${Gn.cardName}"]`).each((e=>{const i=(0,s.$)(e),o=r.card.find(i),a=o?.getValue()||(0,s.RW)(i.attributes(s.TM));if(a?.src&&"done"===a.status){const e=i.find(".data-image-meta img");let o=e.length>0?e.clone(!0):(0,s.$)("");i.empty();let l=a.src;const{onBeforeRender:c}=this.options;c&&(l=c(a.status,a.src,this.editor));const A=i.attributes(s.W9);o.attributes("src",l),o.css("visibility","visible");const u=a.size;u?.width&&o.css("width",`${u.width}px`),u?.height&&o.css("height",`${u.height}px`),o.removeAttributes("class"),o.attributes("data-type",A),t&&(o=t(o,a)),A===s.eT.BLOCK&&(o=r.node.wrap(o,(0,s.$)('

'))),i.replaceWith(o),n.push(o)}else i.remove()})),n}))}static get pluginName(){return"image"}init(){const e=this.editor;e.language.add(or),e.on(ar,this.parseHtml)}execute(e,t,n){const r={status:e,src:t,alt:n};"error"===e&&(r.src="",r.message=t),this.editor.card.insert("image",r)}async waiting(e){const{card:t}=this.editor,n=e=>e.root.inEditor()&&e.name===Gn.cardName&&"uploading"===e.getValue()?.status,r=()=>t.components.find(n),i=t=>{let r=6e4;return new Promise(((i,o)=>{if(e){const n=e(this.constructor.pluginName,t);if(!1===n)return o({name:this.constructor.pluginName,card:t});"number"===typeof n&&(r=n)}const a=(new Date).getTime(),s=(new Date).getTime(),l=()=>{if(s-a>=r)return i();setTimeout((()=>{n(t)?l():i()}),10)};l()}))};return new Promise(((e,t)=>{const n=r(),o=n=>{i(n).then((()=>{const t=r();t?o(t):e()})).catch(t)};n?o(n):e()}))}destroy(){this.editor.off(ar,this.parseHtml)}},lr=n(88478),cr=n(77898),Ar=n.n(cr),ur=n(66046),dr="table-wrapper",hr="table-overflow",pr="data-table",fr="table-cols-header",gr="table-cols-header-item",mr="cols-trigger",vr="cols-addition-header",br="table-rows-header",yr="table-rows-header-item",wr="rows-trigger",xr="table-header",kr="table-menubar",Cr="table-menubar-item",Br="table-menubar-item-input",_r="table-viewport",Er="data-table-reader",Sr="table-placeholder",Fr="multi-addition",Tr="table-highlight",Mr="table-row-delete-button",Ir="table-col-delete-button",Nr="table-row-add-button",Ur="table-row-add-split-button",Lr="table-col-add-button",Qr="table-col-add-split-button",Dr="table-main-content",Hr="table-main-bg",Or=function(){function e(t){(0,r.Z)(this,e),this.isReadonly=!1,this.table=void 0,this.table=t}return(0,i.Z)(e,[{key:"getEmptyCell",value:function(){return e.EmptyCell(this.isReadonly)}},{key:"renderRowsHeader",value:function(e){return"
')+'
')+'
')+'
\n
\n \n \n
\n
\n
').repeat(e)+"\n
"}},{key:"renderColsHeader",value:function(e){return"
')+'
')+'
')+'
\n
\n \n \n
\n
\n
').repeat(e)+"\n
"}},{key:"htmlEdit",value:function(e,t){var n=e.rows,r=e.cols,i=e.html,o=e.noBorder,a=e.overflow;r=r===-1/0?1:r,n=n===-1/0?1:n,r=r===1/0?10:r,n=n===1/0?10:n;var l="').concat(this.getEmptyCell(),"").repeat(r),c="".concat(l,"").repeat(n),A="".repeat(r),u="".concat(A,""),d="
'),h="
'),p="
'),f=t.map((function(e){var t;if(e.split)return'
';var n=e.text;switch(e.action){case"insertColLeft":case"insertColRight":case"insertRowUp":case"insertRowDown":n=(null===(t=n)||void 0===t?void 0:t.replace("$data",'')))||"";break}return'
\n ').concat(n,"
")}));if(f=["
').concat(f.join(""),"
")],i){var g,m=i.indexOf("-1;if(i=(0,s.Gg)(i)||i,!m)i=null===(g=i)||void 0===g?void 0:g.replace(/^(]+>)/,(function(e){return e+u}));var v=this.table.helper.normalize((0,s.$)(i)),b=v.find("tr");n=b.length,i=v.get().outerHTML}var y=i||'').concat(u).concat(c,"
");return"
').concat(h,"
').concat(this.renderColsHeader(r)).concat(y).concat(p).concat(d,"
").concat(this.renderRowsHeader(n)).concat(f,"
")}},{key:"htmlView",value:function(e){var t,n,r=e.html,i=e.noBorder,o=e.overflow;r=(0,s.Gg)(null!==(t=r)&&void 0!==t?t:"");var a=(0,s.$)(r);return a.find("td").attributes(s.Zi,s.gJ),'
").concat(null===(n=a.get())||void 0===n?void 0:n.outerHTML,"
")}}],[{key:"EmptyCell",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return'


').concat(e.CellBG)}}]),e}();Or.TABLE_WRAPPER_CLASS=".".concat(dr),Or.TABLE_OVERFLOW_CLASS=".".concat(hr),Or.TABLE_CLASS=".".concat(pr),Or.COLS_HEADER_CLASS=".".concat(fr),Or.COLS_HEADER_ITEM_CLASS=".".concat(gr),Or.COLS_HEADER_TRIGGER_CLASS=".".concat(mr),Or.COLS_ADDITION_HEADER_CLASS=".".concat(vr),Or.ROWS_HEADER_CLASS=".".concat(br),Or.ROWS_HEADER_ITEM_CLASS=".".concat(yr),Or.ROWS_HEADER_TRIGGER_CLASS=".".concat(wr),Or.HEADER_CLASS=".".concat(xr),Or.MENUBAR_CLASS=".".concat(kr),Or.MENUBAR_ITEM_CLASS=".".concat(Cr),Or.MENUBAR_ITEM_INPUT_CALSS=".".concat(Br),Or.VIEWPORT=".".concat(_r),Or.VIEWPORT_READER=".".concat(Er),Or.PLACEHOLDER_CLASS=".".concat(Sr),Or.MULTI_ADDITION_CLASS=".".concat(Fr),Or.TABLE_HIGHLIGHT_CLASS=".".concat(Tr),Or.ROW_DELETE_BUTTON_CLASS=".".concat(Mr),Or.COL_DELETE_BUTTON_CLASS=".".concat(Ir),Or.ROW_ADD_BUTTON_CLASS=".".concat(Nr),Or.COL_ADD_BUTTON_CLASS=".".concat(Lr),Or.ROW_ADD_BUTTON_SPLIT_CLASS=".".concat(Ur),Or.COL_ADD_BUTTON_SPLIT_CLASS=".".concat(Qr),Or.TABLE_TD_CONTENT_CLASS=".".concat(Dr),Or.TABLE_TD_BG_CLASS=".".concat(Hr),Or.CellBG='
');var zr=function(e){var t=/([\d\.]+)(pt|px)$/i.exec(e);return t&&"pt"===t[2]?String(Math.round(96*parseInt(t[1],10)/72))+"px":e},Zr=(0,F.Z)("editor"),Rr=function(){function e(t){(0,r.Z)(this,e),this.clipboard=void 0,Object.defineProperty(this,Zr,{writable:!0,value:void 0}),(0,S.Z)(this,Zr)[Zr]=t}return(0,i.Z)(e,[{key:"isEmptyModelCol",value:function(e){return e&&e.isEmpty}},{key:"getTableModel",value:function(e){for(var t=[],n=e.get(),r=n.rows,i=(null===r||void 0===r?void 0:r.length)||0,o=0;o1||d>1;t[o]=t[o]||[];var p=c;while(t[o][p])p++;if(t[o][p]={rowSpan:u,colSpan:d,isMulti:h,element:A},h){var f=u;while(f>0){var g=d;while(g>0){if(1!==g||1!==f){var m=o+f-1,v=p+g-1;t[m]=t[m]||[],t[m][v]={isEmpty:!0,parent:{row:o,col:p},element:null}}g--}f--}}}var b=t.map((function(e){return e.length})),y=Math.max.apply(Math,(0,lr.Z)(b));t.forEach((function(e){if(e.length=0;o--){var a,l,c=i[o],A=null===(a=i.eq(o))||void 0===a?void 0:a.attributes("width");if(A)null===(l=i.eq(o))||void 0===l||l.attributes("width",parseInt(A));if(c.span>1){var u=c.span-1;while(u--){var d,h;null===(d=null!==(h=i[o].parentElement)&&void 0!==h?h:i[o].parentNode)||void 0===d||d.insertBefore(i[o].cloneNode(),i[o])}}}if(i=e.find("col"),i.lengthl;l++)o&&o[l]?r.push(parseInt(o[l])):a?r.push(parseInt(a.toString())):r.push(void 0)}}));var i=e.find("td");return i.removeAttributes("data-colwidth"),i.removeAttributes("width"),r}(e),y=document.createElement("col"),w=0;r.cols>w;w++){var x=y.cloneNode();b[w]&&x.setAttribute("width",(b[w]||"").toString()),v.appendChild(x)}}var k=e.get();r.table.forEach((function(e,n){k.rows[n]||k.insertRow(n);var r=e.filter((function(e){return!t.isEmptyModelCol(e)&&e.isShadow})),i=r.length;while(i--)0===n?k.rows[n].insertCell(0):k.rows[n].insertCell()}));var C=e.find("tr");C.each((function(e,n){var r,i=C.eq(n);if(i){var o=parseInt(i.css("height"));o=o||(null===(r=(0,S.Z)(t,Zr)[Zr].plugin.findPlugin("table"))||void 0===r?void 0:r.options.rowMinHeight)||0,i.css("height",o+"px")}}));var B=e.find("td"),_=(0,s.$)(Or.EmptyCell(!(0,s.iC)((0,S.Z)(this,Zr)[Zr])||(0,S.Z)(this,Zr)[Zr].readonly));return B.each((function(e,t){var n=B.eq(t);if(n){n.attributes(s.rN,"table-cell-selection");var r=n.find(s.Su);if(0===r.length){var i=n.children();n.append(_.clone(!0)),r=n.find(s.Su),r.empty(),r.append(i)}r.find("p").each((function(e){0===e.childNodes.length&&e.appendChild(document.createElement("br"))}))}})),e}},{key:"trimStartTr",value:function(e){var t,n=e.find("tr"),r=n.eq(0);r&&0===(null===(t=r.get())||void 0===t?void 0:t.childNodes.length)&&r.remove()}},{key:"fixNumberTr",value:function(e){for(var t=e.get(),n=t.rows,r=(null===n||void 0===n?void 0:n.length)||0,i=[],o=0,a=[],s=0,l=0,c=0,A=0;A1&&(l+=(g-1)*m)}a[A]=h,0===A&&(o=h),c=Math.max(h,c)}var v=Ar()(s/o),b=o===c,y=v&&b;if(y){var w=0;if(a.forEach((function(e){w+=c-e})),w!==l){var x=l-w;if(Ar()(x/c)){for(var k=[],C=0;C1)for(var I=1;I=0;o--){var a,l=i[o],c=null===(a=i.eq(o))||void 0===a?void 0:a.attributes("width");if(c&&!c.endsWith("%")){var A,u=parseInt(c);Number.isNaN(u)||null===(A=i.eq(o))||void 0===A||A.attributes("width",u)}if(l.span>1){var d=l.span-1;while(d--){var h,p;null===(h=null!==(p=i[o].parentElement)&&void 0!==p?p:i[o].parentNode)||void 0===h||h.insertBefore(i[o].cloneNode(),i[o])}}}if(i=e.find("col"),i.lengthn.cells.length&&(n=t)}));var r=(0,s.$)(n).find("td"),i=[];r.each((function(e,t){var n=r.eq(t);if(n){var o=n.attributes("data-colwidth"),a=n.attributes("width")||n.css("width"),s=n[0].colSpan;if(o)o=o.split(",");else if(a){var l=parseInt(a),c=n.css("border-width"),A=n.css("padding-left"),u=n.css("padding-right");c&&(l+=parseInt(zr(c))),A&&(l+=parseInt(zr(A))),u&&(l+=parseInt(zr(u))),a=l/s}for(var d=0;s>d;d++)o&&o[d]?i.push(parseInt(o[d])):a?i.push(parseInt(a.toString())):i.push(void 0)}}));var o=e.find("td");return o.css("width",""),o.css("border-width",""),o.css("padding-left",""),o.css("padding-right",""),o.removeAttributes("data-colwidth"),o.removeAttributes("width"),i}(e),w=document.createElement("col"),x=0;r.cols>x;x++){var k=w.cloneNode();y[x]&&k.setAttribute("width",(y[x]||"").toString()),b.appendChild(k)}}var C=e.get();r.table.forEach((function(e,t){C.rows[t]||C.insertRow(t);var n=e.filter((function(e){return e.isShadow})),r=n.length;while(r--)C.rows[t].insertCell()}));var B=e.find("tr");return B.each((function(e,n){var r,i=B.eq(n);if(i){var o=i.css("height");if("0px"!==o){var a=parseInt(o);a=a||(null===(r=(0,S.Z)(t,Zr)[Zr].plugin.findPlugin("table"))||void 0===r?void 0:r.options.rowMinHeight)||0,i.css("height",a+"px")}else i.remove()}})),e}}]),e}(),Pr=function(e){return[{action:"cut",icon:"cut",text:e.cut},{action:"copy",icon:"copy",text:e.copy},{action:"mockPaste",icon:"paste",text:e.paste},{split:!0},{action:"insertColLeft",icon:"insert-col-left",text:e.insertColLeft},{action:"insertColRight",icon:"insert-col-right",text:e.insertColRight},{action:"insertRowUp",icon:"insert-row-up",text:e.insertRowUp},{action:"insertRowDown",icon:"insert-row-down",text:e.insertRowDown},{split:!0},{action:"mergeCell",icon:"merge-cell",text:e.mergeCell},{action:"splitCell",icon:"split-cell",text:e.splitCell},{split:!0},{action:"removeCol",icon:"remove-col",text:e.removeCol},{action:"removeRow",icon:"remove-row",text:e.removeRow},{split:!0},{action:"removeTable",icon:"remove-table",text:e.removeTable},{split:!0},{action:"clear",icon:"clear",text:e.clear}]},qr=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(e,i,o){var a;return(0,r.Z)(this,n),a=t.call(this),a.editor=void 0,a.table=void 0,a.COL_MIN_WIDTH=void 0,a.ROW_MIN_HEIGHT=void 0,a.MAX_INSERT_NUM=void 0,a.tableRoot=void 0,a.colsHeader=void 0,a.rowsHeader=void 0,a.tableHeader=void 0,a.menuBar=void 0,a.dragging=void 0,a.draggingHeader=void 0,a.changeSize=void 0,a.viewport=void 0,a.placeholder=void 0,a.contextVisible=!1,a.rowDeleteButton=void 0,a.colDeleteButton=void 0,a.colAddButton=void 0,a.colAddAlign=void 0,a.colAddButtonSplit=void 0,a.moveColIndex=-1,a.hideColAddButtonTimeount=void 0,a.rowAddButton=void 0,a.rowAddAlign=void 0,a.rowAddButtonSplit=void 0,a.moveRowIndex=-1,a.hideRowAddButtonTimeount=void 0,a.onMouseDownColsHeader=function(e){var t=(0,s.$)(e.target||[]).closest(Or.COLS_HEADER_TRIGGER_CLASS);0!==t.length?a.startChangeCol(t,e):e instanceof MouseEvent&&2===e.button&&a.showContextMenu(e)},a.onMouseDownRowsHeader=function(e){var t=(0,s.$)(e.target||[]).closest(Or.ROWS_HEADER_TRIGGER_CLASS);0!==t.length?a.startChangeRow(t,e):e instanceof MouseEvent&&2===e.button&&a.showContextMenu(e)},a.onClickColsHeader=function(e){var t,n=a.table.selection,r=(0,s.$)(e.target||[]).closest(Or.COLS_HEADER_TRIGGER_CLASS);if(!(r.length>0)){var i=(0,s.$)(e.target||[]).closest(Or.COLS_HEADER_ITEM_CLASS);if(0!==i.length){var o=null===(t=a.colsHeader)||void 0===t?void 0:t.find(Or.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(i)}));void 0!==o&&n.selectCol(o)}}},a.onClickRowsHeader=function(e){var t,n=a.table.selection,r=(0,s.$)(e.target||[]).closest(Or.ROWS_HEADER_TRIGGER_CLASS);if(!(r.length>0)){var i=(0,s.$)(e.target||[]).closest(Or.ROWS_HEADER_ITEM_CLASS);if(0!==i.length){var o=null===(t=a.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(i)}));void 0!==o&&n.selectRow(o)}}},a.onClickTableHeader=function(e){var t;e.preventDefault();var n=a.table.selection;if(null===(t=a.tableHeader)||void 0===t?void 0:t.hasClass("selected"))n.clearSelect();else{var r=n.tableModel;if(!r)return;n.select({row:0,col:0},{row:r.rows-1,col:r.cols-1})}},a.onChangeSize=function(e){a.dragging&&(a.dragging.y>-1?a.onChangeRowHeight(e):a.dragging.x>-1&&a.onChangeColWidth(e),a.emit("sizeChanging"))},a.onChangeSizeEnd=function(e){if("mouseleave"!==e.type||!a.table.getCenter().contains(e["toElement"])){if(a.dragging&&a.changeSize){var t=a.changeSize.trigger,n=t.width,r=t.height,i=t.element;i.removeClass("dragging"),a.dragging.x>-1&&i.css("height","".concat(r,"px")),a.dragging.y>-1&&i.css("width","".concat(n,"px")),a.dragging=void 0,a.renderRowBars(),a.emit("sizeChanged")}a.unbindChangeSizeEvent()}},a.onDragStartColsHeader=function(e){var t,n;e.stopPropagation();var r=a.table.selection,i=r.getSelectArea();if(e.target&&i.allRow){var o=(0,s.$)(e.target).closest(Or.COLS_HEADER_ITEM_CLASS);if(0!==o.length){var l=null===(t=a.colsHeader)||void 0===t?void 0:t.find(Or.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(o)}));if(void 0!==l){var c=l;ci.end.col||(a.draggingHeader={element:o,minIndex:i.begin.col,maxIndex:i.end.col,count:i.end.col-i.begin.col+1},o.addClass("dragging"),o.find(".drag-info").html(a.editor.language.get("table","draggingCol").replace("$data",a.draggingHeader.count.toString())),null===(n=a.colsHeader)||void 0===n||n.addClass("dragging"),a.table.helper.fixDragEvent(e),a.bindDragColEvent())}}}},a.onDragStartRowsHeader=function(e){var t,n;e.stopPropagation();var r=a.table.selection,i=r.getSelectArea();if(e.target&&i.allCol){var o=(0,s.$)(e.target).closest(Or.ROWS_HEADER_ITEM_CLASS);if(0!==o.length){var l=null===(t=a.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(o)}));if(void 0!==l){var c=l;ci.end.row||(a.draggingHeader={element:o,minIndex:i.begin.row,maxIndex:i.end.row,count:i.end.row-i.begin.row+1},o.addClass("dragging"),o.find(".drag-info").html(a.editor.language.get("table","draggingRow").replace("$data",a.draggingHeader.count.toString())),null===(n=a.rowsHeader)||void 0===n||n.addClass("dragging"),a.table.helper.fixDragEvent(e),a.bindDragRowEvent())}}}},a.onDragCol=function(e){var t;if(e.stopPropagation(),a.draggingHeader&&e.target&&(void 0===a.dragging&&(a.dragging={x:e.offsetX,y:e.offsetY}),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),!(Math.abs(a.dragging.x-e.offsetX)<3))){a.dragging.x=e.offsetX,a.draggingHeader.element.removeClass("dragging");var n=(0,s.$)(e.target).closest("td"),r=(0,s.$)(e.target).closest(Or.COLS_HEADER_ITEM_CLASS);if(0!==n.length||0!==r.length)if(r.length>0){var i,o=null===(i=a.colsHeader)||void 0===i?void 0:i.find(Or.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(r)}));if(void 0===o)return;var l=o,c=e.offsetX>r.get().offsetWidth/2?l+1:l;a.showPlaceHolder(c,c!==l)}else{var A=null===(t=a.colsHeader)||void 0===t?void 0:t.find(Or.COLS_HEADER_ITEM_CLASS);if(A){for(var u=n.get(),d=u.colSpan,h=a.table.selection.getCellPoint(n),p=(0,V.Z)(h,2),f=(p[0],p[1]),g=f,m=0,v=0;ve.offsetX){g=f+v;break}if(m+b.offsetWidth>e.offsetX){g=f+v+1;break}m+=b.offsetWidth}a.showPlaceHolder(g,g!==f)}}}},a.onDragColEnd=function(){var e,t;a.unbindDragColEvent();var n=a.draggingHeader||{},r=n.index,i=n.count,o=n.isNext;if(a.draggingHeader&&void 0!==r&&void 0!==i){var s=a.table,l=s.command,c=s.selection,A=c.getSelectArea(),u=null===(e=a.table.wrapper)||void 0===e?void 0:e.find(Or.COLS_HEADER_ITEM_CLASS);if(u){for(var d=[],h=A.begin.col;h<=A.end.col;h++){var p,f;d.push((null===(p=u.eq(h))||void 0===p||null===(f=p.get())||void 0===f?void 0:f.offsetWidth)||0)}if(l.mockCopy(),A.begin.col>r){var g=o?r-1:r;l.removeCol(),l.insertColAt(g,i,o,d,!0),c.selectCol(g,g+i-1),l.mockPaste(!0)}else{l.removeCol();var m=(o?r-1:r)-i;l.insertColAt(m,i,o,d,!0),c.selectCol(m+1,m+i),l.mockPaste(!0)}null===(t=a.placeholder)||void 0===t||t.css("display","none"),a.draggingHeader=void 0,a.dragging=void 0}}},a.onDragRow=function(e){var t;if(e.stopPropagation(),a.draggingHeader&&e.target&&(void 0===a.dragging&&(a.dragging={x:e.offsetX,y:e.offsetY}),!(Math.abs(a.dragging.y-e.offsetY)<3))){a.dragging.y=e.offsetY,a.draggingHeader.element.removeClass("dragging");var n=(0,s.$)(e.target).closest("td"),r=(0,s.$)(e.target).closest(Or.ROWS_HEADER_ITEM_CLASS);if(0!==n.length||0!==r.length)if(r.length>0){var i,o=null===(i=a.rowsHeader)||void 0===i?void 0:i.find(Or.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(e){return e.equal(r)}));if(void 0===o)return;var l=o,c=e.offsetY>r.get().offsetHeight/2?l+1:l;a.showPlaceHolder(c,c!==l)}else{var A=null===(t=a.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS);if(A){for(var u=n.get().rowSpan,d=a.table.selection.getCellPoint(n),h=(0,V.Z)(d,1),p=h[0],f=p,g=0,m=0;me.offsetY){f=p+m;break}if(g+v.offsetHeight>e.offsetY){f=p+m+1;break}g+=v.offsetHeight}a.showPlaceHolder(f,f!==p)}}}},a.onDragRowEnd=function(){var e;a.unbindDragRowEvent();var t=a.draggingHeader||{},n=t.index,r=t.count,i=t.isNext;if(a.draggingHeader&&void 0!==n&&void 0!==r){var o=a.table,s=o.command,l=o.selection,c=l.getSelectArea(),A=c.begin;c.end;if(s.mockCopy(),A.row>n){var u=i?n-1:n;s.removeRow(),s.insertRowAt(u,r,!i,!0),l.selectRow(n,n+r-1),s.mockPaste(!0)}else{s.removeRow();var d=(i?n-1:n)-r;s.insertRowAt(d,r,!i,!0),l.selectRow(d+1,d+r),s.mockPaste(!0)}null===(e=a.placeholder)||void 0===e||e.css("display","none"),a.draggingHeader=void 0,a.dragging=void 0}},a.menuSets=new WeakSet,a.onMenuInputMousedown=function(e){e.stopPropagation()},a.handleHighlightRow=function(){var e=a.table.selection,t=e.tableModel;if(t){var n=(0,nn.Z)({},e.getSelectArea());n.allCol=!0,n.begin=n.begin,n.end=n.end,e.showHighlight(n)}},a.handleHighlightCol=function(){var e=a.table.selection,t=e.tableModel;if(t){var n=(0,nn.Z)({},e.getSelectArea());n.allRow=!0,n.begin=n.begin,n.end=n.end,e.showHighlight(n)}},a.handleHighlightTable=function(){var e=a.table.selection,t=e.tableModel;if(t){var n=(0,nn.Z)({},e.getSelectArea());n.allRow=!0,n.allCol=!0,n.begin={row:0,col:0},n.end={row:t.rows-1,col:t.cols-1},e.showHighlight(n)}},a.table=i,a.editor=e,a.COL_MIN_WIDTH=o.col_min_width,a.ROW_MIN_HEIGHT=o.row_min_height,a.MAX_INSERT_NUM=o.max_insert_num,a}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.table.wrapper;e&&(this.tableRoot=e.find(Or.TABLE_CLASS),this.colsHeader=e.find(Or.COLS_HEADER_CLASS),this.rowsHeader=e.find(Or.ROWS_HEADER_CLASS),this.tableHeader=e.find(Or.HEADER_CLASS),this.viewport=e.find(Or.VIEWPORT),this.menuBar=e.find(Or.MENUBAR_CLASS),this.placeholder=e.find(Or.PLACEHOLDER_CLASS),this.renderRowBars(),this.renderColBars(),this.bindEvents())}},{key:"renderRowBars",value:function(){var e,t,n,r,i,o,a,l,c=this,A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],u=null===(e=this.tableRoot)||void 0===e?void 0:e.get();if(u&&(null===(t=this.rowDeleteButton)||void 0===t||t.removeAllEvents(),this.rowDeleteButton=null===(n=this.rowsHeader)||void 0===n?void 0:n.find(Or.ROW_DELETE_BUTTON_CLASS),null===(r=this.rowAddButton)||void 0===r||r.removeAllEvents(),this.rowAddButton=null===(i=this.rowsHeader)||void 0===i?void 0:i.find(Or.ROW_ADD_BUTTON_CLASS),this.rowAddButtonSplit=null===(o=this.rowAddButton)||void 0===o?void 0:o.find(Or.ROW_ADD_BUTTON_SPLIT_CLASS),null===(a=this.rowDeleteButton)||void 0===a||a.on("mouseover",(function(e){return c.handleHighlightRow()})).on("mouseleave",(function(e){return c.hideHighlight(e)})).on("mousedown",(function(e){e.preventDefault(),c.table.command["removeRow"]()})),null===(l=this.rowAddButton)||void 0===l||l.on("mouseenter",(function(){var e;c.hideRowAddButtonTimeount&&clearTimeout(c.hideRowAddButtonTimeount),null===(e=c.rowsHeader)||void 0===e||e.css("z-index",128)})).on("mouseleave",(function(){c.hideRowAddButtonTimeount=setTimeout((function(){var e,t;null===(e=c.rowAddButton)||void 0===e||e.hide(),null===(t=c.rowsHeader)||void 0===t||t.css("z-index",1),c.moveRowIndex=-1}),200)})).on("mousedown",(function(e){e.preventDefault(),c.table.command.insertRowAt(c.moveRowIndex,1,"down"!==c.rowAddAlign)})),A)){var d,h,p,f,g=u.rows,m=(null===g||void 0===g?void 0:g.length)||0,v=null===(d=this.rowsHeader)||void 0===d?void 0:d.find(Or.ROWS_HEADER_ITEM_CLASS);if(v)for(var b=0;b0&&void 0!==arguments[0])||arguments[0],h=null===(e=this.tableRoot)||void 0===e?void 0:e.get();if(h){var p=(0,s.ZQ)((0,s.yx)(h,"width"));null===(t=this.colDeleteButton)||void 0===t||t.removeAllEvents(),this.colDeleteButton=null===(n=this.table.wrapper)||void 0===n?void 0:n.find(Or.COL_DELETE_BUTTON_CLASS),null===(r=this.colAddButton)||void 0===r||r.removeAllEvents(),this.colAddButton=null===(i=this.colsHeader)||void 0===i?void 0:i.find(Or.COL_ADD_BUTTON_CLASS),this.colAddButtonSplit=null===(o=this.colAddButton)||void 0===o?void 0:o.find(Or.COL_ADD_BUTTON_SPLIT_CLASS),null===(a=this.colDeleteButton)||void 0===a||a.on("mouseover",(function(e){return u.handleHighlightCol()})).on("mouseleave",(function(e){return u.hideHighlight(e)})).on("mousedown",(function(e){e.preventDefault(),u.table.command["removeCol"]()})),null===(l=this.colAddButton)||void 0===l||l.on("mouseenter",(function(){u.hideColAddButtonTimeount&&clearTimeout(u.hideColAddButtonTimeount)})).on("mouseleave",(function(){u.hideColAddButtonTimeount=setTimeout((function(){var e;null===(e=u.colAddButton)||void 0===e||e.hide(),u.moveColIndex=-1}),200)})).on("mousedown",(function(e){e.preventDefault(),u.moveColIndex>-1&&u.table.command.insertColAt(u.moveColIndex,1,"right"!==u.colAddAlign)}));var f=this.table.root.width(),g=this.table.enableScroll?p:Math.min(p,f);null===(c=this.tableRoot)||void 0===c||c.css("width","".concat(g,"px")),null===(A=this.colsHeader)||void 0===A||A.css("width","".concat(g,"px")),d&&this.renderColSize()}}},{key:"renderColSize",value:function(){var e,t,n,r,i,o=this,a=null===(e=this.tableRoot)||void 0===e?void 0:e.get();if(a){var l=(0,s.ZQ)((0,s.yx)(a,"width"));this.table.enableScroll||(l=Math.min(l,this.table.root.width()));var c=null===(t=this.tableRoot)||void 0===t?void 0:t.find("col");if(c){var A=!0,u={},d=0,h=0;c.each((function(e,t){var n=c[t],r=(0,s.ZQ)((0,s.$)(n).attributes("width"));r?(u[t]=r,d+=r,A=!1):h++}));var p=null===(n=this.colsHeader)||void 0===n?void 0:n.find(Or.COLS_HEADER_ITEM_CLASS);if(p){var f=this.table.selection.tableModel;if(A){var g,m=[];null===f||void 0===f||null===(g=f.table)||void 0===g||g.forEach((function(e){e.forEach((function(e,t){m[t]||o.table.helper.isEmptyModelCol(e)||e.isMulti||!e.element||(m[t]=(0,s.ZQ)((0,s.yx)(e.element,"width")))}))}));for(var v=0,b=0,y=0;y0&&(w=Math.round(1e4*Math.round((l-b)/v))/1e4);for(var x=0;x0&&2===e.button&&this.table.activated?this.showContextMenu(e):this.hideContextMenu()}}},{key:"onMouseMoveColsHeader",value:function(e){var t,n;if(e.target&&this.colAddButton&&this.colAddButtonSplit){var r=(0,s.$)(e.target),i=r.closest(Or.COLS_HEADER_ITEM_CLASS);if(0!==i.length){var o=this.colsHeader.find(Or.COLS_HEADER_ITEM_CLASS).toArray(),a=i.width(),l=this.colAddButton.width(),c=i.get().offsetLeft,A=o.findIndex((function(e){return e.equal(i)})),u=e.offsetX>a/2||r.hasClass("cols-trigger"),d=o[o.length-1].equal(i);u&&(c+=d?a-l/2:a),this.colAddAlign=u?"left":"right",this.moveColIndex=A,null===(t=this.colAddButton)||void 0===t||t.show("flex"),this.colAddButton.css("left","".concat(c,"px")),this.colAddButton.css("z-index",128);var h=((null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.height)||0)+i.height()+4;this.colAddButtonSplit.css("height","".concat(h,"px")),this.colAddButtonSplit.css("left","".concat(d&&u?l-3+"px":""))}}}},{key:"onMouseMoveRowsHeader",value:function(e){var t,n;if(e.target&&this.rowAddButton&&this.rowAddButtonSplit){var r=(0,s.$)(e.target),i=r.closest(Or.ROWS_HEADER_ITEM_CLASS);if(0!==i.length){var o=this.rowsHeader.find(Or.ROWS_HEADER_ITEM_CLASS).toArray(),a=i.height(),l=i.get().offsetTop,c=o.findIndex((function(e){return e.equal(i)})),A=e.offsetY>a/2||r.hasClass("rows-trigger");A&&(l+=a),this.moveRowIndex=c,this.rowAddButton.show("flex"),this.rowAddButton.css("top","".concat(l,"px")),this.rowAddAlign=A?"down":"up";var u=null===(t=this.viewport)||void 0===t?void 0:t.get(),d=((null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.width)||0)+i.width()+4,h=Math.min(u.offsetWidth+4,d);this.rowAddButtonSplit.css("width","".concat(h,"px"))}}}},{key:"activeHeader",value:function(){var e,t,n,r=this.table.selection.getSelectArea();this.clearActiveStatus();var i=null===(e=this.colsHeader)||void 0===e?void 0:e.find(Or.COLS_HEADER_ITEM_CLASS),o=null===(t=this.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS),a=r.begin,s=r.end,l=r.allCol,c=r.allRow;if(o)for(var A=a.row;A<=s.row;A++)if(l){var u=o[A];(null===u||void 0===u?void 0:u.classList.contains("selected"))||null===u||void 0===u||u.classList.add("selected"),c&&!(null===u||void 0===u?void 0:u.classList.contains("no-dragger"))&&(null===u||void 0===u||u.classList.add("no-dragger"))}if(i)for(var d=a.col;d<=s.col;d++)if(c){var h=i[d];(null===h||void 0===h?void 0:h.classList.contains("selected"))||null===h||void 0===h||h.classList.add("selected"),l&&!(null===h||void 0===h?void 0:h.classList.contains("no-dragger"))&&(null===h||void 0===h||h.classList.add("no-dragger"))}var p=null===(n=this.tableHeader)||void 0===n?void 0:n.get();if(l&&c?(null===p||void 0===p?void 0:p.classList.contains("selected"))||null===p||void 0===p||p.classList.add("selected"):(null===p||void 0===p?void 0:p.classList.contains("selected"))&&(null===p||void 0===p||p.classList.remove("selected")),l&&!c){var f,g=null===(f=this.tableRoot)||void 0===f?void 0:f.find("tr").eq(a.row);if(g){var m,v,b=g.get().offsetTop;null===(m=this.rowDeleteButton)||void 0===m||m.show("flex"),null===(v=this.rowDeleteButton)||void 0===v||v.css("top","".concat(b-this.rowDeleteButton.height(),"px"))}}else{var y;null===(y=this.rowDeleteButton)||void 0===y||y.hide()}if(!l&&c){for(var w,x,k,C,B=0,_=a.col;_<=s.col;_++){var E;B+=(null===i||void 0===i||null===(E=i.eq(_))||void 0===E?void 0:E.width())||0}var S=(null===i||void 0===i||null===(w=i.eq(a.col))||void 0===w||null===(x=w.get())||void 0===x?void 0:x.offsetLeft)||0;null===(k=this.colDeleteButton)||void 0===k||k.show("flex"),null===(C=this.colDeleteButton)||void 0===C||C.css("left","".concat(S+B/2,"px"))}else{var F;null===(F=this.colDeleteButton)||void 0===F||F.hide()}}},{key:"clearActiveStatus",value:function(){var e,t,n,r=null===(e=this.colsHeader)||void 0===e?void 0:e.find(Or.COLS_HEADER_ITEM_CLASS),i=null===(t=this.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS);null===r||void 0===r||r.each((function(e){var t=e;t.classList.contains("selected")&&t.classList.remove("selected"),t.classList.contains("no-dragger")&&t.classList.remove("no-dragger")})),null===i||void 0===i||i.each((function(e){var t=e;t.classList.contains("selected")&&t.classList.remove("selected"),t.classList.contains("no-dragger")&&t.classList.remove("no-dragger")}));var o=null===(n=this.tableHeader)||void 0===n?void 0:n.get();(null===o||void 0===o?void 0:o.classList.contains("selected"))&&o.classList.remove("selected")}},{key:"refresh",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.renderColBars(e),this.renderRowBars(e),this.activeHeader()}},{key:"startChangeCol",value:function(e,t){var n,r;if(t.stopPropagation(),t.preventDefault(),this.colsHeader){var i=e.parent(),o=i.get();this.table.selection.clearSelect(),this.dragging={x:t instanceof MouseEvent?t.clientX:t.touches[0].clientX,y:-1};for(var a=this.colsHeader.find(Or.COLS_HEADER_ITEM_CLASS),l=a.toArray(),c=0,A=[],u=0;uw.offsetWidth?w.scrollLeft=x+20-w.offsetWidth:w.scrollLeft+w.offsetWidth===w.scrollWidth&&(w.scrollLeft=Math.max(0,s+34-w.offsetWidth))}this.clearActiveStatus(),this.hideContextMenu(),this.renderRowBars(),this.renderColSplitBars(this.changeSize.element,this.changeSize.trigger.element),null===(n=this.tableRoot)||void 0===n||n.css("width","".concat(s,"px")),null===(r=this.colsHeader)||void 0===r||r.css("width","".concat(s,"px"))}}},{key:"onChangeRowHeight",value:function(e){var t,n;if(this.dragging&&this.changeSize){var r=(e instanceof MouseEvent?e.clientY:e.touches[0].clientY)-this.dragging.y,i=Math.max(this.ROW_MIN_HEIGHT,this.changeSize.height+r);r=i-this.changeSize.height,this.changeSize.element.css("height",i+"px"),this.clearActiveStatus(),this.hideContextMenu(),this.renderRowSplitBars(this.changeSize.element,this.changeSize.trigger.element),null===(t=this.tableRoot)||void 0===t||null===(n=t.find("tr").eq(this.changeSize.index))||void 0===n||n.css("height","".concat(i,"px"))}}},{key:"renderColSplitBars",value:function(e,t){var n,r=(null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.height)||0;t.addClass("dragging").css("height","".concat(r+e.height(),"px"))}},{key:"renderRowSplitBars",value:function(e,t){var n,r,i=null===(n=this.viewport)||void 0===n?void 0:n.get(),o=(null===(r=this.table.selection.tableModel)||void 0===r?void 0:r.width)||0,a=Math.min(i.offsetWidth-e.width(),o);t.addClass("dragging").css("width","".concat(a+e.width(),"px"))}},{key:"bindDragColEvent",value:function(){var e=this.table.wrapper;null===e||void 0===e||e.on("dragover",this.onDragCol),null===e||void 0===e||e.on("drop",this.onDragColEnd),null===e||void 0===e||e.on("dragend",this.onDragColEnd)}},{key:"unbindDragColEvent",value:function(){var e,t,n=this.table.wrapper,r=null===(e=this.colsHeader)||void 0===e?void 0:e.find(Or.COLS_HEADER_ITEM_CLASS);null===r||void 0===r||r.removeClass("dragging"),null===(t=this.colsHeader)||void 0===t||t.removeClass("dragging"),null===n||void 0===n||n.off("dragover",this.onDragCol),null===n||void 0===n||n.off("drop",this.onDragColEnd),null===n||void 0===n||n.off("dragend",this.onDragColEnd)}},{key:"bindDragRowEvent",value:function(){var e=this.table.wrapper;null===e||void 0===e||e.on("dragover",this.onDragRow),null===e||void 0===e||e.on("drop",this.onDragRowEnd),null===e||void 0===e||e.on("dragend",this.onDragRowEnd)}},{key:"unbindDragRowEvent",value:function(){var e,t,n=this.table.wrapper,r=null===(e=this.rowsHeader)||void 0===e?void 0:e.find(Or.ROWS_HEADER_ITEM_CLASS);null===r||void 0===r||r.removeClass("dragging"),null===(t=this.rowsHeader)||void 0===t||t.removeClass("dragging"),null===n||void 0===n||n.off("dragover",this.onDragRow),null===n||void 0===n||n.off("drop",this.onDragRowEnd),null===n||void 0===n||n.off("dragend",this.onDragRowEnd)}},{key:"showPlaceHolder",value:function(e,t){if(this.draggingHeader){var n=this.draggingHeader,r=n.element,i=n.minIndex,o=n.maxIndex;if(r.closest(Or.COLS_HEADER_CLASS).length>0){var a,l,c,A,u,d,h,p,f,g,m;if(e===this.draggingHeader.index)return;if(i<=e&&e<=o+1)return delete this.draggingHeader.index,delete this.draggingHeader.isNext,void(null===(m=this.placeholder)||void 0===m||m.css("display","none"));this.draggingHeader.isNext=t,this.draggingHeader.index=e;var v=null===(a=this.colsHeader)||void 0===a?void 0:a.find(Or.COLS_HEADER_ITEM_CLASS);if(!v)return;var b=this.draggingHeader.index!==v.length?v.eq(this.draggingHeader.index).get().offsetLeft+2:v.eq(this.draggingHeader.index-1).get().offsetLeft+v.eq(this.draggingHeader.index-1).get().offsetWidth+2,y=null===(l=this.viewport)||void 0===l?void 0:l.get(),w=y.scrollLeft,x=y.offsetWidth;bw+x&&(y.scrollLeft=b-x+5);var k=((null===(c=this.table.selection.tableModel)||void 0===c?void 0:c.height)||0)+v.height(),C=null===(A=this.viewport)||void 0===A?void 0:A.css("padding-top"),B=(null===(u=this.viewport)||void 0===u?void 0:u.css("padding-left"))||"0";null===(d=this.placeholder)||void 0===d||d.css("width","2px"),null===(h=this.placeholder)||void 0===h||h.css("height","".concat(k,"px")),null===(p=this.placeholder)||void 0===p||p.css("left",b-4+(0,s.ZQ)(B)+"px"),null===(f=this.placeholder)||void 0===f||f.css("top",C),null===(g=this.placeholder)||void 0===g||g.css("display","block")}else if(r.closest(Or.ROWS_HEADER_CLASS).length>0){var _,E,S,F,T,M,I,N,U,L,Q;if(e===this.draggingHeader.index)return;if(i<=e&&e<=o+1)return delete this.draggingHeader.index,delete this.draggingHeader.isNext,void(null===(Q=this.placeholder)||void 0===Q||Q.css("display","none"));this.draggingHeader.index=e,this.draggingHeader.isNext=t;var D=null===(_=this.rowsHeader)||void 0===_?void 0:_.find(Or.ROWS_HEADER_ITEM_CLASS);if(!D)return;var H=this.draggingHeader.index!==D.length?D.eq(this.draggingHeader.index).get().offsetTop+2:D.eq(this.draggingHeader.index-1).get().offsetTop+D.eq(this.draggingHeader.index-1).get().offsetHeight-2,O=(null===(E=this.table.selection.tableModel)||void 0===E?void 0:E.width)||0,z=null===(S=this.viewport)||void 0===S?void 0:S.css("padding-top"),Z=(null===(F=this.viewport)||void 0===F?void 0:F.css("padding-left"))||"0",R=null===(T=this.colsHeader)||void 0===T?void 0:T.find(Or.COLS_HEADER_ITEM_CLASS);null===(M=this.placeholder)||void 0===M||M.css("height","2px"),null===(I=this.placeholder)||void 0===I||I.css("width","".concat(O,"px")),null===(N=this.placeholder)||void 0===N||N.css("left",Z),null===(U=this.placeholder)||void 0===U||U.css("top",H+(0,s.ZQ)(z||"0")+((null===R||void 0===R?void 0:R.height())||0)-2+"px"),null===(L=this.placeholder)||void 0===L||L.css("display","block")}}}},{key:"removeRow",value:function(e){var t,n,r,i,o=null===(t=this.rowsHeader)||void 0===t?void 0:t.find(Or.ROWS_HEADER_ITEM_CLASS),a=null===o||void 0===o||null===(n=o.eq(e))||void 0===n?void 0:n.get();a&&(null===(r=this.rowsHeader)||void 0===r||null===(i=r.get())||void 0===i||i.removeChild(a))}},{key:"removeCol",value:function(e){var t,n,r,i,o,a,s=null===(t=this.colsHeader)||void 0===t?void 0:t.find(Or.COLS_HEADER_ITEM_CLASS),l=null===(n=this.colsHeader)||void 0===n?void 0:n.get(),c=null===s||void 0===s||null===(r=s.eq(e))||void 0===r?void 0:r.get();l&&c&&(null===(i=this.colsHeader)||void 0===i||i.css("width",l.offsetWidth-c.offsetWidth+"px"),l.removeChild(c),null===(o=this.tableRoot)||void 0===o||o.css("width",null===(a=this.colsHeader)||void 0===a?void 0:a.css("width")))}},{key:"showContextMenu",value:function(e){var t=this,n=this.editor;if(this.menuBar&&e.target&&this.table.wrapper&&n.scrollNode){e.preventDefault();var r=this.table.selection,i=this.menuBar.find(Or.MENUBAR_ITEM_CLASS);i.removeClass("disabled"),i.each((function(e){var n=(0,s.$)(e),i=n.attributes("data-action");if(t.getMenuDisabled(i))n.addClass("disabled");else{var o=n.find("input".concat(Or.MENUBAR_ITEM_INPUT_CALSS));if(0===o.length)return;var a=o.get();t.menuSets.has(e)||(t.menuSets.add(e),o.on("blur",(function(){a.value=Math.min(parseInt(a.value,10)||1,t.MAX_INSERT_NUM).toString()})).on("keydown",(function(e){(0,s.P6)("enter",e)&&t.handleTriggerMenu(n)})),o.on("mousedown",t.onMenuInputMousedown));var l=r.getSelectArea(),c=["insertColLeft","insertColRight"].indexOf(i)>-1,A=["insertRowUp","insertRowDown"].indexOf(i)>-1;c&&(a.value="".concat(l.end.col-l.begin.col+1)),A&&(a.value="".concat(l.end.row-l.begin.row+1))}}));var o=this.menuBar.find("div.split");o.each((function(e){var t=(0,s.$)(e),n=t.prev();while(n){if(n.hasClass("split")){t.remove();break}if(!n.hasClass("disabled"))break;n=n.prev()}n||t.remove()}));var a=(0,s.$)(e.target),l=a.getBoundingClientRect()||{top:0,left:0},c=a.parent(),A=0,u=0;while(c&&c.closest(Or.TABLE_WRAPPER_CLASS).length>0){var d=c.getBoundingClientRect()||{top:0,left:0};A+=l.top-d.top,u+=l.left-d.left,l=d,c=c.parent()}var h=this.table.wrapper.get().getBoundingClientRect(),p=n.scrollNode.getViewport();A+=e.offsetY;var f=this.menuBar.height(),g=h.top+A+f+4;if(g>p.bottom){var m=g-p.bottom;A-m<0&&h.top+A-m0)i=Math.min(parseInt((null===(t=r.get())||void 0===t?void 0:t.value)||"1",10),this.MAX_INSERT_NUM);this.table.command[n](i)}this.hideContextMenu()}},{key:"handleHoverMenu",value:function(e){if(e.target){var t=(0,s.$)(e.target).closest(".table-menubar-item");if(0!==t.length){e.stopPropagation();var n=this.table.selection;if(!t.hasClass("disabled")){var r=t.attributes("data-action");switch(r){case"removeCol":this.handleHighlightCol();break;case"removeRow":this.handleHighlightRow();break;case"removeTable":this.handleHighlightTable();break;default:n.hideHighlight()}}}}}},{key:"hideHighlight",value:function(e){e.stopPropagation(),this.table.selection.hideHighlight()}},{key:"drawBackgroundColor",value:function(e){var t=this.table,n=t.selection,r=t.helper;n.each((function(t){!r.isEmptyModelCol(t)&&t.element&&(e&&"transparent"!==e?t.element.style.backgroundColor=e:t.element.style.removeProperty("background-color"))}))}},{key:"setAlign",value:function(e){var t=this.table,n=t.selection,r=t.helper;n.each((function(t){!r.isEmptyModelCol(t)&&t.element&&(e&&"top"!==e?t.element.style.verticalAlign=e:t.element.style.removeProperty("vertical-align"))}))}},{key:"destroy",value:function(){var e,t,n,r,i,o,a,s,l,c,A,u,d;null===(e=this.colsHeader)||void 0===e||e.removeAllEvents(),null===(t=this.rowsHeader)||void 0===t||t.removeAllEvents(),null===(n=this.tableHeader)||void 0===n||n.removeAllEvents(),null===(r=this.table.wrapper)||void 0===r||r.removeAllEvents(),null===(i=this.tableRoot)||void 0===i||i.removeAllEvents(),null===(o=this.menuBar)||void 0===o||o.removeAllEvents(),null===(a=this.viewport)||void 0===a||a.removeAllEvents(),null===(s=this.rowDeleteButton)||void 0===s||s.removeAllEvents(),null===(l=this.colDeleteButton)||void 0===l||l.removeAllEvents(),null===(c=this.colAddButton)||void 0===c||c.removeAllEvents(),null===(A=this.colsHeader)||void 0===A||A.removeAllEvents(),null===(u=this.rowAddButton)||void 0===u||u.removeAllEvents(),null===(d=this.rowsHeader)||void 0===d||d.removeAllEvents()}}]),n}(Ln.EventEmitter2),Kr=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(e,i){var o;return(0,r.Z)(this,n),o=t.call(this),o.editor=void 0,o.table=void 0,o.tableRoot=void 0,o.colsHeader=void 0,o.rowsHeader=void 0,o.tableHeader=void 0,o.tableModel=void 0,o.selectArea=void 0,o.selectRange=void 0,o.dragging=void 0,o.isShift=!1,o.prevMouseDownTd=void 0,o.prevOverTd=void 0,o.highlight=void 0,o.beginAllRow=void 0,o.beginAllCol=void 0,o.onTdMouseDown=function(e){o.selectRange=void 0;var t=o.editor;if(e.target&&(0,s.iC)(t)){var n=t.change,r=(0,s.$)(e.target),i=r.closest("td");if(0!==i.length&&i.inEditor()){var a=n.range.get(),l=o.getCellPoint(i),c=(0,V.Z)(l,2),A=c[0],u=c[1],d=!!i.attributes("table-cell-selection");if(o.isShift){var h={row:0,col:0};if(o.prevMouseDownTd){var p=o.getCellPoint(o.prevMouseDownTd),f=(0,V.Z)(p,2),g=f[0],m=f[1];h={row:g,col:m}}else if(o.selectArea&&(h=o.selectArea.begin,o.tableModel)){var v=o.tableModel.table[h.row][h.col];!o.table.helper.isEmptyModelCol(v)&&v.element&&(o.prevMouseDownTd=(0,s.$)(v.element))}o.select(h,{row:A,col:u})}else{if(o.prevMouseDownTd=i,e instanceof MouseEvent&&2!==e.button&&o.select({row:A,col:u},{row:A,col:u}),"td"!==r.name||!d&&a.startNode.closest("td").equal(i)&&a.endNode.closest("td").equal(i))"td"===r.name&&e.preventDefault();else{if(e instanceof MouseEvent&&2===e.button&&r.attributes("table-cell-selection"))return;e.preventDefault(),o.focusCell(i)}var b=function(){o.select({row:A,col:u},{row:A,col:u}),o.dragging={trigger:{element:i}},o.addDragEvent()};if(e instanceof MouseEvent&&2===e.button)r.attributes("table-cell-selection")&&e.preventDefault();else{if("td"===r.name){var y=i.find(s.Su);if(y.length>0){var w=y.last();if(w){var x,k;if(!w.isBlockCard())return b();if(((null===(x=w.get())||void 0===x?void 0:x.offsetTop)||0)+((null===(k=w.get())||void 0===k?void 0:k.clientHeight)||0)>(e instanceof MouseEvent?e:e.touches[0]).clientY)return b();var C=(0,s.$)("


");y.append(C);var B=t.change.range.get();B.select(C,!0).collapse(!1),t.change.apply(B)}}}b()}}}}},o.removeDragEvent=function(){var e,t;null===(e=o.tableRoot)||void 0===e||e.removeClass("drag-select"),null===(t=o.table.wrapper)||void 0===t||t.removeClass("drag-selecting"),document.removeEventListener(s.tq?"touchend":"mouseup",o.removeDragEvent),document.removeEventListener(s.tq?"touchmove":"mousemove",o.onDragMove),o.dragging=void 0},o.onDragMove=function(e){if(o.dragging&&e.target){var t,n,r=(0,s.$)(e.target).closest("td");if(!(0===r.length||!r.inEditor()||o.prevOverTd&&r.equal(o.prevOverTd)))if(o.prevOverTd=r,o.dragging.trigger.element.equal(r))null===(t=o.table.wrapper)||void 0===t||t.removeClass("drag-selecting"),o.clearSelect();else null===(n=o.table.wrapper)||void 0===n||n.addClass("drag-selecting"),o.selectCell(o.dragging.trigger.element,r)}},o.onShiftKeydown=function(e){e.target&&o.tableModel&&(0,s.iC)(o.editor)&&(0,s.P6)("shift",e)&&(o.isShift=!0)},o.onKeydown=function(e){if(e.target&&o.tableModel&&(0,s.iC)(o.editor)){var t=(0,s.$)(e.target).closest("td");if(0!==t.length&&t.inEditor()){var n=o.getCellPoint(t),r=(0,V.Z)(n,2),i=r[0],a=r[1];if(!(i<0||a<0))if((0,s.P6)("shift+left",e)?o.selectLeft(e,t):(0,s.P6)("shift+right",e)?o.selectRigth(e,t):(0,s.P6)("shift+up",e)?o.selectUp(e,t):(0,s.P6)("shift+down",e)&&o.selectDown(e,t),(0,s.P6)("shift",e))o.isShift=!0;else{if(o.selectRange&&(o.isShift=!1,o.selectRange=void 0),(0,s.P6)("tab",e)||(0,s.P6)("mod",e)||(0,s.P6)("opt",e)||(0,s.P6)("shift",e)||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;setTimeout((function(){o.clearSelect()}),50)}}}},o.onShiftKeyup=function(e){!1===o.isShift&&o.selectRange&&(o.selectRange=void 0,o.clearSelect()),o.isShift=!1},o.table=i,o.editor=e,o}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.table.wrapper;e&&(this.tableRoot=e.find(Or.TABLE_CLASS),this.colsHeader=e.find(Or.COLS_HEADER_CLASS),this.rowsHeader=e.find(Or.ROWS_HEADER_CLASS),this.tableHeader=e.find(Or.HEADER_CLASS),this.highlight=e.find(Or.TABLE_HIGHLIGHT_CLASS),this.render("init"),this.bindEvents())}},{key:"render",value:function(e){this.refreshModel();var t=this.tableModel;if(t){var n=this.getSelectArea(),r=n.begin,i=n.end;if("mergeCell"===e||"splitCell"===e){var o=r.row<0?0:Math.min(r.row,t.rows-1),a=r.col<0?0:Math.min(r.col,t.cols-1),s=t.table[o][a];this.table.helper.isEmptyModelCol(s)&&(s=t.table[s.parent.row][s.parent.col]),!this.table.helper.isEmptyModelCol(s)&&s.element&&"mergeCell"===e&&(this.clearSelect(),this.selectCellRange(s.element))}else if("removeRow"===e){var l=r.row<0?0:Math.min(r.row,t.rows-1),c=t.table[l][0];!this.table.helper.isEmptyModelCol(c)&&c.element&&this.focusCell(c.element)}else if("removeCol"===e){var A=r.col<0?0:Math.min(r.col,t.cols-1),u=t.table[0][A];!this.table.helper.isEmptyModelCol(u)&&u.element&&this.focusCell(u.element)}else this.select(r,i);this.renderBorder()}}},{key:"renderBorder",value:function(){var e=this,t=this.tableModel;t&&t.table.forEach((function(n,r){n.forEach((function(n,i){if(!e.table.helper.isEmptyModelCol(n)){if(!n.element)return;var o=r===t.rows-1,a=i===t.cols-1;n.isMulti&&(i+n.colSpan===t.cols&&(a=!0),r+n.rowSpan===t.rows&&(o=!0)),o?n.element.classList.contains("table-last-column")||n.element.classList.add("table-last-column"):n.element.classList.contains("table-last-column")&&n.element.classList.remove("table-last-column"),a?n.element.classList.contains("table-last-row")||n.element.classList.add("table-last-row"):n.element.classList.contains("table-last-row")&&n.element.classList.remove("table-last-row")}}))}))}},{key:"bindEvents",value:function(){var e;document.addEventListener("keydown",this.onShiftKeydown),document.addEventListener("keyup",this.onShiftKeyup),null===(e=this.table.wrapper)||void 0===e||e.on("mousedown",this.onTdMouseDown).on("keydown",this.onKeydown)}},{key:"unbindEvents",value:function(){var e;document.removeEventListener("keydown",this.onShiftKeydown),document.removeEventListener("keyup",this.onShiftKeyup),null===(e=this.table.wrapper)||void 0===e||e.off("mousedown",this.onTdMouseDown).off("keydown",this.onKeydown)}},{key:"refreshModel",value:function(){this.tableRoot&&0!==this.tableRoot.length&&(this.tableModel=this.table.helper.getTableModel(this.tableRoot))}},{key:"each",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.tableModel;if(n){var r=this.getSelectArea(),i=r.begin,o=r.end;if(!(i.row<0||i.col<0))if(t)for(var a=o.row;a>-1&&a>=i.row;a--)for(var s=o.col;s>-1&&s>=i.col;s--){var l=n.table[a][s];e(l,a,s)}else for(var c=i.row;c>-1&&c<=o.row;c++)for(var A=i.col;A>-1&&A<=o.col;A++){var u=n.table[c][A];e(u,c,A)}}}},{key:"getCellPoint",value:function(e){var t,n,r,i=this;if("td"!==e.name)return[-1,-1];var o=null===(t=e.parent())||void 0===t?void 0:t.index();if(void 0===o||o<0)return[-1,-1];var a=null===(n=this.tableModel)||void 0===n||null===(r=n.table[o])||void 0===r?void 0:r.findIndex((function(t){var n;return e.equal((i.table.helper.isEmptyModelCol(t)?null===(n=i.tableModel)||void 0===n?void 0:n.table[t.parent.row][t.parent.col]:t).element)}));return void 0===a||a<0?[-1,-1]:[o,a]}},{key:"getCellIndex",value:function(e,t){if(!this.tableModel)return 0;for(var n=this.tableModel.table[e],r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:e;if(this.tableModel){if(this.isShift)if(this.beginAllCol)e1&&void 0!==arguments[1]?arguments[1]:e;if(this.tableModel){if(this.isShift)if(this.beginAllRow)e1&&i1&&a1&&i1&&a=0&&l>=0&&a-1&&e.col>-1){var f,g=this.tableModel.table[e.row][e.col];g&&!this.table.helper.isEmptyModelCol(g)&&g.element&&!(null===(f=this.prevMouseDownTd)||void 0===f?void 0:f.equal(g.element))&&this.focusCell(g.element)}var m=0===l&&c===this.tableModel.cols-1,v=0===o&&a===this.tableModel.rows-1;m&&!this.beginAllRow?this.beginAllRow=o:!m&&this.beginAllRow&&(this.beginAllRow=void 0),v&&!this.beginAllCol?this.beginAllCol=l:!v&&this.beginAllCol&&(this.beginAllCol=void 0),this.selectArea=0===A||r?void 0:{begin:{row:o,col:l},end:{row:a,col:c},count:A,allCol:m,allRow:v},this.emit("select",this.selectArea)}}},{key:"focusCell",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.editor;if((0,s.iC)(n)){var r=n.change;(0,s.mW)(e)&&(e=(0,s.$)(e));var i,o=r.range.get(),a=e.find(s.Su);if(a.length>0)o.select(a,!0).shrinkToElementNode().shrinkToTextNode().collapse(t),setTimeout((function(){r.range.select(o)}),20),null===(i=a.get())||void 0===i||i.focus(),this.prevMouseDownTd=e,this.selectCell(e,e)}}},{key:"selectCellRange",value:function(e){var t,n=this.editor;if((0,s.iC)(n)){var r=n.change;(0,s.mW)(e)&&(e=(0,s.$)(e));var i=r.range.get(),o=e.find(s.Su);if(0!==o.length){i.select(o,!0).shrinkToElementNode();var a,l=o.children(),c=l.eq(0);if(1===l.length&&"br"===(null===c||void 0===c||null===(t=c.first())||void 0===t?void 0:t.name))i.collapse(!1),r.range.select(i),null===(a=o.get())||void 0===a||a.focus();else r.range.select(i);this.prevMouseDownTd=e,this.selectCell(e,e)}}}},{key:"addDragEvent",value:function(){var e;null===(e=this.tableRoot)||void 0===e||e.addClass("drag-select"),document.addEventListener(s.tq?"touchend":"mouseup",this.removeDragEvent,{passive:!0}),document.addEventListener(s.tq?"touchmove":"mousemove",this.onDragMove,{passive:!0})}},{key:"selectLeft",value:function(e,t){var n,r,i,o=this.editor;if((0,s.iC)(o)){var a=this.getCellPoint(t),l=(0,V.Z)(a,2),c=l[0],A=l[1];if(!(c<0||A<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){if(this.selectRange&&"right"===this.selectRange.type&&d.endOffset!==this.selectRange.startOffset)return;this.selectRange={type:"left",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.startNode;if(0!==d.startOffset)return;if(h.prev())return;var p=h.parent();while(p&&!p.isEditable()){if(p.prev())return;p=p.parent()}}var f=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:c,col:A},g=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:c,col:A},m=f.col!==A,v=m?f.col-1:g.col-1;v<0||(e.preventDefault(),v===A&&2===u&&(v=-1),m?this.select((0,nn.Z)((0,nn.Z)({},f),{},{col:v}),g):this.select(f,(0,nn.Z)((0,nn.Z)({},g),{},{col:v})))}}}},{key:"selectRigth",value:function(e,t){var n,r,i,o=this.editor;if((0,s.iC)(o)&&this.tableModel){e.stopPropagation();var a=this.getCellPoint(t),l=(0,V.Z)(a,2),c=l[0],A=l[1];if(!(c<0||A<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){var h;if(this.selectRange&&"left"===this.selectRange.type&&d.startOffset!==this.selectRange.endOffset)return;this.selectRange={type:"right",startOffset:d.startOffset,endOffset:d.endOffset};var p=d.endNode;if(p.isText()&&d.endOffset!==p.text().length)return;var f=p.children();if(p.isElement()&&d.endOffset!==f.length&&"br"!==(null===(h=p.last())||void 0===h?void 0:h.name))return;if(p.next())return;var g=p.parent();while(g&&!g.isEditable()){if(g.next())return;g=g.parent()}}var m=this.tableModel.cols,v=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:c,col:A},b=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:c,col:A},y=v.col!==A,w=y?v.col+1:b.col+1;w>m-1||(e.preventDefault(),w===A&&2===u&&(w=-1),y?this.select((0,nn.Z)((0,nn.Z)({},v),{},{col:w}),b):this.select(v,(0,nn.Z)((0,nn.Z)({},b),{},{col:w})))}}}},{key:"selectUp",value:function(e,t){var n,r,i,o=this.editor;if((0,s.iC)(o)&&this.tableModel){var a=this.getCellPoint(t),l=(0,V.Z)(a,2),c=l[0],A=l[1];if(!(c<0||A<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){if(this.selectRange&&"bottom"===this.selectRange.type&&d.endOffset!==this.selectRange.startOffset)return;this.selectRange={type:"top",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.getBoundingClientRect(),p=t.find(s.Su).getBoundingClientRect();if(0!==h.width&&0===h.height&&h.top-((null===p||void 0===p?void 0:p.top)||0)>10)return}var f=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:c,col:A},g=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:c,col:A},m=f.row!==c,v=m?f.row-1:g.row-1;e.preventDefault(),v<0||(v===c&&2===u&&(v=-1),m?this.select((0,nn.Z)((0,nn.Z)({},f),{},{row:v}),g):this.select(f,(0,nn.Z)((0,nn.Z)({},g),{},{row:v})))}}}},{key:"selectDown",value:function(e,t){var n,r,i,o=this.editor;if((0,s.iC)(o)&&this.tableModel){var a=this.getCellPoint(t),l=(0,V.Z)(a,2),c=l[0],A=l[1];if(!(c<0||A<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(d.shrinkToElementNode(),0===u){if(this.selectRange&&"top"===this.selectRange.type&&d.startOffset!==this.selectRange.endOffset)return;this.selectRange={type:"bottom",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.getBoundingClientRect(),p=t.find(s.Su).getBoundingClientRect();if(0!==h.width&&0===h.height&&((null===p||void 0===p?void 0:p.bottom)||0)-h.bottom>10)return}var f=this.tableModel.rows,g=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:c,col:A},m=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:c,col:A},v=g.row!==c,b=v?g.row+1:m.row+1;b>f-1||(e.preventDefault(),b===c&&2===u&&(b=-1),v?this.select((0,nn.Z)((0,nn.Z)({},g),{},{row:b}),m):this.select(g,(0,nn.Z)((0,nn.Z)({},m),{},{row:b})))}}}},{key:"getSelectionHtml",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.tableModel,n=this.table.helper;if(!t||!this.tableRoot)return null;var r={row:0,col:0},i={row:t.rows-1,col:t.cols-1};if(!e){var o=this.getSelectArea();r=o.begin,i=o.end}for(var a=this.tableRoot.find("col"),l=[],c=0,A=r.col;A<=i.col;A++){var u,d=null===(u=a.eq(A))||void 0===u?void 0:u.get();d&&(l.push('')),c+=parseInt(d.width))}for(var h="".concat(l.join(""),""),p=[],f=r.row;f<=i.row;f++){for(var g=[],m=void 0,v=r.col;v<=i.col;v++){var b=t.table[f][v],y=void 0,w=void 0,x=void 0;if(!n.isEmptyModelCol(b)&&b.element&&(x=b.element.cloneNode(!0),b.element.parentElement&&(m=(0,s.$)(b.element.parentElement).css("height"))),!n.isEmptyModelCol(b)&&b.isMulti&&(y=Math.min(f+b.rowSpan-1,i.row)-f+1,w=Math.min(v+b.colSpan-1,i.col)-v+1),n.isEmptyModelCol(b)){var k=t.table[b.parent.row][b.parent.col];if(b.parent.row===f&&b.parent.col".concat(g.join(""),""));m&&T.css("height",m),p.push(T.get().outerHTML)}return'').concat(h).concat(p.join(""),"
")}},{key:"hasMergeCell",value:function(){var e=this.table,t=this.tableModel;if(!t)return!1;var n=this.getSelectArea(),r=n.begin,i=(n.end,n.count);if(1!==i)return!1;var o=t.table[r.row][r.col];return!e.helper.isEmptyModelCol(o)&&!0===o.isMulti}},{key:"isRowSelected",value:function(){return!!this.selectArea&&this.selectArea.allRow}},{key:"isColSelected",value:function(){return!!this.selectArea&&this.selectArea.allCol}},{key:"isTableSelected",value:function(){return!!this.selectArea&&this.selectArea.allCol&&this.selectArea.allRow}},{key:"showHighlight",value:function(e){var t,n,r,i,o,a,l,c=this.table.helper,A=this.tableModel;if(A){var u=e.begin,d=e.end,h=e.allCol,p=e.allRow;if(!(u.row<0||u.col<0)){var f=u.row,g=d.row;if(h&&!p)for(var m=u.row;m<=d.row;m++){var v=A.table[m][u.col];if(c.isEmptyModelCol(v)){var b=A.table[v.parent.row][v.parent.col];if(c.isEmptyModelCol(b))continue;f=Math.min(v.parent.row,f)}else g=Math.max(m+v.rowSpan-1,g)}var y=u.col,w=d.col;if(p&&!h)for(var x=u.col;x<=d.col;x++){var k=A.table[u.row][x];if(c.isEmptyModelCol(k)){var C=A.table[k.parent.row][k.parent.col];if(c.isEmptyModelCol(C))continue;y=Math.min(k.parent.col,y)}else w=Math.max(x+k.colSpan-1,w)}this.hideHighlight();for(var B,_=null===(t=this.colsHeader)||void 0===t?void 0:t.find(Or.COLS_HEADER_ITEM_CLASS),E=null===(n=this.rowsHeader)||void 0===n?void 0:n.find(Or.ROWS_HEADER_ITEM_CLASS),S=0,F=0,T=p?0:f;T<=(p?A.rows-1:g);T++){var M=A.table[T][y];if(c.isEmptyModelCol(M)){var I,N=A.table[M.parent.row][M.parent.col];if(c.isEmptyModelCol(N))continue;N.element&&p&&(S+=N.element.offsetHeight),null===E||void 0===E||null===(I=E.eq(T))||void 0===I||I.addClass("active")}else{var U;M.element&&(S+=M.element.offsetHeight),null===E||void 0===E||null===(U=E.eq(T))||void 0===U||U.addClass("active")}}for(var L=h?0:y;L<=(h?A.cols-1:w);L++){var Q=A.table[f][L];if(c.isEmptyModelCol(Q)){var D,H=A.table[Q.parent.row][Q.parent.col];if(c.isEmptyModelCol(H))continue;H.element&&h&&(F+=H.element.offsetWidth),null===_||void 0===_||null===(D=_.eq(L))||void 0===D||D.addClass("active")}else{var O;Q.element&&(F+=Q.element.offsetWidth),null===_||void 0===_||null===(O=_.eq(L))||void 0===O||O.addClass("active")}}if(g===A.rows-1&&w===A.cols-1)null===(B=this.tableHeader)||void 0===B||B.addClass("active");var z=A.table[p?0:f][h?0:y],Z=0,R=0;if(!c.isEmptyModelCol(z)&&z.element){var P,q=null===(P=this.tableRoot)||void 0===P?void 0:P.parent(),K=null===q||void 0===q?void 0:q.getBoundingClientRect(),W=z.element.getBoundingClientRect();Z+=W.top-((null===K||void 0===K?void 0:K.top)||0)-13,R+=W.left-((null===K||void 0===K?void 0:K.left)||0)}var j=(0,s.ZQ)((null===(r=this.table.wrapper)||void 0===r||null===(i=r.find(".data-scrollbar"))||void 0===i?void 0:i.css("left"))||"0")+(0,s.ZQ)((null===(o=this.table.wrapper)||void 0===o?void 0:o.css("margin-left"))||"0");R+=j;var V=(null===(a=this.colsHeader)||void 0===a||null===(l=a.find(Or.COLS_HEADER_ITEM_CLASS).get())||void 0===l?void 0:l.offsetHeight)||0;if(Z+=V,S>0&&F>0){var G,$,Y,X,J,ee,te,ne,re;if(null===(G=this.highlight)||void 0===G||G.css("width","".concat(F,"px")),null===($=this.highlight)||void 0===$||$.css("height","".concat(S,"px")),null===(Y=this.highlight)||void 0===Y||Y.css("top","".concat(Z,"px")),null===(X=this.highlight)||void 0===X||X.css("left","".concat(R,"px")),null===(J=this.highlight)||void 0===J||J.show("block"),null===(ee=this.table.wrapper)||void 0===ee||ee.addClass("data-table-highlight"),h)null===(te=this.table.wrapper)||void 0===te||te.addClass("data-table-highlight-row");if(p)null===(ne=this.table.wrapper)||void 0===ne||ne.addClass("data-table-highlight-col");if(h&&p)null===(re=this.table.wrapper)||void 0===re||re.addClass("data-table-highlight-all")}}}}},{key:"hideHighlight",value:function(){var e,t,n,r,i,o,a,s;null===(e=this.highlight)||void 0===e||e.hide(),null===(t=this.colsHeader)||void 0===t||t.find(".active").removeClass("active"),null===(n=this.rowsHeader)||void 0===n||n.find(".active").removeClass("active"),null===(r=this.tableHeader)||void 0===r||r.removeClass("active"),null===(i=this.table.wrapper)||void 0===i||i.removeClass("data-table-highlight"),null===(o=this.table.wrapper)||void 0===o||o.removeClass("data-table-highlight-row"),null===(a=this.table.wrapper)||void 0===a||a.removeClass("data-table-highlight-col"),null===(s=this.table.wrapper)||void 0===s||s.removeClass("data-table-highlight-all")}},{key:"destroy",value:function(){this.unbindEvents()}}]),n}(Ln.EventEmitter2),Wr=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(e,i){var o;return(0,r.Z)(this,n),o=t.call(this),o.editor=void 0,o.table=void 0,o.tableCleared=!1,o.rowCleared=!1,o.colCleared=!1,o.tableRoot=void 0,o.colsHeader=void 0,o.rowsHeader=void 0,o.tableHeader=void 0,o.viewport=void 0,o.clearFormat=function(){var e=o.table,t=e.selection,n=e.helper;t.getSelectArea();t.each((function(e){!n.isEmptyModelCol(e)&&e.element&&e.element.removeAttribute("style")})),o.emit("actioned","clearFormat")},o.hasCopyData=function(){return!!o.table.helper.getCopyData()},o.clearCopyData=function(){o.table.helper.clearCopyData()},o.editor=e,o.table=i,o}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.table.wrapper;e&&(this.tableRoot=e.find(Or.TABLE_CLASS),this.colsHeader=e.find(Or.COLS_HEADER_CLASS),this.rowsHeader=e.find(Or.ROWS_HEADER_CLASS),this.tableHeader=e.find(Or.HEADER_CLASS),this.viewport=e.find(Or.VIEWPORT))}},{key:"insertColAt",value:function(e,t,n,r){var i,o,a=this,l=this.table,c=l.selection,A=l.wrapper,u=c.tableModel;if(A&&u&&this.tableRoot){var d=e,h=n?"after":"before",p=A.find(Or.COLS_HEADER_ITEM_CLASS),f=null===(i=p.eq(d))||void 0===i?void 0:i.get(),g=n?d+1:d,m=A.find(Or.COLS_HEADER_CLASS),v=A.find(Or.TABLE_CLASS);r||(r=f.offsetWidth);var b=this.table.root.width(),y=this.table.colMinWidth,w=[];if(p.each((function(e,t){var n=p.eq(t);n&&w.push((0,s.ZQ)(n.css("width")))})),Array.isArray(r))for(var x=0;xb){for(var B=0,_=0;_y){if(w[_]=E-1,C--,C<=b)break}else B++}if(B===w.length)break}m.css("width",C+"px"),v.css("width",C+"px");var S=this.tableRoot.find("colgroup"),F=A.find("tr"),T=this.tableRoot.find("col"),M=null===(o=T.eq(d))||void 0===o?void 0:o.clone();if(M){var I=t,N=this.editor.nodeId;while(I>0){var U=(0,s.$)(f.outerHTML);(0,s.$)(f)[h](U);var L=null===M||void 0===M?void 0:M.clone();L.removeAttributes(s.Mr),N.create(L);var Q=T[e];"after"===h?(0,s.$)(Q).after(L):S[0].insertBefore(L[0],Q),I--}p=A.find(Or.COLS_HEADER_ITEM_CLASS),T=this.tableRoot.find("col");for(var D=0;D4?Z-4:0),P=4;P1&&void 0!==arguments[1]?arguments[1]:1,r=this.table,i=r.selection,o=r.wrapper,a=i.tableModel;if(o&&a){var s=i.getSelectArea(),l="left"===e,c="end"===e||!e,A=o.find(Or.COLS_HEADER_ITEM_CLASS),u=a.cols-1;c||(u=l?s.begin.col:s.end.col);var d=l?u-1:u+1;d<0?(d=0,l=!1):l||u!==a.cols-1||(d--,l=!0);for(var h=null===(t=A.eq(u))||void 0===t?void 0:t.get().offsetWidth,p=arguments.length,f=new Array(p>2?p-2:0),g=2;g=l.begin.col;h--){var p;r.removeCol(h),null===(p=d.eq(h))||void 0===p||p.remove()}a.forEach((function(t,n){for(var r=l.end.col;r>=l.begin.col;r--){var o=t[r];if(i.isEmptyModelCol(o)){var A=a[o.parent.row][o.parent.col];if(!i.isEmptyModelCol(A)&&o.parent.coll.end.col,f=l.end.col+1-r;if(p){for(var g,m,v=0,b=0;b<=l.end.col;b++)i.isEmptyModelCol(t[b])||v++;var y=null===(g=u.eq(n))||void 0===g||null===(m=g.get())||void 0===m?void 0:m.insertCell(v);if(!y)return;y.setAttribute(s.rN,"table-cell-selection"),y.innerHTML=e.table.template.getEmptyCell(),y.colSpan=o.colSpan-f,y.rowSpan=o.rowSpan,e.editor.nodeId.generate(y)}}null===(h=o.element)||void 0===h||h.remove()}}}));for(var f=arguments.length,g=new Array(f),m=0;m0&&void 0!==arguments[0]?arguments[0]:1;this.insertCol("left",e)}},{key:"insertColRight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertCol("right",e)}},{key:"insertRowAt",value:function(e,t,n){var r=this,i=this.table,o=i.wrapper,a=i.selection,l=i.helper,c=a.tableModel;if(o&&c){var A=n?"after":"before",u=e,d=o.find(Or.ROWS_HEADER_ITEM_CLASS),h=d[u],p=n?u:u+1,f=[],g=c.table[u];g.forEach((function(e,r){if(l.isEmptyModelCol(e)||!e.isMulti)if(l.isEmptyModelCol(e)){var i=c.table[e.parent.row][e.parent.col];!l.isEmptyModelCol(i)&&e.parent.row=p?i.element.rowSpan=i.rowSpan+t:!l.isEmptyModelCol(i)&&e.parent.row1&&p<=u+e.rowSpan-1?e.element.rowSpan=e.rowSpan+t:f.push({tdBase:e.element})}));var m=t,v=this.editor.nodeId,b=function(){var e,t,n=null===(e=r.tableRoot)||void 0===e||null===(t=e.get())||void 0===t?void 0:t.insertRow(p);n&&(f.forEach((function(e){var t=n.insertCell();t.setAttribute(s.rN,"table-cell-selection"),t.innerHTML=r.table.template.getEmptyCell(),t.colSpan=e.tdBase.colSpan})),(0,s.$)(h)[A]((0,s.$)(h.outerHTML)),v.generate(n),v.generateAll(n),m--)};while(m>0)b();for(var y=arguments.length,w=new Array(y>3?y-3:0),x=3;x1&&void 0!==arguments[1]?arguments[1]:1,n=this.table,r=n.selection,i=n.helper,o=r.tableModel;if(o){var a=r.getSelectArea(),s="up"===e,l="end"===e||!e,c=o.rows-1;if(!l){var A=a.end.row;r.each((function(e){i.isEmptyModelCol(e)||(A+=e.rowSpan-1)})),c=s?a.begin.row:A}for(var u=c,d=arguments.length,h=new Array(d>2?d-2:0),p=2;p0&&void 0!==arguments[0]?arguments[0]:1;this.insertRow("up",e)}},{key:"insertRowDown",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertRow("down",e)}},{key:"removeRow",value:function(){var e=this,t=this.table,n=t.selection,r=t.conltrollBar,i=t.helper,o=n.tableModel;if(o&&this.tableRoot){var a=o.table,l=(0,nn.Z)({},n.getSelectArea()),c=l.begin,A=l.end;A.row-c.row===0&&n.each((function(e){i.isEmptyModelCol(e)||(A.row+=e.rowSpan-1)}));var u=A.row-c.row+1,d=this.tableRoot.find("tr");if(l.allRow)this.removeTable();else{for(var h=function(t){var r=a[t];r.forEach((function(r,o){if(!i.isEmptyModelCol(r)&&r.isMulti&&r.rowSpan>1&&t+r.rowSpan-1>A.row){var l=n.getCellIndex(A.row+1,o),h=d[A.row+1].insertCell(l),p=A.row-t+1;h.setAttribute(s.rN,"table-cell-selection"),h.innerHTML=e.table.template.getEmptyCell(),h.colSpan=r.colSpan,h.rowSpan=r.rowSpan-p,e.editor.nodeId.generate(h)}if(i.isEmptyModelCol(r)){var f=a[r.parent.row][r.parent.col];if(!i.isEmptyModelCol(f)&&r.parent.row=c.row;f--){var g;null===(g=this.tableRoot.get())||void 0===g||g.deleteRow(f),r.removeRow(f)}for(var m=arguments.length,v=new Array(m),b=0;b0&&void 0!==arguments[0]&&arguments[0],t=this.table,n=t.selection,r=t.helper,i=n.getSelectionHtml(e);i&&(this.editor.clipboard.copy(i),r.copyHTML(i))}},{key:"mockCopy",value:function(){var e=this.table,t=e.selection,n=e.helper,r=t.getSelectionHtml();r&&n.copyHTML(r)}},{key:"shortcutCopy",value:function(e){var t,n,r,i=this.table,o=i.selection,a=i.helper,l=o.getSelectionHtml();l&&(null===(t=e.clipboardData)||void 0===t||t.clearData(),null===(n=e.clipboardData)||void 0===n||n.setData("text/plain",(0,s.$)(l).html()),null===(r=e.clipboardData)||void 0===r||r.setData("text/html",l),a.copyHTML(l),e.preventDefault())}},{key:"cut",value:function(){this.copy(),this.clear()}},{key:"shortcutCut",value:function(e){this.shortcutCopy(e),this.clear()}},{key:"clear",value:function(){var e=this,t=this.table,n=t.selection,r=t.helper,i=n.getSelectArea();if(i.allCol&&i.allRow){if(this.tableCleared)return this.removeTable(),void(this.tableCleared=!1);this.tableCleared=!0}if(i.allRow){if(this.rowCleared)return this.removeRow(),void(this.rowCleared=!1);this.rowCleared=!0}if(i.allCol){if(this.colCleared)return this.removeCol(),void(this.colCleared=!1);this.colCleared=!0}n.each((function(t){!r.isEmptyModelCol(t)&&t.element&&(t.element.innerHTML=e.table.template.getEmptyCell())})),this.emit("actioned","clear")}},{key:"mockPaste",value:function(){var e=this.table.helper.getCopyData();if(e){for(var t=arguments.length,n=new Array(t),r=0;r1?g-1:0),v=1;vi.cols){var S=w+a.col-i.cols;this.insertCol("end",S,!0)}if(y+a.row>i.rows){var F=y+a.row-i.rows;this.insertRow("end",F,!0)}n.select(a,{row:a.row+y-1,col:a.col+w-1})}var T=n.getSelectArea();m[0]||this.splitCell(!0),n.each((function(e,t,n){var i=(t-T.begin.row)%y,o=(n-T.begin.col)%w,a=b.table[i][o];if(a){if(!r.isEmptyModelCol(a)&&a.isMulti&&!r.isEmptyModelCol(e)){var s=e.element;return s.rowSpan=Math.min(a.rowSpan,T.end.row-t+1),s.colSpan=Math.min(a.colSpan,T.end.col-n+1),void r.copyTo(a.element,s)}var l;if(r.isEmptyModelCol(a))r.isEmptyModelCol(e)||null===(l=e.element)||void 0===l||l.remove();else a.element&&!r.isEmptyModelCol(e)&&e.element&&r.copyTo(a.element,e.element)}}))}else this.mergeCell(!0);this.emit.apply(this,["actioned","paste"].concat(m))}}}},{key:"mergeCell",value:function(){var e=this.table,t=e.selection,n=e.helper,r=t.selectArea,i=t.tableModel;if(r&&i){var o=r.begin,a=r.end,l=a.row-o.row+1,c=a.col-o.col+1,A=[],u=null;if(this.splitCell(),t.select(o,a),t.each((function(e,t,r){if(!n.isEmptyModelCol(e))return r===o.col&&t===o.row?(u=e.element,u.rowSpan=l,void(u.colSpan=c)):void(e.element&&(""!==e.element.innerText.trim()&&A.unshift((0,s.$)(e.element).find(Or.TABLE_TD_CONTENT_CLASS).html()),e.element.remove()))})),u){var d=(0,s.$)(u),h=d.find(Or.TABLE_TD_CONTENT_CLASS);h.html(h.html()+A.join(""));for(var p=arguments.length,f=new Array(p),g=0;g=a;u--){u>=o.length&&e.insertRowAt(a,1);for(var d=u>=o.length?e.tableRoot.find("tr")[u]:o[u],h=A-1;h>=l;h--){var p=i.table[u][h];if(!r.isEmptyModelCol(p)&&p.isMulti)p.element=p.element,p.element.colSpan=1,p.element.rowSpan=1;else if(r.isEmptyModelCol(p)){var f=n.getCellIndex(u,h),g=d.insertCell(f);e.editor.nodeId.generate(g),g.setAttribute(s.rN,"table-cell-selection"),g.innerHTML=e.table.template.getEmptyCell()}}}}));for(var a=arguments.length,l=new Array(a),c=0;c2&&t.x<5)?this.colors[4][t.x]:e},jr.getColors=function(){return this.colors};var Vr=(0,F.Z)("editor"),Gr=(0,F.Z)("options"),$r=(0,F.Z)("color"),Yr=(0,F.Z)("button"),Xr=(0,F.Z)("cardId"),Jr=(0,F.Z)("container"),ei=(0,F.Z)("position"),ti=function(){function e(t,n,i){var o=this;(0,r.Z)(this,e),Object.defineProperty(this,Vr,{writable:!0,value:void 0}),Object.defineProperty(this,Gr,{writable:!0,value:void 0}),Object.defineProperty(this,$r,{writable:!0,value:void 0}),Object.defineProperty(this,Yr,{writable:!0,value:void 0}),Object.defineProperty(this,Xr,{writable:!0,value:void 0}),Object.defineProperty(this,Jr,{writable:!0,value:void 0}),Object.defineProperty(this,ei,{writable:!0,value:void 0}),this.windowClick=function(e){var t=e.target;t&&0===(0,s.$)(t).closest(".data-table-color-tool,.table-color-dropdown-arrow").length&&o.remove()},(0,S.Z)(this,Vr)[Vr]=t,(0,S.Z)(this,Xr)[Xr]=n,(0,S.Z)(this,Gr)[Gr]=i,(0,S.Z)(this,ei)[ei]=new s.Ly((0,S.Z)(this,Vr)[Vr]),(0,S.Z)(this,$r)[$r]=i.defaultColor||"transparent",(0,S.Z)(this,Yr)[Yr]=(0,s.$)('
\n \n \n
')),(0,S.Z)(this,Yr)[Yr].find(".table-color-dropdown-arrow").on("mousedown",(function(e){e.preventDefault(),void 0!==(0,S.Z)(o,Jr)[Jr]&&(0,S.Z)(o,Jr)[Jr].length>0?o.remove():o.render()})),(0,S.Z)(this,Yr)[Yr].find(".table-color-dropdown-button-text").on("mousedown",(function(e){e.preventDefault();var t=(0,S.Z)(o,Gr)[Gr].onChange;t&&t((0,S.Z)(o,$r)[$r])}))}return(0,i.Z)(e,[{key:"getButton",value:function(){return(0,S.Z)(this,Yr)[Yr]}},{key:"select",value:function(e){var t=jr.getStroke(e),n=(0,S.Z)(this,Yr)[Yr].find("rect");n.attributes("stroke",t),n.attributes("fill",e),(0,S.Z)(this,Yr)[Yr].find("svg").css("margin-bottom","transparent"===e?-5:-3)}},{key:"change",value:function(e){(0,S.Z)(this,$r)[$r]=e,this.select(e);var t=(0,S.Z)(this,Gr)[Gr].onChange;t&&t(e)}},{key:"toState",value:function(e,t){var n,r=null!==(n=e.hex)&&void 0!==n?n:e;"transparent"===r&&(r="rgba(0,0,0,0)");var i=(0,ur.Vi)(r),o=i.toHsl(),a=i.toHsv(),s=i.toRgb(),l=i.toHex();0===o.s&&(o.h=t||0,a.h=t||0);var c="000000"===l&&0===s.a;return{hsl:o,hex:c?"transparent":"#".concat(l),rgb:s,hsv:a,oldHue:e["h"]||t||o.h,source:e["source"]}}},{key:"render",value:function(){var e,t=this;(0,S.Z)(this,Jr)[Jr]=(0,s.$)('
'));var n=(0,s.$)('
'),r=(0,S.Z)(this,Gr)[Gr].colors,i=function(e,r){var i=t.toState(e.color||"#FFFFFF"),o=["#ffffff","#fafafa","transparent"].indexOf(i.hex)>=0,a=(0,s.$)(''));return a.on("mousedown",(function(i){i.preventDefault(),i.stopPropagation(),n.find("svg").each((function(e){e.style.display="none"})),!1!==r&&a.find("svg").css("display","block"),t.change(e.color)})),a},o=(0,s.$)('
'),a=i({color:"transparent"},!1);o.append(a),o.on("mousedown",(function(e){e.preventDefault(),n.find("svg").each((function(e){e.style.display="none"})),t.change("transparent")}));var l=(0,S.Z)(this,Vr)[Vr].language.get("table","color","nonFillText");o.append((0,s.$)(''.concat(l,""))),(0,S.Z)(this,Jr)[Jr].append(o),r.forEach((function(e){var t=(0,s.$)('
');e.forEach((function(e){var n=i(e);t.append(n)})),n.append(t)})),(0,S.Z)(this,Jr)[Jr].append(n),null===(e=(0,S.Z)(this,ei)[ei])||void 0===e||e.bind((0,S.Z)(this,Jr)[Jr],(0,S.Z)(this,Yr)[Yr]),document.addEventListener("mousedown",this.windowClick,!0)}},{key:"remove",value:function(){var e,t;null===(e=(0,S.Z)(this,Jr)[Jr])||void 0===e||e.remove(),null===(t=(0,S.Z)(this,ei)[ei])||void 0===t||t.destroy(),document.removeEventListener("mousedown",this.windowClick,!0),(0,S.Z)(this,Jr)[Jr]=void 0}},{key:"destroy",value:function(){this.remove();var e=(0,S.Z)(this,Gr)[Gr].onDestroy;e&&e()}}]),e}();function ni(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ri='.table-color-dropdown-trigger {\r\n display: flex;\r\n}\r\n\r\n.table-color-dropdown-trigger:hover {\r\n background: transparent !important;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-button-text, .table-color-dropdown-trigger .table-color-dropdown-arrow {\r\n display: inline-block;\r\n width: auto;\r\n margin: 0;\r\n text-align: center;\r\n background-color: transparent;\r\n border: 1px solid transparent;\r\n border-radius: 3px 3px;\r\n font-size: 16px;\r\n cursor: pointer;\r\n color: #595959;\r\n outline: none;\r\n margin-right: 0;\r\n min-width: 26px;\r\n border-radius: 3px 0 0 3px;\r\n padding: 0 4px;\r\n}\r\n\r\n.table-color-dropdown-trigger:hover .table-color-dropdown-button-text, .table-color-dropdown-trigger:hover .table-color-dropdown-arrow\r\n{\r\n border: 1px solid #e8e8e8;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-button-text:hover, .table-color-dropdown-trigger .table-color-dropdown-arrow:hover {\r\n background-color: #f5f5f5;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow {\r\n margin-left: -1px;\r\n min-width: 17px;\r\n text-align: center;\r\n border-radius: 0 3px 3px 0;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow .table-color-dropdown-empty {\r\n display: inline-block;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 5px;\r\n top: 12px;\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n}\r\n\r\n.data-table-color-tool {\r\n outline: none;\r\n width: auto;\r\n border-radius: 3px 3px;\r\n position: absolute;\r\n border: 1px solid #e8e8e8;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\r\n z-index: 130;\r\n text-indent: 0;\r\n top:0;\r\n padding: 8px 0;\r\n background: #fff;\r\n}\r\n\r\n.data-table-color-tool-mobile {\r\n width: calc(100vw - 20px);\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-panle {\r\n position: relative;\r\n text-align: left;\r\n text-indent: 0;\r\n width: 100%;\r\n height: auto;\r\n margin-top: 8px;\r\n padding: 0 8px;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group\r\n{\r\n display: flex;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span {\r\n width: 24px;\r\n height: 24px;\r\n display: inline-block;\r\n cursor: pointer;\r\n background-color: rgb(255, 255, 255);\r\n padding: 2px;\r\n border-radius: 3px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n flex: 0 0 auto;\r\n position: relative;\r\n}\r\n\r\n.data-table-color-tool span.data-table-color-tool-border > span {\r\n border: 1px solid #e8e8e8 !important;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span > span\r\n{\r\n position: relative;\r\n width: 18px;\r\n height: 18px;\r\n display: block;\r\n border-radius: 2px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span > span > svg {\r\n position: absolute;\r\n top: -1px;\r\n left: 1px;\r\n width: 12px;\r\n height: 12px;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default {\r\n display: flex;\r\n align-items: center;\r\n margin: 2px 0 8px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n padding: 2px 8px;\r\n} \r\n\r\n.data-table-color-tool .data-table-color-tool-default:hover {\r\n background: #f5f5f5;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default > span:first-child::after {\r\n content: "";\r\n display: block;\r\n position: absolute;\r\n top: 10px;\r\n left: 0px;\r\n width: 22px;\r\n height: 0;\r\n border-bottom: 2px solid #ff5151;\r\n transform: rotate(45deg);\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default .data-table-color-tool-default-text {\r\n width: auto;\r\n margin-left: 8px;\r\n height: auto;\r\n background: transparent;\r\n}';ni(ri);var ii=(0,F.Z)("changeTimeout"),oi=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(e){var i,o;(0,r.Z)(this,n),o=t.call(this,e),o.contenteditable=["div".concat(Or.TABLE_TD_CONTENT_CLASS)],o.colMinWidth=void 0,o.rowMinHeight=void 0,o.maxInsertNum=void 0,o.wrapper=void 0,o.helper=void 0,o.template=void 0,o.selection=void 0,o.conltrollBar=void 0,o.command=void 0,o.scrollbar=void 0,o.viewport=void 0,o.colorTool=void 0,o.noBorderToolButton=void 0,o.alignToolButton=void 0,o.enableScroll=void 0,Object.defineProperty((0,E.Z)(o),ii,{writable:!0,value:void 0}),o.getOptions=function(){var e;return null===(e=o.editor.plugin.findPlugin("table"))||void 0===e?void 0:e.options},o.doChange=function(){o.remoteRefresh(),o.handleChange("local")},o.handleChange=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local",r=o.editor;o.conltrollBar.refresh(),o.selection.render("change");var a,l=(0,d.Z)((i=(0,E.Z)(o),(0,h.Z)(n.prototype)),"getValue",i).call(i);(null===l||void 0===l?void 0:l.noBorder)?null===(a=o.noBorderToolButton)||void 0===a||a.addClass("active"):null===(e=o.noBorderToolButton)||void 0===e||e.removeClass("active");if("local"===t&&(0,s.iC)(r)){var c=o.getValue();c&&o.setValue(c)}},o.onChange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local",t=o.editor;(0,s.iC)(t)&&"local"===e&&t.model.mutation.isStopped||((0,S.Z)((0,E.Z)(o),ii)[ii]&&clearTimeout((0,S.Z)((0,E.Z)(o),ii)[ii]),(0,S.Z)((0,E.Z)(o),ii)[ii]=setTimeout((function(){o.handleChange(e),"remote"===e&&o.remoteRefresh()}),50))},o.updateScrollbar=function(){var e,t,n,r;if(o.scrollbar&&o.enableScroll){var i=((null===(e=o.wrapper)||void 0===e||null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.bottom)||0)-((null===(n=o.wrapper)||void 0===n?void 0:n.getViewport().bottom)||0);null===(r=o.wrapper)||void 0===r||r.find(".data-scrollbar-x").css({bottom:"".concat(i>0?i+2:0,"px")})}},o.remoteRefreshTimeout=null;var a=o.getOptions();return o.colMinWidth=(null===a||void 0===a?void 0:a.colMinWidth)||40,o.rowMinHeight=(null===a||void 0===a?void 0:a.rowMinHeight)||35,o.maxInsertNum=(null===a||void 0===a?void 0:a.maxInsertNum)||30,o.helper=new Rr(o.editor),o.template=new Or((0,E.Z)(o)),o.selection=new Kr(o.editor,(0,E.Z)(o)),o.conltrollBar=new qr(o.editor,(0,E.Z)(o),{col_min_width:o.colMinWidth,row_min_height:o.rowMinHeight,max_insert_num:o.maxInsertNum}),o.command=new Wr(o.editor,(0,E.Z)(o)),o.enableScroll=!1!==(null===a||void 0===a?void 0:a.enableScroll),o}return(0,i.Z)(n,[{key:"init",value:function(){var e,t=this;(0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this);var r=this.editor;(0,s.iC)(r)&&(r.event.listeners["keydown:tab"]||(r.event.listeners["keydown:tab"]=[]),r.event.listeners["keydown:tab"].unshift((function(e){if((0,s.iC)(r)&&!r.readonly){var n=r.change,i=r.block,o=r.node,a=r.card,l=n.range.get(),c=l.endNode.closest("td");if(0!==c.length&&c.inEditor()){var A=a.closest(c,!0);if(null===A||void 0===A?void 0:A.equal(t.root)){var u=i.closest(l.endNode);if(c.length>0&&(i.isLastOffset(l,"end")||"li"!==u.name&&o.isEmptyWidthChild(u))){var d=c.next();if(!d){var h,p,f,g=null===(h=c.parent())||void 0===h?void 0:h.next();if(g)d=g.find("td:first-child")||null;else t.command.insertRowDown(),d=(null===(p=c.parent())||void 0===p||null===(f=p.next())||void 0===f?void 0:f.find("td:first-child"))||null}if(d)return e.preventDefault(),t.selection.focusCell(d),!1}c.length>0&&t.enableScroll&&setTimeout((function(){var e;null===(e=t.scrollbar)||void 0===e||e.refresh()}),0)}}}})),r.on("keydown:down",(function(e){if((0,s.iC)(r)&&!r.readonly){var n=r.change,i=r.card,o=n.range.get(),a=o.endNode.closest("td");if(0!==a.length&&a.inEditor()){var l=i.closest(a,!0);if(null===l||void 0===l?void 0:l.equal(t.root)){var c=a.find(".table-main-content");if(c){var A=c.get().getBoundingClientRect(),u=o.getBoundingClientRect();if(a.length>0&&(0===u.bottom||A.bottom-u.bottom<10)){var d,h=a.index(),p=null===(d=a.parent())||void 0===d?void 0:d.next();if(!p){e.preventDefault();var f=o.cloneRange(),g=t.root.next(),m=g?i.find(g):void 0;return(null===m||void 0===m?void 0:m.onSelectDown)?m.onSelectDown(e):(i.focusNextBlock(t,f,!1),n.range.select(f)),!1}var v,b=0,y=p.find("td:last-child");if(null===(v=t.selection.tableModel)||void 0===v||v.table[p.index()].some((function(e){return!t.helper.isEmptyModelCol(e)&&b>=h&&e.element?(y=(0,s.$)(e.element),!0):(b++,!1)})),y)return e.preventDefault(),t.selection.focusCell(y,!0),!1}a.length>0&&t.enableScroll&&setTimeout((function(){var e;null===(e=t.scrollbar)||void 0===e||e.refresh()}),0)}}}}})),r.on("keydown:up",(function(e){if((0,s.iC)(r)&&!r.readonly){var n=r.change,i=r.card,o=n.range.get(),a=o.endNode.closest("td");if(0!==a.length&&a.inEditor()){var l=i.closest(a,!0);if(null===l||void 0===l?void 0:l.equal(t.root)){var c=a.find(".table-main-content");if(c){var A=c.get().getBoundingClientRect(),u=o.getBoundingClientRect();if(a.length>0&&(0===u.top||u.top-A.top<10)){var d,h=a.index(),p=null===(d=a.parent())||void 0===d?void 0:d.prev();if(!p){e.preventDefault();var f=o.cloneRange(),g=t.root.prev(),m=g?i.find(g):void 0;return(null===m||void 0===m?void 0:m.onSelectUp)?m.onSelectUp(e):(i.focusPrevBlock(t,f,!1),n.range.select(f)),!1}var v,b=0,y=p.find("td:first-child");if(null===(v=t.selection.tableModel)||void 0===v||v.table[p.index()].some((function(e){return!t.helper.isEmptyModelCol(e)&&b>=h&&e.element?(y=(0,s.$)(e.element),!0):(b++,!1)})),y)return e.preventDefault(),t.selection.focusCell(y),!1}a.length>0&&t.enableScroll&&setTimeout((function(){var e;null===(e=t.scrollbar)||void 0===e||e.refresh()}),0)}}}}})),r.on("keydown:left",(function(){if((0,s.iC)(r)&&!r.readonly){var e=r.change,n=r.card,i=e.range.get(),o=i.endNode.closest("td");if(0!==o.length&&o.inEditor()){var a=n.closest(o,!0);if(null===a||void 0===a?void 0:a.equal(t.root)){var l=o.find(".table-main-content");l&&o.length>0&&t.enableScroll&&setTimeout((function(){var e;null===(e=t.scrollbar)||void 0===e||e.refresh()}),0)}}}})),r.on("keydown:right",(function(){if((0,s.iC)(r)&&!r.readonly){var e=r.change,n=r.card,i=e.range.get(),o=i.endNode.closest("td");if(0!==o.length&&o.inEditor()){var a=n.closest(o,!0);if(null===a||void 0===a?void 0:a.equal(t.root)){var l=o.find(".table-main-content");l&&o.length>0&&t.enableScroll&&setTimeout((function(){var e;null===(e=t.scrollbar)||void 0===e||e.refresh()}),0)}}}}))),this.colorTool||(this.colorTool=new ti(r,this.id,{colors:n.colors,defaultColor:null===(e=(0,d.Z)((0,h.Z)(n.prototype),"getValue",this).call(this))||void 0===e?void 0:e.color,onChange:function(e){t.conltrollBar.drawBackgroundColor(e);var n=t.getValue();t.setValue((0,nn.Z)((0,nn.Z)({},n),{},{color:e}))}}))}},{key:"toolbar",value:function(){var e=this,t=this.editor,r=function(){var r,i;if(!(0,s.iC)(t)||t.readonly)return[{key:"maximize",type:"maximize"}];var o=t.language.get("table"),a=[{key:"color",type:"node",title:t.language.get("table","color","title"),node:e.colorTool.getButton()},{key:"border",type:"button",title:(null===(r=(0,d.Z)((0,h.Z)(n.prototype),"getValue",e).call(e))||void 0===r?void 0:r.noBorder)?o["showBorder"]:o["noBorder"],content:'',didMount:function(t){var r=(0,d.Z)((0,h.Z)(n.prototype),"getValue",e).call(e);!0===(null===r||void 0===r?void 0:r.noBorder)&&t.addClass("active"),e.noBorderToolButton=t},onClick:function(t,r){var i,o=(0,d.Z)((0,h.Z)(n.prototype),"getValue",e).call(e);e.setValue({noBorder:!(null===o||void 0===o?void 0:o.noBorder)});var a=null===(i=e.wrapper)||void 0===i?void 0:i.find(".data-table");!0===(null===o||void 0===o?void 0:o.noBorder)?(null===a||void 0===a||a.removeAttributes("data-table-no-border"),r.removeClass("active")):(null===a||void 0===a||a.attributes("data-table-no-border","true"),r.addClass("active"))}},{key:"align",type:"dropdown",content:'',title:o["verticalAlign"]["title"],didMount:function(t){e.alignToolButton=t.find(".data-toolbar-btn")},items:[{type:"button",content:' '.concat(o["verticalAlign"]["top"]),onClick:function(t){return e.updateAlign(t,"top")}},{type:"button",content:' '.concat(o["verticalAlign"]["middle"]),onClick:function(t){return e.updateAlign(t,"middle")}},{type:"button",content:' '.concat(o["verticalAlign"]["bottom"]),onClick:function(t){return e.updateAlign(t,"bottom")}}]},{key:"merge",type:"button",title:o["mergeCell"],content:'',disabled:e.conltrollBar.getMenuDisabled("mergeCell"),onClick:function(){e.command.mergeCell()}},{key:"split",type:"button",title:o["splitCell"],content:'',disabled:e.conltrollBar.getMenuDisabled("splitCell"),onClick:function(){e.command.splitCell()}}];if(e.isMaximize)return a;var l=[{key:"maximize",type:"maximize"},{key:"copy",type:"copy",onClick:function(){e.command.copy(!0),t.messageSuccess("copy",t.language.get("copy","success"))}},{key:"delete",type:"delete"},{key:"separator",type:"separator"}].concat(a);return 0===(0,s.ZQ)((null===(i=e.wrapper)||void 0===i?void 0:i.css("margin-left"))||"0")&&l.unshift({key:"dnd",type:"dnd"}),l},i=this.getOptions();return(null===i||void 0===i?void 0:i.cardToolbars)?i.cardToolbars(r(),this.editor):r()}},{key:"onSelectLeft",value:function(e){var t=this.selection.tableModel;if(t)for(var n=t.rows-1;n>=0;n--)for(var r=t.cols-1;r>=0;r--){var i=t.table[n][r];if(!this.helper.isEmptyModelCol(i)&&i.element)return e.preventDefault(),this.selection.focusCell(i.element,!1),!1}}},{key:"onSelectRight",value:function(e){var t=this.selection.tableModel;if(t)for(var n=0;n=0;n--)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"top";e.preventDefault(),this.conltrollBar.setAlign(t),this.onChange("local"),this.updateAlignText(t)}},{key:"updateAlignText",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top",n='');null===(e=this.alignToolButton)||void 0===e||e.html(n)}},{key:"getValue",value:function(){var e=(0,d.Z)((0,h.Z)(n.prototype),"getValue",this).call(this);if(!this.wrapper)return e;var t=this.wrapper.find(Or.TABLE_CLASS);if(!t)return e;var r=this.selection.tableModel;if(!r)return e;var i=this.editor,o=i.schema,a=i.conversion,l=(0,s.$)("
");l.append(t.clone(!0));var c=new s._b(l,i,(function(e){e.find(Or.TABLE_TD_BG_CLASS).remove(),e.find(s.Su).each((function(e){"TD"===e.nodeName?(0,s.$)(e).removeAttributes(s.Zi):i.node.unwrap((0,s.$)(e))}))})),A=r.rows,u=r.cols,p=r.height,f=r.width,g=c.toValue(o,a,!1,!1);return(0,s.iC)(i)?(0,nn.Z)((0,nn.Z)({},e),{},{rows:A,cols:u,height:p,width:f,html:g}):(0,nn.Z)((0,nn.Z)({},e),{},{html:g})}},{key:"drawBackground",value:function(e,t){var n,r,i=e.get().getBoundingClientRect(),o=new DOMRect(i.x,i.y,0,0),a=t.startContainer,l=t.endContainer,c=(0,s.oq)(a,"td"),A=(0,s.oq)(l,"td");if(c instanceof Element&&A instanceof Element&&"TD"===c.nodeName&&"TD"===(null===A||void 0===A?void 0:A.nodeName)&&c!==A){var u=c.getBoundingClientRect(),d=A.getBoundingClientRect(),h=null===(n=this.viewport)||void 0===n?void 0:n.getBoundingClientRect(),p=((null===h||void 0===h?void 0:h.left)||0)+(this.activated?13:0);return o.x=Math.max(u.left-i.left,p-((null===(r=this.editor.root.getBoundingClientRect())||void 0===r?void 0:r.left)||0)),o.y=u.top-i.top,o.width=(h?Math.min(d.right,h.right):d.right)-u.left,o.height=u.bottom-u.top,o.width<0&&(o.width=0),o.height=d.bottom-u.top,o}}},{key:"activate",value:function(e){var t,r,i;((0,d.Z)((0,h.Z)(n.prototype),"activate",this).call(this,e),e)?(this.conltrollBar.refresh(),null===(r=this.wrapper)||void 0===r||r.addClass("active")):(this.selection.clearSelect(),this.conltrollBar.hideContextMenu(),null===(i=this.wrapper)||void 0===i||i.removeClass("active"));this.enableScroll&&(null===(t=this.scrollbar)||void 0===t||t.refresh())}},{key:"maximize",value:function(){var e;(0,d.Z)((0,h.Z)(n.prototype),"maximize",this).call(this),this.enableScroll&&(null===(e=this.scrollbar)||void 0===e||e.refresh());var t=this.editor;(0,s.iC)(t)&&!s.tq&&this.getCenter().on("scroll",this.updateScrollbar,{passive:!0})}},{key:"minimize",value:function(){var e;(0,d.Z)((0,h.Z)(n.prototype),"minimize",this).call(this),this.enableScroll&&(null===(e=this.scrollbar)||void 0===e||e.refresh()),this.getCenter().off("scroll",this.updateScrollbar)}},{key:"getSelectionNodes",value:function(){var e=this,t=[];return this.selection.each((function(n){!e.helper.isEmptyModelCol(n)&&n.element&&t.push((0,s.$)(n.element).find(s.Su))})),1===t.length&&0===t[0].closest("[table-cell-selection=true]").length?[]:t}},{key:"overflow",value:function(e){var t,n;if(this.enableScroll){var r,i=(null===(t=this.wrapper)||void 0===t||null===(n=t.find(".data-table"))||void 0===n?void 0:n.width())||0,o=this.getCenter().width(),a=i-o;if(a>0&&!this.isMaximize)null===(r=this.wrapper)||void 0===r||r.css("margin-right","-".concat(a>e?e:a,"px"));else if(a<0||this.isMaximize){var s;null===(s=this.wrapper)||void 0===s||s.css("margin-right","")}}}},{key:"initScrollbar",value:function(){var e,t,n,r=this;if(this.viewport){var i=this.editor,o=i.plugin.findPlugin("table"),a=(null===o||void 0===o?void 0:o.options.overflow)||{},l=a.maxLeftWidth?{onScrollX:function(e){var t;r.isMaximize&&(e=0);var n=a.maxLeftWidth();return null===(t=r.wrapper)||void 0===t||t.css("margin-left","-".concat(e>n?n:e,"px")),e>0?i.root.find(".data-card-dnd").hide():i.root.find(".data-card-dnd").show(),e-n},getScrollLeft:function(e){var t;return e-(0,s.ZQ)((null===(t=r.wrapper)||void 0===t?void 0:t.css("margin-left"))||"0")},getOffsetWidth:function(e){var t;return e+(0,s.ZQ)((null===(t=r.wrapper)||void 0===t?void 0:t.css("margin-left"))||"0")}}:void 0;this.enableScroll&&(this.scrollbar=new s.LW(this.viewport,!0,!1,!0,l)),null===(e=this.scrollbar)||void 0===e||e.setContentNode(this.viewport.find(".data-table")),null===(t=this.scrollbar)||void 0===t||t.on("display",(function(e){var t,n;"block"===e?null===(t=r.wrapper)||void 0===t||t.addClass("scrollbar-show"):null===(n=r.wrapper)||void 0===n||n.removeClass("scrollbar-show")}));var c,A={x:0,y:0},u=function(e){var t=e.x,n=e.y;a["maxRightWidth"]&&r.overflow(a["maxRightWidth"]()),A.x===t&&A.y===n||(A={x:t,y:n},(0,s.iC)(i)&&(i.trigger("scroll",r.root,{x:t,y:n}),r.conltrollBar.refresh()))};if(null===(n=this.scrollbar)||void 0===n||n.on("change",u),s.tq||window.addEventListener("scroll",this.updateScrollbar,{passive:!0}),window.addEventListener("resize",this.updateScrollbar),(0,s.iC)(i)&&!s.tq)null===(c=i.scrollNode)||void 0===c||c.on("scroll",this.updateScrollbar,{passive:!0})}}},{key:"didRender",value:function(){var e,t,r,i,o,a=this;(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this);var l=this.editor;l.on("undo",this.doChange),l.on("redo",this.doChange),this.viewport=(0,s.iC)(l)?null===(e=this.wrapper)||void 0===e?void 0:e.find(Or.VIEWPORT):null===(t=this.wrapper)||void 0===t?void 0:t.find(Or.VIEWPORT_READER),this.selection.init(),this.conltrollBar.init(),this.command.init(),!(0,s.iC)(l)||l.readonly?null===(r=this.toolbarModel)||void 0===r||r.setOffset([0,0]):null===(i=this.toolbarModel)||void 0===i||i.setOffset([13,-28,0,-6]);var c=this.getOptions(),A=(null===c||void 0===c?void 0:c.overflow)||{};this.viewport&&(this.selection.refreshModel(),this.enableScroll&&setTimeout((function(){a.initScrollbar()}),0)),this.selection.on("select",(function(){var e,t;if(a.conltrollBar.refresh(!1),(0,s.iC)(l)){var n=null===(e=a.selection.getSingleCell())||void 0===e?void 0:e.css("vertical-align");a.updateAlignText(n),null===(t=a.toolbarModel)||void 0===t||t.update()}})),this.conltrollBar.on("sizeChanged",(function(){var e;a.selection.refreshModel(),a.onChange(),a.enableScroll&&(null===(e=a.scrollbar)||void 0===e||e.refresh())})),this.conltrollBar.on("sizeChanging",(function(){var e;a.enableScroll&&(null===(e=a.scrollbar)||void 0===e||e.refresh()),l.trigger("editor:resize"),a.updateScrollbar()})),this.command.on("actioned",(function(e,t){var n,r;"paste"===e&&l.card.render(a.wrapper),["splitCell","mergeCell","insertCol"].includes(e)&&l.trigger("editor:resize"),a.selection.render(e),null===(n=a.toolbarModel)||void 0===n||n.update(),t||a.onChange(),A.maxRightWidth&&a.overflow(A.maxRightWidth()),a.enableScroll&&(null===(r=a.scrollbar)||void 0===r||r.refresh())}));var u=null===(o=this.wrapper)||void 0===o?void 0:o.find(Or.TABLE_CLASS);if(u){var p=(0,d.Z)((0,h.Z)(n.prototype),"getValue",this).call(this);if(!(null===p||void 0===p?void 0:p.html)){var f=this.getValue();f&&(0,s.iC)(l)&&this.setValue(f),this.onChange()}A.maxRightWidth&&this.overflow(A.maxRightWidth())}}},{key:"remoteRefresh",value:function(){var e,t,r=this;if(this.wrapper&&0!==this.wrapper.length&&(null!==(e=this.wrapper[0].parentElement)&&void 0!==e?e:this.wrapper[0].parentNode)){var i=this.wrapper.find(Or.COLS_HEADER_CLASS),o=(0,d.Z)((0,h.Z)(n.prototype),"getValue",this).call(this),a=i.find(Or.COLS_HEADER_ITEM_CLASS),l=a.length;if(o.cols>l)i.append((0,s.$)(this.template.renderColsHeader(o.cols-l)).find(Or.COLS_HEADER_ITEM_CLASS)),a=i.find(Or.COLS_HEADER_ITEM_CLASS);else if(o.colso.cols;c--){var A;null===(A=a.eq(c-1))||void 0===A||A.remove()}var u=o.html?(0,s.$)(o.html):this.wrapper.find("table"),p=u.find("col").toArray();p.forEach((function(e,t){var n,i=e.attributes("width")||e.css("width");null===(n=a.eq(t))||void 0===n||n.css("width","".concat(Math.max(parseInt(i),r.colMinWidth),"px"))}));var f=this.wrapper.find(Or.ROWS_HEADER_CLASS),g=f.find(Or.ROWS_HEADER_ITEM_CLASS),m=g.length;if(o.rows>m)f.append((0,s.$)(this.template.renderRowsHeader(o.rows-m)).find(Or.ROWS_HEADER_ITEM_CLASS)),g=f.find(Or.ROWS_HEADER_ITEM_CLASS);else if(o.rowso.rows;v--){var b;null===(b=g.eq(v-1))||void 0===b||b.remove()}var y=u.find("tr").toArray();y.forEach((function(e,t){var n;null===(n=g.eq(t))||void 0===n||n.css("height",Math.max(parseInt(e.css("width")),r.rowMinHeight))})),this.enableScroll&&(null===(t=this.scrollbar)||void 0===t||t.refresh()),this.remoteRefreshTimeout&&clearTimeout(this.remoteRefreshTimeout),this.remoteRefreshTimeout=setTimeout((function(){var e;null===(e=r.wrapper)||void 0===e||e.find(s.Su).each((function(e){var t=e;t.hasAttribute(s.xT)||t.setAttribute(s.xT,r.template.isReadonly?"false":"true")}))}),10)}}},{key:"render",value:function(){var e,t=this.editor;if(this.template.isReadonly=!(0,s.iC)(t)||t.readonly,!(this.wrapper&&this.wrapper.length>0&&(null!==(e=this.wrapper[0].parentElement)&&void 0!==e?e:this.wrapper[0].parentNode))){var n=this.getValue();if(!n)return"Error value";if(n.html){var r=(0,s.$)(n.html);r&&"table"!==r.name&&(r=r.toArray().find((function(e){return"table"===e.name})),r?n.html=r.get().outerHTML:(n.html="
".concat(n.html,"
"),r=(0,s.$)(n.html)));var i=this.helper.getTableModel(r);n.rows=i.rows,n.cols=i.cols}if(this.wrapper=(0,s.iC)(t)?(0,s.$)(this.template.htmlEdit(n,Pr(t.language.get("table")))):(0,s.$)(this.template.htmlView(n)),(0,s.iC)(t)||this.wrapper.find("table").addClass("data-table").addClass("data-table-view"),n.rows=this.wrapper.find("tr").length,n.width){var o=this.root.width();this.wrapper.find("table").css("width","".concat(this.enableScroll?n.width:Math.min(n.width,o),"px"))}return this.wrapper}this.remoteRefresh()}},{key:"destroy",value:function(){var e,t;(0,d.Z)((0,h.Z)(n.prototype),"destroy",this).call(this);var r=this.editor;window.removeEventListener("scroll",this.updateScrollbar),window.removeEventListener("resize",this.updateScrollbar),null===(e=r.scrollNode)||void 0===e||e.off("scroll",this.updateScrollbar),this.enableScroll&&(null===(t=this.scrollbar)||void 0===t||t.destroy()),this.command.removeAllListeners();var i=this.selection;i.removeAllListeners(),i.destroy();var o=this.conltrollBar;o.removeAllListeners(),o.destroy(),r.off("undo",this.doChange),r.off("redo",this.doChange)}}],[{key:"cardName",get:function(){return"table"}},{key:"cardType",get:function(){return s.eT.BLOCK}},{key:"selectStyleType",get:function(){return s.dw.BACKGROUND}},{key:"autoSelected",get:function(){return!1}},{key:"lazyRender",get:function(){return!0}}]),n}(s.Zb);oi.colors=jr.getColors().map((function(e){return e.map((function(e){return{color:e,border:jr.getStroke(e)}}))}));var ai={table:{insertColLeft:"Insert column(s) $data left",insertColRight:"Insert column(s) $data right",insertRowUp:"Insert row(s) $data up",insertRowDown:"Insert row(s) $data down",mergeCell:"Merge cells",splitCell:"Unmerge cells",removeCol:"Delete selected column(s)",removeRow:"Delete selected row(s)",removeTable:"Delete table",copy:"Copy",cut:"Cut",paste:"Paste",clear:"Clear",draggingCol:"Moving $data column",draggingRow:"Moving $data row",color:{title:"Cell background color",nonFillText:"No fill color"},noBorder:"Hide border",showBorder:"Show border",verticalAlign:{title:"Vertical align",top:"Align top",middle:"Align middle",bottom:"Align bottom"}}},si={table:{insertColLeft:"左边插入 $data 列",insertColRight:"右边插入 $data 列",insertRowUp:"上方插入 $data 行",insertRowDown:"下方插入 $data 行",mergeCell:"合并单元格",splitCell:"拆分单元格",removeCol:"删除选中列",removeRow:"删除选中行",removeTable:"删除表格",copy:"复制",cut:"剪切",paste:"粘贴",clear:"清空内容",draggingCol:"正在移动 $data 列",draggingRow:"正在移动 $data 行",color:{title:"单元格背景色",nonFillText:"无填充色"},noBorder:"隐藏边框",showBorder:"显示边框",verticalAlign:{title:"垂直对齐",top:"顶对齐",middle:"垂直居中",bottom:"底对齐"}}},li={"en-US":ai,"zh-CN":si},ci='div[dnd-trigger-key="table"], div[toolbar-trigger-key="table"] {\n margin-left: -13px;\n margin-top: -13px;\n}\n\n.data-table {\n border: none;\n position: relative;\n z-index: 1;\n table-layout: fixed;\n white-space: pre-wrap;\n width: 100%;\n border-collapse: collapse;\n background-color: #ffffff;\n}\n\ndiv[data-card-key="table"].card-selected .data-table, div[data-card-key="table"].card-selected-other .data-table {\n background: transparent\n}\n\n.am-engine [data-card-key="table"].card-selected [data-card-element="center"].data-card-background-selected {\n background: transparent;\n}\n\n.am-engine [data-card-key="table"].card-selected [data-card-element="center"].data-card-background-selected .table-wrapper {\n background: rgba(27, 162, 227, 0.2);\n}\n\n.am-engine-mobile div[data-card-key="table"].card-activated {\n margin-left: 20px;\n}\n\n.data-table tr,.data-table td {\n position: relative;\n}\n\n.data-table tr {\n height: 35px;\n}\n\n.data-table tr td {\n border: none;\n vertical-align: top;\n cursor: text;\n}\n\n.data-table tr td[table-cell-selection]:after {\n content: \' \';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(180, 213, 254, 0.5);\n pointer-events: none;\n z-index: 2;\n}\n\n.drag-selecting .data-table, .data-table tr td[table-cell-selection] {\n caret-color:transparent\n}\n\n.data-table tr td[table-cell-selection] ::-moz-selection{\n background: transparent !important;\n}\n\n.data-table tr td[table-cell-selection] ::selection{\n background: transparent !important;\n}\n\n.table-wrapper {\n position: relative;\n cursor: default;\n}\n\n.table-wrapper.active {\n margin-top: -41px;\n width: 100%;\n}\n\n.table-wrapper.scrollbar-show {\n margin-bottom: -10px;\n}\n\n.table-wrapper.data-table-highlight tr td[table-cell-selection]:after {\n background: transparent;\n}\n\n.table-wrapper .table-header {\n position: absolute;\n visibility: hidden;\n left: -13px;\n top: 28px;\n width: 14px;\n height: 14px;\n cursor: pointer;\n z-index: 4;\n background-color: #ffffff;\n}\n\n.table-wrapper .table-header .table-header-item {\n border: 1px solid #dfdfdf;\n background-color: #f2f3f5;\n border-top-left-radius: 50%;\n width: 100%;\n height: 100%;\n}\n\n.table-wrapper .table-header:hover {\n background-color: #ffffff;\n}\n\n.table-wrapper.data-table-highlight-all .table-header .table-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n\n.table-wrapper .table-header-item:hover{\n background-color: #e2e4e6;\n}\n\n.table-wrapper.active .table-header {\n visibility:visible\n}\n\n.table-wrapper .table-header.selected .table-header-item {\n background: #4daaff;\n border-color: #4daaff;\n}\n\n.table-wrapper .table-cols-header {\n position: relative;\n height: 13px;\n display: none;\n width: 100%;\n cursor: default;\n}\n\n.table-wrapper.active .table-cols-header {\n display: flex;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item {\n position: relative;\n height: 13px;\n width: auto;\n border: 1px solid #dfdfdf;\n border-bottom: 0 none;\n overflow: visible;\n background: #f2f3f5;\n cursor: pointer;\n border-right: 0 none;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item.active{\n background-color: #e2e4e6;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item:first-child {\n border-top-left-radius: 2px;\n border-bottom-left-radius: 2px;\n}\n.table-wrapper .table-cols-header .table-cols-header-item:last-child {\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n border-right: 1px solid #dfdfdf;\n}\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item.active, .table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected {\n background: #fff;\n z-index: 1;\n border-radius: 0;\n border-bottom: 0;\n cursor: move;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected .col-dragger {\n display: flex;\n position: absolute;\n left: -1px;\n top: -1px;\n right: -1px;\n bottom: -1px;\n background: #4daaff;\n border-radius: 0;\n z-index: 1;\n justify-content: center;\n align-items: center;\n}\n\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item .col-dragger,.table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item .col-dragger {\n background: transparent !important;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected .col-dragger .drag-info {\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.no-dragger .col-dragger .data-icon {\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.dragging .col-dragger {\n height: 50px;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.dragging .col-dragger .drag-info {\n display: block;\n color: #fff;\n}\n.table-wrapper .table-cols-header .table-cols-header-item .cols-trigger {\n position: absolute;\n right: -1px;\n top: -1px;\n width: 2px;\n height: 14px;\n z-index: 10;\n}\n\n.am-engine-mobile .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger {\n right: -3px;\n width: 6px;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger.active {\n background: #0589f3;\n cursor: col-resize;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger.dragging {\n width: 2px;\n background: #0589f3;\n right: -1px;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger {\n text-align: center;\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag {\n font-size: 10px;\n color: #fff;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag::before {\n transform: rotate(90deg);\n display: inline-block;\n}\n\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag,.table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag{\n display: none;\n}\n.table-wrapper .table-cols-header.dragging .table-cols-header-item .cols-trigger,.table-wrapper.drag-selecting .table-cols-header-item .cols-trigger{\n display: none;\n}\n.table-wrapper .table-cols-header.resize .table-cols-header-item {\n cursor: col-resize;\n}\n.table-wrapper .table-rows-header {\n position: absolute;\n left: -13px;\n top: 41px;\n width: 14px;\n z-index: 128;\n border-right: 0;\n display: none;\n}\n\n.table-wrapper.active .table-rows-header {\n display: block;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item {\n position: relative;\n width: 100%;\n border: 1px solid #dfdfdf;\n border-bottom: 0;\n background: #f2f3f5;\n cursor: pointer;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item.active\n{\n background-color: #e2e4e6;\n}\n\n/* .table-wrapper .table-rows-header .table-rows-header-item:nth-child(3) {\n border-top: 0 none;\n} */\n\n.table-wrapper .table-rows-header .table-rows-header-item:last-child{\n border-bottom: 1px solid #dfdfdf;\n}\n\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item.active,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item.selected {\n width: 14px;\n background: #fff;\n cursor: move;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.selected .row-dragger {\n display: flex;\n position: absolute;\n align-items: center;\n text-align: left;\n white-space: nowrap;\n content: \' \';\n left: -1px;\n top: -1px;\n bottom: -1px;\n right: -1px;\n background: #4daaff;\n border-radius: 0;\n z-index: 1;\n}\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item .row-dragger,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item .row-dragger{\n background: transparent !important;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.selected .row-dragger .drag-info {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.no-dragger .row-dragger .data-icon {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.dragging .row-dragger {\n width: 150px;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.dragging .row-dragger .drag-info {\n margin-left: 5px;\n display: flex;\n padding: 10px;\n color: #fff;\n}\n.table-wrapper .table-rows-header .table-rows-header-item .rows-trigger {\n position: absolute;\n bottom: -1px;\n height: 2px;\n width: 14px;\n left: -1px;\n z-index: 10;\n cursor: row-resize;\n}\n\n.am-engine-mobile .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger {\n bottom: -3px;\n height: 6px;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger.active {\n background: #0589f3;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger.dragging {\n height: 2px;\n background: #0589f3;\n bottom: -1px;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag {\n font-size: 10px;\n color: #fff;\n margin-left: 1px;\n}\n\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag{\n display: none;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger .drag-info {\n height: 100%;\n display: flex;\n align-items: center;\n}\n.table-wrapper .table-rows-header.dragging .table-rows-header-item .rows-trigger,.table-wrapper.drag-selecting .table-rows-header-item .rows-trigger {\n display: none;\n}\n.table-wrapper .table-rows-header.resize .table-rows-header-item {\n cursor: row-resize;\n}\n\n.table-wrapper .table-viewport {\n position: relative;\n overflow: hidden;\n overflow-y: hidden;\n cursor: text;\n}\n\n.table-wrapper.active .table-viewport{\n padding-top: 28px;\n padding-left: 13px;\n margin-left: -13px;\n}\n\n.table-wrapper .table-viewport .scrollbar-shadow-left {\n top: 0;\n bottom: 10px;\n}\n\n.table-wrapper.active .table-viewport .scrollbar-shadow-left {\n top: 28px;\n margin-left: 14px;\n}\n\n.table-wrapper .table-viewport .scrollbar-shadow-right {\n top: 0;\n bottom: 10px;\n}\n\n.table-wrapper.active .table-viewport .scrollbar-shadow-right {\n top: 28px;\n}\n\n.table-wrapper .table-placeholder {\n position: absolute;\n border: 1px solid #008dff;\n background: #008dff;\n display: none;\n z-index: 126;\n}\n.table-wrapper .table-menubar {\n position: absolute;\n top: -99999px;\n left: -99999px;\n padding: 4px 0;\n border-radius: 4px;\n border: 1px solid #e9e9e9;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.08);\n background: #fff;\n /* \\u4ee3\\u7801\\u5757\\u7684 codemirror \\u9ed8\\u8ba4\\u7ed9\\u6bcf\\u884c\\u4ee3\\u7801\\u7684 pre \\u8bbe\\u7f6e\\u4e86 z-index 2, \\u5982\\u679c\\u8868\\u683c\\u5728\\u4ee3\\u7801\\u5757\\u524d\\u9762\\uff0c\\u9020\\u6210\\u53f3\\u952e\\u83dc\\u5355\\u65e0\\u6cd5\\u70b9\\u51fb */\n z-index: 130;\n min-width: 240px;\n}\n.table-wrapper .table-menubar .table-menubar-item {\n padding: 6px 16px;\n cursor: default;\n}\n.table-wrapper .table-menubar .table-menubar-item:hover {\n background: #f0f0f0;\n}\n\n.table-wrapper .table-menubar .table-menubar-item.disabled {\n color: #aaa;\n display: none;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input {\n width: 46px;\n line-height: 12px;\n font-size: 12px;\n outline: none;\n border: 1px solid #dadada;\n border-radius: 4px;\n text-align: center;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input::-moz-selection {\n color: inherit;\n background:transparent\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input::selection {\n color: inherit;\n background:transparent\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input:focus::-moz-selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input:focus::selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.table-wrapper .table-menubar .split {\n height: 0;\n border-top: 1px solid #e8e8e8;\n margin: 2px 0;\n}\n\n.table-wrapper .table-main-content {\n margin: 2px 2px;\n padding: 4px 4px;\n position: relative;\n z-index: 3;\n}\n\n.table-wrapper .table-main-content [data-card-key] {\n max-width: 100%;\n}\n\n.table-wrapper .table-main-bg {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n bottom: 0;\n pointer-events: none;\n}\n\n.table-wrapper .table-main-bg .table-main-border-top {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n height: 0;\n border-top: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-top {\n border-top-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-top {\n border-top-style: dashed;\n}\n\n.table-wrapper .table-main-bg .table-main-border-right {\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n right: -1px;\n z-index: 1;\n width: 0;\n border-right: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-right {\n border-right-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-right {\n border-right-style: dashed;\n}\n\n.table-wrapper tr td.table-last-row .table-main-bg .table-main-border-right {\n display: block;\n right: 0;\n}\n\n.table-wrapper .table-main-bg .table-main-border-bottom {\n display: none;\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n z-index: 1;\n height: 0;\n border-bottom: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-bottom {\n border-bottom-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-bottom {\n border-bottom-style: dashed;\n}\n\n.table-wrapper tr td.table-last-column .table-main-bg .table-main-border-bottom{\n display: block;\n bottom: 0;\n}\n\n.table-wrapper .table-main-bg .table-main-border-left {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: 0;\n border-left: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-left {\n border-left-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-left {\n border-left-style: dashed;\n}\n\n.table-wrapper .table-highlight {\n background: #ff4d4f;\n opacity: 0.08;\n position: absolute;\n z-index: 2;\n pointer-events: none;\n display: none;\n}\n\n.table-wrapper.scrollbar-show .data-scrollable.scroll-x {\n padding-bottom: 10px;\n}\n\n.table-wrapper .data-scrollable.scroll-x {\n padding-bottom: 0;\n}\n\n.table-wrapper .data-scrollable.scroll-x:hover {\n overflow: hidden;\n}\n\n.table-wrapper.scrollbar-show .data-scrollable.scroll-x .data-scrollbar-x{\n margin-bottom: 2px;\n}\n\n.table-wrapper .data-scrollable .data-scrollbar.data-scrollbar-x {\n height: 6px;\n z-index: 5;\n}\n\n.table-wrapper .data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\n height: 6px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button,.table-wrapper .table-rows-header .table-row-add-button {\n position: absolute;\n right: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 2;\n width: 24px;\n height: 24px;\n border: 1px solid #e4e4e4;\n border-radius: 2px;\n cursor: pointer;\n background-color: #fff;\n background-position: center center;\n background-repeat: no-repeat;\n\n left: 14px;\n margin-left: 2px;\n margin-top: -2px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button .data-icon,.table-wrapper .table-rows-header .table-row-add-button .data-icon {\n font-size: 12px;\n}\n\n.table-wrapper .table-rows-header .table-row-add-button {\n left: -30px;\n margin-top: -12px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button:hover,.table-wrapper .table-col-delete-button:hover {\n color:#ff4d4f;\n}\n\n.table-wrapper .table-col-delete-button, .table-wrapper .table-col-add-button {\n position: absolute;\n bottom: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 128;\n margin-bottom: 4px;\n width: 24px;\n height: 24px;\n border: 1px solid #e4e4e4;\n border-radius: 2px;\n cursor: pointer;\n background: #fff;\n background-position: center center;\n background-repeat: no-repeat;\n margin-left: -12px;\n}\n\n.table-wrapper .table-col-delete-button .data-icon, .table-wrapper .table-col-add-button .data-icon {\n font-size: 12px;\n}\n\n.table-wrapper .table-cols-header .table-col-add-button .table-col-add-split-button {\n position: absolute;\n width: 2px;\n left: 10px;\n top: 22px;\n background: #008dff;\n display: none;\n}\n\n.table-wrapper .table-rows-header .table-row-add-button .table-row-add-split-button {\n position: absolute;\n height: 2px;\n left: 22px;\n background: #008dff;\n display: none;\n}\n\n.table-wrapper .table-col-add-button:hover, .table-wrapper .table-row-add-button:hover {\n color: #008dff;\n}\n\n.table-wrapper .table-col-add-button:hover .table-col-add-split-button{\n display: block;\n}\n\n.table-wrapper .table-row-add-button:hover .table-row-add-split-button{\n display: block;\n}\n\n.data-table-reader .data-table tr td {\n border: 1px solid rgb(217, 217, 217);\n cursor: auto;\n padding: 4px 8px;\n}\n\n.data-table-reader .data-table[data-table-no-border="true"] tr td {\n border:0 none\n}\n\n.data-table-reader.data-scrollable.scroll-x {\n padding-bottom: 10px;\n}\n\n.data-table-reader .scrollbar-shadow-left, .data-table-reader .scrollbar-shadow-right {\n bottom: 10px;\n}\n\n.data-table-reader.scrollbar-show.data-scrollable.scroll-x .data-scrollbar-x{\n margin-bottom: 2px;\n}\n\n.data-table-reader.data-scrollable .data-scrollbar.data-scrollbar-x {\n height: 6px;\n}\n\n.data-table-reader.data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\n height: 6px;\n}\n\n[data-card-key="table"].data-card-block-max > [data-card-element="body"] > [data-card-element="center"] {\n padding: 48px;\n margin-top: 4px;\n}\n/**\n表格可溢出样式\n**/\n.table-wrapper.table-overflow {\n width: auto;\n}\n';ni(ci);var Ai=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a1)return t.preventDefault(),a.command.copy(),n.messageSuccess("copy",n.language.get("copy","success")),!1}return!0},e.onCut=function(t){var n=e.editor;if(!(0,s.iC)(n)||n.readonly)return!0;var r=n.change,i=n.card,o=r.range.get(),a=i.find(o.commonAncestorNode,!0);if(a&&a.name===oi.cardName&&!a.isCursor(o.startNode)){var l=a.getSelectionNodes();if(l.length>1)return t.preventDefault(),a.command.cut(),!1}return!0},e.onPaste=function(t){var n=e.editor;if(!(0,s.iC)(n)||n.readonly)return!0;var r=n.change,i=n.card,o=r.range.get(),a=i.find(o.commonAncestorNode,!0);if(a&&a.name===oi.cardName&&!a.isCursor(o.startNode)){var l=n.clipboard.getData(t);if(!l||!//gi.test(l.html||"")){if(l.html&&~l.html.indexOf("1&&void 0!==arguments[1]?arguments[1]:"width",n=e.attributes("data-width"),r=n||e.css(t);r.endsWith("%")&&e.css(t,""),r.endsWith("pt")&&e.css(t,zr(r))},i=t.find("table");if(0!==i.length){var o=new Rr(n),a=n.change,l=a.range.get(),c=function(e){var t=e.find("thead"),r=t.find("th,td").toArray();r.forEach((function(t){e.before(t.children())}));var i=e.find("tr").toArray();i.forEach((function(t){var r=t.find("td").toArray();r.forEach((function(t){n.node.isEmpty(t)||e.before(t.children())}))}));var o=e.find("tfoot"),a=o.find("th,td").toArray();a.forEach((function(t){e.after(t.children())})),e.remove()},A=l.startNode.closest(s.Su).length>0;i.each((function(e,t){var a,l,u,d=i.eq(t);if(d)if(A||"td"===(null===(a=d.parent())||void 0===a?void 0:a.name))c(d);else{var h=d.find("tr");h.each((function(e){var t=(0,s.$)(e),n=t.css("display");"none"===n?t.remove():t.css("display",""),r(t),r(t,"height");var i=t.children();i.each((function(e){var t=(0,s.$)(e);r(t);var n=t.text(),i=t.find("table");if(i.length>0&&(i.after(document.createTextNode(i.text())),i.remove()),"td"!==t.name&&["\n","\r\n"].includes(n.trim())){var o=(0,s.$)("");t.before(o),o.append(t)}}))})),r(d),r(d,"height"),d=o.normalizeTable(d);var p=d.find("tbody");if(p.length>1)for(var f=1;f0)null===(g=p.eq(0))||void 0===g||g.append(v);null===m||void 0===m||m.remove()}var b=d.find("thead");b&&b.length>0&&p.prepend(b.children()),b.remove();var y=d.find("tfoot");y&&y.length>0&&p.append(y.children()),y.remove();var w=d.find("th");w.each((function(e,t){var n=w.eq(t);null===n||void 0===n||n.replaceWith((0,s.$)("".concat(n.html(),"")))}));var x=d.find("td"),k=(0,s.Me)().createDocumentFragment();x.each((function(e,t){k=(0,s.Me)().createDocumentFragment();var i=x.eq(t);if(i){r(i),r(i,"height");var o=i.css("background");o&&i.css("background-color",o);var a=i.attributes("valign");a&&i.attributes("vertical-align",a);for(var l=i.children(),c=0,A=l.length;c0){var i=n.toArray().map((function(e){return e[0].rowSpan}));B=Math.max.apply(Math,(0,lr.Z)(i))}t&&(r(t),r(t,"height"));var o=(null===t||void 0===t?void 0:t.css("background"))||(null===t||void 0===t?void 0:t.css("background-color"));o&&(null===n||void 0===n||n.css("background",o))})),n.nodeId.generateAll(d,!0);var _=d.allChildren();_.forEach((function(e){n.node.isInline(e)&&n.inline.repairCursor(e)}));var E=d.get().outerHTML.replace(/\n|\r\n/g,"").replace(/>\s+<");n.card.replaceNode(d,oi.cardName,{html:E}),d.remove()}}))}}},e.parseHtml=function(t,n){var r=e.editor,i=[];return t.find("[".concat(s.Jr,'="').concat(oi.cardName,'"],[').concat(s.mV,'="').concat(oi.cardName,'"]')).each((function(t){var o=(0,s.$)(t),a=o.find("table"),l=(0,s.RW)(o.attributes(s.TM));if(0===a.length){if(!l||!l.html)return;if(a=(0,s.$)((0,s.Gg)(l.html)),0===a.length)return void o.remove();r.trigger("parse:html",a)}var c=!1!==e.options.enableScroll,A=a.attributes("width")||a.css("width");a.css({outline:"none","border-collapse":"collapse",width:c?"100%":A}),a.attributes("data-width",A);var u=a.find("td");u.each((function(e,t){var n=u.eq(t);null===n||void 0===n||n.css({"min-width":"auto","white-space":"flat","word-wrap":"break-word",margin:"4px 8px",border:a.attributes("data-table-no-border")?"0 none":"1px solid #d9d9d9",padding:"4px 8px",cursor:"default","vertical-align":n.css("vertical-align")||"top"})})),a.find(Or.TABLE_TD_BG_CLASS).remove(),a.find(Or.TABLE_TD_CONTENT_CLASS).each((function(e){r.node.unwrap((0,s.$)(e))}));var d=a.find("colgroup"),h=(0,s.$)('');d.find("col").each((function(e){var t=(0,s.$)(e).attributes("width"),n=(0,s.$)(''));h.append(n)})),a.find("tbody").append(h),n&&(a=n(a,l));var p=a.attributes("data-id")+"-table";a=(0,s.$)("
")).append(a),o.replaceWith(a),i.push(a)})),i},e.markdownIt=function(t){!1!==e.options.markdown&&t.enable("table")},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;this.options.colMinWidth||(this.options.colMinWidth=40),this.options.rowMinHeight||(this.options.rowMinHeight=30),e.language.add(li),e.schema.add(this.schema()),e.conversion.add("th","td"),e.on("parse:html",this.parseHtml),e.on("paste:each",this.pasteEach),e.on("paste:each-after",this.pasteHtml),e.on("paste:schema",this.pasteSchema),(0,s.iC)(e)&&(this.editor.on("markdown-it",this.markdownIt),e.change.event.onDocument("copy",this.onCopy,0),e.change.event.onDocument("cut",this.onCut,0),e.change.event.onDocument("paste",this.onPaste,0))}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"schema",value:function(){return[{name:"table",type:"block",attributes:{class:["data-table"],"data-table-no-border":"*",style:{width:"@length"}}},{name:"colgroup",type:"block",allowIn:["table"]},{name:"col",type:"block",isVoid:!0,attributes:{width:"@number",span:"@number"},allowIn:["colgroup"]},{name:"thead",type:"block",allowIn:["table"]},{name:"tbody",type:"block",allowIn:["table"]},{name:"tr",type:"block",attributes:{style:{height:"@length"}},allowIn:["tbody","thead","tfoot"]},{name:"td",type:"block",attributes:{colspan:"@number",rowspan:"@number",class:["table-last-column","table-last-row","table-last-column","table-cell-selection"],style:{"background-color":"@color","vertical-align":["top","middle","bottom"]}},allowIn:["tr"]},{name:"th",type:"block",attributes:{colspan:"@number",rowspan:"@number"},allowIn:["tr"]}]}},{key:"execute",value:function(e,t){var n=this.editor;if((0,s.iC)(n)){var r=n.change,i=r.range.get();i.startNode.closest(s.Su).isCard()||n.card.insert(oi.cardName,{rows:e||3,cols:t||3,overflow:!!this.options.overflow})}}},{key:"destroy",value:function(){var e=this.editor;e.off("parse:html",this.parseHtml),e.off("paste:each-after",this.pasteHtml),e.off("paste:schema",this.pasteSchema),e.off("markdown-it",this.markdownIt)}}],[{key:"pluginName",get:function(){return"table"}}]),n}(s.Sy),ui=Ai,di=n(3336);function hi(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var pi='.data-file {\r\n display: flex;\r\n height: 24px;\r\n line-height: 24px;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n .data-file .data-file-icon {\r\n flex: auto;\r\n width: 24px;\r\n height: 24px;\r\n font-size: 16px;\r\n text-align: center;\r\n }\r\n .data-file .data-file-title {\r\n flex: auto;\r\n font-size: 14px;\r\n margin-right: 4px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n .data-file .data-file-size {\r\n flex: auto;\r\n font-size: 12px;\r\n }\r\n .data-file-done {\r\n color: #096DD9;\r\n }\r\n .data-file-uploading,\r\n .data-file-error {\r\n color: #595959;\r\n }\r\n .data-file-uploading .data-file-size,\r\n .data-file-error .data-file-size {\r\n color: #8C8C8C;\r\n }\r\n .data-file-error {\r\n padding: 2px 4px;\r\n background: #f5f5f5;\r\n display: flex;\r\n border-radius: 4px;\r\n max-width: 200px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n font-size: 12px;\r\n align-items: center;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n cursor: pointer;\r\n}\r\n\r\n.am-engine [data-card-key="file"].card-selected [data-card-element=center].data-card-background-selected {\r\n border-radius: 4px;\r\n}\r\n\r\n.data-file-error .data-icon {\r\n font-size: 12px;\r\n}\r\n\r\n.data-file-error .data-icon-error {\r\n color: red;\r\n margin-right: 8px;\r\n}\r\n\r\n.data-file-error .data-icon-copy {\r\n margin-left: 8px;\r\n cursor: pointer;\r\n}';hi(pi);var fi=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e,i;(0,r.Z)(this,n);for(var o=arguments.length,a=new Array(o),s=0;s',title:c.preview,link:i.onPreview?void 0:(0,s.Nm)(n.onBeforeRender("preview",a)),onClick:i.onPreview?A:void 0})}if(l){var u=function(){i.onDownload&&i.onDownload(l,t)};e.push({key:"download",type:"button",content:'',title:c.download,link:i.onDownload?void 0:(0,s.Nm)(n.onBeforeRender("download",l)),onClick:i.onDownload?u:void 0})}(0,s.iC)(r)&&!r.readonly&&e.length>0&&e.push({key:"separator",type:"separator"})}return(0,s.iC)(r)&&!r.readonly&&e.push({key:"delete",type:"delete"}),e};return(null===i||void 0===i?void 0:i.cardToolbars)?i.cardToolbars(o(),this.editor):o()}},{key:"renderTemplate",value:function(e){var t=e.name,n=e.status,r=e.message,i=e.percent,o=e.size,a=this.getLocales();if("error"===n)return''.concat(r||a["loadError"],'');var l='';"uploading"===n&&(l='\n \n \n ');var c="",A=o?(0,s.hR)(o):"";A&&(c='('.concat((0,s.YU)(A),")"));var u="";return"uploading"===n&&(u=''.concat(i||0,"%")),'\n \n ').concat(l,"\n ").concat(u,'\n ').concat((0,s.YU)(t),"\n ").concat(c,"\n \n ")}},{key:"bindErrorEvent",value:function(e){var t=this,n=this.editor,r=e.find(".data-icon-copy");r.on("mouseenter",(function(){s.u.show(r,n.language.get("image","errorMessageCopy").toString())})),r.on("mouseleave",(function(){s.u.hide()})),r.on("click",(function(e){var r;e.stopPropagation(),e.preventDefault(),s.u.hide(),n.clipboard.copy((null===(r=t.getValue())||void 0===r?void 0:r.message)||"Error message"),n.messageSuccess("copy",n.language.get("copy","success").toString())}))}},{key:"setProgressPercent",value:function(e){var t;null===(t=this.container)||void 0===t||t.find(".percent").html("".concat(e,"%")),this.setValue({percent:e})}},{key:"onActivate",value:function(e){var t,n;e?null===(t=this.container)||void 0===t||t.addClass("data-file-active"):null===(n=this.container)||void 0===n||n.removeClass("data-file-active")}},{key:"writeHistoryOnValueChange",value:function(){if(this.loading)return!1}},{key:"render",value:function(){var e,t=this.getValue();if(t){this.container&&0!==this.container.length?this.container=this.getCenter().first():(this.container=(0,s.$)(this.renderTemplate(t)),this.getCenter().empty().append(this.container));var n=this.editor;(0,s.iC)(n)?this.container.attributes("draggable","true"):this.renderView(),"error"===t.status&&this.bindErrorEvent(this.root),null===(e=this.container)||void 0===e||e.find(".percent").html("".concat(t.percent,"%")),this.updateMaxWidth(),window.addEventListener("resize",this.onWindowResize),n.on("editor:resize",this.onWindowResize)}}},{key:"renderView",value:function(){var e,t,n,r,i,o=this.getValue(),a=null!==(e=null===(t=this.editor.plugin.findPlugin("file"))||void 0===t?void 0:t.options)&&void 0!==e?e:{},l=(0,s.Nm)(this.onBeforeRender("download",o.download||""));a.onDownload?null===(n=this.container)||void 0===n||n.on("click",(function(){a.onDownload(l,o)})):(null===(r=this.container)||void 0===r||r.attributes("target","_blank"),null===(i=this.container)||void 0===i||i.attributes("href",l))}},{key:"didUpdate",value:function(){var e,t,r,i=this.getValue();"done"===i.status&&(0,d.Z)((0,h.Z)(n.prototype),"didUpdate",this).call(this),null===(e=this.toolbarModel)||void 0===e||null===(t=e.getContainer())||void 0===t||t.remove(),null===(r=this.toolbarModel)||void 0===r||r.create()}}],[{key:"cardName",get:function(){return"file"}},{key:"cardType",get:function(){return s.eT.INLINE}},{key:"selectStyleType",get:function(){return s.dw.BACKGROUND}},{key:"autoSelected",get:function(){return!1}},{key:"collab",get:function(){return!1}}]),n}(s.Zb),gi="drop:files",mi="paste:event",vi="paste:each",bi=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&(this.extensionNames=o)}else"object"===(0,di.Z)(i)&&(this.extensionNames=i)}},{key:"isFile",value:function(e){var t,n=null!==(t=(0,s.Ym)(e))&&void 0!==t?t:"",r=Array.isArray(this.extensionNames)?this.extensionNames:Object.keys(this.extensionNames);return r.indexOf("*")>=0||r.indexOf(n)>=0}},{key:"execute",value:function(){var e=(0,_t.Z)(St().mark((function e(t){var n,r,i,o,a,l,c,A,u,d,h,p,f,g,m,v,b,y=this;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.editor,(0,s.iC)(n)){e.next=3;break}return e.abrupt("return");case 3:if(r=n.request,i=n.card,o=n.language,a=this.options,l=a.action,c=a.type,A=a.contentType,u=a.multiple,d=a.crossOrigin,h=a.withCredentials,p=a.headers,f=a.name,g=this.options.data,"function"!==typeof g){e.next=10;break}return e.next=9,g();case 9:g=e.sent;case 10:if(m=this.options.parse,v=this.options.limitSize||5242880,Array.isArray(t)){e.next=17;break}return b=Array.isArray(this.extensionNames)?"."+this.extensionNames.join(",."):Object.values(this.extensionNames).join(","),e.next=16,r.getFiles({event:t,accept:s.Dt?"*":b.length>0?b:"",multiple:u});case 16:t=e.sent;case 17:if(0!==t.length){e.next=19;break}return e.abrupt("return");case 19:return r.upload({url:l,data:g,type:c,contentType:A,crossOrigin:d,withCredentials:h,headers:p,onBefore:function(e){return!(e.size>v)||(n.messageError("upload-limit",o.get("file","uploadLimitError").toString().replace("$size",(v/1024/1024).toFixed(0)+"M")),!1)},onReady:function(e){if((0,s.iC)(n)&&!y.cardComponents[e.uid]){var t=i.insert("file",{status:"uploading",name:e.name,size:e.size});y.cardComponents[e.uid]=t}},onUploading:function(e,t){var n=t.percent,r=y.cardComponents[e.uid||""];r&&r.setProgressPercent(n)},onSuccess:function(e,t){var r=y.cardComponents[t.uid||""];if(r){var a=e.url||e.data&&e.data.url,s=e.preview||e.data&&e.data.preview,l=e.download||e.data&&e.data.download,c={result:!0,data:{status:"done",url:a,preview:s,download:l}};if(m){var A=m(e);if(A.result){var u=c.data;"string"===typeof A.data?c.data=(0,nn.Z)((0,nn.Z)({},u),{},{url:A.data}):(u.url=A.data.url,void 0!==A.data.status&&(u=(0,nn.Z)((0,nn.Z)({},u),{},{status:A.data.status})),void 0!==A.data.preview&&(u=(0,nn.Z)((0,nn.Z)({},u),{},{preview:A.data.preview})),void 0!==A.data.download&&(u=(0,nn.Z)((0,nn.Z)({},u),{},{download:A.data.download})),c.data=(0,nn.Z)({},u))}else c={result:!1,data:A.data.toString()}}else a||(c={result:!1,data:e.data});if(c.result){var d="string"===typeof c.data?{url:c.data}:(0,nn.Z)({},c.data);n.card.update(r.id,d)}else i.update(r.id,{status:"error",message:"string"===typeof c.data?c.data:o.get("file","uploadError")});delete y.cardComponents[t.uid||""]}},onError:function(e,t){var n=y.cardComponents[t.uid||""];n&&(i.update(n.id,{status:"error",message:e.message||o.get("file","uploadError")}),delete y.cardComponents[t.uid||""])}},t,f),e.abrupt("return");case 21:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"destroy",value:function(){var e=this.editor;(0,s.iC)(e)&&(e.off(gi,this.dropFiles),e.off(mi,this.pasteFiles),e.off(vi,this.pasteEach))}}],[{key:"pluginName",get:function(){return"file-uploader"}}]),n}(s.Sy),yi={file:{errorMessageCopy:"Copy error message",loadError:"The file failed to load!",uploadError:"The picture failed to upload!",uploadLimitError:"Upload file size is limited to $size",download:"Download",preview:"Preview"}},wi={file:{errorMessageCopy:"复制错误信息",loadError:"文件加载失败!",uploadError:"上传文件失败!",uploadLimitError:"上传文件大小限制为 $size",download:"下载",preview:"预览"}},xi={"en-US":yi,"zh-CN":wi},ki="parse:html",Ci="paste:schema",Bi="paste:each",_i=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a📎').concat(a.name,"");i.empty();var c=(0,s.$)(l);n&&(c=n(c,a)),i.replaceWith(c),r.push(c)}else i.remove()})),r},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.language.add(xi),e.on(ki,this.parseHtml),e.on(Bi,this.pasteHtml),e.on(Ci,this.pasteSchema)}},{key:"execute",value:function(e,t,n,r,i,o){var a={status:e,url:t,name:n||t,size:r,preview:i,download:o};"error"===e&&(a.url="",a.message=t),this.editor.card.insert("file",a)}},{key:"waiting",value:function(){var e=(0,_t.Z)(St().mark((function e(t){var n,r,i,o,a=this;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=this.editor.card,r=function(e){var t;return e.root.inEditor()&&e.name===fi.cardName&&"uploading"===(null===(t=e.getValue())||void 0===t?void 0:t.status)},i=function(){return n.components.find(r)},o=function(e){var n=6e4;return new Promise((function(i,o){if(t){var s=t(a.name,e);if(!1===s)return o({name:a.name,card:e});"number"===typeof s&&(n=s)}var l=(new Date).getTime(),c=(new Date).getTime(),A=function t(){if(c-l>=n)return i();setTimeout((function(){r(e)?t():i()}),10)};A()}))},e.abrupt("return",new Promise(function(){var e=(0,_t.Z)(St().mark((function e(t,n){var r,a;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=i(),a=function e(r){o(r).then((function(){var n=i();n?e(n):t()})).catch(n)},r?a(r):t();case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"destroy",value:function(){var e=this.editor;e.off(ki,this.parseHtml),e.off(Bi,this.pasteHtml),e.off(Ci,this.pasteSchema)}}],[{key:"pluginName",get:function(){return"file"}}]),n}(s.Sy),Ei=_i;function Si(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Fi=".data-video {\r\n margin: 0 auto;\r\n position: relative;\r\n cursor: pointer;\r\n}\r\n .data-video-content {\r\n position: relative;\r\n height: 420px;\r\n background: #f7f7f7;\r\n }\r\n .data-video-content video {\r\n width: 100%;\r\n height: 100%;\r\n outline: none;\r\n position: relative;\r\n z-index: 1;\r\n background: #000;\r\n }\r\n .data-video-uploading,\r\n .data-video-uploaded,\r\n .data-video-error {\r\n border: 1px solid #e6e6e6;\r\n background: #f6f6f6;\r\n }\r\n .data-video-content .data-video-mask {\r\n width: 100%;\r\n height: 100%;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n z-index: 1;\r\n }\r\n .data-video-done {\r\n height: auto;\r\n border: none;\r\n background: none;\r\n line-height: 0;\r\n }\r\n .data-video-active {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n }\r\n .data-video-center {\r\n position: absolute;\r\n top: 50%;\r\n margin-top: -48px;\r\n width: 100%;\r\n height: 96px;\r\n }\r\n .data-video-center .data-video-icon,\r\n .data-video-center .data-video-name,\r\n .data-video-center .data-video-message,\r\n .data-video-center .data-video-progress,\r\n .data-video-center .data-video-transcoding {\r\n text-align: center;\r\n }\r\n .data-video-center .data-video-icon {\r\n font-size: 24px;\r\n color: #BFBFBF;\r\n margin-bottom: 12px;\r\n }\r\n .data-video-center .data-video-name {\r\n color: #595959;\r\n margin-bottom: 12px;\r\n }\r\n .data-video-center .data-video-message {\r\n color: #595959;\r\n }\r\n .data-video-center .data-video-anticon {\r\n display: inline-block;\r\n font-style: normal;\r\n vertical-align: -0.125em;\r\n text-align: center;\r\n text-transform: none;\r\n line-height: 0;\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n margin-right: 5px;\r\n }\r\n .data-video-center .data-video-anticon .data-video-anticon-spin {\r\n display: inline-block;\r\n -webkit-animation: loadingCircle 1s infinite linear;\r\n animation: loadingCircle 1s infinite linear;\r\n }\r\n .data-video-center .data-error-icon {\r\n width: 16px;\r\n height: 16px;\r\n display: inline-block;\r\n background: #F5222D;\r\n text-align: center;\r\n font-size: 12px;\r\n color: #ffffff;\r\n padding: 1px 0 0 0;\r\n line-height: 16px;\r\n border-radius: 100%;\r\n vertical-align: middle;\r\n margin: -2px 5px 0 0;\r\n }\r\n\r\n.data-video-title {\r\n text-align: center;\r\n}\r\n.data-video-title::-moz-selection {\r\n background: transparent\r\n}\r\n.data-video-title::selection {\r\n background: transparent\r\n}\r\n.data-video .data-resizer {\r\n z-index: inherit;\r\n}\r\n.data-video .data-resizer .data-resizer-holder {\r\n z-index: 2;\r\n}\r\n\r\n.data-video .data-resizing {\r\n z-index: 3;\r\n}";Si(Fi);var Ti=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a\n
',spin:'',warn:'
',error:'X'};if("error"===n)return'\n
\n
\n
\n
'.concat((0,s.YU)(t),'
\n
\n ').concat(l.error,"\n ").concat(i||a["loadError"],"\n
\n
\n
\n
");var c=r?(0,s.hR)(r):"",A=t?'
'.concat((0,s.YU)(t),"
"):"";if("uploading"===n)return'\n
\n
\n
\n '.concat(l.video,'\n
\n ').concat((0,s.YU)(t)," (").concat((0,s.YU)(c),')\n
\n
\n ').concat(l.spin,'\n ').concat(o||0,"%\n
\n
\n
\n
");var u="undefined"===typeof n;if("transcoding"===n||u)return'\n
\n
\n
\n '.concat(l.video,'\n
\n ').concat((0,s.YU)(t)," (").concat((0,s.YU)(c),')\n
\n
\n ').concat(l.spin,'\n ').concat(u?a["loading"]:a["transcoding"],"%\n
\n
\n
\n
\n ");var d=this.editor.plugin.components["video"];return'\n
\n
\n\t\t\t'.concat(d&&!1!==d.options.showTitle?A:"","\n
\n ")}},{key:"initPlayer",value:function(){var e,t,n,r=this,i=this.getValue();if(i){var o=(0,s.Nm)(this.onBeforeRender("query",i.url)),a=document.createElement("video");a.preload="metadata",a.setAttribute("src",o),a.setAttribute("webkit-playsinline","webkit-playsinline"),a.setAttribute("playsinline","playsinline");var l=i.cover;l&&(a.poster=(0,s.Nm)(this.onBeforeRender("cover",l))),this.maxWidth=this.getMaxWidth();var c=null===(e=this.container)||void 0===e?void 0:e.find(".data-video-content");if(c){c.append(a),this.mask=(0,s.$)('
'),c.append(this.mask),this.videoContainer=null===(t=this.container)||void 0===t?void 0:t.find(".data-video-content"),a.oncontextmenu=function(){return!1};var A=this.editor.plugin.findPlugin("video"),u=null===A||void 0===A?void 0:A.options.fullEditor,d=this.editor;a.onloadedmetadata=function(){i.naturalWidth&&i.naturalHeight||(i.naturalWidth=a.videoWidth,i.naturalHeight=a.videoHeight,r.setValue({naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight})),u&&r._fullWidth&&(i.naturalWidth',title:a.download,onClick:t.downloadFile}),(0,s.iC)(n)&&!n.readonly&&(e.push({key:"copy",type:"copy"}),e.push({key:"separator",type:"separator"}))),(0,s.iC)(n)&&!n.readonly&&e.push({key:"delete",type:"delete"}),e},i=null===(e=n.plugin.findPlugin("video"))||void 0===e?void 0:e.options;return(null===i||void 0===i?void 0:i.cardToolbars)?i.cardToolbars(r(),this.editor):r()}},{key:"setProgressPercent",value:function(e){var t;null===(t=this.container)||void 0===t||t.find(".percent").html("".concat(e,"%")),this.setValue({percent:e})}},{key:"getMaxWidth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getCenter(),t=this.editor.block.closest(e).get();return t?t.clientWidth:0}},{key:"resetSize",value:function(){var e,t,n;if(this.videoContainer){var r=this.getValue();if(r){this.videoContainer.css({width:"",height:""}),null===(e=this.container)||void 0===e||e.css({width:""});var i=this.editor.plugin.findPlugin("video"),o=null===i||void 0===i?void 0:i.options.fullEditor,a=null===(t=this.video)||void 0===t?void 0:t.get();if(a){var s=r.width,l=r.height;l?s?s&&l?l=Math.round(this.rate*s):(s=this._naturalSize.width,l=this._naturalSize.height):(l=this._naturalSize.height,s=Math.round(l/this.rate)):(s=this._naturalSize.width,l=Math.round(this.rate*s)),s>this.maxWidth&&(s=this.maxWidth,l=Math.round(s*this.rate)),0!==s&&0!==l&&(null===(n=this.container)||void 0===n||n.css({width:s>0?"".concat(s,"px"):""}),this.videoContainer.css("width",s>0?"".concat(s,"px"):""),"number"===typeof o&&this.videoContainer.css("height",l>0?"".concat(l,"px"):""))}}}}},{key:"changeSize",value:function(e,t){var n,r,i;e<24&&(e=24,t=e*this.rate),e>this.maxWidth&&(e=this.maxWidth,t=e*this.rate),t<24&&(t=24,e=t/this.rate),e=Math.round(e),t=Math.round(t),null===(n=this.videoContainer)||void 0===n||n.css({width:e>0?"".concat(e,"px"):""});var o,a=this.editor.plugin.findPlugin("video"),s=null===a||void 0===a?void 0:a.options.fullEditor;"number"===typeof s&&(null===(o=this.videoContainer)||void 0===o||o.css({height:"".concat(t,"px")}));null===(r=this.container)||void 0===r||r.css({width:e>0?"".concat(e,"px"):""}),this.setValue({width:e,height:t}),null===(i=this.resizer)||void 0===i||i.destroy(),this.initResizer()}},{key:"initResizer",value:function(){var e,t=this,n=this.getValue();if(n){var r=n.status;if("done"===r){var i=n.width,o=n.height,a=n.cover;this.maxWidth=this.getMaxWidth();var l=new s.w_({imgUrl:a,width:i||this._naturalSize.width,height:o||this._naturalSize.height,rate:this.rate,maxWidth:this.maxWidth,onChange:function(e){var n=e.width,r=e.height;return t.changeSize(n,r)}});this.resizer=l;var c=l.render();null===(e=this.videoContainer)||void 0===e||e.append(c)}}}},{key:"onActivate",value:function(e){var t,r,i,o,a;((0,d.Z)((0,h.Z)(n.prototype),"onActivate",this).call(this,e),e)?(null===(t=this.container)||void 0===t||t.addClass("data-video-active"),null===(r=this.mask)||void 0===r||r.hide(),this.initResizer()):(null===(i=this.container)||void 0===i||i.removeClass("data-video-active"),null===(o=this.mask)||void 0===o||o.show(),null===(a=this.resizer)||void 0===a||a.destroy())}},{key:"onSelectByOther",value:function(e,t){var n;null===(n=this.container)||void 0===n||n.css("outline",e?"2px solid "+t.color:"");var r="card-selected-other";return e?this.root.addClass(r):this.root.removeClass(r),this.container}},{key:"writeHistoryOnValueChange",value:function(){if(this.loading)return!1}},{key:"checker",value:function(e,t,n){var r=this.editor.command,i=function i(){r.executeMethod("video-uploader","query",e,(function(e){e&&"done"!==e.status?setTimeout(i,3e3):t(e)}),(function(e){n(e)}))};i()}},{key:"render",value:function(){var e=this,t=this.getValue(),n=this.getCenter(),r=this.editor;if(this._fullWidth=r.container.width()-(0,s.ZQ)(r.container.css("padding-left"))-(0,s.ZQ)(r.container.css("padding-right")),!t||this.container&&this.container.inEditor())return this.container=(0,s.$)(this.renderTemplate((0,nn.Z)({},t))),n.empty(),n.append(this.container),void this.initPlayer();n.empty();var i=r.command,o=r.plugin,a=t.video_id,l=t.status,c=this.getLocales();if(this.maxWidth=this.getMaxWidth(),(0,s.iC)(r)){if("transcoding"===l){if(this.container=(0,s.$)(this.renderTemplate(t)),!a)throw"video id is undefined";return this.checker(a,(function(r){var i=(0,nn.Z)((0,nn.Z)({},t),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:t.url,name:(null===r||void 0===r?void 0:r.name)?r.name:t.name,cover:(null===r||void 0===r?void 0:r.cover)?r.cover:t.cover,download:(null===r||void 0===r?void 0:r.download)?r.download:t.download,status:"done"});e.setValue(i),e.container=(0,s.$)(e.renderTemplate(i)),n.empty(),n.append(e.container),e.initPlayer()}),(function(r){var i=(0,nn.Z)((0,nn.Z)({},t),{},{status:"error",message:r||c["loadError"]});e.setValue(i),e.container=(0,s.$)(e.renderTemplate(i)),n.empty(),n.append(e.container)})),this.container}return"done"===l?(this.container=(0,s.$)(this.renderTemplate((0,nn.Z)((0,nn.Z)({},t),{},{status:void 0}))),i.executeMethod("video-uploader","query",a,(function(r){var i=(0,nn.Z)((0,nn.Z)({},t),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:t.url,name:(null===r||void 0===r?void 0:r.name)?r.name:t.name,cover:(null===r||void 0===r?void 0:r.cover)?r.cover:t.cover,download:(null===r||void 0===r?void 0:r.download)?r.download:t.download});e.container=(0,s.$)(e.renderTemplate(i)),e.video=e.container.find("video"),n.empty(),n.append(e.container),e.initPlayer()}),(function(r){e.container=(0,s.$)(e.renderTemplate((0,nn.Z)((0,nn.Z)({},t),{},{status:"error",message:r||c["loadError"]}))),n.empty(),n.append(e.container)})),this.container):(this.container=(0,s.$)(this.renderTemplate(t)),this.container)}if("done"===l){this.container=(0,s.$)(this.renderTemplate((0,nn.Z)((0,nn.Z)({},t),{},{status:void 0})));var A=function(r){var i=(0,nn.Z)((0,nn.Z)({},t),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:t.url,name:(null===r||void 0===r?void 0:r.name)?r.name:t.name,cover:(null===r||void 0===r?void 0:r.cover)?r.cover:t.cover,download:(null===r||void 0===r?void 0:r.download)?r.download:t.download});e.container=(0,s.$)(e.renderTemplate(i)),n.empty(),n.append(e.container),e.initPlayer()};return o.components["video-uploader"]?i.executeMethod("video-uploader","query",a,(function(e){A(e)}),(function(r){e.container=(0,s.$)(e.renderTemplate((0,nn.Z)((0,nn.Z)({},t),{},{status:"error",message:r||c["loadError"]}))),n.empty(),n.append(e.container)})):A(),this.container}return"error"===l?(0,s.$)(this.renderTemplate((0,nn.Z)((0,nn.Z)({},t),{},{message:t.message||c["loadError"]}))):void 0}},{key:"didUpdate",value:function(){var e;(0,d.Z)((0,h.Z)(n.prototype),"didUpdate",this).call(this),null===(e=this.toolbarModel)||void 0===e||e.setDefaultAlign("top")}},{key:"didRender",value:function(){var e,t,r=this.getValue();"done"===r.status&&(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this),this.onWindowResize();var i,o=this.editor;(window.addEventListener("resize",this.onWindowResize),o.on("editor:resize",this.onWindowResize),null===(e=this.toolbarModel)||void 0===e||e.setDefaultAlign("top"),null===(t=this.container)||void 0===t||t.on("mousedown",this.handleClick),!(0,s.iC)(o)||o.readonly)&&(null===(i=this.mask)||void 0===i||i.hide())}},{key:"destroy",value:function(){var e;(0,d.Z)((0,h.Z)(n.prototype),"destroy",this).call(this),null===(e=this.container)||void 0===e||e.off("mousedown",this.handleClick),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"video"}},{key:"cardType",get:function(){return s.eT.BLOCK}},{key:"autoSelected",get:function(){return!1}}]),n}(s.Zb),Mi="drop:files",Ii="paste:event",Ni="paste:each",Ui=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0&&(this.extensionNames=r)}else"object"===(0,di.Z)(n)&&(this.extensionNames=n)}},{key:"isVideo",value:function(e){var t=(0,s.Ym)(e),n=Array.isArray(this.extensionNames)?this.extensionNames:Object.keys(this.extensionNames);return n.indexOf("*")>=0||n.indexOf(t)>=0}},{key:"execute",value:function(){var e=(0,_t.Z)(St().mark((function e(t){var n,r,i,o,a,l,c,A,u,d,h,p,f,g,m,v,b,y=this,w=arguments;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("string"!==typeof t){e.next=6;break}e.t0=t,e.next="query"===e.t0?4:5;break;case 4:return e.abrupt("return",this.query(w.length<=1?void 0:w[1],w.length<=2?void 0:w[2],w.length<=3?void 0:w[3]));case 5:return e.abrupt("return");case 6:if(n=this.editor,r=n.request,i=n.card,o=n.language,a=this.options,l=a.action,c=a.data,A=a.type,u=a.contentType,d=a.multiple,h=a.crossOrigin,p=a.withCredentials,f=a.headers,g=a.name,m=this.options.parse,v=this.options.limitSize||5242880,Array.isArray(t)){e.next=16;break}return b=Array.isArray(this.extensionNames)?"."+this.extensionNames.join(",."):Object.values(this.extensionNames).join(","),e.next=15,r.getFiles({event:t,accept:s.Dt?"video/*":b.length>0?b:"",multiple:d});case 15:t=e.sent;case 16:if(0!==t.length){e.next=18;break}return e.abrupt("return");case 18:return r.upload({url:l,data:c,type:A,contentType:u,crossOrigin:h,withCredentials:p,headers:f,onBefore:function(e){return!(e.size>v)||(n.messageError("upload-limit",o.get("video","uploadLimitError").toString().replace("$size",(v/1024/1024).toFixed(0)+"M")),!1)},onReady:function(e){if((0,s.iC)(n)&&!y.cardComponents[e.uid]){var t=i.insert("video",{status:"uploading",name:e.name,size:e.size});y.cardComponents[e.uid]=t}},onUploading:function(e,t){var n=t.percent,r=y.cardComponents[e.uid||""];r&&r.setProgressPercent(n)},onSuccess:function(e,t){var r=y.cardComponents[t.uid||""];if(r){var a=e.id||e.data&&e.data.id,s=e.url||e.data&&e.data.url,l=e.cover||e.data&&e.data.cover,c=e.download||e.data&&e.data.download,A=e.width||e.data&&e.data.width,u=e.height||e.data&&e.data.height,d=e.status||e.data&&e.data.status;d="transcoding"===d?"transcoding":"done";var h={result:!0,data:{video_id:a,url:s,cover:l,download:c,status:d,width:A,height:u}};if(m){var p=m(e);if(p.result){var f=h.data;"string"===typeof p.data?h.data=(0,nn.Z)((0,nn.Z)({},f),{},{url:p.data}):(f.url=p.data.url,void 0!==p.data.status&&(f=(0,nn.Z)((0,nn.Z)({},f),{},{status:p.data.status})),void 0!==p.data.id&&(f=(0,nn.Z)((0,nn.Z)({},f),{},{video_id:p.data.id})),void 0!==p.data.cover&&(f=(0,nn.Z)((0,nn.Z)({},f),{},{cover:p.data.cover})),void 0!==p.data.width&&(f=(0,nn.Z)((0,nn.Z)({},f),{},{width:p.data.width})),void 0!==p.data.height&&(f=(0,nn.Z)((0,nn.Z)({},f),{},{height:p.data.height})),h.data=(0,nn.Z)({},f))}else h={result:!1,data:p.data.toString()}}else s||(h={result:!1,data:e.data});h.result?n.card.update(r.id,"string"===typeof h.data?{url:h.data}:(0,nn.Z)((0,nn.Z)({},h.data),{},{naturalWidth:h.data.width,naturalHeight:h.data.height})):i.update(r.id,{status:"error",message:"string"===typeof h.data?h.data:o.get("video","uploadError")}),delete y.cardComponents[t.uid||""]}},onError:function(e,t){var n=y.cardComponents[t.uid||""];n&&(i.update(n.id,{status:"error",message:e.message||o.get("video","uploadError")}),delete y.cardComponents[t.uid||""])}},t,g),e.abrupt("return");case 20:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"query",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.editor,i=r.request,o=r.language,a=this.options,s=a.query,l=a.parse;if(!s||!e)return t();var c=s.action,A=s.type,u=s.contentType,d=s.data,h=s.headers;i.ajax({url:c,contentType:u||"",type:void 0===A?"json":A,headers:h,data:"function"===typeof d?(0,_t.Z)(St().mark((function t(){var n;return St().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d();case 2:return n=t.sent,t.abrupt("return",(0,nn.Z)((0,nn.Z)({},n),{},{id:e}));case 4:case"end":return t.stop()}}),t)}))):(0,nn.Z)((0,nn.Z)({},d),{},{id:e}),success:function(e){var r=e.result,i=e.data;if(r){var a=l?l(e):e;!1===a.result?n(a.data||o.get("video","loadError")):t((0,nn.Z)((0,nn.Z)({},a.data),{},{status:"transcoding"!==a.data.status?"done":"transcoding"}))}else n(i)},error:function(e){n(e.message||o.get("video","loadError"))},method:"GET"})}},{key:"destroy",value:function(){var e=this.editor;e.off(Mi,this.dropFiles),e.off(Ii,this.pasteFiles),e.off(Ni,this.pasteEach)}}],[{key:"pluginName",get:function(){return"video-uploader"}}]),n}(s.Sy),Li={video:{errorMessageCopy:"Copy error message",loadError:"The video failed to load!",uploadError:"The video failed to upload!",uploadLimitError:"Upload video size is limited to $size",download:"Download",preview:"Preview",loading:"Loading...",transcoding:"Transcoding..."}},Qi={video:{errorMessageCopy:"复制错误信息",loadError:"视频加载失败!",uploadError:"上传视频失败!",uploadLimitError:"上传视频大小限制为 $size",download:"下载",preview:"预览",loading:"加载中...",transcoding:"转码中..."}},Di={"en-US":Li,"zh-CN":Qi},Hi="parse:html",Oi="paste:each",zi="paste:schema",Zi=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a
');i.empty();var d=(0,s.$)(u);n&&(d=n(d,a)),i.replaceWith(d),r.push(d)}else i.remove()})),r},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.language.add(Di),e.on(Hi,this.parseHtml),e.on(Oi,this.pasteHtml),e.on(zi,this.pasteSchema)}},{key:"execute",value:function(e,t,n,r,i,o,a,s,l,c,A){var u={status:e,video_id:r,cover:i,url:t,name:n||t,size:o,download:a,width:c,height:A,naturalWidth:s,naturalHeight:l};"error"===e&&(u.url="",u.message=t),this.editor.card.insert("video",u)}},{key:"waiting",value:function(){var e=(0,_t.Z)(St().mark((function e(t){var n,r,i,o,a=this;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=this.editor.card,r=function(e){var t;return e.root.inEditor()&&e.name===Ti.cardName&&"uploading"===(null===(t=e.getValue())||void 0===t?void 0:t.status)},i=function(){return n.components.find(r)},o=function(e){var n=6e4;return new Promise((function(i,o){if(t){var s=t(a.constructor.pluginName,e);if(!1===s)return o({name:a.constructor.pluginName,card:e});"number"===typeof s&&(n=s)}var l=(new Date).getTime(),c=(new Date).getTime(),A=function t(){if(c-l>=n)return i();setTimeout((function(){r(e)?t():i()}),10)};A()}))},e.abrupt("return",new Promise(function(){var e=(0,_t.Z)(St().mark((function e(t,n){var r,a;return St().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=i(),a=function e(r){o(r).then((function(){var n=i();n?e(n):t()})).catch(n)},r?a(r):t();case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"destroy",value:function(){var e=this.editor;e.off(Hi,this.parseHtml),e.off(Oi,this.pasteHtml),e.off(zi,this.pasteSchema)}}],[{key:"pluginName",get:function(){return"video"}}]),n}(s.Sy),Ri=Zi;function Pi(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qi(e,t,n){Pi(e,t),t.set(e,n)}function Ki(e,t){return t.get?t.get.call(e):t.value}function Wi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function ji(e,t){var n=Wi(e,t,"get");return Ki(e,n)}function Vi(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function Gi(e,t,n){var r=Wi(e,t,"set");return Vi(e,r,n),n}const $i={class:"math-formula"},Yi=["src","width","height"],Xi={key:1},Ji={key:0,class:"math-modal-content"},eo={class:"math-modal-content-left"},to=["onClick"],no={class:"math-modal-content-right"},ro={class:"content-editor-preview"};function io(e,t,n,r,i,o){const a=(0,Ft.up)("TabPane"),s=(0,Ft.up)("Tabs"),l=(0,Ft.up)("Textarea"),c=(0,Ft.up)("Modal");return(0,Ft.wg)(),(0,Ft.iD)("div",$i,[(0,Ft._)("div",{class:(0,Mt.C_)(`math-formula-content ${e.id}`)},[e.mathTextareaValue?((0,Ft.wg)(),(0,Ft.iD)("img",{key:0,src:e.imageUrl,width:e.width,height:e.height},null,8,Yi)):((0,Ft.wg)(),(0,Ft.iD)("span",Xi,"添加公式"))],2),(0,Ft.Wm)(c,{visible:e.visible,"onUpdate:visible":t[1]||(t[1]=t=>e.visible=t),title:"公式编辑器",width:"1000px","wrap-class-name":"math-formula-modal","cancel-text":"取消","ok-text":"保存",onOk:e.handleOk},{default:(0,Ft.w5)((()=>[(0,Ft.Wm)(s,{activeKey:e.activeKey,onChange:e.changePanel},{default:(0,Ft.w5)((()=>[((0,Ft.wg)(!0),(0,Ft.iD)(Ft.HY,null,(0,Ft.Ko)(e.mathTypeList,((e,t)=>((0,Ft.wg)(),(0,Ft.j4)(a,{key:t,tab:e.name},null,8,["tab"])))),128))])),_:1},8,["activeKey","onChange"]),e.visible?((0,Ft.wg)(),(0,Ft.iD)("div",Ji,[(0,Ft._)("div",eo,[((0,Ft.wg)(!0),(0,Ft.iD)(Ft.HY,null,(0,Ft.Ko)(e.mathTypeList[e.activeKey].children,(t=>((0,Ft.wg)(),(0,Ft.iD)("div",{class:"math-model-node",onClick:n=>e.addTextareaValue(t),key:t},"$$"+(0,Mt.zw)(t)+"$$",9,to)))),128))]),(0,Ft._)("div",no,[(0,Ft.Wm)(l,{class:"content-editor-input",value:e.mathTextareaValue,"onUpdate:value":t[0]||(t[0]=t=>e.mathTextareaValue=t),placeholder:"请输入latex公式",onFocus:e.setSelection,onBlur:e.setSelection,onClick:e.setSelection,onInput:e.renderPreview,"auto-size":{minRows:5,maxRows:6},"allow-clear":""},null,8,["value","onFocus","onBlur","onClick","onInput"]),(0,Ft._)("div",ro,(0,Mt.zw)(e.mathPreviewValue),1)])])):(0,Ft.kq)("",!0)])),_:1},8,["visible","onOk"])])}class oo{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new oo(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class ao{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new ao(t,oo.range(this,e))}}class so{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,i="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var a=o.lexer.input;n=o.start,r=o.end,n===a.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var s,l,c=a.slice(n,r).replace(/[^]/g,"$&̲");s=n>15?"…"+a.slice(n-15,n):a.slice(0,n),l=r+15":">","<":"<",'"':""","'":"'"},po=/[&><"']/g;function fo(e){return String(e).replace(po,(e=>ho[e]))}var go=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},mo=function(e){var t=go(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},vo=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},bo=function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"},yo={contains:lo,deflt:co,escape:fo,hyphenate:uo,getBaseElem:go,isCharacterBox:mo,protocolFromUrl:bo},wo={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function xo(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!==typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class ko{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},wo)if(wo.hasOwnProperty(t)){var n=wo[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:xo(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"===typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new so("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"===typeof r)try{r=r(e,t,n)}catch(i){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=yo.protocolFromUrl(e.url));var t="function"===typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Co{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return No[Uo[this.id]]}sub(){return No[Lo[this.id]]}fracNum(){return No[Qo[this.id]]}fracDen(){return No[Do[this.id]]}cramp(){return No[Ho[this.id]]}text(){return No[Oo[this.id]]}isTight(){return this.size>=2}}var Bo=0,_o=1,Eo=2,So=3,Fo=4,To=5,Mo=6,Io=7,No=[new Co(Bo,0,!1),new Co(_o,0,!0),new Co(Eo,1,!1),new Co(So,1,!0),new Co(Fo,2,!1),new Co(To,2,!0),new Co(Mo,3,!1),new Co(Io,3,!0)],Uo=[Fo,To,Fo,To,Mo,Io,Mo,Io],Lo=[To,To,To,To,Io,Io,Io,Io],Qo=[Eo,So,Fo,To,Mo,Io,Mo,Io],Do=[So,So,To,To,Io,Io,Io,Io],Ho=[_o,_o,So,So,To,To,Io,Io],Oo=[Bo,_o,Eo,So,Eo,So,Eo,So],zo={DISPLAY:No[Bo],TEXT:No[Eo],SCRIPT:No[Fo],SCRIPTSCRIPT:No[Mo]},Zo=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Ro(e){for(var t=0;t=i[0]&&e<=i[1])return n.name}return null}var Po=[];function qo(e){for(var t=0;t=Po[t]&&e<=Po[t+1])return!0;return!1}Zo.forEach((e=>e.blocks.forEach((e=>Po.push(...e)))));var Ko=80,Wo=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},jo=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Vo=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Go=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"},$o=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},Yo=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},Xo=function(e,t,n){var r=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+r+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"},Jo=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=Wo(t,Ko);break;case"sqrtSize1":r=jo(t,Ko);break;case"sqrtSize2":r=Vo(t,Ko);break;case"sqrtSize3":r=Go(t,Ko);break;case"sqrtSize4":r=$o(t,Ko);break;case"sqrtTall":r=Xo(t,Ko,n)}return r},ea=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}},ta={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},na=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}};class ra{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return yo.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;te.toText();return this.children.map(e).join("")}}var ia={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},oa={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},aa={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function sa(e,t){ia[e]=t}function la(e,t,n){if(!ia[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=ia[t][r];if(!i&&e[0]in aa&&(r=aa[e[0]].charCodeAt(0),i=ia[t][r]),i||"text"!==n||qo(r)&&(i=ia[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var ca={};function Aa(e){var t;if(t=e>=5?0:e>=3?1:2,!ca[t]){var n=ca[t]={cssEmPerMu:oa.quad[t]/18};for(var r in oa)oa.hasOwnProperty(r)&&(n[r]=oa[r][t])}return ca[t]}var ua=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],da=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],ha=function(e,t){return t.size<2?e:ua[e-1][t.size-1]};class pa{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||pa.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=da[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new pa(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:ha(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:da[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=ha(pa.BASESIZE,e);return this.size===t&&this.textSize===pa.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==pa.BASESIZE?["sizing","reset-size"+this.size,"size"+pa.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=Aa(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}pa.BASESIZE=6;var fa={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},ga={ex:!0,em:!0,mu:!0},ma=function(e){return"string"!==typeof e&&(e=e.unit),e in fa||e in ga||"ex"===e},va=function(e,t){var n;if(e.unit in fa)n=fa[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new so("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},ba=function(e){return+e.toFixed(4)+"em"},ya=function(e){return e.filter((e=>e)).join(" ")},wa=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},xa=function(e){var t=document.createElement(e);for(var n in t.className=ya(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i",t};class Ca{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,wa.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return yo.contains(this.classes,e)}toNode(){return xa.call(this,"span")}toMarkup(){return ka.call(this,"span")}}class Ba{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,wa.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return yo.contains(this.classes,e)}toNode(){return xa.call(this,"a")}toMarkup(){return ka.call(this,"a")}}class _a{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return yo.contains(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=""+this.alt+"0&&(t=document.createElement("span"),t.style.marginRight=ba(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=ya(this.classes)),this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=yo.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+yo.escape(n)+'"');var i=yo.escape(this.text);return e?(t+=">",t+=i,t+="
",t):i}}class Fa{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var r=0;r":""}}class Ma{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e=" but got "+String(e)+".")}var Ua={bin:1,close:1,inner:1,open:1,punct:1,rel:1},La={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Qa={math:{},text:{}};function Da(e,t,n,r,i,o){Qa[e][i]={font:t,group:n,replace:r},o&&r&&(Qa[e][r]=Qa[e][i])}var Ha="math",Oa="text",za="main",Za="ams",Ra="accent-token",Pa="bin",qa="close",Ka="inner",Wa="mathord",ja="op-token",Va="open",Ga="punct",$a="rel",Ya="spacing",Xa="textord";Da(Ha,za,$a,"≡","\\equiv",!0),Da(Ha,za,$a,"≺","\\prec",!0),Da(Ha,za,$a,"≻","\\succ",!0),Da(Ha,za,$a,"∼","\\sim",!0),Da(Ha,za,$a,"⊥","\\perp"),Da(Ha,za,$a,"⪯","\\preceq",!0),Da(Ha,za,$a,"⪰","\\succeq",!0),Da(Ha,za,$a,"≃","\\simeq",!0),Da(Ha,za,$a,"∣","\\mid",!0),Da(Ha,za,$a,"≪","\\ll",!0),Da(Ha,za,$a,"≫","\\gg",!0),Da(Ha,za,$a,"≍","\\asymp",!0),Da(Ha,za,$a,"∥","\\parallel"),Da(Ha,za,$a,"⋈","\\bowtie",!0),Da(Ha,za,$a,"⌣","\\smile",!0),Da(Ha,za,$a,"⊑","\\sqsubseteq",!0),Da(Ha,za,$a,"⊒","\\sqsupseteq",!0),Da(Ha,za,$a,"≐","\\doteq",!0),Da(Ha,za,$a,"⌢","\\frown",!0),Da(Ha,za,$a,"∋","\\ni",!0),Da(Ha,za,$a,"∝","\\propto",!0),Da(Ha,za,$a,"⊢","\\vdash",!0),Da(Ha,za,$a,"⊣","\\dashv",!0),Da(Ha,za,$a,"∋","\\owns"),Da(Ha,za,Ga,".","\\ldotp"),Da(Ha,za,Ga,"⋅","\\cdotp"),Da(Ha,za,Xa,"#","\\#"),Da(Oa,za,Xa,"#","\\#"),Da(Ha,za,Xa,"&","\\&"),Da(Oa,za,Xa,"&","\\&"),Da(Ha,za,Xa,"ℵ","\\aleph",!0),Da(Ha,za,Xa,"∀","\\forall",!0),Da(Ha,za,Xa,"ℏ","\\hbar",!0),Da(Ha,za,Xa,"∃","\\exists",!0),Da(Ha,za,Xa,"∇","\\nabla",!0),Da(Ha,za,Xa,"♭","\\flat",!0),Da(Ha,za,Xa,"ℓ","\\ell",!0),Da(Ha,za,Xa,"♮","\\natural",!0),Da(Ha,za,Xa,"♣","\\clubsuit",!0),Da(Ha,za,Xa,"℘","\\wp",!0),Da(Ha,za,Xa,"♯","\\sharp",!0),Da(Ha,za,Xa,"♢","\\diamondsuit",!0),Da(Ha,za,Xa,"ℜ","\\Re",!0),Da(Ha,za,Xa,"♡","\\heartsuit",!0),Da(Ha,za,Xa,"ℑ","\\Im",!0),Da(Ha,za,Xa,"♠","\\spadesuit",!0),Da(Ha,za,Xa,"§","\\S",!0),Da(Oa,za,Xa,"§","\\S"),Da(Ha,za,Xa,"¶","\\P",!0),Da(Oa,za,Xa,"¶","\\P"),Da(Ha,za,Xa,"†","\\dag"),Da(Oa,za,Xa,"†","\\dag"),Da(Oa,za,Xa,"†","\\textdagger"),Da(Ha,za,Xa,"‡","\\ddag"),Da(Oa,za,Xa,"‡","\\ddag"),Da(Oa,za,Xa,"‡","\\textdaggerdbl"),Da(Ha,za,qa,"⎱","\\rmoustache",!0),Da(Ha,za,Va,"⎰","\\lmoustache",!0),Da(Ha,za,qa,"⟯","\\rgroup",!0),Da(Ha,za,Va,"⟮","\\lgroup",!0),Da(Ha,za,Pa,"∓","\\mp",!0),Da(Ha,za,Pa,"⊖","\\ominus",!0),Da(Ha,za,Pa,"⊎","\\uplus",!0),Da(Ha,za,Pa,"⊓","\\sqcap",!0),Da(Ha,za,Pa,"∗","\\ast"),Da(Ha,za,Pa,"⊔","\\sqcup",!0),Da(Ha,za,Pa,"◯","\\bigcirc",!0),Da(Ha,za,Pa,"∙","\\bullet",!0),Da(Ha,za,Pa,"‡","\\ddagger"),Da(Ha,za,Pa,"≀","\\wr",!0),Da(Ha,za,Pa,"⨿","\\amalg"),Da(Ha,za,Pa,"&","\\And"),Da(Ha,za,$a,"⟵","\\longleftarrow",!0),Da(Ha,za,$a,"⇐","\\Leftarrow",!0),Da(Ha,za,$a,"⟸","\\Longleftarrow",!0),Da(Ha,za,$a,"⟶","\\longrightarrow",!0),Da(Ha,za,$a,"⇒","\\Rightarrow",!0),Da(Ha,za,$a,"⟹","\\Longrightarrow",!0),Da(Ha,za,$a,"↔","\\leftrightarrow",!0),Da(Ha,za,$a,"⟷","\\longleftrightarrow",!0),Da(Ha,za,$a,"⇔","\\Leftrightarrow",!0),Da(Ha,za,$a,"⟺","\\Longleftrightarrow",!0),Da(Ha,za,$a,"↦","\\mapsto",!0),Da(Ha,za,$a,"⟼","\\longmapsto",!0),Da(Ha,za,$a,"↗","\\nearrow",!0),Da(Ha,za,$a,"↩","\\hookleftarrow",!0),Da(Ha,za,$a,"↪","\\hookrightarrow",!0),Da(Ha,za,$a,"↘","\\searrow",!0),Da(Ha,za,$a,"↼","\\leftharpoonup",!0),Da(Ha,za,$a,"⇀","\\rightharpoonup",!0),Da(Ha,za,$a,"↙","\\swarrow",!0),Da(Ha,za,$a,"↽","\\leftharpoondown",!0),Da(Ha,za,$a,"⇁","\\rightharpoondown",!0),Da(Ha,za,$a,"↖","\\nwarrow",!0),Da(Ha,za,$a,"⇌","\\rightleftharpoons",!0),Da(Ha,Za,$a,"≮","\\nless",!0),Da(Ha,Za,$a,"","\\@nleqslant"),Da(Ha,Za,$a,"","\\@nleqq"),Da(Ha,Za,$a,"⪇","\\lneq",!0),Da(Ha,Za,$a,"≨","\\lneqq",!0),Da(Ha,Za,$a,"","\\@lvertneqq"),Da(Ha,Za,$a,"⋦","\\lnsim",!0),Da(Ha,Za,$a,"⪉","\\lnapprox",!0),Da(Ha,Za,$a,"⊀","\\nprec",!0),Da(Ha,Za,$a,"⋠","\\npreceq",!0),Da(Ha,Za,$a,"⋨","\\precnsim",!0),Da(Ha,Za,$a,"⪹","\\precnapprox",!0),Da(Ha,Za,$a,"≁","\\nsim",!0),Da(Ha,Za,$a,"","\\@nshortmid"),Da(Ha,Za,$a,"∤","\\nmid",!0),Da(Ha,Za,$a,"⊬","\\nvdash",!0),Da(Ha,Za,$a,"⊭","\\nvDash",!0),Da(Ha,Za,$a,"⋪","\\ntriangleleft"),Da(Ha,Za,$a,"⋬","\\ntrianglelefteq",!0),Da(Ha,Za,$a,"⊊","\\subsetneq",!0),Da(Ha,Za,$a,"","\\@varsubsetneq"),Da(Ha,Za,$a,"⫋","\\subsetneqq",!0),Da(Ha,Za,$a,"","\\@varsubsetneqq"),Da(Ha,Za,$a,"≯","\\ngtr",!0),Da(Ha,Za,$a,"","\\@ngeqslant"),Da(Ha,Za,$a,"","\\@ngeqq"),Da(Ha,Za,$a,"⪈","\\gneq",!0),Da(Ha,Za,$a,"≩","\\gneqq",!0),Da(Ha,Za,$a,"","\\@gvertneqq"),Da(Ha,Za,$a,"⋧","\\gnsim",!0),Da(Ha,Za,$a,"⪊","\\gnapprox",!0),Da(Ha,Za,$a,"⊁","\\nsucc",!0),Da(Ha,Za,$a,"⋡","\\nsucceq",!0),Da(Ha,Za,$a,"⋩","\\succnsim",!0),Da(Ha,Za,$a,"⪺","\\succnapprox",!0),Da(Ha,Za,$a,"≆","\\ncong",!0),Da(Ha,Za,$a,"","\\@nshortparallel"),Da(Ha,Za,$a,"∦","\\nparallel",!0),Da(Ha,Za,$a,"⊯","\\nVDash",!0),Da(Ha,Za,$a,"⋫","\\ntriangleright"),Da(Ha,Za,$a,"⋭","\\ntrianglerighteq",!0),Da(Ha,Za,$a,"","\\@nsupseteqq"),Da(Ha,Za,$a,"⊋","\\supsetneq",!0),Da(Ha,Za,$a,"","\\@varsupsetneq"),Da(Ha,Za,$a,"⫌","\\supsetneqq",!0),Da(Ha,Za,$a,"","\\@varsupsetneqq"),Da(Ha,Za,$a,"⊮","\\nVdash",!0),Da(Ha,Za,$a,"⪵","\\precneqq",!0),Da(Ha,Za,$a,"⪶","\\succneqq",!0),Da(Ha,Za,$a,"","\\@nsubseteqq"),Da(Ha,Za,Pa,"⊴","\\unlhd"),Da(Ha,Za,Pa,"⊵","\\unrhd"),Da(Ha,Za,$a,"↚","\\nleftarrow",!0),Da(Ha,Za,$a,"↛","\\nrightarrow",!0),Da(Ha,Za,$a,"⇍","\\nLeftarrow",!0),Da(Ha,Za,$a,"⇏","\\nRightarrow",!0),Da(Ha,Za,$a,"↮","\\nleftrightarrow",!0),Da(Ha,Za,$a,"⇎","\\nLeftrightarrow",!0),Da(Ha,Za,$a,"△","\\vartriangle"),Da(Ha,Za,Xa,"ℏ","\\hslash"),Da(Ha,Za,Xa,"▽","\\triangledown"),Da(Ha,Za,Xa,"◊","\\lozenge"),Da(Ha,Za,Xa,"Ⓢ","\\circledS"),Da(Ha,Za,Xa,"®","\\circledR"),Da(Oa,Za,Xa,"®","\\circledR"),Da(Ha,Za,Xa,"∡","\\measuredangle",!0),Da(Ha,Za,Xa,"∄","\\nexists"),Da(Ha,Za,Xa,"℧","\\mho"),Da(Ha,Za,Xa,"Ⅎ","\\Finv",!0),Da(Ha,Za,Xa,"⅁","\\Game",!0),Da(Ha,Za,Xa,"‵","\\backprime"),Da(Ha,Za,Xa,"▲","\\blacktriangle"),Da(Ha,Za,Xa,"▼","\\blacktriangledown"),Da(Ha,Za,Xa,"■","\\blacksquare"),Da(Ha,Za,Xa,"⧫","\\blacklozenge"),Da(Ha,Za,Xa,"★","\\bigstar"),Da(Ha,Za,Xa,"∢","\\sphericalangle",!0),Da(Ha,Za,Xa,"∁","\\complement",!0),Da(Ha,Za,Xa,"ð","\\eth",!0),Da(Oa,za,Xa,"ð","ð"),Da(Ha,Za,Xa,"╱","\\diagup"),Da(Ha,Za,Xa,"╲","\\diagdown"),Da(Ha,Za,Xa,"□","\\square"),Da(Ha,Za,Xa,"□","\\Box"),Da(Ha,Za,Xa,"◊","\\Diamond"),Da(Ha,Za,Xa,"¥","\\yen",!0),Da(Oa,Za,Xa,"¥","\\yen",!0),Da(Ha,Za,Xa,"✓","\\checkmark",!0),Da(Oa,Za,Xa,"✓","\\checkmark"),Da(Ha,Za,Xa,"ℶ","\\beth",!0),Da(Ha,Za,Xa,"ℸ","\\daleth",!0),Da(Ha,Za,Xa,"ℷ","\\gimel",!0),Da(Ha,Za,Xa,"ϝ","\\digamma",!0),Da(Ha,Za,Xa,"ϰ","\\varkappa"),Da(Ha,Za,Va,"┌","\\@ulcorner",!0),Da(Ha,Za,qa,"┐","\\@urcorner",!0),Da(Ha,Za,Va,"└","\\@llcorner",!0),Da(Ha,Za,qa,"┘","\\@lrcorner",!0),Da(Ha,Za,$a,"≦","\\leqq",!0),Da(Ha,Za,$a,"⩽","\\leqslant",!0),Da(Ha,Za,$a,"⪕","\\eqslantless",!0),Da(Ha,Za,$a,"≲","\\lesssim",!0),Da(Ha,Za,$a,"⪅","\\lessapprox",!0),Da(Ha,Za,$a,"≊","\\approxeq",!0),Da(Ha,Za,Pa,"⋖","\\lessdot"),Da(Ha,Za,$a,"⋘","\\lll",!0),Da(Ha,Za,$a,"≶","\\lessgtr",!0),Da(Ha,Za,$a,"⋚","\\lesseqgtr",!0),Da(Ha,Za,$a,"⪋","\\lesseqqgtr",!0),Da(Ha,Za,$a,"≑","\\doteqdot"),Da(Ha,Za,$a,"≓","\\risingdotseq",!0),Da(Ha,Za,$a,"≒","\\fallingdotseq",!0),Da(Ha,Za,$a,"∽","\\backsim",!0),Da(Ha,Za,$a,"⋍","\\backsimeq",!0),Da(Ha,Za,$a,"⫅","\\subseteqq",!0),Da(Ha,Za,$a,"⋐","\\Subset",!0),Da(Ha,Za,$a,"⊏","\\sqsubset",!0),Da(Ha,Za,$a,"≼","\\preccurlyeq",!0),Da(Ha,Za,$a,"⋞","\\curlyeqprec",!0),Da(Ha,Za,$a,"≾","\\precsim",!0),Da(Ha,Za,$a,"⪷","\\precapprox",!0),Da(Ha,Za,$a,"⊲","\\vartriangleleft"),Da(Ha,Za,$a,"⊴","\\trianglelefteq"),Da(Ha,Za,$a,"⊨","\\vDash",!0),Da(Ha,Za,$a,"⊪","\\Vvdash",!0),Da(Ha,Za,$a,"⌣","\\smallsmile"),Da(Ha,Za,$a,"⌢","\\smallfrown"),Da(Ha,Za,$a,"≏","\\bumpeq",!0),Da(Ha,Za,$a,"≎","\\Bumpeq",!0),Da(Ha,Za,$a,"≧","\\geqq",!0),Da(Ha,Za,$a,"⩾","\\geqslant",!0),Da(Ha,Za,$a,"⪖","\\eqslantgtr",!0),Da(Ha,Za,$a,"≳","\\gtrsim",!0),Da(Ha,Za,$a,"⪆","\\gtrapprox",!0),Da(Ha,Za,Pa,"⋗","\\gtrdot"),Da(Ha,Za,$a,"⋙","\\ggg",!0),Da(Ha,Za,$a,"≷","\\gtrless",!0),Da(Ha,Za,$a,"⋛","\\gtreqless",!0),Da(Ha,Za,$a,"⪌","\\gtreqqless",!0),Da(Ha,Za,$a,"≖","\\eqcirc",!0),Da(Ha,Za,$a,"≗","\\circeq",!0),Da(Ha,Za,$a,"≜","\\triangleq",!0),Da(Ha,Za,$a,"∼","\\thicksim"),Da(Ha,Za,$a,"≈","\\thickapprox"),Da(Ha,Za,$a,"⫆","\\supseteqq",!0),Da(Ha,Za,$a,"⋑","\\Supset",!0),Da(Ha,Za,$a,"⊐","\\sqsupset",!0),Da(Ha,Za,$a,"≽","\\succcurlyeq",!0),Da(Ha,Za,$a,"⋟","\\curlyeqsucc",!0),Da(Ha,Za,$a,"≿","\\succsim",!0),Da(Ha,Za,$a,"⪸","\\succapprox",!0),Da(Ha,Za,$a,"⊳","\\vartriangleright"),Da(Ha,Za,$a,"⊵","\\trianglerighteq"),Da(Ha,Za,$a,"⊩","\\Vdash",!0),Da(Ha,Za,$a,"∣","\\shortmid"),Da(Ha,Za,$a,"∥","\\shortparallel"),Da(Ha,Za,$a,"≬","\\between",!0),Da(Ha,Za,$a,"⋔","\\pitchfork",!0),Da(Ha,Za,$a,"∝","\\varpropto"),Da(Ha,Za,$a,"◀","\\blacktriangleleft"),Da(Ha,Za,$a,"∴","\\therefore",!0),Da(Ha,Za,$a,"∍","\\backepsilon"),Da(Ha,Za,$a,"▶","\\blacktriangleright"),Da(Ha,Za,$a,"∵","\\because",!0),Da(Ha,Za,$a,"⋘","\\llless"),Da(Ha,Za,$a,"⋙","\\gggtr"),Da(Ha,Za,Pa,"⊲","\\lhd"),Da(Ha,Za,Pa,"⊳","\\rhd"),Da(Ha,Za,$a,"≂","\\eqsim",!0),Da(Ha,za,$a,"⋈","\\Join"),Da(Ha,Za,$a,"≑","\\Doteq",!0),Da(Ha,Za,Pa,"∔","\\dotplus",!0),Da(Ha,Za,Pa,"∖","\\smallsetminus"),Da(Ha,Za,Pa,"⋒","\\Cap",!0),Da(Ha,Za,Pa,"⋓","\\Cup",!0),Da(Ha,Za,Pa,"⩞","\\doublebarwedge",!0),Da(Ha,Za,Pa,"⊟","\\boxminus",!0),Da(Ha,Za,Pa,"⊞","\\boxplus",!0),Da(Ha,Za,Pa,"⋇","\\divideontimes",!0),Da(Ha,Za,Pa,"⋉","\\ltimes",!0),Da(Ha,Za,Pa,"⋊","\\rtimes",!0),Da(Ha,Za,Pa,"⋋","\\leftthreetimes",!0),Da(Ha,Za,Pa,"⋌","\\rightthreetimes",!0),Da(Ha,Za,Pa,"⋏","\\curlywedge",!0),Da(Ha,Za,Pa,"⋎","\\curlyvee",!0),Da(Ha,Za,Pa,"⊝","\\circleddash",!0),Da(Ha,Za,Pa,"⊛","\\circledast",!0),Da(Ha,Za,Pa,"⋅","\\centerdot"),Da(Ha,Za,Pa,"⊺","\\intercal",!0),Da(Ha,Za,Pa,"⋒","\\doublecap"),Da(Ha,Za,Pa,"⋓","\\doublecup"),Da(Ha,Za,Pa,"⊠","\\boxtimes",!0),Da(Ha,Za,$a,"⇢","\\dashrightarrow",!0),Da(Ha,Za,$a,"⇠","\\dashleftarrow",!0),Da(Ha,Za,$a,"⇇","\\leftleftarrows",!0),Da(Ha,Za,$a,"⇆","\\leftrightarrows",!0),Da(Ha,Za,$a,"⇚","\\Lleftarrow",!0),Da(Ha,Za,$a,"↞","\\twoheadleftarrow",!0),Da(Ha,Za,$a,"↢","\\leftarrowtail",!0),Da(Ha,Za,$a,"↫","\\looparrowleft",!0),Da(Ha,Za,$a,"⇋","\\leftrightharpoons",!0),Da(Ha,Za,$a,"↶","\\curvearrowleft",!0),Da(Ha,Za,$a,"↺","\\circlearrowleft",!0),Da(Ha,Za,$a,"↰","\\Lsh",!0),Da(Ha,Za,$a,"⇈","\\upuparrows",!0),Da(Ha,Za,$a,"↿","\\upharpoonleft",!0),Da(Ha,Za,$a,"⇃","\\downharpoonleft",!0),Da(Ha,za,$a,"⊶","\\origof",!0),Da(Ha,za,$a,"⊷","\\imageof",!0),Da(Ha,Za,$a,"⊸","\\multimap",!0),Da(Ha,Za,$a,"↭","\\leftrightsquigarrow",!0),Da(Ha,Za,$a,"⇉","\\rightrightarrows",!0),Da(Ha,Za,$a,"⇄","\\rightleftarrows",!0),Da(Ha,Za,$a,"↠","\\twoheadrightarrow",!0),Da(Ha,Za,$a,"↣","\\rightarrowtail",!0),Da(Ha,Za,$a,"↬","\\looparrowright",!0),Da(Ha,Za,$a,"↷","\\curvearrowright",!0),Da(Ha,Za,$a,"↻","\\circlearrowright",!0),Da(Ha,Za,$a,"↱","\\Rsh",!0),Da(Ha,Za,$a,"⇊","\\downdownarrows",!0),Da(Ha,Za,$a,"↾","\\upharpoonright",!0),Da(Ha,Za,$a,"⇂","\\downharpoonright",!0),Da(Ha,Za,$a,"⇝","\\rightsquigarrow",!0),Da(Ha,Za,$a,"⇝","\\leadsto"),Da(Ha,Za,$a,"⇛","\\Rrightarrow",!0),Da(Ha,Za,$a,"↾","\\restriction"),Da(Ha,za,Xa,"‘","`"),Da(Ha,za,Xa,"$","\\$"),Da(Oa,za,Xa,"$","\\$"),Da(Oa,za,Xa,"$","\\textdollar"),Da(Ha,za,Xa,"%","\\%"),Da(Oa,za,Xa,"%","\\%"),Da(Ha,za,Xa,"_","\\_"),Da(Oa,za,Xa,"_","\\_"),Da(Oa,za,Xa,"_","\\textunderscore"),Da(Ha,za,Xa,"∠","\\angle",!0),Da(Ha,za,Xa,"∞","\\infty",!0),Da(Ha,za,Xa,"′","\\prime"),Da(Ha,za,Xa,"△","\\triangle"),Da(Ha,za,Xa,"Γ","\\Gamma",!0),Da(Ha,za,Xa,"Δ","\\Delta",!0),Da(Ha,za,Xa,"Θ","\\Theta",!0),Da(Ha,za,Xa,"Λ","\\Lambda",!0),Da(Ha,za,Xa,"Ξ","\\Xi",!0),Da(Ha,za,Xa,"Π","\\Pi",!0),Da(Ha,za,Xa,"Σ","\\Sigma",!0),Da(Ha,za,Xa,"Υ","\\Upsilon",!0),Da(Ha,za,Xa,"Φ","\\Phi",!0),Da(Ha,za,Xa,"Ψ","\\Psi",!0),Da(Ha,za,Xa,"Ω","\\Omega",!0),Da(Ha,za,Xa,"A","Α"),Da(Ha,za,Xa,"B","Β"),Da(Ha,za,Xa,"E","Ε"),Da(Ha,za,Xa,"Z","Ζ"),Da(Ha,za,Xa,"H","Η"),Da(Ha,za,Xa,"I","Ι"),Da(Ha,za,Xa,"K","Κ"),Da(Ha,za,Xa,"M","Μ"),Da(Ha,za,Xa,"N","Ν"),Da(Ha,za,Xa,"O","Ο"),Da(Ha,za,Xa,"P","Ρ"),Da(Ha,za,Xa,"T","Τ"),Da(Ha,za,Xa,"X","Χ"),Da(Ha,za,Xa,"¬","\\neg",!0),Da(Ha,za,Xa,"¬","\\lnot"),Da(Ha,za,Xa,"⊤","\\top"),Da(Ha,za,Xa,"⊥","\\bot"),Da(Ha,za,Xa,"∅","\\emptyset"),Da(Ha,Za,Xa,"∅","\\varnothing"),Da(Ha,za,Wa,"α","\\alpha",!0),Da(Ha,za,Wa,"β","\\beta",!0),Da(Ha,za,Wa,"γ","\\gamma",!0),Da(Ha,za,Wa,"δ","\\delta",!0),Da(Ha,za,Wa,"ϵ","\\epsilon",!0),Da(Ha,za,Wa,"ζ","\\zeta",!0),Da(Ha,za,Wa,"η","\\eta",!0),Da(Ha,za,Wa,"θ","\\theta",!0),Da(Ha,za,Wa,"ι","\\iota",!0),Da(Ha,za,Wa,"κ","\\kappa",!0),Da(Ha,za,Wa,"λ","\\lambda",!0),Da(Ha,za,Wa,"μ","\\mu",!0),Da(Ha,za,Wa,"ν","\\nu",!0),Da(Ha,za,Wa,"ξ","\\xi",!0),Da(Ha,za,Wa,"ο","\\omicron",!0),Da(Ha,za,Wa,"π","\\pi",!0),Da(Ha,za,Wa,"ρ","\\rho",!0),Da(Ha,za,Wa,"σ","\\sigma",!0),Da(Ha,za,Wa,"τ","\\tau",!0),Da(Ha,za,Wa,"υ","\\upsilon",!0),Da(Ha,za,Wa,"ϕ","\\phi",!0),Da(Ha,za,Wa,"χ","\\chi",!0),Da(Ha,za,Wa,"ψ","\\psi",!0),Da(Ha,za,Wa,"ω","\\omega",!0),Da(Ha,za,Wa,"ε","\\varepsilon",!0),Da(Ha,za,Wa,"ϑ","\\vartheta",!0),Da(Ha,za,Wa,"ϖ","\\varpi",!0),Da(Ha,za,Wa,"ϱ","\\varrho",!0),Da(Ha,za,Wa,"ς","\\varsigma",!0),Da(Ha,za,Wa,"φ","\\varphi",!0),Da(Ha,za,Pa,"∗","*",!0),Da(Ha,za,Pa,"+","+"),Da(Ha,za,Pa,"−","-",!0),Da(Ha,za,Pa,"⋅","\\cdot",!0),Da(Ha,za,Pa,"∘","\\circ",!0),Da(Ha,za,Pa,"÷","\\div",!0),Da(Ha,za,Pa,"±","\\pm",!0),Da(Ha,za,Pa,"×","\\times",!0),Da(Ha,za,Pa,"∩","\\cap",!0),Da(Ha,za,Pa,"∪","\\cup",!0),Da(Ha,za,Pa,"∖","\\setminus",!0),Da(Ha,za,Pa,"∧","\\land"),Da(Ha,za,Pa,"∨","\\lor"),Da(Ha,za,Pa,"∧","\\wedge",!0),Da(Ha,za,Pa,"∨","\\vee",!0),Da(Ha,za,Xa,"√","\\surd"),Da(Ha,za,Va,"⟨","\\langle",!0),Da(Ha,za,Va,"∣","\\lvert"),Da(Ha,za,Va,"∥","\\lVert"),Da(Ha,za,qa,"?","?"),Da(Ha,za,qa,"!","!"),Da(Ha,za,qa,"⟩","\\rangle",!0),Da(Ha,za,qa,"∣","\\rvert"),Da(Ha,za,qa,"∥","\\rVert"),Da(Ha,za,$a,"=","="),Da(Ha,za,$a,":",":"),Da(Ha,za,$a,"≈","\\approx",!0),Da(Ha,za,$a,"≅","\\cong",!0),Da(Ha,za,$a,"≥","\\ge"),Da(Ha,za,$a,"≥","\\geq",!0),Da(Ha,za,$a,"←","\\gets"),Da(Ha,za,$a,">","\\gt",!0),Da(Ha,za,$a,"∈","\\in",!0),Da(Ha,za,$a,"","\\@not"),Da(Ha,za,$a,"⊂","\\subset",!0),Da(Ha,za,$a,"⊃","\\supset",!0),Da(Ha,za,$a,"⊆","\\subseteq",!0),Da(Ha,za,$a,"⊇","\\supseteq",!0),Da(Ha,Za,$a,"⊈","\\nsubseteq",!0),Da(Ha,Za,$a,"⊉","\\nsupseteq",!0),Da(Ha,za,$a,"⊨","\\models"),Da(Ha,za,$a,"←","\\leftarrow",!0),Da(Ha,za,$a,"≤","\\le"),Da(Ha,za,$a,"≤","\\leq",!0),Da(Ha,za,$a,"<","\\lt",!0),Da(Ha,za,$a,"→","\\rightarrow",!0),Da(Ha,za,$a,"→","\\to"),Da(Ha,Za,$a,"≱","\\ngeq",!0),Da(Ha,Za,$a,"≰","\\nleq",!0),Da(Ha,za,Ya," ","\\ "),Da(Ha,za,Ya," ","\\space"),Da(Ha,za,Ya," ","\\nobreakspace"),Da(Oa,za,Ya," ","\\ "),Da(Oa,za,Ya," "," "),Da(Oa,za,Ya," ","\\space"),Da(Oa,za,Ya," ","\\nobreakspace"),Da(Ha,za,Ya,null,"\\nobreak"),Da(Ha,za,Ya,null,"\\allowbreak"),Da(Ha,za,Ga,",",","),Da(Ha,za,Ga,";",";"),Da(Ha,Za,Pa,"⊼","\\barwedge",!0),Da(Ha,Za,Pa,"⊻","\\veebar",!0),Da(Ha,za,Pa,"⊙","\\odot",!0),Da(Ha,za,Pa,"⊕","\\oplus",!0),Da(Ha,za,Pa,"⊗","\\otimes",!0),Da(Ha,za,Xa,"∂","\\partial",!0),Da(Ha,za,Pa,"⊘","\\oslash",!0),Da(Ha,Za,Pa,"⊚","\\circledcirc",!0),Da(Ha,Za,Pa,"⊡","\\boxdot",!0),Da(Ha,za,Pa,"△","\\bigtriangleup"),Da(Ha,za,Pa,"▽","\\bigtriangledown"),Da(Ha,za,Pa,"†","\\dagger"),Da(Ha,za,Pa,"⋄","\\diamond"),Da(Ha,za,Pa,"⋆","\\star"),Da(Ha,za,Pa,"◃","\\triangleleft"),Da(Ha,za,Pa,"▹","\\triangleright"),Da(Ha,za,Va,"{","\\{"),Da(Oa,za,Xa,"{","\\{"),Da(Oa,za,Xa,"{","\\textbraceleft"),Da(Ha,za,qa,"}","\\}"),Da(Oa,za,Xa,"}","\\}"),Da(Oa,za,Xa,"}","\\textbraceright"),Da(Ha,za,Va,"{","\\lbrace"),Da(Ha,za,qa,"}","\\rbrace"),Da(Ha,za,Va,"[","\\lbrack",!0),Da(Oa,za,Xa,"[","\\lbrack",!0),Da(Ha,za,qa,"]","\\rbrack",!0),Da(Oa,za,Xa,"]","\\rbrack",!0),Da(Ha,za,Va,"(","\\lparen",!0),Da(Ha,za,qa,")","\\rparen",!0),Da(Oa,za,Xa,"<","\\textless",!0),Da(Oa,za,Xa,">","\\textgreater",!0),Da(Ha,za,Va,"⌊","\\lfloor",!0),Da(Ha,za,qa,"⌋","\\rfloor",!0),Da(Ha,za,Va,"⌈","\\lceil",!0),Da(Ha,za,qa,"⌉","\\rceil",!0),Da(Ha,za,Xa,"\\","\\backslash"),Da(Ha,za,Xa,"∣","|"),Da(Ha,za,Xa,"∣","\\vert"),Da(Oa,za,Xa,"|","\\textbar",!0),Da(Ha,za,Xa,"∥","\\|"),Da(Ha,za,Xa,"∥","\\Vert"),Da(Oa,za,Xa,"∥","\\textbardbl"),Da(Oa,za,Xa,"~","\\textasciitilde"),Da(Oa,za,Xa,"\\","\\textbackslash"),Da(Oa,za,Xa,"^","\\textasciicircum"),Da(Ha,za,$a,"↑","\\uparrow",!0),Da(Ha,za,$a,"⇑","\\Uparrow",!0),Da(Ha,za,$a,"↓","\\downarrow",!0),Da(Ha,za,$a,"⇓","\\Downarrow",!0),Da(Ha,za,$a,"↕","\\updownarrow",!0),Da(Ha,za,$a,"⇕","\\Updownarrow",!0),Da(Ha,za,ja,"∐","\\coprod"),Da(Ha,za,ja,"⋁","\\bigvee"),Da(Ha,za,ja,"⋀","\\bigwedge"),Da(Ha,za,ja,"⨄","\\biguplus"),Da(Ha,za,ja,"⋂","\\bigcap"),Da(Ha,za,ja,"⋃","\\bigcup"),Da(Ha,za,ja,"∫","\\int"),Da(Ha,za,ja,"∫","\\intop"),Da(Ha,za,ja,"∬","\\iint"),Da(Ha,za,ja,"∭","\\iiint"),Da(Ha,za,ja,"∏","\\prod"),Da(Ha,za,ja,"∑","\\sum"),Da(Ha,za,ja,"⨂","\\bigotimes"),Da(Ha,za,ja,"⨁","\\bigoplus"),Da(Ha,za,ja,"⨀","\\bigodot"),Da(Ha,za,ja,"∮","\\oint"),Da(Ha,za,ja,"∯","\\oiint"),Da(Ha,za,ja,"∰","\\oiiint"),Da(Ha,za,ja,"⨆","\\bigsqcup"),Da(Ha,za,ja,"∫","\\smallint"),Da(Oa,za,Ka,"…","\\textellipsis"),Da(Ha,za,Ka,"…","\\mathellipsis"),Da(Oa,za,Ka,"…","\\ldots",!0),Da(Ha,za,Ka,"…","\\ldots",!0),Da(Ha,za,Ka,"⋯","\\@cdots",!0),Da(Ha,za,Ka,"⋱","\\ddots",!0),Da(Ha,za,Xa,"⋮","\\varvdots"),Da(Ha,za,Ra,"ˊ","\\acute"),Da(Ha,za,Ra,"ˋ","\\grave"),Da(Ha,za,Ra,"¨","\\ddot"),Da(Ha,za,Ra,"~","\\tilde"),Da(Ha,za,Ra,"ˉ","\\bar"),Da(Ha,za,Ra,"˘","\\breve"),Da(Ha,za,Ra,"ˇ","\\check"),Da(Ha,za,Ra,"^","\\hat"),Da(Ha,za,Ra,"⃗","\\vec"),Da(Ha,za,Ra,"˙","\\dot"),Da(Ha,za,Ra,"˚","\\mathring"),Da(Ha,za,Wa,"","\\@imath"),Da(Ha,za,Wa,"","\\@jmath"),Da(Ha,za,Xa,"ı","ı"),Da(Ha,za,Xa,"ȷ","ȷ"),Da(Oa,za,Xa,"ı","\\i",!0),Da(Oa,za,Xa,"ȷ","\\j",!0),Da(Oa,za,Xa,"ß","\\ss",!0),Da(Oa,za,Xa,"æ","\\ae",!0),Da(Oa,za,Xa,"œ","\\oe",!0),Da(Oa,za,Xa,"ø","\\o",!0),Da(Oa,za,Xa,"Æ","\\AE",!0),Da(Oa,za,Xa,"Œ","\\OE",!0),Da(Oa,za,Xa,"Ø","\\O",!0),Da(Oa,za,Ra,"ˊ","\\'"),Da(Oa,za,Ra,"ˋ","\\`"),Da(Oa,za,Ra,"ˆ","\\^"),Da(Oa,za,Ra,"˜","\\~"),Da(Oa,za,Ra,"ˉ","\\="),Da(Oa,za,Ra,"˘","\\u"),Da(Oa,za,Ra,"˙","\\."),Da(Oa,za,Ra,"¸","\\c"),Da(Oa,za,Ra,"˚","\\r"),Da(Oa,za,Ra,"ˇ","\\v"),Da(Oa,za,Ra,"¨",'\\"'),Da(Oa,za,Ra,"˝","\\H"),Da(Oa,za,Ra,"◯","\\textcircled");var Ja={"--":!0,"---":!0,"``":!0,"''":!0};Da(Oa,za,Xa,"–","--",!0),Da(Oa,za,Xa,"–","\\textendash"),Da(Oa,za,Xa,"—","---",!0),Da(Oa,za,Xa,"—","\\textemdash"),Da(Oa,za,Xa,"‘","`",!0),Da(Oa,za,Xa,"‘","\\textquoteleft"),Da(Oa,za,Xa,"’","'",!0),Da(Oa,za,Xa,"’","\\textquoteright"),Da(Oa,za,Xa,"“","``",!0),Da(Oa,za,Xa,"“","\\textquotedblleft"),Da(Oa,za,Xa,"”","''",!0),Da(Oa,za,Xa,"”","\\textquotedblright"),Da(Ha,za,Xa,"°","\\degree",!0),Da(Oa,za,Xa,"°","\\degree"),Da(Oa,za,Xa,"°","\\textdegree",!0),Da(Ha,za,Xa,"£","\\pounds"),Da(Ha,za,Xa,"£","\\mathsterling",!0),Da(Oa,za,Xa,"£","\\pounds"),Da(Oa,za,Xa,"£","\\textsterling",!0),Da(Ha,Za,Xa,"✠","\\maltese"),Da(Oa,Za,Xa,"✠","\\maltese");for(var es='0123456789/@."',ts=0;ts{if(ya(e.classes)!==ya(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},_s=e=>{for(var t=0;tt&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>r&&(r=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Ss=function(e,t,n,r){var i=new Ca(e,t,n,r);return Es(i),i},Fs=(e,t,n,r)=>new Ca(e,t,n,r),Ts=function(e,t,n){var r=Ss([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=ba(r.height),r.maxFontSize=1,r},Ms=function(e,t,n,r){var i=new Ba(e,t,n,r);return Es(i),i},Is=function(e){var t=new ra(e);return Es(t),t},Ns=function(e,t){return e instanceof ra?Ss([],[e],t):e},Us=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,o=1;o{var n=Ss(["mspace"],[],t),r=va(e,t);return n.style.marginRight=ba(r),n},Ds=function(e,t,n){var r,i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}return r="textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular",i+"-"+r},Hs={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Os={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},zs=function(e,t){var[n,r,i]=Os[e],o=new Ta(n),a=new Fa([o],{width:ba(r),height:ba(i),style:"width:"+ba(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),s=Fs(["overlay"],[a],t);return s.height=i,s.style.height=ba(i),s.style.width=ba(r),s},Zs={fontMap:Hs,makeSymbol:ws,mathsym:xs,makeSpan:Ss,makeSvgSpan:Fs,makeLineSpan:Ts,makeAnchor:Ms,makeFragment:Is,wrapFragment:Ns,makeVList:Ls,makeOrd:Cs,makeGlue:Qs,staticSvg:zs,svgData:Os,tryCombineChars:_s},Rs={number:3,unit:"mu"},Ps={number:4,unit:"mu"},qs={number:5,unit:"mu"},Ks={mord:{mop:Rs,mbin:Ps,mrel:qs,minner:Rs},mop:{mord:Rs,mop:Rs,mrel:qs,minner:Rs},mbin:{mord:Ps,mop:Ps,mopen:Ps,minner:Ps},mrel:{mord:qs,mop:qs,mopen:qs,minner:qs},mopen:{},mclose:{mop:Rs,mbin:Ps,mrel:qs,minner:Rs},mpunct:{mord:Rs,mop:Rs,mrel:qs,mopen:Rs,mclose:Rs,mpunct:Rs,minner:Rs},minner:{mord:Rs,mop:Rs,mbin:Ps,mrel:qs,mopen:Rs,mpunct:Rs,minner:Rs}},Ws={mord:{mop:Rs},mop:{mord:Rs,mop:Rs},mbin:{},mrel:{},mopen:{},mclose:{mop:Rs},mpunct:{},minner:{mop:Rs}},js={},Vs={},Gs={};function $s(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l{var n=t.classes[0],r=e.classes[0];"mbin"===n&&yo.contains(nl,r)?t.classes[0]="mord":"mbin"===r&&yo.contains(tl,n)&&(e.classes[0]="mord")}),{node:A},u,d),al(i,((e,t)=>{var n=cl(t),r=cl(e),i=n&&r?e.hasClass("mtight")?Ws[n][r]:Ks[n][r]:null;if(i)return Zs.makeGlue(i,l)}),{node:A},u,d),i},al=function e(t,n,r,i,o){i&&t.push(i);for(var a=0;an=>{t.splice(e+1,0,n),a++})(a)}}i&&t.pop()},sl=function(e){return e instanceof ra||e instanceof Ba||e instanceof Ca&&e.hasClass("enclosing")?e:null},ll=function e(t,n){var r=sl(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},cl=function(e,t){return e?(t&&(e=ll(e,t)),il[e.classes[0]]||null):null},Al=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return el(t.concat(n))},ul=function(e,t,n){if(!e)return el();if(Vs[e.type]){var r=Vs[e.type](e,t);if(n&&t.size!==n.size){r=el(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new so("Got group of unknown type: '"+e.type+"'")};function dl(e,t){var n=el(["base"],e,t),r=el(["strut"]);return r.style.height=ba(n.height+n.depth),n.depth&&(r.style.verticalAlign=ba(-n.depth)),n.children.unshift(r),n}function hl(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=ol(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var o,a=[],s=[],l=0;l0&&(a.push(dl(s,t)),s=[]),a.push(i[l]));s.length>0&&a.push(dl(s,t)),n?(o=dl(ol(n,t,!0)),o.classes=["tag"],a.push(o)):r&&a.push(r);var A=el(["katex-html"],a);if(A.setAttribute("aria-hidden","true"),o){var u=o.children[0];u.style.height=ba(A.height+A.depth),A.depth&&(u.style.verticalAlign=ba(-A.depth))}return A}function pl(e){return new ra(e)}class fl{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=ya(this.classes));for(var n=0;n0&&(e+=' class ="'+yo.escape(ya(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map((e=>e.toText())).join("")}}class gl{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return yo.escape(this.toText())}toText(){return this.text}}class ml{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?"  ":e>=-.05556&&e<=-.05555?" ⁣":e>=-.1667&&e<=-.1666?" ⁣":e>=-.2223&&e<=-.2222?" ⁣":e>=-.2778&&e<=-.2777?" ⁣":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ba(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var vl={MathNode:fl,TextNode:gl,SpaceNode:ml,newDocumentFragment:pl},bl=function(e,t,n){return!Qa[t][e]||!Qa[t][e].replace||55349===e.charCodeAt(0)||Ja.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=Qa[t][e].replace),new vl.TextNode(e)},yl=function(e){return 1===e.length?e[0]:new vl.MathNode("mrow",e)},wl=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=e.text;if(yo.contains(["\\imath","\\jmath"],i))return null;Qa[r][i]&&Qa[r][i].replace&&(i=Qa[r][i].replace);var o=Zs.fontMap[n].fontName;return la(i,o,r)?Zs.fontMap[n].variant:null},xl=function(e,t,n){if(1===e.length){var r=Cl(e[0],t);return n&&r instanceof fl&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,o=[],a=0;a0&&(A.text=A.text.slice(0,1)+"̸"+A.text.slice(1),o.pop())}}}o.push(s),i=s}return o},kl=function(e,t,n){return yl(xl(e,t,n))},Cl=function(e,t){if(!e)return new vl.MathNode("mrow");if(Gs[e.type]){var n=Gs[e.type](e,t);return n}throw new so("Got group of unknown type: '"+e.type+"'")};function Bl(e,t,n,r,i){var o,a=xl(e,n);o=1===a.length&&a[0]instanceof fl&&yo.contains(["mrow","mtable"],a[0].type)?a[0]:new vl.MathNode("mrow",a);var s=new vl.MathNode("annotation",[new vl.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new vl.MathNode("semantics",[o,s]),c=new vl.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var A=i?"katex":"katex-mathml";return Zs.makeSpan([A],[c])}var _l=function(e){return new pa({style:e.displayMode?zo.DISPLAY:zo.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},El=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Zs.makeSpan(n,[e])}return e},Sl=function(e,t,n){var r,i=_l(n);if("mathml"===n.output)return Bl(e,t,i,n.displayMode,!0);if("html"===n.output){var o=hl(e,i);r=Zs.makeSpan(["katex"],[o])}else{var a=Bl(e,t,i,n.displayMode,!1),s=hl(e,i);r=Zs.makeSpan(["katex"],[a,s])}return El(r,n)},Fl=function(e,t,n){var r=_l(n),i=hl(e,r),o=Zs.makeSpan(["katex"],[i]);return El(o,n)},Tl={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ml=function(e){var t=new vl.MathNode("mo",[new vl.TextNode(Tl[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Il={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Nl=function(e){return"ordgroup"===e.type?e.body.length:1},Ul=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(yo.contains(["widehat","widecheck","widetilde","utilde"],r)){var i,o,a,s=e,l=Nl(s.base);if(l>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,a=.42,o=r+"4"):(i=312,n=2340,a=.34,o="tilde4");else{var c=[1,1,2,2,3,3][l];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][c],i=[0,239,300,360,420][c],a=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],i=[0,260,286,306,312][c],a=[0,.26,.286,.3,.306,.34][c],o="tilde"+c)}var A=new Ta(o),u=new Fa([A],{width:"100%",height:ba(a),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:Zs.makeSvgSpan([],[u],t),minWidth:0,height:a}}var d,h,p=[],f=Il[r],[g,m,v]=f,b=v/1e3,y=g.length;if(1===y){var w=f[3];d=["hide-tail"],h=[w]}else if(2===y)d=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");d=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var x=0;x0&&(r.style.minWidth=ba(i)),r},Ll=function(e,t,n,r,i){var o,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(o=Zs.makeSpan(["stretchy",t],[],i),"fbox"===t){var s=i.color&&i.getColor();s&&(o.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Ma({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Ma({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Fa(l,{width:"100%",height:ba(a)});o=Zs.makeSvgSpan([],[c],i)}return o.height=a,o.style.height=ba(a),o},Ql={encloseSpan:Ll,mathMLnode:Ml,svgSpan:Ul};function Dl(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Hl(e){var t=Ol(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Ol(e){return e&&("atom"===e.type||La.hasOwnProperty(e.type))?e:null}var zl=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(r=Dl(e.base,"accent"),n=r.base,e.base=n,i=Na(ul(e,t)),e.base=r):(r=Dl(e,"accent"),n=r.base);var o=ul(n,t.havingCrampedStyle()),a=r.isShifty&&yo.isCharacterBox(n),s=0;if(a){var l=yo.getBaseElem(n),c=ul(l,t.havingCrampedStyle());s=Ia(c).skew}var A,u="\\c"===r.label,d=u?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight);if(r.isStretchy)A=Ql.svgSpan(r,t),A=Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:A,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+ba(2*s)+")",marginLeft:ba(2*s)}:void 0}]},t);else{var h,p;"\\vec"===r.label?(h=Zs.staticSvg("vec",t),p=Zs.svgData.vec[1]):(h=Zs.makeOrd({mode:r.mode,text:r.label},t,"textord"),h=Ia(h),h.italic=0,p=h.width,u&&(d+=h.depth)),A=Zs.makeSpan(["accent-body"],[h]);var f="\\textcircled"===r.label;f&&(A.classes.push("accent-full"),d=o.height);var g=s;f||(g-=p/2),A.style.left=ba(g),"\\textcircled"===r.label&&(A.style.top=".2em"),A=Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-d},{type:"elem",elem:A}]},t)}var m=Zs.makeSpan(["mord","accent"],[A],t);return i?(i.children[0]=m,i.height=Math.max(m.height,i.height),i.classes[0]="mord",i):m},Zl=(e,t)=>{var n=e.isStretchy?Ql.mathMLnode(e.label):new vl.MathNode("mo",[bl(e.label,e.mode)]),r=new vl.MathNode("mover",[Cl(e.base,t),n]);return r.setAttribute("accent","true"),r},Rl=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));$s({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Xs(t[0]),r=!Rl.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:zl,mathmlBuilder:Zl}),$s({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:zl,mathmlBuilder:Zl}),$s({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=ul(e.base,t),r=Ql.svgSpan(e,t),i="\\utilde"===e.label?.12:0,o=Zs.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return Zs.makeSpan(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=Ql.mathMLnode(e.label),r=new vl.MathNode("munder",[Cl(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Pl=e=>{var t=new vl.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};$s({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),o=Zs.wrapFragment(ul(e.body,i,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";o.classes.push(a+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),n=Zs.wrapFragment(ul(e.below,i,t),t),n.classes.push(a+"-arrow-pad"));var s,l=Ql.svgSpan(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,A=-t.fontMetrics().axisHeight-.5*l.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(A-=o.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Zs.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:A},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else s=Zs.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:A},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Zs.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=Ql.mathMLnode(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=Pl(Cl(e.body,t));if(e.below){var o=Pl(Cl(e.below,t));n=new vl.MathNode("munderover",[r,o,i])}else n=new vl.MathNode("mover",[r,i])}else if(e.below){var a=Pl(Cl(e.below,t));n=new vl.MathNode("munder",[r,a])}else n=Pl(),n=new vl.MathNode("mover",[r,n]);return n}});var ql=Zs.makeSpan;function Kl(e,t){var n=ol(e.body,t,!0);return ql([e.mclass],n,t)}function Wl(e,t){var n,r=xl(e.body,t);return"minner"===e.mclass?n=new vl.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0],n.type="mi"):n=new vl.MathNode("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new vl.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}$s({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Js(i),isCharacterBox:yo.isCharacterBox(i)}},htmlBuilder:Kl,mathmlBuilder:Wl});var jl=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};$s({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:jl(t[0]),body:Js(t[1]),isCharacterBox:yo.isCharacterBox(t[1])}}}),$s({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,o=t[1],a=t[0];n="\\stackrel"!==i?jl(o):"mrel";var s={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:Js(o)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===i?null:a,sub:"\\underset"===i?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:yo.isCharacterBox(l)}},htmlBuilder:Kl,mathmlBuilder:Wl}),$s({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:jl(t[0]),body:Js(t[0])}},htmlBuilder(e,t){var n=ol(e.body,t,!0),r=Zs.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=xl(e.body,t),r=new vl.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Vl={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Gl=()=>({type:"styling",body:[],mode:"math",style:"display"}),$l=e=>"textord"===e.type&&"@"===e.text,Yl=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function Xl(e,t,n){var r=Vl[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[o],[]),s=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,s]};return n.callFunction("\\\\cdparent",[l],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[]);default:return{type:"textord",text:" ",mode:"math"}}}function Jl(e){var t=[];e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();while(1){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new so("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],o=0;o-1);else{if(!("<>AV".indexOf(c)>-1))throw new so('Expected one of "<>AV=|." after @',a[l]);for(var u=0;u<2;u++){for(var d=!0,h=l+1;h=1114111)throw new so("\\@char with invalid code point "+o);return c<=65535?l=String.fromCharCode(c):(c-=65536,l=String.fromCharCode(55296+(c>>10),56320+(1023&c))),{type:"textord",mode:n.mode,text:l}}});var ec=(e,t)=>{var n=ol(e.body,t.withColor(e.color),!1);return Zs.makeFragment(n)},tc=(e,t)=>{var n=xl(e.body,t.withColor(e.color)),r=new vl.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};$s({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Dl(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:Js(i)}},htmlBuilder:ec,mathmlBuilder:tc}),$s({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Dl(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var o=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:o}},htmlBuilder:ec,mathmlBuilder:tc}),$s({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,o=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:o,size:i&&Dl(i,"size").value}},htmlBuilder(e,t){var n=Zs.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ba(va(e.size,t)))),n},mathmlBuilder(e,t){var n=new vl.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ba(va(e.size,t)))),n}});var nc={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},rc=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new so("Expected a control sequence",e);return t},ic=e=>{var t=e.gullet.popToken();return"="===t.text&&(t=e.gullet.popToken()," "===t.text&&(t=e.gullet.popToken())),t},oc=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};$s({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(nc[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=nc[r.text]),Dl(t.parseFunction(),"internal");throw new so("Invalid token after macro prefix",r)}}),$s({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new so("Expected a control sequence",r);var o,a=0,s=[[]];while("{"!==t.gullet.future().text)if(r=t.gullet.popToken(),"#"===r.text){if("{"===t.gullet.future().text){o=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new so('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new so('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new so("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},n===nc[n]),{type:"internal",mode:t.mode}}}),$s({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=rc(t.gullet.popToken());t.gullet.consumeSpaces();var i=ic(t);return oc(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),$s({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=rc(t.gullet.popToken()),i=t.gullet.popToken(),o=t.gullet.popToken();return oc(t,r,o,"\\\\globalfuture"===n),t.gullet.pushToken(o),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var ac=function(e,t,n){var r=Qa.math[e]&&Qa.math[e].replace,i=la(r||e,t,n);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},sc=function(e,t,n,r){var i=n.havingBaseStyle(t),o=Zs.makeSpan(r.concat(i.sizingClasses(n)),[e],n),a=i.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=i.sizeMultiplier,o},lc=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ba(i),e.height-=i,e.depth+=i},cc=function(e,t,n,r,i,o){var a=Zs.makeSymbol(e,"Main-Regular",i,r),s=sc(a,t,r,o);return n&&lc(s,r,t),s},Ac=function(e,t,n,r){return Zs.makeSymbol(e,"Size"+t+"-Regular",n,r)},uc=function(e,t,n,r,i,o){var a=Ac(e,t,i,r),s=sc(Zs.makeSpan(["delimsizing","size"+t],[a],r),zo.TEXT,r,o);return n&&lc(s,r,zo.TEXT),s},dc=function(e,t,n){var r;r="Size1-Regular"===t?"delim-size1":"delim-size4";var i=Zs.makeSpan(["delimsizinginner",r],[Zs.makeSpan([],[Zs.makeSymbol(e,t,n)])]);return{type:"elem",elem:i}},hc=function(e,t,n){var r=ia["Size4-Regular"][e.charCodeAt(0)]?ia["Size4-Regular"][e.charCodeAt(0)][4]:ia["Size1-Regular"][e.charCodeAt(0)][4],i=new Ta("inner",ea(e,Math.round(1e3*t))),o=new Fa([i],{width:ba(r),height:ba(t),style:"width:"+ba(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Zs.makeSvgSpan([],[o],n);return a.height=t,a.style.height=ba(t),a.style.width=ba(r),{type:"elem",elem:a}},pc=.008,fc={type:"kern",size:-1*pc},gc=["|","\\lvert","\\rvert","\\vert"],mc=["\\|","\\lVert","\\rVert","\\Vert"],vc=function(e,t,n,r,i,o){var a,s,l,c,A="",u=0;a=l=c=e,s=null;var d="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):yo.contains(gc,e)?(l="∣",A="vert",u=333):yo.contains(mc,e)?(l="∥",A="doublevert",u=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",d="Size4-Regular",A="lbrack",u=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",d="Size4-Regular",A="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",d="Size4-Regular",A="lfloor",u=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",d="Size4-Regular",A="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",d="Size4-Regular",A="rfloor",u=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",d="Size4-Regular",A="rceil",u=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",d="Size4-Regular",A="lparen",u=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",d="Size4-Regular",A="rparen",u=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",d="Size4-Regular");var h=ac(a,d,i),p=h.height+h.depth,f=ac(l,d,i),g=f.height+f.depth,m=ac(c,d,i),v=m.height+m.depth,b=0,y=1;if(null!==s){var w=ac(s,d,i);b=w.height+w.depth,y=2}var x=p+v+b,k=Math.max(0,Math.ceil((t-x)/(y*g))),C=x+k*y*g,B=r.fontMetrics().axisHeight;n&&(B*=r.sizeMultiplier);var _=C/2-B,E=[];if(A.length>0){var S=C-p-v,F=Math.round(1e3*C),T=na(A,Math.round(1e3*S)),M=new Ta(A,T),I=(u/1e3).toFixed(3)+"em",N=(F/1e3).toFixed(3)+"em",U=new Fa([M],{width:I,height:N,viewBox:"0 0 "+u+" "+F}),L=Zs.makeSvgSpan([],[U],r);L.height=F/1e3,L.style.width=I,L.style.height=N,E.push({type:"elem",elem:L})}else{if(E.push(dc(c,d,i)),E.push(fc),null===s){var Q=C-p-v+2*pc;E.push(hc(l,Q,r))}else{var D=(C-p-v-b)/2+2*pc;E.push(hc(l,D,r)),E.push(fc),E.push(dc(s,d,i)),E.push(fc),E.push(hc(l,D,r))}E.push(fc),E.push(dc(a,d,i))}var H=r.havingBaseStyle(zo.TEXT),O=Zs.makeVList({positionType:"bottom",positionData:_,children:E},H);return sc(Zs.makeSpan(["delimsizing","mult"],[O],H),zo.TEXT,r,o)},bc=80,yc=.08,wc=function(e,t,n,r,i){var o=Jo(e,r,n),a=new Ta(e,o),s=new Fa([a],{width:"400em",height:ba(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Zs.makeSvgSpan(["hide-tail"],[s],i)},xc=function(e,t){var n,r,i=t.havingBaseSizing(),o=Ic("\\surd",e*i.sizeMultiplier,Tc,i),a=i.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,A=0;return"small"===o.type?(A=1e3+1e3*s+bc,e<1?a=1:e<1.4&&(a=.7),l=(1+s+yc)/a,c=(1+s)/a,n=wc("sqrtMain",l,A,s,t),n.style.minWidth="0.853em",r=.833/a):"large"===o.type?(A=(1e3+bc)*_c[o.size],c=(_c[o.size]+s)/a,l=(_c[o.size]+s+yc)/a,n=wc("sqrtSize"+o.size,l,A,s,t),n.style.minWidth="1.02em",r=1/a):(l=e+s+yc,c=e+s,A=Math.floor(1e3*e+s)+bc,n=wc("sqrtTall",l,A,s,t),n.style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=ba(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},kc=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Cc=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Bc=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],_c=[0,1.2,1.8,2.4,3],Ec=function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),yo.contains(kc,e)||yo.contains(Bc,e))return uc(e,t,!1,n,r,i);if(yo.contains(Cc,e))return vc(e,_c[t],!1,n,r,i);throw new so("Illegal delimiter: '"+e+"'")},Sc=[{type:"small",style:zo.SCRIPTSCRIPT},{type:"small",style:zo.SCRIPT},{type:"small",style:zo.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Fc=[{type:"small",style:zo.SCRIPTSCRIPT},{type:"small",style:zo.SCRIPT},{type:"small",style:zo.TEXT},{type:"stack"}],Tc=[{type:"small",style:zo.SCRIPTSCRIPT},{type:"small",style:zo.SCRIPT},{type:"small",style:zo.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Mc=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Ic=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size),o=i;ot)return n[o]}return n[n.length-1]},Nc=function(e,t,n,r,i,o){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=yo.contains(Bc,e)?Sc:yo.contains(kc,e)?Tc:Fc;var s=Ic(e,t,a,r);return"small"===s.type?cc(e,s.style,n,r,i,o):"large"===s.type?uc(e,s.size,n,r,i,o):vc(e,t,n,r,i,o)},Uc=function(e,t,n,r,i,o){var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,l=5/r.fontMetrics().ptPerEm,c=Math.max(t-a,n+a),A=Math.max(c/500*s,2*c-l);return Nc(e,A,!0,r,i,o)},Lc={sqrtImage:xc,sizedDelim:Ec,sizeToMaxHeight:_c,customSizedDelim:Nc,leftRightDelim:Uc},Qc={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Dc=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Hc(e,t){var n=Ol(e);if(n&&yo.contains(Dc,n.text))return n;throw new so(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Oc(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}$s({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Hc(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Qc[e.funcName].size,mclass:Qc[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Zs.makeSpan([e.mclass]):Lc.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(bl(e.delim,e.mode));var n=new vl.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ba(Lc.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),$s({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!==typeof n)throw new so("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Hc(t[0],e).text,color:n}}}),$s({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Hc(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var o=Dl(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{Oc(e);for(var n,r,i=ol(e.body,t,!0,["mopen","mclose"]),o=0,a=0,s=!1,l=0;l{Oc(e);var n=xl(e.body,t);if("."!==e.left){var r=new vl.MathNode("mo",[bl(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new vl.MathNode("mo",[bl(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return yl(n)}}),$s({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Hc(t[0],e);if(!e.parser.leftrightDepth)throw new so("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Al(t,[]);else{n=Lc.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?bl("|","text"):bl(e.delim,e.mode),r=new vl.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var zc=(e,t)=>{var n,r,i=Zs.wrapFragment(ul(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,s=0,l=yo.isCharacterBox(e.body);if("sout"===o)n=Zs.makeSpan(["stretchy","sout"]),n.height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===o){var c=va({number:.6,unit:"pt"},t),A=va({number:.35,unit:"ex"},t),u=t.havingBaseSizing();a/=u.sizeMultiplier;var d=i.height+i.depth+c+A;i.style.paddingLeft=ba(d/2+c);var h=Math.floor(1e3*d*a),p=Yo(h),f=new Fa([new Ta("phase",p)],{width:"400em",height:ba(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});n=Zs.makeSvgSpan(["hide-tail"],[f],t),n.style.height=ba(d),s=i.depth+c+A}else{/cancel/.test(o)?l||i.classes.push("cancel-pad"):"angl"===o?i.classes.push("anglpad"):i.classes.push("boxpad");var g=0,m=0,v=0;/box/.test(o)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+("colorbox"===o?0:v),m=g):"angl"===o?(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*v,m=Math.max(0,.25-i.depth)):(g=l?.2:0,m=g),n=Ql.encloseSpan(i,o,g,m,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=ba(v)):"angl"===o&&.049!==v&&(n.style.borderTopWidth=ba(v),n.style.borderRightWidth=ba(v)),s=i.depth+m,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Zs.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:i,shift:0}]},t);else{var b=/cancel|phase/.test(o)?["svg-align"]:[];r=Zs.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:b}]},t)}return/cancel/.test(o)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(o)&&!l?Zs.makeSpan(["mord","cancel-lap"],[r],t):Zs.makeSpan(["mord"],[r],t)},Zc=(e,t)=>{var n=0,r=new vl.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Cl(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};$s({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,o=Dl(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,body:a}},htmlBuilder:zc,mathmlBuilder:Zc}),$s({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,o=Dl(t[0],"color-token").color,a=Dl(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:o,body:s}},htmlBuilder:zc,mathmlBuilder:Zc}),$s({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),$s({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:zc,mathmlBuilder:Zc}),$s({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Rc={};function Pc(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var t=e.parser.settings;if(!t.displayMode)throw new so("{"+e.envName+"} can be used only in display mode.")};function Vc(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Gc(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:o,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:A,maxNumCols:u,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var h=e.gullet.expandMacroAsText("\\arraystretch");if(null==h)a=1;else if(a=parseFloat(h),!a||a<0)throw new so("Invalid \\arraystretch: "+h)}e.gullet.beginGroup();var p=[],f=[p],g=[],m=[],v=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new ao("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}b(),m.push(Wc(e));while(1){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),p.push(w);var x=e.fetch().text;if("&"===x){if(u&&p.length===u){if(c||s)throw new so("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){y(),1===p.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!A)&&f.pop(),m.length0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(b(o[0]),n=0;n0&&(_+=m,x<_&&(x=_),_=0)),e.addJot&&(x+=p),k.height=w,k.depth=x,v+=w,k.pos=v,v+=x+_,s[n]=k,b(o[n+1])}var E,S,F=v/2+t.fontMetrics().axisHeight,T=e.cols||[],M=[],I=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n=a)){var R=void 0;(r>0||e.hskipBeforeAndAfter)&&(R=yo.deflt(D.pregap,u),0!==R&&(E=Zs.makeSpan(["arraycolsep"],[]),E.style.width=ba(R),M.push(E)));var P=[];for(n=0;n0){var j=Zs.makeLineSpan("hline",t,c),V=Zs.makeLineSpan("hdashline",t,c),G=[{type:"elem",elem:s,shift:0}];while(l.length>0){var $=l.pop(),Y=$.pos-F;$.isDashed?G.push({type:"elem",elem:V,shift:Y}):G.push({type:"elem",elem:j,shift:Y})}s=Zs.makeVList({positionType:"individualShift",children:G},t)}if(0===I.length)return Zs.makeSpan(["mord"],[s],t);var X=Zs.makeVList({positionType:"individualShift",children:I},t);return X=Zs.makeSpan(["tag"],[X],t),Zs.makeFragment([s,X])},Xc={c:"center ",l:"left ",r:"right "},Jc=function(e,t){for(var n=[],r=new vl.MathNode("mtd",[],["mtr-glue"]),i=new vl.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var h=e.cols,p="",f=!1,g=0,m=h.length;"separator"===h[0].type&&(u+="top ",g=1),"separator"===h[h.length-1].type&&(u+="bottom ",m-=1);for(var v=g;v0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var C=1;C-1?"alignat":"align",o="split"===e.envName,a=Gc(e.parser,{cols:r,addJot:!0,autoTag:o?void 0:Vc(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",A=0;A0&&d&&(f=1),r[h]={type:"align",align:p,pregap:f,postgap:0}}return a.colSeparationType=d?"align":"alignat",a};Pc({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Ol(t[0]),r=n?[t[0]]:Dl(t[0],"ordgroup").body,i=r.map((function(e){var t=Hl(e),n=t.text;if(-1!=="lcr".indexOf(n))return{type:"align",align:n};if("|"===n)return{type:"separator",separator:"|"};if(":"===n)return{type:"separator",separator:":"};throw new so("Unknown column alignment: "+n,e)})),o={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Gc(e.parser,o,$c(e.envName))},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new so("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var o=Gc(e.parser,r,$c(e.envName)),a=Math.max(0,...o.body.map((e=>e.length)));return o.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Gc(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Ol(t[0]),r=n?[t[0]]:Dl(t[0],"ordgroup").body,i=r.map((function(e){var t=Hl(e),n=t.text;if(-1!=="lc".indexOf(n))return{type:"align",align:n};throw new so("Unknown column alignment: "+n,e)}));if(i.length>1)throw new so("{subarray} can contain only one column");var o={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(o=Gc(e.parser,o,"script"),o.body.length>0&&o.body[0].length>1)throw new so("{subarray} can contain only one column");return o},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Gc(e.parser,t,$c(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:eA,htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){yo.contains(["gather","gather*"],e.envName)&&jc(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Vc(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Gc(e.parser,t,"display")},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:eA,htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jc(e);var t={autoTag:Vc(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Gc(e.parser,t,"display")},htmlBuilder:Yc,mathmlBuilder:Jc}),Pc({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jc(e),Jl(e.parser)},htmlBuilder:Yc,mathmlBuilder:Jc}),Kc("\\nonumber","\\gdef\\@eqnsw{0}"),Kc("\\notag","\\nonumber"),$s({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new so(e.funcName+" valid only within array environment")}});var tA=Rc;$s({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new so("Invalid environment name",i);for(var o="",a=0;a{var n=e.font,r=t.withFont(n);return ul(e.body,r)},rA=(e,t)=>{var n=e.font,r=t.withFont(n);return Cl(e.body,r)},iA={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};$s({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Xs(t[0]),o=r;return o in iA&&(o=iA[o]),{type:"font",mode:n.mode,font:o.slice(1),body:i}},htmlBuilder:nA,mathmlBuilder:rA}),$s({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=yo.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:jl(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),$s({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:o}=n,a=n.parseExpression(!0,i),s="math"+r.slice(1);return{type:"font",mode:o,font:s,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:nA,mathmlBuilder:rA});var oA=(e,t)=>{var n=t;return"display"===e?n=n.id>=zo.SCRIPT.id?n.text():zo.DISPLAY:"text"===e&&n.size===zo.DISPLAY.size?n=zo.TEXT:"script"===e?n=zo.SCRIPT:"scriptscript"===e&&(n=zo.SCRIPTSCRIPT),n},aA=(e,t)=>{var n,r=oA(e.size,t.style),i=r.fracNum(),o=r.fracDen();n=t.havingStyle(i);var a=ul(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height0?3*u:7*u,p=t.fontMetrics().denom1):(A>0?(d=t.fontMetrics().num2,h=u):(d=t.fontMetrics().num3,h=3*u),p=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;d-a.depth-(y+.5*A){var n=new vl.MathNode("mfrac",[Cl(e.numer,t),Cl(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=va(e.barSize,t);n.setAttribute("linethickness",ba(r))}}else n.setAttribute("linethickness","0px");var i=oA(e.size,t.style);if(i.size!==t.style.size){n=new vl.MathNode("mstyle",[n]);var o=i.size===zo.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new vl.MathNode("mo",[new vl.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new vl.MathNode("mo",[new vl.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return yl(a)}return n};$s({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,o=t[0],a=t[1],s=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:o,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:aA,mathmlBuilder:sA}),$s({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:o,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),$s({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var lA=["display","text","script","scriptscript"],cA=function(e){var t=null;return e.length>0&&(t=e,t="."===t?null:t),t};$s({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],o=t[5],a=Xs(t[0]),s="atom"===a.type&&"open"===a.family?cA(a.text):null,l=Xs(t[1]),c="atom"===l.type&&"close"===l.family?cA(l.text):null,A=Dl(t[2],"size"),u=null;A.isBlank?n=!0:(u=A.value,n=u.number>0);var d="auto",h=t[3];if("ordgroup"===h.type){if(h.body.length>0){var p=Dl(h.body[0],"textord");d=lA[Number(p.text)]}}else h=Dl(h,"textord"),d=lA[Number(h.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:n,barSize:u,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:aA,mathmlBuilder:sA}),$s({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Dl(t[0],"size").value,token:i}}}),$s({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=vo(Dl(t[1],"infix").size),a=t[2],s=o.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:!1,hasBarLine:s,barSize:o,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:aA,mathmlBuilder:sA});var AA=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?ul(e.sup,t.havingStyle(i.sup()),t):ul(e.sub,t.havingStyle(i.sub()),t),r=Dl(e.base,"horizBrace")):r=Dl(e,"horizBrace");var o,a=ul(r.base,t.havingBaseStyle(zo.DISPLAY)),s=Ql.svgSpan(r,t);if(r.isOver?(o=Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},t),o.children[0].children[0].children[1].classes.push("svg-align")):(o=Zs.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},t),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Zs.makeSpan(["mord",r.isOver?"mover":"munder"],[o],t);o=r.isOver?Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Zs.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Zs.makeSpan(["mord",r.isOver?"mover":"munder"],[o],t)},uA=(e,t)=>{var n=Ql.mathMLnode(e.label);return new vl.MathNode(e.isOver?"mover":"munder",[Cl(e.base,t),n])};$s({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:AA,mathmlBuilder:uA}),$s({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Dl(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Js(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=ol(e.body,t,!1);return Zs.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=kl(e.body,t);return n instanceof fl||(n=new fl("mrow",[n])),n.setAttribute("href",e.href),n}}),$s({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Dl(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],o=0;o{var n,{parser:r,funcName:i,token:o}=e,a=Dl(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),A=0;A{var n=ol(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Zs.makeSpan(r,n,t);for(var o in e.attributes)"class"!==o&&e.attributes.hasOwnProperty(o)&&i.setAttribute(o,e.attributes[o]);return i},mathmlBuilder:(e,t)=>kl(e.body,t)}),$s({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Js(t[0]),mathml:Js(t[1])}},htmlBuilder:(e,t)=>{var n=ol(e.html,t,!1);return Zs.makeFragment(n)},mathmlBuilder:(e,t)=>kl(e.mathml,t)});var dA=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new so("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!ma(n))throw new so("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};$s({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},o={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=Dl(n[0],"raw").string,c=l.split(","),A=0;A{var n=va(e.height,t),r=0;e.totalheight.number>0&&(r=va(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=va(e.width,t));var o={height:ba(n+r)};i>0&&(o.width=ba(i)),r>0&&(o.verticalAlign=ba(-r));var a=new _a(e.src,e.alt,o);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new vl.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=va(e.height,t),i=0;if(e.totalheight.number>0&&(i=va(e.totalheight,t)-r,n.setAttribute("valign",ba(-i))),n.setAttribute("height",ba(r+i)),e.width.number>0){var o=va(e.width,t);n.setAttribute("width",ba(o))}return n.setAttribute("src",e.src),n}}),$s({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Dl(t[0],"size");if(n.settings.strict){var o="m"===r[1],a="mu"===i.value.unit;o?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Zs.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=va(e.dimension,t);return new vl.SpaceNode(n)}}),$s({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Zs.makeSpan([],[ul(e.body,t)]),n=Zs.makeSpan(["inner"],[n],t)):n=Zs.makeSpan(["inner"],[ul(e.body,t)]);var r=Zs.makeSpan(["fix"],[]),i=Zs.makeSpan([e.alignment],[n,r],t),o=Zs.makeSpan(["strut"]);return o.style.height=ba(i.height+i.depth),i.depth&&(o.style.verticalAlign=ba(-i.depth)),i.children.unshift(o),i=Zs.makeSpan(["thinbox"],[i],t),Zs.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new vl.MathNode("mpadded",[Cl(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),$s({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var o="\\("===n?"\\)":"$",a=r.parseExpression(!1,o);return r.expect(o),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:a}}}),$s({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new so("Mismatched "+e.funcName)}});var hA=(e,t)=>{switch(t.style.size){case zo.DISPLAY.size:return e.display;case zo.TEXT.size:return e.text;case zo.SCRIPT.size:return e.script;case zo.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};$s({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Js(t[0]),text:Js(t[1]),script:Js(t[2]),scriptscript:Js(t[3])}},htmlBuilder:(e,t)=>{var n=hA(e,t),r=ol(n,t,!1);return Zs.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=hA(e,t);return kl(n,t)}});var pA=(e,t,n,r,i,o,a)=>{e=Zs.makeSpan([],[e]);var s,l,c,A=n&&yo.isCharacterBox(n);if(t){var u=ul(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=ul(n,r.havingStyle(i.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var h=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=Zs.makeVList({positionType:"bottom",positionData:h,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ba(-o)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ba(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var p=e.height-a;c=Zs.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ba(-o)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Zs.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ba(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==o&&!A){var m=Zs.makeSpan(["mspace"],[],r);m.style.marginRight=ba(o),g.unshift(m)}return Zs.makeSpan(["mop","op-limits"],g,r)},fA=["\\smallint"],gA=(e,t)=>{var n,r,i,o=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=Dl(e.base,"op"),o=!0):i=Dl(e,"op");var a,s=t.style,l=!1;if(s.size===zo.DISPLAY.size&&i.symbol&&!yo.contains(fA,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",A="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(A=i.name.slice(1),i.name="oiint"===A?"\\iint":"\\iiint"),a=Zs.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),A.length>0){var u=a.italic,d=Zs.staticSvg(A+"Size"+(l?"2":"1"),t);a=Zs.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),i.name="\\"+A,a.classes.unshift("mop"),a.italic=u}}else if(i.body){var h=ol(i.body,t,!0);1===h.length&&h[0]instanceof Sa?(a=h[0],a.classes[0]="mop"):a=Zs.makeSpan(["mop"],h,t)}else{for(var p=[],f=1;f{var n;if(e.symbol)n=new fl("mo",[bl(e.name,e.mode)]),yo.contains(fA,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new fl("mo",xl(e.body,t));else{n=new fl("mi",[new gl(e.name.slice(1))]);var r=new fl("mo",[bl("⁡","text")]);n=e.parentIsSupSub?new fl("mrow",[n,r]):pl([n,r])}return n},vA={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};$s({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=vA[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:gA,mathmlBuilder:mA}),$s({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Js(r)}},htmlBuilder:gA,mathmlBuilder:mA});var bA={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};$s({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:gA,mathmlBuilder:mA}),$s({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:gA,mathmlBuilder:mA}),$s({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=bA[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:gA,mathmlBuilder:mA});var yA=(e,t)=>{var n,r,i,o,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=Dl(e.base,"operatorname"),a=!0):i=Dl(e,"operatorname"),i.body.length>0){for(var s=i.body.map((e=>{var t=e.text;return"string"===typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=ol(s,t.withFont("mathrm"),!0),c=0;c{for(var n=xl(e.body,t.withFont("mathrm")),r=!0,i=0;ie.toText())).join("");n=[new vl.TextNode(s)]}var l=new vl.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new vl.MathNode("mo",[bl("⁡","text")]);return e.parentIsSupSub?new vl.MathNode("mrow",[l,c]):vl.newDocumentFragment([l,c])};function xA(e,t,n){for(var r=ol(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,o=0;o{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:Js(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:yA,mathmlBuilder:wA}),Kc("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Ys({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Zs.makeFragment(ol(e.body,t,!1)):Zs.makeSpan(["mord"],ol(e.body,t,!0),t)},mathmlBuilder(e,t){return kl(e.body,t,!0)}}),$s({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=ul(e.body,t.havingCrampedStyle()),r=Zs.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,o=Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return Zs.makeSpan(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new vl.MathNode("mo",[new vl.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new vl.MathNode("mover",[Cl(e.body,t),n]);return r.setAttribute("accent","true"),r}}),$s({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Js(r)}},htmlBuilder:(e,t)=>{var n=ol(e.body,t.withPhantom(),!1);return Zs.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=xl(e.body,t);return new vl.MathNode("mphantom",n)}}),$s({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Zs.makeSpan([],[ul(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=xl(Js(e.body),t),r=new vl.MathNode("mphantom",n),i=new vl.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),$s({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Zs.makeSpan(["inner"],[ul(e.body,t.withPhantom())]),r=Zs.makeSpan(["fix"],[]);return Zs.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=xl(Js(e.body),t),r=new vl.MathNode("mphantom",n),i=new vl.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),$s({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Dl(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=ul(e.body,t),r=va(e.dy,t);return Zs.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new vl.MathNode("mpadded",[Cl(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),$s({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),$s({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],o=Dl(t[0],"size"),a=Dl(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Dl(i,"size").value,width:o.value,height:a.value}},htmlBuilder(e,t){var n=Zs.makeSpan(["mord","rule"],[],t),r=va(e.width,t),i=va(e.height,t),o=e.shift?va(e.shift,t):0;return n.style.borderRightWidth=ba(r),n.style.borderTopWidth=ba(i),n.style.bottom=ba(o),n.width=r,n.height=i+o,n.depth=-o,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=va(e.width,t),r=va(e.height,t),i=e.shift?va(e.shift,t):0,o=t.color&&t.getColor()||"black",a=new vl.MathNode("mspace");a.setAttribute("mathbackground",o),a.setAttribute("width",ba(n)),a.setAttribute("height",ba(r));var s=new vl.MathNode("mpadded",[a]);return i>=0?s.setAttribute("height",ba(i)):(s.setAttribute("height",ba(i)),s.setAttribute("depth",ba(-i))),s.setAttribute("voffset",ba(i)),s}});var kA=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],CA=(e,t)=>{var n=t.havingSize(e.size);return xA(e.body,n,t)};$s({type:"sizing",names:kA,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:kA.indexOf(r)+1,body:o}},htmlBuilder:CA,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=xl(e.body,n),i=new vl.MathNode("mstyle",r);return i.setAttribute("mathsize",ba(n.sizeMultiplier)),i}}),$s({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,o=!1,a=n[0]&&Dl(n[0],"ordgroup");if(a)for(var s="",l=0;l{var n=Zs.makeSpan([],[ul(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new vl.MathNode("mpadded",[Cl(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),$s({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],o=t[0];return{type:"sqrt",mode:r.mode,body:o,index:i}},htmlBuilder(e,t){var n=ul(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Zs.wrapFragment(n,t);var r=t.fontMetrics(),i=r.defaultRuleThickness,o=i;t.style.idn.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=l.height-n.height-a-c;n.style.paddingLeft=ba(A);var h=Zs.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+d)},{type:"elem",elem:l},{type:"kern",size:c}]},t);if(e.index){var p=t.havingStyle(zo.SCRIPTSCRIPT),f=ul(e.index,p,t),g=.6*(h.height-h.depth),m=Zs.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),v=Zs.makeSpan(["root"],[m]);return Zs.makeSpan(["mord","sqrt"],[v,h],t)}return Zs.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new vl.MathNode("mroot",[Cl(n,t),Cl(r,t)]):new vl.MathNode("msqrt",[Cl(n,t)])}});var BA={display:zo.DISPLAY,text:zo.TEXT,script:zo.SCRIPT,scriptscript:zo.SCRIPTSCRIPT};$s({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:a,body:o}},htmlBuilder(e,t){var n=BA[e.style],r=t.havingStyle(n).withFont("");return xA(e.body,r,t)},mathmlBuilder(e,t){var n=BA[e.style],r=t.havingStyle(n),i=xl(e.body,r),o=new vl.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=a[e.style];return o.setAttribute("scriptlevel",s[0]),o.setAttribute("displaystyle",s[1]),o}});var _A=function(e,t){var n=e.base;if(n){if("op"===n.type){var r=n.limits&&(t.style.size===zo.DISPLAY.size||n.alwaysHandleSupSub);return r?gA:null}if("operatorname"===n.type){var i=n.alwaysHandleSupSub&&(t.style.size===zo.DISPLAY.size||n.limits);return i?yA:null}if("accent"===n.type)return yo.isCharacterBox(n.base)?zl:null;if("horizBrace"===n.type){var o=!e.sub;return o===n.isOver?AA:null}return null}return null};Ys({type:"supsub",htmlBuilder(e,t){var n=_A(e,t);if(n)return n(e,t);var r,i,o,{base:a,sup:s,sub:l}=e,c=ul(a,t),A=t.fontMetrics(),u=0,d=0,h=a&&yo.isCharacterBox(a);if(s){var p=t.havingStyle(t.style.sup());r=ul(s,p,t),h||(u=c.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());i=ul(l,f,t),h||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}o=t.style===zo.DISPLAY?A.sup1:t.style.cramped?A.sup3:A.sup2;var g,m=t.sizeMultiplier,v=ba(.5/A.ptPerEm/m),b=null;if(i){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Sa||y)&&(b=ba(-c.italic))}if(r&&i){u=Math.max(u,o,r.depth+.25*A.xHeight),d=Math.max(d,A.sub2);var w=A.defaultRuleThickness,x=4*w;if(u-r.depth-(i.height-d)0&&(u+=k,d-=k)}var C=[{type:"elem",elem:i,shift:d,marginRight:v,marginLeft:b},{type:"elem",elem:r,shift:-u,marginRight:v}];g=Zs.makeVList({positionType:"individualShift",children:C},t)}else if(i){d=Math.max(d,A.sub1,i.height-.8*A.xHeight);var B=[{type:"elem",elem:i,marginLeft:b,marginRight:v}];g=Zs.makeVList({positionType:"shift",positionData:d,children:B},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,o,r.depth+.25*A.xHeight),g=Zs.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:v}]},t)}var _=cl(c,"right")||"mord";return Zs.makeSpan([_],[c,Zs.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r,i=!1;e.base&&"horizBrace"===e.base.type&&(r=!!e.sup,r===e.base.isOver&&(i=!0,n=e.base.isOver)),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,a=[Cl(e.base,t)];if(e.sub&&a.push(Cl(e.sub,t)),e.sup&&a.push(Cl(e.sup,t)),i)o=n?"mover":"munder";else if(e.sub)if(e.sup){var s=e.base;o=s&&"op"===s.type&&s.limits&&t.style===zo.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(t.style===zo.DISPLAY||s.limits)?"munderover":"msubsup"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===zo.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===zo.DISPLAY)?"munder":"msub"}else{var c=e.base;o=c&&"op"===c.type&&c.limits&&(t.style===zo.DISPLAY||c.alwaysHandleSupSub)||c&&"operatorname"===c.type&&c.alwaysHandleSupSub&&(c.limits||t.style===zo.DISPLAY)?"mover":"msup"}return new vl.MathNode(o,a)}}),Ys({type:"atom",htmlBuilder(e,t){return Zs.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new vl.MathNode("mo",[bl(e.text,e.mode)]);if("bin"===e.family){var r=wl(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var EA={mi:"italic",mn:"normal",mtext:"normal"};Ys({type:"mathord",htmlBuilder(e,t){return Zs.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new vl.MathNode("mi",[bl(e.text,e.mode,t)]),r=wl(e,t)||"italic";return r!==EA[n.type]&&n.setAttribute("mathvariant",r),n}}),Ys({type:"textord",htmlBuilder(e,t){return Zs.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n,r=bl(e.text,e.mode,t),i=wl(e,t)||"normal";return n="text"===e.mode?new vl.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new vl.MathNode("mn",[r]):"\\prime"===e.text?new vl.MathNode("mo",[r]):new vl.MathNode("mi",[r]),i!==EA[n.type]&&n.setAttribute("mathvariant",i),n}});var SA={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},FA={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ys({type:"spacing",htmlBuilder(e,t){if(FA.hasOwnProperty(e.text)){var n=FA[e.text].className||"";if("text"===e.mode){var r=Zs.makeOrd(e,t,"textord");return r.classes.push(n),r}return Zs.makeSpan(["mspace",n],[Zs.mathsym(e.text,e.mode,t)],t)}if(SA.hasOwnProperty(e.text))return Zs.makeSpan(["mspace",SA[e.text]],[],t);throw new so('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){var n;if(!FA.hasOwnProperty(e.text)){if(SA.hasOwnProperty(e.text))return new vl.MathNode("mspace");throw new so('Unknown type of space "'+e.text+'"')}return n=new vl.MathNode("mtext",[new vl.TextNode(" ")]),n}});var TA=()=>{var e=new vl.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Ys({type:"tag",mathmlBuilder(e,t){var n=new vl.MathNode("mtable",[new vl.MathNode("mtr",[TA(),new vl.MathNode("mtd",[kl(e.body,t)]),TA(),new vl.MathNode("mtd",[kl(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var MA={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},IA={"\\textbf":"textbf","\\textmd":"textmd"},NA={"\\textit":"textit","\\textup":"textup"},UA=(e,t)=>{var n=e.font;return n?MA[n]?t.withTextFontFamily(MA[n]):IA[n]?t.withTextFontWeight(IA[n]):t.withTextFontShape(NA[n]):t};$s({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:Js(i),font:r}},htmlBuilder(e,t){var n=UA(e,t),r=ol(e.body,n,!0);return Zs.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=UA(e,t);return kl(e.body,n)}}),$s({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ul(e.body,t),r=Zs.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,o=Zs.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return Zs.makeSpan(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new vl.MathNode("mo",[new vl.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new vl.MathNode("munder",[Cl(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),$s({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ul(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Zs.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new vl.MathNode("mpadded",[Cl(e.body,t)],["vcenter"])}}),$s({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new so("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=LA(e),r=[],i=t.havingStyle(t.style.text()),o=0;oe.body.replace(/ /g,e.star?"␣":" "),QA=js,DA="[ \r\n\t]",HA="\\\\[a-zA-Z@]+",OA="\\\\[^\ud800-\udfff]",zA="("+HA+")"+DA+"*",ZA="\\\\(\n|[ \r\t]+\n?)[ \r\t]*",RA="[̀-ͯ]",PA=new RegExp(RA+"+$"),qA="("+DA+"+)|"+ZA+"|([!-\\[\\]-‧‪-퟿豈-￿]"+RA+"*|[\ud800-\udbff][\udc00-\udfff]"+RA+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+zA+"|"+OA+")";class KA{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(qA,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new ao("EOF",new oo(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new so("Unexpected character: '"+e[t]+"'",new ao(e[t],new oo(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new ao(r,new oo(this,t,this.tokenRegex.lastIndex))}}class WA{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new so("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){while(this.undefStack.length>0)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var jA=qc;Kc("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),Kc("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),Kc("\\@firstoftwo",(function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}})),Kc("\\@secondoftwo",(function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}})),Kc("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Kc("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Kc("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var VA={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Kc("\\char",(function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if(n=e.popToken(),"\\"===n.text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new so("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=VA[n.text],null==r||r>=t)throw new so("Invalid base-"+t+" digit "+n.text);var i;while(null!=(i=VA[e.future().text])&&i{var r=e.consumeArg().tokens;if(1!==r.length)throw new so("\\newcommand's first argument must be a macro name");var i=r[0].text,o=e.isDefined(i);if(o&&!t)throw new so("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!o&&!n)throw new so("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var a=0;if(r=e.consumeArg().tokens,1===r.length&&"["===r[0].text){var s="",l=e.expandNextToken();while("]"!==l.text&&"EOF"!==l.text)s+=l.text,l=e.expandNextToken();if(!s.match(/^\s*[0-9]+\s*$/))throw new so("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(i,{tokens:r,numArgs:a}),""};Kc("\\newcommand",(e=>GA(e,!1,!0))),Kc("\\renewcommand",(e=>GA(e,!0,!1))),Kc("\\providecommand",(e=>GA(e,!0,!0))),Kc("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),Kc("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),Kc("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),QA[n],Qa.math[n],Qa.text[n]),""})),Kc("\\bgroup","{"),Kc("\\egroup","}"),Kc("~","\\nobreakspace"),Kc("\\lq","`"),Kc("\\rq","'"),Kc("\\aa","\\r a"),Kc("\\AA","\\r A"),Kc("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Kc("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Kc("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Kc("ℬ","\\mathscr{B}"),Kc("ℰ","\\mathscr{E}"),Kc("ℱ","\\mathscr{F}"),Kc("ℋ","\\mathscr{H}"),Kc("ℐ","\\mathscr{I}"),Kc("ℒ","\\mathscr{L}"),Kc("ℳ","\\mathscr{M}"),Kc("ℛ","\\mathscr{R}"),Kc("ℭ","\\mathfrak{C}"),Kc("ℌ","\\mathfrak{H}"),Kc("ℨ","\\mathfrak{Z}"),Kc("\\Bbbk","\\Bbb{k}"),Kc("·","\\cdotp"),Kc("\\llap","\\mathllap{\\textrm{#1}}"),Kc("\\rlap","\\mathrlap{\\textrm{#1}}"),Kc("\\clap","\\mathclap{\\textrm{#1}}"),Kc("\\mathstrut","\\vphantom{(}"),Kc("\\underbar","\\underline{\\text{#1}}"),Kc("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Kc("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Kc("\\ne","\\neq"),Kc("≠","\\neq"),Kc("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Kc("∉","\\notin"),Kc("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Kc("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Kc("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Kc("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Kc("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Kc("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Kc("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Kc("⟂","\\perp"),Kc("‼","\\mathclose{!\\mkern-0.8mu!}"),Kc("∌","\\notni"),Kc("⌜","\\ulcorner"),Kc("⌝","\\urcorner"),Kc("⌞","\\llcorner"),Kc("⌟","\\lrcorner"),Kc("©","\\copyright"),Kc("®","\\textregistered"),Kc("️","\\textregistered"),Kc("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Kc("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Kc("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Kc("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Kc("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Kc("⋮","\\vdots"),Kc("\\varGamma","\\mathit{\\Gamma}"),Kc("\\varDelta","\\mathit{\\Delta}"),Kc("\\varTheta","\\mathit{\\Theta}"),Kc("\\varLambda","\\mathit{\\Lambda}"),Kc("\\varXi","\\mathit{\\Xi}"),Kc("\\varPi","\\mathit{\\Pi}"),Kc("\\varSigma","\\mathit{\\Sigma}"),Kc("\\varUpsilon","\\mathit{\\Upsilon}"),Kc("\\varPhi","\\mathit{\\Phi}"),Kc("\\varPsi","\\mathit{\\Psi}"),Kc("\\varOmega","\\mathit{\\Omega}"),Kc("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Kc("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Kc("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Kc("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Kc("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Kc("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var $A={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Kc("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in $A?t=$A[n]:("\\not"===n.slice(0,4)||n in Qa.math&&yo.contains(["bin","rel"],Qa.math[n].group))&&(t="\\dotsb"),t}));var YA={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Kc("\\dotso",(function(e){var t=e.future().text;return t in YA?"\\ldots\\,":"\\ldots"})),Kc("\\dotsc",(function(e){var t=e.future().text;return t in YA&&","!==t?"\\ldots\\,":"\\ldots"})),Kc("\\cdots",(function(e){var t=e.future().text;return t in YA?"\\@cdots\\,":"\\@cdots"})),Kc("\\dotsb","\\cdots"),Kc("\\dotsm","\\cdots"),Kc("\\dotsi","\\!\\cdots"),Kc("\\dotsx","\\ldots\\,"),Kc("\\DOTSI","\\relax"),Kc("\\DOTSB","\\relax"),Kc("\\DOTSX","\\relax"),Kc("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Kc("\\,","\\tmspace+{3mu}{.1667em}"),Kc("\\thinspace","\\,"),Kc("\\>","\\mskip{4mu}"),Kc("\\:","\\tmspace+{4mu}{.2222em}"),Kc("\\medspace","\\:"),Kc("\\;","\\tmspace+{5mu}{.2777em}"),Kc("\\thickspace","\\;"),Kc("\\!","\\tmspace-{3mu}{.1667em}"),Kc("\\negthinspace","\\!"),Kc("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Kc("\\negthickspace","\\tmspace-{5mu}{.277em}"),Kc("\\enspace","\\kern.5em "),Kc("\\enskip","\\hskip.5em\\relax"),Kc("\\quad","\\hskip1em\\relax"),Kc("\\qquad","\\hskip2em\\relax"),Kc("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Kc("\\tag@paren","\\tag@literal{({#1})}"),Kc("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new so("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Kc("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Kc("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Kc("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Kc("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Kc("\\newline","\\\\\\relax"),Kc("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var XA=ba(ia["Main-Regular"]["T".charCodeAt(0)][1]-.7*ia["Main-Regular"]["A".charCodeAt(0)][1]);Kc("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+XA+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Kc("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+XA+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Kc("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Kc("\\@hspace","\\hskip #1\\relax"),Kc("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Kc("\\ordinarycolon",":"),Kc("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Kc("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Kc("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Kc("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Kc("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Kc("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Kc("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Kc("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Kc("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Kc("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Kc("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Kc("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Kc("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Kc("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Kc("∷","\\dblcolon"),Kc("∹","\\eqcolon"),Kc("≔","\\coloneqq"),Kc("≕","\\eqqcolon"),Kc("⩴","\\Coloneqq"),Kc("\\ratio","\\vcentcolon"),Kc("\\coloncolon","\\dblcolon"),Kc("\\colonequals","\\coloneqq"),Kc("\\coloncolonequals","\\Coloneqq"),Kc("\\equalscolon","\\eqqcolon"),Kc("\\equalscoloncolon","\\Eqqcolon"),Kc("\\colonminus","\\coloneq"),Kc("\\coloncolonminus","\\Coloneq"),Kc("\\minuscolon","\\eqcolon"),Kc("\\minuscoloncolon","\\Eqcolon"),Kc("\\coloncolonapprox","\\Colonapprox"),Kc("\\coloncolonsim","\\Colonsim"),Kc("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Kc("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Kc("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Kc("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Kc("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Kc("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Kc("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Kc("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Kc("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Kc("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Kc("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Kc("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Kc("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Kc("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Kc("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Kc("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Kc("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Kc("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Kc("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Kc("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Kc("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Kc("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Kc("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Kc("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Kc("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Kc("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Kc("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Kc("\\imath","\\html@mathml{\\@imath}{ı}"),Kc("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Kc("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Kc("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Kc("⟦","\\llbracket"),Kc("⟧","\\rrbracket"),Kc("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Kc("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Kc("⦃","\\lBrace"),Kc("⦄","\\rBrace"),Kc("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Kc("⦵","\\minuso"),Kc("\\darr","\\downarrow"),Kc("\\dArr","\\Downarrow"),Kc("\\Darr","\\Downarrow"),Kc("\\lang","\\langle"),Kc("\\rang","\\rangle"),Kc("\\uarr","\\uparrow"),Kc("\\uArr","\\Uparrow"),Kc("\\Uarr","\\Uparrow"),Kc("\\N","\\mathbb{N}"),Kc("\\R","\\mathbb{R}"),Kc("\\Z","\\mathbb{Z}"),Kc("\\alef","\\aleph"),Kc("\\alefsym","\\aleph"),Kc("\\Alpha","\\mathrm{A}"),Kc("\\Beta","\\mathrm{B}"),Kc("\\bull","\\bullet"),Kc("\\Chi","\\mathrm{X}"),Kc("\\clubs","\\clubsuit"),Kc("\\cnums","\\mathbb{C}"),Kc("\\Complex","\\mathbb{C}"),Kc("\\Dagger","\\ddagger"),Kc("\\diamonds","\\diamondsuit"),Kc("\\empty","\\emptyset"),Kc("\\Epsilon","\\mathrm{E}"),Kc("\\Eta","\\mathrm{H}"),Kc("\\exist","\\exists"),Kc("\\harr","\\leftrightarrow"),Kc("\\hArr","\\Leftrightarrow"),Kc("\\Harr","\\Leftrightarrow"),Kc("\\hearts","\\heartsuit"),Kc("\\image","\\Im"),Kc("\\infin","\\infty"),Kc("\\Iota","\\mathrm{I}"),Kc("\\isin","\\in"),Kc("\\Kappa","\\mathrm{K}"),Kc("\\larr","\\leftarrow"),Kc("\\lArr","\\Leftarrow"),Kc("\\Larr","\\Leftarrow"),Kc("\\lrarr","\\leftrightarrow"),Kc("\\lrArr","\\Leftrightarrow"),Kc("\\Lrarr","\\Leftrightarrow"),Kc("\\Mu","\\mathrm{M}"),Kc("\\natnums","\\mathbb{N}"),Kc("\\Nu","\\mathrm{N}"),Kc("\\Omicron","\\mathrm{O}"),Kc("\\plusmn","\\pm"),Kc("\\rarr","\\rightarrow"),Kc("\\rArr","\\Rightarrow"),Kc("\\Rarr","\\Rightarrow"),Kc("\\real","\\Re"),Kc("\\reals","\\mathbb{R}"),Kc("\\Reals","\\mathbb{R}"),Kc("\\Rho","\\mathrm{P}"),Kc("\\sdot","\\cdot"),Kc("\\sect","\\S"),Kc("\\spades","\\spadesuit"),Kc("\\sub","\\subset"),Kc("\\sube","\\subseteq"),Kc("\\supe","\\supseteq"),Kc("\\Tau","\\mathrm{T}"),Kc("\\thetasym","\\vartheta"),Kc("\\weierp","\\wp"),Kc("\\Zeta","\\mathrm{Z}"),Kc("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Kc("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Kc("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Kc("\\bra","\\mathinner{\\langle{#1}|}"),Kc("\\ket","\\mathinner{|{#1}\\rangle}"),Kc("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Kc("\\Bra","\\left\\langle#1\\right|"),Kc("\\Ket","\\left|#1\\right\\rangle");var JA=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),i.length&&n.macros.set("\\|",s));var o=t;if(!t&&i.length){var l=n.future();"|"===l.text&&(n.popToken(),o=!0)}return{tokens:o?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,A=t.expandTokens([...o,...c,...n]);return t.macros.endGroup(),{tokens:A.reverse(),numArgs:0}};Kc("\\bra@ket",JA(!1)),Kc("\\bra@set",JA(!0)),Kc("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Kc("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Kc("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Kc("\\angln","{\\angl n}"),Kc("\\blue","\\textcolor{##6495ed}{#1}"),Kc("\\orange","\\textcolor{##ffa500}{#1}"),Kc("\\pink","\\textcolor{##ff00af}{#1}"),Kc("\\red","\\textcolor{##df0030}{#1}"),Kc("\\green","\\textcolor{##28ae7b}{#1}"),Kc("\\gray","\\textcolor{gray}{#1}"),Kc("\\purple","\\textcolor{##9d38bd}{#1}"),Kc("\\blueA","\\textcolor{##ccfaff}{#1}"),Kc("\\blueB","\\textcolor{##80f6ff}{#1}"),Kc("\\blueC","\\textcolor{##63d9ea}{#1}"),Kc("\\blueD","\\textcolor{##11accd}{#1}"),Kc("\\blueE","\\textcolor{##0c7f99}{#1}"),Kc("\\tealA","\\textcolor{##94fff5}{#1}"),Kc("\\tealB","\\textcolor{##26edd5}{#1}"),Kc("\\tealC","\\textcolor{##01d1c1}{#1}"),Kc("\\tealD","\\textcolor{##01a995}{#1}"),Kc("\\tealE","\\textcolor{##208170}{#1}"),Kc("\\greenA","\\textcolor{##b6ffb0}{#1}"),Kc("\\greenB","\\textcolor{##8af281}{#1}"),Kc("\\greenC","\\textcolor{##74cf70}{#1}"),Kc("\\greenD","\\textcolor{##1fab54}{#1}"),Kc("\\greenE","\\textcolor{##0d923f}{#1}"),Kc("\\goldA","\\textcolor{##ffd0a9}{#1}"),Kc("\\goldB","\\textcolor{##ffbb71}{#1}"),Kc("\\goldC","\\textcolor{##ff9c39}{#1}"),Kc("\\goldD","\\textcolor{##e07d10}{#1}"),Kc("\\goldE","\\textcolor{##a75a05}{#1}"),Kc("\\redA","\\textcolor{##fca9a9}{#1}"),Kc("\\redB","\\textcolor{##ff8482}{#1}"),Kc("\\redC","\\textcolor{##f9685d}{#1}"),Kc("\\redD","\\textcolor{##e84d39}{#1}"),Kc("\\redE","\\textcolor{##bc2612}{#1}"),Kc("\\maroonA","\\textcolor{##ffbde0}{#1}"),Kc("\\maroonB","\\textcolor{##ff92c6}{#1}"),Kc("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Kc("\\maroonD","\\textcolor{##ca337c}{#1}"),Kc("\\maroonE","\\textcolor{##9e034e}{#1}"),Kc("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Kc("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Kc("\\purpleC","\\textcolor{##aa87ff}{#1}"),Kc("\\purpleD","\\textcolor{##7854ab}{#1}"),Kc("\\purpleE","\\textcolor{##543b78}{#1}"),Kc("\\mintA","\\textcolor{##f5f9e8}{#1}"),Kc("\\mintB","\\textcolor{##edf2df}{#1}"),Kc("\\mintC","\\textcolor{##e0e5cc}{#1}"),Kc("\\grayA","\\textcolor{##f6f7f7}{#1}"),Kc("\\grayB","\\textcolor{##f0f1f2}{#1}"),Kc("\\grayC","\\textcolor{##e3e5e6}{#1}"),Kc("\\grayD","\\textcolor{##d6d8da}{#1}"),Kc("\\grayE","\\textcolor{##babec2}{#1}"),Kc("\\grayF","\\textcolor{##888d93}{#1}"),Kc("\\grayG","\\textcolor{##626569}{#1}"),Kc("\\grayH","\\textcolor{##3b3e40}{#1}"),Kc("\\grayI","\\textcolor{##21242c}{#1}"),Kc("\\kaBlue","\\textcolor{##314453}{#1}"),Kc("\\kaGreen","\\textcolor{##71B307}{#1}");var eu={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class tu{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new WA(jA,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new KA(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new ao("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(" "!==e.text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),o=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++o;else if("}"===r.text){if(--o,-1===o)throw new so("Extra }",r)}else if("EOF"===r.text)throw new so("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===o||1===o&&"{"===e[a])&&r.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(0!==o||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new so("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;rthis.settings.maxExpand)throw new so("Too many expansions: infinite loop or need to increase maxExpand setting");var i=r.tokens,o=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var a=i.length-1;a>=0;--a){var s=i[a];if("#"===s.text){if(0===a)throw new so("Incomplete placeholder at end of macro body",s);if(s=i[--a],"#"===s.text)i.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new so("Not a valid argument number",s);i.splice(a,2,...o[+s.text-1])}}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new ao(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;this.pushTokens(e);while(this.stack.length>n)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"===typeof t?t(this):t;if("string"===typeof r){var i=0;if(-1!==r.indexOf("#")){var o=r.replace(/##/g,"");while(-1!==o.indexOf("#"+(i+1)))++i}var a=new KA(r,this.settings),s=[],l=a.lex();while("EOF"!==l.text)s.push(l),l=a.lex();s.reverse();var c={tokens:s,numArgs:i};return c}return r}isDefined(e){return this.macros.has(e)||QA.hasOwnProperty(e)||Qa.math.hasOwnProperty(e)||Qa.text.hasOwnProperty(e)||eu.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"===typeof t||"function"===typeof t||!t.unexpandable:QA.hasOwnProperty(e)&&!QA[e].primitive}}var nu=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ru=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),iu={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},ou={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class au{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new tu(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new so("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new ao("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){var n=[];while(1){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==au.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&QA[r.text]&&QA[r.text].infix)break;var i=this.parseAtom(t);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=Qa[this.mode][t].group,l=oo.range(e);if(Ua.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={type:s,mode:this.mode,loc:l,text:t};i=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(qo(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:oo.range(e),text:t}}if(this.consume(),o)for(var A=0;Agu(e.left))).join("|")+")");while(1){if(n=e.search(i),-1===n)break;n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));const o=t.findIndex((t=>e.startsWith(t.left)));if(n=fu(t[o].right,e,t[o].left.length),-1===n)break;const a=e.slice(0,n+t[o].right.length),s=mu.test(a)?a:e.slice(t[o].left.length,n);r.push({type:"math",data:s,rawData:a,display:t[o].display}),e=e.slice(n+t[o].right.length)}return""!==e&&r.push({type:"text",data:e}),r};var bu=vu;const yu=function(e,t){const n=bu(e,t.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let o=0;o-1===e.indexOf(" "+t+" ")));n&&wu(r,t)}}},xu=function(e,t){if(!e)throw new Error("No element provided to render");const n={};for(const r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},wu(e,n)};var ku=xu,Cu=n(40521),Bu=n(47922),_u=n(18914),Eu=n(54587);const Su=[{name:"积分",children:["a^2","a_2","a^{2+2}","a_{i,j}","{}_1^2\\!X_3^4","\\overset{\\frown} {AB}","\\overline{hij}","\\underline{klm}","\\overbrace{1+2+\\cdots+100}","\\begin{matrix} 5050 \\\\ \\overbrace{ 1+2+\\cdots+100 }\\end{matrix}","\\underbrace{a+b+\\cdots+z}","\\sum_{k=1}^N k^2","\\begin{matrix} \\sum_{k=1}^N k^2 \\end{matrix}","\\prod_{i=1}^N x_i","\\begin{matrix} \\prod_{i=1}^N x_i \\end{matrix}","\\coprod_{i=1}^N x_i","\\begin{matrix} \\coprod_{i=1}^N x_i \\end{matrix}","\\lim_{n \\to \\infty}x_n","\\begin{matrix} \\ lim_{n \\to \\infty}x_n \\end{matrix}","\\int_{-N}^{N} e^x\\, \\mathrm{d}x","\\begin{matrix} \\int_{_N}^{N} e^x\\, \\mathrm{d}x \\end{matrix}","\\iint_{D}^{W} \\, \\mathrm{d}x\\,\\mathrm{d}y","\\iiint_{E}^{V} \\,\\mathrm{d}x\\,\\mathrm{d}y,\\mathrm{d}z","\\oint_{C} x^3\\, \\mathrm{d}x + 4y^2\\, \\mathrm{d}y","\\bigcap_1^{n} p","\\bigcup_1^{k} p"]},{name:"分隔符",children:["\\left(\\frac{a}{b} \\right)","\\left[\\frac{a}{b} \\right]","\\left\\{\\frac{a}{b} \\right\\}","\\left \\langle \\frac{a}{b} \\right \\rangle","\\left|\\frac{a}{b} \\right|","\\left \\lceil \\frac{c}{d} \\right \\rceil","\\left / \\frac{a}{b} \\right \\backslash","\\left \\Uparrow \\frac{a}{b} \\right \\Downarrow","\\left \\updownarrow \\frac{a}{b} \\right \\Updownarrow","\\left [ 0,1 \\right ) \\left \\langle \\psi \\right |","\\left \\{ \\frac{a}{b} \\right.","\\left . \\frac{a}{b} \\right \\}","\\langle","\\rangle","\\lceil","\\rceil","\\lfloor","\\rfloor","\\lbrace","\\rbrace","\\lvert","\\rvert"]},{name:"函数",children:["\\sin\\theta","\\cos\\theta","\\tan\\theta","\\arcsin\\frac{L}{r}","\\arccos\\frac{T}{r}","\\arctan\\frac{L}{T}","\\sinh g","\\cosh h","\\tanh i","\\coth j","\\operatorname{sh}j","\\operatorname{ch}h","\\operatorname{th}i","\\operatorname{argsh}k","\\operatorname{argch}l","\\operatorname{argth}m","\\limsup S","\\liminf I","\\max H","\\min L","\\inf s","\\sup t","\\exp\\!t","\\ln X","\\lg X","\\log X","\\log_\\alpha X","\\ker x","\\deg x","\\gcd(T,U,V,W,X)","\\Pr x","\\det x","\\hom x","\\arg x","\\dim x","\\lim_{t\\to n}T"]},{name:"微分导数",children:["\\nabla\\psi","\\partial x","\\mathrm{d}x","\\dot x","\\ddot y","X^\\prime","\\backprime","f^{(3)}"]},{name:"运算符",children:["\\pm","\\times","\\div","\\mid","\\nmid","\\cdot","\\circ","\\ast","\\bigodot","\\bigoplus","\\leq","\\geq","\\leqq","\\geqq","=","\\neq","\\approx","\\equiv","\\not\\equiv","\\sum","\\prod","\\coprod","\\backslash","\\sim","\\backsim","\\simeq","\\cong","\\dot=","\\ggg","\\gg",">","<","\\ll","\\lll","\\propto"]},{name:"逻辑符号",children:["、emptyset","\\varnothing","\\in","\\not\\in","\\subset","\\supset","\\subseteq","\\sqsupseteq","\\cap","\\cup","\\bigcup","\\sqcap","\\sqcup","\\uplus","\\biguplus","\\bigsqcup","\\top","\\bot","\\complement","\\vee","\\wedge","\\bigvee","\\bigwedge","\\forall","\\exists","\\not\\subset","\\not=","\\not<","\\not>","\\because","\\therefore","\\neg","\\bar{q} \\to p","\\setminus","\\smallsetminus"]},{name:"几何符号",children:["\\Diamond","\\Box","\\triangle","\\perp","\\angle\\Alpha\\Beta\\Gamma","60^\\circ"]},{name:"戴帽符号",children:["\\vec{c}","\\overleftarrow{ab}","\\overrightarrow{cd}","\\overleftrightarrow{ab}","\\widehat{efg}","\\overset{\\frown} {AB}","\\hat{xyz}","\\tilde{xy}","\\bar{y}","\\widetilde{xyz}","\\acute{y}","\\breve{y}","\\check{y}","\\grave{y}"]},{name:"箭头符号",children:["\\to","\\mapsto","\\underrightarrow{1^circ/min}","\\implies","\\impliedby","\\iff","\\downarrow","\\Uparrow","\\Downarrow","\\leftarrow","\\rightarrow","\\leftrightarrow","\\Leftarrow","\\Rightarrow","\\Leftrightarrow","\\longleftarrow","\\longrightarrow","\\longleftrightarrow","\\Longleftarrow","\\Longrightarrow","\\Longleftrightarrow"]},{name:"特殊符号",children:["\\eth","\\%","\\dagger","\\ddagger","\\star","*","\\ldots","\\smile","\\frown","\\wr"]},{name:"分数多行",children:["\\frac{2}{4}=0.5","{2 \\over 3}","{{a+b} \\over {a-b}}","\\tfrac{2}{4} = 0.5","\\cfrac{2}{c + \\cfrac{2}{d + \\cfrac{2}{4}}} = a","\\begin{matrix}x & y \\\\z & v\\end{matrix}","\\begin{Vmatrix}x & y \\\\z & v\\end{Vmatrix}","\\begin{bmatrix}0& \\cdots & 0\\\\\\vdots & \\ddots & \\vdots \\\\0& \\cdots & 0\\end{bmatrix}","\\begin{Bmatrix}x & y \\\\z & v\\end{Bmatrix}","\\begin{pmatrix}x & y \\\\z & v\\end{pmatrix}","\\begin{cases}3x + 5y + z \\\\7x - 2y + 4z \\\\-6x + 3y + 2z\\end{cases}","\\begin{array}{|c|c||c|} a & b & S \\\\\\hline0&0&1\\\\0&1&1\\\\1&0&1\\\\1&1&0\\\\\\end{array}"]},{name:"希腊字母",children:["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\epsilon","\\zeta","\\eta","\\theta","\\iota","\\kappa","\\lambda","\\mu","\\nu","\\xi","o","\\pi","\\rho","\\sigma","\\tau","\\upsilon","\\phi"]}],Fu={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],throwOnError:!1};var Tu=n(92269),Mu=n.n(Tu),Iu=(0,Ft.aZ)({name:"math-comp",components:{Modal:Cu.Z,Tabs:Bu.Z,TabPane:_u.Z,Textarea:Eu.Z},props:{value:{type:Object,required:!0},defaultVisible:{type:Boolean,required:!1},change:{type:Function}},setup(e){const{defaultVisible:t,value:n,change:r}={...e},i=(0,Tt.iH)(n.id),o=(0,Tt.iH)(n.width),a=(0,Tt.iH)(n.height),s=(0,Tt.iH)(n.imageUrl),l=(0,Tt.iH)(t),c=(0,Tt.iH)(0);let A=(0,Tt.iH)(Su);const u=(0,Tt.iH)(n.code||""),d=(0,Tt.iH)(""),h=(0,Tt.qj)({start:-1,end:-1});(0,Ft.bv)((()=>{f(0),v()}));const p=e=>{console.log("mathTextareaValue",u.value),(0,Ft.Y3)((()=>{const e=document.querySelector(".content-editor-preview span.katex");Mu()(e,{scale:2}).then((t=>{let n=t.toDataURL("image/svg+xml");s.value=n,o.value=1.2*e.offsetWidth,a.value=1.2*e.offsetHeight,l.value=!1,r&&r({code:u.value,width:o.value,height:a.value,imageUrl:s.value})}))}))},f=e=>{c.value=e,(0,Ft.Y3)((()=>{let e=document.getElementsByClassName("math-model-node");for(let t=0;t{let t=u.value,n=h.start,r=h.end;-1===n&&-1===r&&(n=t.length,r=t.length);const i=t.substring(0,n),o=t.substring(r);u.value=`${i}${e}${o}`,console.log("addTextareaValue",n,r),v()},m=()=>{const e=document.querySelector("textarea.ant-input.content-editor-input");if(!e)return;console.log("setSelection",e.selectionStart,e.selectionEnd);let t=u.value,n=h.start,r=h.end;t.length===n&&t.length===r?(h.start=-1,h.end=-1):(h.start=e.selectionStart,h.end=e.selectionEnd)},v=()=>{if(u.value){const e=document.querySelector(".content-editor-preview");if(!e)return;e.innerHTML=`$$${u.value}$$`,(0,Ft.Y3)((()=>{ku(e,Fu)}))}},b=()=>{m(),v()};return{id:i,width:o,height:a,imageUrl:s,visible:l,activeKey:c,mathTypeList:A,mathTextareaValue:u,mathPreviewValue:d,changePanel:f,addTextareaValue:g,setSelection:m,renderPreview:b,handleOk:p}}}),Nu=n(40089);const Uu=(0,Nu.Z)(Iu,[["render",io]]);var Lu=Uu;const Qu='\n \n \n \n';var Du=new WeakMap;class Hu extends s.Zb{constructor(...e){super(...e),qi(this,Du,{writable:!0,value:void 0}),(0,Fe.Z)(this,"vm",void 0),(0,Fe.Z)(this,"defaultVisible",!1)}static get cardName(){return"math"}static get cardType(){return s.eT.INLINE}toolbar(){return!(0,s.iC)(this.editor)||this.editor.readonly?[]:[{type:"node",node:(0,s.$)(Qu),didMount:e=>{e.on("click",(()=>{this.defaultVisible=!0,this.didRender()}))}},{type:"copy"},{type:"delete"}]}render(e){return Gi(this,Du,(0,s.$)("
Loading
")),this.defaultVisible=e??!1,ji(this,Du)}didRender(){super.didRender();const e=this.getValue();setTimeout((()=>{this.vm=(0,It.ri)(Lu,{value:e,defaultVisible:this.defaultVisible,change:t=>{this.setValue({...e,...t})}}),this.vm.mount(ji(this,Du)?.get())}),20)}destroy(){super.destroy(),this.vm?.unmount()}}var Ou=Hu,zu=class extends s.Sy{static get pluginName(){return"math"}init(){this.editor.on("paser:html",(e=>this.parseHtml(e))),this.editor.on("paste:schema",(e=>this.pasteSchema(e))),this.editor.on("paste:each",(e=>this.pasteHtml(e)))}execute(){if(!(0,s.iC)(this.editor))return;const{card:e}=this.editor;e.insert(Ou.cardName,{code:""},!0)}hotkey(){return this.options.hotkey||"mod+shift+0"}pasteSchema(e){e.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Ou.cardName},"data-value":"*"}})}pasteHtml(e){if((0,s.iC)(this.editor)){if(e.isElement()){const t=e.attributes("data-type");if(t===Ou.cardName){const t=e.attributes("data-value"),n=(0,s.RW)(t);return this.editor.card.replaceNode(e,Ou.cardName,n),e.remove(),!1}}return!0}}parseHtml(e){e.find(`[${s.Jr}=${Ou.cardName}`).each((e=>{const t=(0,s.$)(e),n=this.editor.card.find(t),r=n?.getValue();if(r){t.empty();const e=(0,s.$)(`
`);t.replaceWith(e)}else t.remove()}))}},Zu="paste:each",Ru=(0,F.Z)("styleName"),Pu=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a")),o=this.queryState();if(!e||o&&e===o[0])o&&(this.setStyle(i,o[0]),r.unwrap(i));else{if(this.setStyle(i,e),!this.followStyle&&n.range.get().collapsed)return;r.wrap(i)}}}},{key:"hotkey",value:function(){return this.options.hotkey||[]}},{key:"destroy",value:function(){var e=this.editor;(0,s.iC)(e)&&e.off(Zu,this.pasteEach)}}],[{key:"pluginName",get:function(){return"fontfamily"}}]),n}(s.Rw),qu=Pu,Ku=(0,F.Z)("color"),Wu=(0,F.Z)("value"),ju=function(){function e(t){(0,r.Z)(this,e),this.options=void 0,this.container=void 0,Object.defineProperty(this,Ku,{writable:!0,value:void 0}),Object.defineProperty(this,Wu,{writable:!0,value:void 0}),this.options=t}return(0,i.Z)(e,[{key:"focus",value:function(){var e,t;null===(e=this.container)||void 0===e||null===(t=e.find("input").get())||void 0===t||t.focus()}},{key:"change",value:function(){var e=this.options.onChange;e&&e((0,S.Z)(this,Wu)[Wu],(0,S.Z)(this,Ku)[Ku])}},{key:"updateActive",value:function(e){var t,n=null===(t=this.container)||void 0===t?void 0:t.find("svg");null===n||void 0===n||n.css("display","none");var r,i=this.options.colors.findIndex((function(t){return t.background===e.background&&t.color===e.color}));i>-1?null===n||void 0===n||null===(r=n.eq(i))||void 0===r||r.css("display","block"):(0,S.Z)(this,Ku)[Ku]=void 0}},{key:"render",value:function(e,t,n){var r=this;this.destroy(),(0,S.Z)(this,Wu)[Wu]=t,(0,S.Z)(this,Ku)[Ku]=n,this.container=(0,s.$)('
'));var i=this.options,o=i.colors,a=i.onBlur,l=i.onFocus,c=i.onOk,A=(0,s.$)(''));A.on("focus",(function(){l&&l()})),A.on("blur",(function(){a&&a()})),A.on("input",(function(e){(0,S.Z)(r,Wu)[Wu]=e.target.value,r.change()})),A.on(s.tq?"touchstart":"mousedown",(function(e){}),{passive:!0}),c&&A.on("keydown",(function(e){-1!==[13,27].indexOf(e.keyCode)&&c(e)})),this.container.append(A);var u=(0,s.$)('
');return o.forEach((function(e){var t=(0,s.$)(''));t.on("mousedown",(function(t){t.preventDefault(),(0,S.Z)(r,Ku)[Ku]=e,r.change()})),u.append(t)})),this.container.append(u),this.container}},{key:"destroy",value:function(){var e;null===(e=this.container)||void 0===e||e.remove();var t=this.options.onDestroy;t&&t()}}]),e}();function Vu(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var Gu='.am-engine [data-card-key="status"].card-selected:not(.card-activated) [data-card-element="center"] .data-label-container::before\r\n{\r\n content: "";\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background: #1890FF;\r\n opacity: 0.2;\r\n border-radius: 2px;\r\n}\r\n\r\n.am-engine [data-card-key="status"].card-activated ::-moz-selection {\r\n background: transparent !important;\r\n}\r\n\r\n.am-engine [data-card-key="status"].card-activated ::selection {\r\n background: transparent !important;\r\n}\r\n\r\n.data-label-container {\r\n overflow: hidden;\r\n max-width: 200px;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n cursor: pointer;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n display: inline-block;\r\n border-radius: 4px;\r\n vertical-align: top;\r\n}\r\n\r\n.data-label-container * {\r\n display: inline-block;\r\n}\r\n\r\n.data-label-container .data-label-background {\r\n padding: 0 3px;\r\n}\r\n\r\n.data-label-container.data-label-empty {\r\n opacity: 0.45;\r\n}\r\n\r\n.data-card-status-editor {\r\n outline: none;\r\n width: 162px;\r\n border-radius: 3px 3px;\r\n position: absolute;\r\n border: 1px solid #e8e8e8;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\r\n z-index: 125;\r\n text-indent: 0;\r\n top:0;\r\n padding: 8px;\r\n background: #fff;\r\n}\r\n\r\n.data-card-status-editor-mobile {\r\n width: calc(100vw - 40px);\r\n}\r\n \r\n.data-card-status-editor input {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: "tnum","tnum";\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n min-width: 0;\r\n padding: 4px 11px;\r\n color: #595959;\r\n font-size: 14px;\r\n line-height: 24px;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 2px;\r\n transition: all .3s;\r\n}\r\n\r\n.data-card-status-editor input:focus\r\n{\r\n border-color: #5c9dff;\r\n border-right-width: 1px!important;\r\n outline: 0;\r\n box-shadow: 0 0 0 2px rgba(52,126,255,.2)\r\n}\r\n\r\n.data-card-status-editor-mobile input{\r\n min-width:auto;\r\n}\r\n\r\n.data-card-status-editor .data-status-editor-color-panle {\r\n position: relative;\r\n text-align: left;\r\n text-indent: 0;\r\n display: flex;\r\n justify-content: space-between;\r\n width: 100%;\r\n height: auto;\r\n margin-top: 8px;\r\n}\r\n\r\n.data-status-editor-color-panle > span {\r\n width: 24px;\r\n height: 24px;\r\n display: inline-block;\r\n cursor: pointer;\r\n background-color: rgb(255, 255, 255);\r\n padding: 2px;\r\n border-radius: 3px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n flex: 0 0 auto;\r\n}\r\n\r\n.data-status-editor-color-panle > span > span\r\n{\r\n position: relative;\r\n width: 18px;\r\n height: 18px;\r\n display: block;\r\n border-radius: 2px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n}\r\n\r\n.data-status-editor-color-panle > span > span > svg {\r\n position: absolute;\r\n top: -1px;\r\n left: 1px;\r\n width: 12px;\r\n height: 12px;\r\n}';Vu(Gu);var $u=(0,F.Z)("position"),Yu=(0,F.Z)("container"),Xu=(0,F.Z)("editorContainer"),Ju=(0,F.Z)("statusEditor"),ed=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0?e[0]:{background:"#FFFFFF",color:"#222222"}}},{key:"getSelectionNodes",value:function(){return(0,S.Z)(this,Yu)[Yu]?[(0,S.Z)(this,Yu)[Yu]]:[]}},{key:"executeMark",value:function(e,t){var n;if((0,S.Z)(this,Yu)[Yu]){var r=this.editor.mark,i=(0,S.Z)(this,Yu)[Yu].children();if(e)if(t){var o=r.findPlugin(e);"backcolor"===(null===o||void 0===o?void 0:o.name)&&e.addClass("data-label-background"),i.each((function(t,n){var o=i.eq(n);o&&r.wrapByNode(o,e)}));var a=this.queryMarks().map((function(e){var t;return(null===(t=e.clone().get())||void 0===t?void 0:t.outerHTML)||""}));this.setValue({marks:a})}else{var s=r.findPlugin(e);if("backcolor"===(null===s||void 0===s?void 0:s.name))return;r.unwrapByNodes(this.queryMarks(!1),e);var l=this.queryMarks().map((function(e){var t;return(null===(t=e.get())||void 0===t?void 0:t.outerHTML)||""}));this.setValue({marks:l})}else{var c=this.queryMarks(!1),A=!1;r.unwrapByNodes(c.filter((function(e){if(A)return!0;var t=r.findPlugin(e);return"backcolor"!==(null===t||void 0===t?void 0:t.name)||(A=!0,!1)}))),this.setValue({marks:[]})}null===(n=(0,S.Z)(this,Ju)[Ju])||void 0===n||n.updateActive(this.getColor())}}},{key:"queryMarks",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,S.Z)(this,Yu)[Yu]?(0,S.Z)(this,Yu)[Yu].allChildren().filter((function(t){return t.isElement()&&e.editor.node.isMark(t)})).map((function(e){if(t){var n=e.clone();return n.removeClass("data-label-background"),n}return e})):[]}},{key:"focusEditor",value:function(){var e;null===(e=(0,S.Z)(this,Ju)[Ju])||void 0===e||e.focus()}},{key:"onActivate",value:function(e){var t;(0,d.Z)((0,h.Z)(n.prototype),"onActivate",this).call(this,e);var r=this.editor;(0,s.iC)(r)&&!r.readonly&&(e?this.renderEditor():null===(t=(0,S.Z)(this,Ju)[Ju])||void 0===t||t.destroy())}},{key:"renderEditor",value:function(){var e,t;if((0,S.Z)(this,Ju)[Ju]){var n=this.getValue();if(n&&n.id){null===(e=(0,S.Z)(this,$u)[$u])||void 0===e||e.destroy();var r=this.getDefaultColor(),i=this.getColor();(0,S.Z)(this,Xu)[Xu]=(0,S.Z)(this,Ju)[Ju].render(n.id,n.text||"",(0,nn.Z)((0,nn.Z)({},r),i)),(0,S.Z)(this,Yu)[Yu]&&(null===(t=(0,S.Z)(this,$u)[$u])||void 0===t||t.bind((0,S.Z)(this,Xu)[Xu],(0,S.Z)(this,Yu)[Yu]))}}}},{key:"render",value:function(){if(!(0,S.Z)(this,Yu)[Yu])return(0,S.Z)(this,Yu)[Yu]=(0,s.$)(''),this.updateContent(),(0,s.iC)(this.editor)&&(0,S.Z)(this,Yu)[Yu].attributes("draggable","true"),(0,S.Z)(this,Yu)[Yu];this.updateContent()}},{key:"didRender",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this),this.updateMaxWidth(),window.addEventListener("resize",this.onWindowResize),this.editor.on("editor:resize",this.onWindowResize)}},{key:"destroy",value:function(){var e,t;null===(e=(0,S.Z)(this,Ju)[Ju])||void 0===e||e.destroy(),null===(t=(0,S.Z)(this,$u)[$u])||void 0===t||t.destroy(),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"status"}},{key:"cardType",get:function(){return s.eT.INLINE}},{key:"autoSelected",get:function(){return!1}},{key:"selectStyleType",get:function(){return s.dw.NONE}}]),n}(s.Zb),td={status:{defaultValue:"SET A STATUS"}},nd={status:{defaultValue:"设置状态"}},rd={"en-US":td,"zh-CN":nd},id="parse:html",od="paste:each",ad="paste:schema",sd=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a'),c=a.marks||[],A=(0,s.$)("
".concat(a.text,"
")),u=A.first();c.forEach((function(e){var t=(0,s.$)(e);u=r.node.wrap(u,t)})),t.empty();var d=(0,s.$)(l);d.append(u),d.css({"font-weight":400,overflow:"hidden","max-width":"200px","white-space":"nowrap","border-radius":"4px",border:"2px solid transparent",padding:"0 3px","text-overflow":"ellipsis"}),n&&(d=n(d,a)),t.replaceWith(d),i.push(d)}else t.remove()})),i},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.language.add(rd),e.on(id,this.parseHtml),e.on(od,this.pasteHtml),e.on(ad,this.pasteSchema)}},{key:"execute",value:function(){var e=this.editor;if((0,s.iC)(e)){var t=e.card,n=t.insert(ed.cardName);t.activate(n.root),setTimeout((function(){n.focusEditor()}),50)}}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"destroy",value:function(){var e=this.editor;e.off(id,this.parseHtml),e.off(od,this.pasteHtml),e.off(ad,this.pasteSchema)}}],[{key:"pluginName",get:function(){return"status"}}]),n}(s.Sy),ld=sd,cd="paste:each",Ad=(0,F.Z)("styleName"),ud=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;aEmpty Data'},this.getPluginOptions=function(){var e=i.engine.plugin.findPlugin("mention");return null===e||void 0===e?void 0:e.options},this.handlePreventDefault=function(e){var t;if(0!==(null===(t=i.root)||void 0===t?void 0:t.closest("body").length))return e.preventDefault(),!1},this.bindItem=function(e,t){var n=i.otpions.onSelect;e.addClass("data-mention-item");var r=t.key,o=t.name;return r?e.attributes({"data-key":(0,s.YU)(r)}):e.removeAttributes("data-key"),e.attributes({"data-name":(0,s.YU)(o)}),e.removeAllEvents(),e.on("click",(function(e){r&&(e.stopPropagation(),e.preventDefault(),n&&n(e,t))}),{once:!0}),e.on("mouseenter",(function(){var t;r&&(null===(t=i.root)||void 0===t||t.find(".data-mention-item-active").removeClass("data-mention-item-active"),e.addClass("data-mention-item-active"))})),e},this.otpions=n,this.engine=t,(0,S.Z)(this,gd)[gd]=new s.Ly(this.engine)}return(0,i.Z)(e,[{key:"select",value:function(e){var t,n,r;null===(t=this.root)||void 0===t||t.find(".data-mention-item-active").removeClass("data-mention-item-active"),null===(n=this.root)||void 0===n||null===(r=n.find(".data-mention-item").eq(e))||void 0===r||r.addClass("data-mention-item-active")}},{key:"scroll",value:function(e){var t;if(this.root){var n=this.root.find(".data-mention-item").toArray();if(0!==n.length){var r=n.find((function(e){return e.hasClass("data-mention-item-active")}))||n[0],i=r;r="up"===e?r.prev():r.next();while(1){if(r||(r="up"===e?n[n.length-1]:n[0]),r.attributes("data-key")||i.equal(r))break;r="up"===e?r.prev():r.next()}r&&r.attributes("data-key")?(this.select(n.findIndex((function(e){return e.equal(r)}))),null===(t=r.get())||void 0===t||t.scrollIntoView({block:"nearest"})):this.select(-1)}}}},{key:"unbindEvents",value:function(){var e;(0,pd.deleteScope)(this.SCOPE_NAME),(0,pd.unbind)("enter",this.SCOPE_NAME),(0,pd.unbind)("up",this.SCOPE_NAME),(0,pd.unbind)("down",this.SCOPE_NAME),(0,pd.unbind)("esc",this.SCOPE_NAME),this.engine.off("keydown:enter",this.handlePreventDefault),null===(e=(0,S.Z)(this,gd)[gd])||void 0===e||e.destroy()}},{key:"bindEvents",value:function(){var e,t=this;this.unbindEvents(),(0,pd.setScope)(this.SCOPE_NAME),fd()("enter",this.SCOPE_NAME,(function(e){var n,r,i;if(0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)){e.preventDefault(),e.stopImmediatePropagation();var o=null===(r=t.root)||void 0===r?void 0:r.find(".data-mention-item-active");null===o||void 0===o||null===(i=o.get())||void 0===i||i.click()}})),fd()("up",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("up"))})),fd()("down",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("down"))})),fd()("esc",this.SCOPE_NAME,(function(e){e.preventDefault(),t.unbindEvents();var n=t.otpions.onCancel;n&&n()})),this.engine.on("keydown:enter",this.handlePreventDefault),this.root&&this.target&&0!==this.target.length&&(null===(e=(0,S.Z)(this,gd)[gd])||void 0===e||e.bind(this.root,this.target))}},{key:"remove",value:function(){this.root&&0!==this.root.length&&(this.unbindEvents(),this.root.remove(),this.root=void 0)}},{key:"renderTemplate",value:function(e){var t=e.name,n=e.avatar;return'
\n '.concat(n?''):"",'\n ').concat((0,s.AK)(t),"\n
")}},{key:"getBody",value:function(){var e;return null===(e=this.root)||void 0===e?void 0:e.find(".data-mention-component-body")}},{key:"createRoot",value:function(){this.root=(0,s.$)('
'))}},{key:"renderRootEmpty",value:function(){var e,t,n,r=this.getBody(),i=null===r||void 0===r?void 0:r.children();r&&r.length>0&&(0===(null===i||void 0===i?void 0:i.length)||1===(null===i||void 0===i?void 0:i.length)&&(null===(e=i.eq(0))||void 0===e?void 0:e.hasClass("data-scrollbar")))?null===(t=this.root)||void 0===t||t.addClass("data-mention-component-empty"):null===(n=this.root)||void 0===n||n.removeClass("data-mention-component-empty")}},{key:"render",value:function(e,t){var n=this;if(this.root||this.createRoot(),this.root){this.target=e;var r,i=this.getBody(),o=null,a=this.getPluginOptions();if("boolean"===typeof t&&!0===t)o=(null===a||void 0===a?void 0:a.onLoading)?a.onLoading(this.root):this.engine.trigger("mention:loading",this.root),i=this.getBody(),o&&(null===(r=i)||void 0===r||r.empty().append(o));else if(0===t.filter((function(e){return!!e.key})).length){var l,c=this.engine.trigger("mention:empty",this.root)||((null===a||void 0===a?void 0:a.onEmpty)?null===a||void 0===a?void 0:a.onEmpty(this.root):this.renderEmpty(this.root));i=this.getBody(),c&&(null===(l=i)||void 0===l||l.empty().append(c))}else{if((null===a||void 0===a?void 0:a.onRender)||(o=this.engine.trigger("mention:render",this.root,t,this.bindItem)))return((null===a||void 0===a?void 0:a.onRender)?a.onRender(this.root,t,this.bindItem):o).then((function(e){var t=n.getBody();e&&(null===t||void 0===t||t.empty().append(e)),n.select(0),n.bindEvents()})),void this.renderRootEmpty();var A;i&&0!==i.length||(this.createRoot(),i=this.getBody()),null===(A=i)||void 0===A||A.empty(),t.forEach((function(e){var t,r=n.engine.trigger("mention:render-item",e,n.root),o=r||((null===a||void 0===a?void 0:a.onRenderItem)?a.onRenderItem(e,n.root):n.renderTemplate(e));o&&(null===(t=i)||void 0===t||t.append(n.bindItem((0,s.$)(o),e)))})),this.select(0)}this.renderRootEmpty(),this.bindEvents()}}}]),e}();function vd(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var bd='.am-engine .data-mention-component, .am-engine-view .data-mention-component {\n color: #1890ff !important;\n cursor: pointer;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n vertical-align: top;\n}\n\n.am-engine [data-card-key="mention"].card-selected [data-card-element="center"].data-card-border-selected {\n outline: 0 none;\n}\n\n.am-engine [data-card-key="mention"].card-activated ::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine [data-card-key="mention"].card-activated ::selection {\n background: transparent !important;\n}\n\n.data-mention-component-list {\n position: absolute;\n font-size: 12px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n overflow: hidden;\n padding: 5px 0;\n max-width: 250px;\n}\n\n.data-mention-component-empty {\n padding: 0;\n box-shadow: none;\n border: none;\n}\n\n.data-mention-component-body {\n max-height: calc(40vh);\n overflow-y: auto;\n}\n\n.data-mention-component-placeholder {\n color: rgba(0,0,0,0.25);\n pointer-events: none;\n min-width: 78px;\n}\n\n.data-mention-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px;\n min-width: 160px;\n align-items: center;\n}\n\n.data-mention-item .data-mention-item-text {\n display: block;\n text-align: left;\n margin-left: 8px;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n\n.data-mention-item.data-mention-item-active {\n background-color: #f4f4f4;\n}\n\n.data-mention-item-avatar img {\n max-width: 38px;\n}\n\n.data-mention-component-body.data-scrollable.scroll-y {\n padding-right: 0 !important;\n}\n\n.data-mention-hover-layout {\n position: absolute;\n font-size: 12px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n}\n';vd(bd);var yd=["id","key","name","marks","type"],wd=["id","key","name"],xd=(0,F.Z)("container"),kd=(0,F.Z)("keyword"),Cd=(0,F.Z)("placeholder"),Bd=(0,F.Z)("position"),_d=(0,F.Z)("showTimeout"),Ed=(0,F.Z)("hideTimeout"),Sd=(0,F.Z)("enterLayout"),Fd=(0,F.Z)("request"),Td=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a0||((0,S.Z)((0,E.Z)(e),_d)[_d]=setTimeout((function(){(0,S.Z)((0,E.Z)(e),xd)[xd]&&((0,S.Z)((0,E.Z)(e),Sd)[Sd]=(0,s.$)('
')),(0,S.Z)((0,E.Z)(e),Sd)[Sd].on("mouseenter",(function(){(0,S.Z)((0,E.Z)(e),Ed)[Ed]&&clearTimeout((0,S.Z)((0,E.Z)(e),Ed)[Ed])})),(0,S.Z)((0,E.Z)(e),Sd)[Sd].on("mouseleave",e.hideEnter),e.editor.trigger("mention:enter",(0,S.Z)((0,E.Z)(e),Sd)[Sd],(0,nn.Z)({key:(0,s.AK)(r||""),name:(0,s.AK)(i)},o)),t.onMouseEnter((0,S.Z)((0,E.Z)(e),Sd)[Sd],(0,nn.Z)({key:(0,s.AK)(r||""),name:(0,s.AK)(i)},o)),setTimeout((function(){var t;null===(t=(0,S.Z)((0,E.Z)(e),Bd)[Bd])||void 0===t||t.bind((0,S.Z)((0,E.Z)(e),Sd)[Sd],(0,S.Z)((0,E.Z)(e),xd)[xd])}),10))}),200))}}},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this,t=this.editor;if((0,S.Z)(this,Bd)[Bd]||((0,S.Z)(this,Bd)[Bd]=new s.Ly(t)),(0,s.iC)(t)&&!s.sk&&((0,d.Z)((0,h.Z)(n.prototype),"init",this).call(this),!this.component)){var r=this.getPluginOptions();this.component=new md(t,{onCancel:function(){e.changeToText()},onSelect:function(i,o){var a,l,c=t.trigger("mention:select",o)||{};delete c["id"],(null===r||void 0===r?void 0:r.onSelect)&&(c=r.onSelect(o)||{},delete c["id"]);var A=t.card,u=e.getValue();null===(a=e.component)||void 0===a||a.remove(),e.component=void 0,null===(l=(0,S.Z)(e,kd)[kd])||void 0===l||l.remove(),A.focus(e,!1);var d=A.insert(n.cardName,(0,nn.Z)((0,nn.Z)({},o),{},{marks:u.marks},c));if(A.removeNode(e),t.trigger("mention:insert",d),(null===r||void 0===r?void 0:r.onInsert)&&r.onInsert(d),(0,s.iC)(t)){var h=t.change,p=h.range.get().cloneRange();p.setStartAfter(d.root.get()),p.collapse(!0),h.range.select(p)}else A.focus(d,!1)}})}}},{key:"remove",value:function(){var e,t,n=this.editor;(0,s.iC)(n)&&(null===(e=this.component)||void 0===e||e.remove(),null===(t=(0,S.Z)(this,kd)[kd])||void 0===t||t.remove(),n.card.remove(this.id))}},{key:"changeToText",value:function(){var e,t,n=this.editor;if(this.root.inEditor()&&(0,s.iC)(n)){var r=(null===(e=(0,S.Z)(this,kd)[kd])||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText)||"";this.remove(),n.node.insertText(r)}}},{key:"activate",value:function(e){var t;((0,d.Z)((0,h.Z)(n.prototype),"activate",this).call(this,e),!e&&(0,S.Z)(this,kd)[kd]&&(0,S.Z)(this,kd)[kd].length>0)&&(null===(t=this.component)||void 0===t||t.unbindEvents(),this.changeToText())}},{key:"handleInput",value:function(){var e,t,n,r,i=this,o=this.editor;if((0,s.iC)(o)){var a=o.change,l=o.card;if(!a.isComposing()){var c,A=(null===(e=(0,S.Z)(this,kd)[kd])||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText.replace(/[\r\n]/g,""))||"";if(""===A)return null===(c=this.component)||void 0===c||c.remove(),void l.remove(this.id);var u=A.substr(1),d=o.trigger("mention:default")||(null===(n=this.getPluginOptions())||void 0===n?void 0:n.defaultData);if(""===u&&d){var h;null===(h=this.component)||void 0===h||h.render(this.root,d)}else{null===(r=this.component)||void 0===r||r.render(this.root,!0);o.trigger("mention:search",u);this.search(u).then((function(e){var t;null===(t=i.component)||void 0===t||t.render(i.root,e)}))}}}}},{key:"resetPlaceHolder",value:function(){var e,t,n,r;"@"===(null===(e=(0,S.Z)(this,kd)[kd])||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText)?null===(n=(0,S.Z)(this,Cd)[Cd])||void 0===n||n.css("visibility","visible"):null===(r=(0,S.Z)(this,Cd)[Cd])||void 0===r||r.css("visibility","hidden")}},{key:"executeMark",value:function(e,t){if((0,S.Z)(this,xd)[xd]){var n=this.editor.mark,r=(0,S.Z)(this,xd)[xd].children();if(e)if(t){r.each((function(t,i){var o=r.eq(i);o&&n.wrapByNode(o,e)}));var i=this.queryMarks().map((function(e){var t;return(null===(t=e.clone().get())||void 0===t?void 0:t.outerHTML)||""}));this.setValue({marks:i})}else{n.unwrapByNodes(this.queryMarks(!1),e);var o=this.queryMarks().map((function(e){var t;return(null===(t=e.get())||void 0===t?void 0:t.outerHTML)||""}));this.setValue({marks:o})}else n.unwrapByNodes(this.queryMarks(!1)),this.setValue({marks:[]})}}},{key:"queryMarks",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,S.Z)(this,xd)[xd]?(0,S.Z)(this,xd)[xd].allChildren().filter((function(t){return t.isElement()&&e.editor.node.isMark(t)})).map((function(e){return t?e.clone():e})):[]}},{key:"toolbar",value:function(){var e,t=null===(e=this.editor.plugin.findPlugin("mention"))||void 0===e?void 0:e.options;return(null===t||void 0===t?void 0:t.cardToolbars)?t.cardToolbars([],this.editor):[]}},{key:"render",value:function(){var e=this,t=this.getValue(),n=this.editor;if((null===t||void 0===t?void 0:t.name)&&!(0,S.Z)(this,xd)[xd]){t.id;var r=t.key,i=t.name,o=(0,hd.Z)(t,wd);(0,S.Z)(this,xd)[xd]=(0,s.$)('@'.concat((0,s.AK)(i),"")),(t.marks||[]).forEach((function(t){e.executeMark((0,s.$)(t),!0)})),(0,S.Z)(this,xd)[xd].on("click",(function(){(0,S.Z)(e,xd)[xd]&&(n.trigger("mention:item-click",(0,S.Z)(e,xd)[xd],(0,nn.Z)({key:(0,s.AK)(r||""),name:(0,s.AK)(i)},o)),(null===d||void 0===d?void 0:d.itemClick)&&(null===d||void 0===d||d.itemClick((0,S.Z)(e,xd)[xd],(0,nn.Z)({key:(0,s.AK)(r||""),name:(0,s.AK)(i)},o))))})),(0,S.Z)(this,xd)[xd].on("mouseenter",this.showEnter),(0,S.Z)(this,xd)[xd].on("mouseleave",this.hideEnter)}else if((0,S.Z)(this,xd)[xd])return void(t&&((0,S.Z)(this,xd)[xd].html("@".concat((0,s.AK)(t.name||""))),((null===t||void 0===t?void 0:t.marks)||[]).forEach((function(t){e.executeMark((0,s.$)(t),!0)}))));if(!(0,s.iC)(n))return(0,S.Z)(this,xd)[xd];var a,l,c,A=n.language.get("mention"),u=void 0,d=this.getPluginOptions();if((0,S.Z)(this,xd)[xd])return null===(a=this.component)||void 0===a||a.remove(),(0,S.Z)(this,xd)[xd];(0,S.Z)(this,xd)[xd]=(0,s.$)('@').concat(A["placeholder"],"")),(0,S.Z)(this,kd)[kd]=(0,S.Z)(this,xd)[xd].eq(0),(0,S.Z)(this,Cd)[Cd]=(0,S.Z)(this,xd)[xd].eq(1),null===(l=(0,S.Z)(this,kd)[kd])||void 0===l||l.on("keydown",(function(e){(0,s.P6)("enter",e)&&e.preventDefault()}));var h,p=Date.now();null===(c=(0,S.Z)(this,kd)[kd])||void 0===c||c.on("input",(function(){if(e.resetPlaceHolder(),Date.now()-p<200){var t,n=null===(t=(0,S.Z)(e,kd)[kd])||void 0===t?void 0:t.allChildren().find((function(e){return e.isText()}));if(n&&n.isText()&&"@@"===n[0].nodeValue){var r,i=null===(r=n.get())||void 0===r?void 0:r.splitText(1);null===i||void 0===i||i.remove()}}u&&clearTimeout(u),u=setTimeout((function(){e.handleInput()}),100)})),this.getCenter().append((0,S.Z)(this,xd)[xd]),setTimeout((function(){if((0,s.iC)(n)){var t,r=n.change.range.get();(0,S.Z)(e,kd)[kd]=null===(t=(0,S.Z)(e,xd)[xd])||void 0===t?void 0:t.eq(0),r.select((0,S.Z)(e,kd)[kd],!0).collapse(!1);var i=window.getSelection();null===i||void 0===i||i.removeAllRanges(),null===i||void 0===i||i.addRange(r.toRange())}}),10),((null===d||void 0===d?void 0:d.defaultData)?null===d||void 0===d?void 0:d.defaultData:n.trigger("mention:default"))?null===(h=this.component)||void 0===h||h.render(this.root,n.trigger("mention:default")||(null===d||void 0===d?void 0:d.defaultData)||[]):setTimeout((function(){e.handleInput()}),50)}},{key:"didRender",value:function(){(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this),this.updateMaxWidth(),window.addEventListener("resize",this.onWindowResize),this.editor.on("editor:resize",this.onWindowResize)}},{key:"destroy",value:function(){var e,t;null===(e=this.component)||void 0===e||e.remove(),null===(t=(0,S.Z)(this,Bd)[Bd])||void 0===t||t.destroy(),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"mention"}},{key:"cardType",get:function(){return s.eT.INLINE}},{key:"autoSelected",get:function(){return!1}},{key:"selectStyleType",get:function(){return s.dw.NONE}}]),n}(s.Zb),Md={mention:{placeholder:"User name"}},Id={mention:{placeholder:"用户名"}},Nd={"en-US":Md,"zh-CN":Id},Ud=["key","name"],Ld="parse:value",Qd="parse:node",Dd="parse:html",Hd="paste:schema",Od="paste:each",zd="keydown:at",Zd=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a'),c=a.marks||[],A=(0,s.$)("
@".concat(a.name,"
")),u=A.first();c.forEach((function(e){var t=(0,s.$)(e);u=r.node.wrap(u,t)})),t.empty();var d=(0,s.$)(l);d.append(u),n&&(d=n(d,a)),t.replaceWith(d),i.push(d)}else t.remove()})),i},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.on(Ld,this.paserValue),e.on(Qd,this.paserNode),e.on(Dd,this.parseHtml),e.on(Od,this.pasteHtml),e.on(Hd,this.pasteSchema),(0,s.iC)(e)&&e.on(zd,this.onAt),e.language.add(Nd)}},{key:"getList",value:function(){var e=[];return this.editor.card.each((function(t){if(t.name===Td.cardName){var n=t.getValue()||{},r=n.key,i=n.name,o=(0,hd.Z)(n,Ud);i&&r&&e.push((0,nn.Z)({key:(0,s.AK)(r),name:(0,s.AK)(i)},o))}})),e}},{key:"execute",value:function(){}},{key:"destroy",value:function(){var e=this.editor;e.off(Ld,this.paserValue),e.off(Qd,this.paserNode),e.off(Dd,this.parseHtml),e.off(Od,this.pasteHtml),e.off(Hd,this.pasteSchema),(0,s.iC)(e)&&e.off(zd,this.onAt)}}],[{key:"pluginName",get:function(){return"mention"}}]),n}(s.Sy),Rd=Zd;function Pd(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var qd=".data-embed-form {\n position: relative;\n border-radius: 2px;\n border: 1px solid #e8e8e8;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 8px;\n}\n\n.data-embed-icon {\n flex: 1 0;\n}\n\n.data-embed-editor {\n flex: 1 0;\n}\n\n.data-embed-input {\n border: 0;\n height: 32px;\n line-height: 32px;\n font-size: 14px;\n outline: none;\n width: 100%;\n}\n\n.data-embed-button {\n margin-left: 12px;\n}\n\n.data-embed-ui-button {\n line-height: 1.499;\n display: inline-block;\n font-weight: 400;\n text-align: center;\n cursor: pointer;\n white-space: nowrap;\n padding: 0 15px;\n font-size: 14px;\n border-radius: 4px;\n height: 30px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n transition: all .3s cubic-bezier(.645,.045,.355,1);\n position: relative;\n box-shadow: 0 2px 0 rgba(0,0,0,.015);\n color: rgba(0,0,0,.65);\n background-color: #fff;\n color: #fff;\n background-color: #347eff;\n border: 1px solid #347eff;\n text-shadow: 0 -1px 0 rgba(0,0,0,.12);\n outline: 0\n}\n\n.data-embed-ui-button:hover {\n background-color: #466fb6;\n border-color: #466fb6\n}\n\n.data-embed-collapse, .data-embed-header {\n background: #fafafa;\n position: relative;\n border-radius: 2px;\n border: 1px solid #e8e8e8;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 8px;\n}\n\n.data-embed-collapse a, .data-embed-header a {\n color: rgba(0,0,0,.65);\n}\n\n.data-embed-collapse a:hover, .data-embed-header a:hover {\n color: #347eff;\n}\n\n.data-embed-title {\n flex: 1 0;\n margin: 0 8px;\n}\n\n.data-embed .data-embed-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n.data-embed .data-embed-mask {\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n z-index: 3;\n display: block;\n transition: all .3s cubic-bezier(.3,1.2,.2,1)\n}\n\n.data-embed .data-embed-mask:hover {\n cursor: pointer\n}\n\n.data-embed-content-bg {\n width: 80px;\n height: 80px;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -40px;\n margin-left: -40px;\n text-align: center;\n line-height: 80px;\n color: #666;\n font-size: 36px;\n z-index: 1;\n visibility: visible;\n opacity: 1;\n transition: all .3s linear;\n -webkit-animation: loading .8s linear infinite;\n animation: loading .8s linear infinite\n}\n\n.data-embed-header {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.data-embed-body {\n border: 1px solid #e8e8e8;\n border-top: 0;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n}\n\n.data-embed-body iframe {\n padding: 0;\n margin: 0;\n width: 100%;\n height: 100%;\n position: relative;\n z-index: 2;\n}";Pd(qd);var Kd=(0,F.Z)("mask"),Wd=(0,F.Z)("iframe"),jd=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e,i;(0,r.Z)(this,n);for(var o=arguments.length,a=new Array(o),l=0;l',isResize:!0};if(i.renderBefore){var A=i.renderBefore(l);c=(0,nn.Z)((0,nn.Z)({},c),A)}i.setValue(c),i.render(),(0,d.Z)((e=(0,E.Z)(i),(0,h.Z)(n.prototype)),"didRender",e).call(e)}else r.messageError("embed",o["addressInvalid"])},i}return(0,i.Z)(n,[{key:"onActivate",value:function(e){var t,r;(0,d.Z)((0,h.Z)(n.prototype),"onActivate",this).call(this,e),e?null===(t=(0,S.Z)(this,Kd)[Kd])||void 0===t||t.hide():(0,s.iC)(this.editor)&&(null===(r=(0,S.Z)(this,Kd)[Kd])||void 0===r||r.show())}},{key:"collapse",value:function(){var e=this.getValue();(null===e||void 0===e?void 0:e.collapsed)||(this.setValue({collapsed:!0}),this.render(),(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this))}},{key:"expand",value:function(){var e=this.getValue();(null===e||void 0===e?void 0:e.collapsed)&&(this.setValue({collapsed:!1}),this.render(),(0,d.Z)((0,h.Z)(n.prototype),"didRender",this).call(this))}},{key:"toolbar",value:function(){var e,t=this,n=this.editor,r=function(){if((0,s.iC)(n)){var e=[],r=t.getValue();return(null===r||void 0===r?void 0:r.url)&&e.push({key:"expand",type:"button",content:'',title:n.language.get("embed","expand"),onClick:function(){return t.expand()}},{key:"collapse",type:"button",content:'',title:n.language.get("embed","collapse"),onClick:function(){return t.collapse()}}),n.readonly||e.unshift({key:"dnd",type:"dnd"},{key:"copy",type:"copy"},{key:"delete",type:"delete"},{key:"separator",type:"separator"}),e}return[]},i=null===(e=n.plugin.findPlugin("embed"))||void 0===e?void 0:e.options;return(null===i||void 0===i?void 0:i.cardToolbars)?i.cardToolbars(r(),this.editor):r()}},{key:"handleInputKeydown",value:function(e){(0,s.P6)("enter",e)&&this.handleSubmit()}},{key:"renderEdit",value:function(e){var t=this,n=this.editor.language.get("embed"),r=(0,s.$)('
\n
\n \n \n \n \n \n \n
\n
")),i=r.find('[data-role="url"]');i.on("keydown",(function(e){return t.handleInputKeydown(e)}));var o=r.find('[data-role="submit"]');return o.on("click",this.handleSubmit),r}},{key:"renderCollapse",value:function(){var e=this.getValue(),t=(null===e||void 0===e?void 0:e.url)||"",n='
\n '.concat(null===e||void 0===e?void 0:e.ico,'\n ').concat((0,s.YU)((null===e||void 0===e?void 0:e.title)||""),'\n \n
\n ');return(0,s.$)(n)}},{key:"renderExpand",value:function(){var e=this.getValue(),t=(null===e||void 0===e?void 0:e.url)||"",n=(null===e||void 0===e?void 0:e.height)||"auto",r=(0,s.$)('\n \n ')),i=r.find("iframe");return i.on("load",(function(){r.find(".data-embed-content-bg").hide()})),(0,S.Z)(this,Kd)[Kd]=r.find(".data-embed-mask"),this.activated&&(0,S.Z)(this,Kd)[Kd].hide(),(null===e||void 0===e?void 0:e.height)&&i.attributes("data-height",e.height),i.attributes("src",t),(0,S.Z)(this,Wd)[Wd]=i,r}},{key:"render",value:function(e){this.renderBefore=e;var t=this.getValue(),n=(null===t||void 0===t?void 0:t.url)||"",r=this.getCenter();r.empty(),n&&t?t.collapsed?r.append(this.renderCollapse()):r.append(this.renderExpand()):r.append(this.renderEdit())}}],[{key:"cardName",get:function(){return"embed"}},{key:"cardType",get:function(){return s.eT.BLOCK}},{key:"lazyRender",get:function(){return!0}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}}]),n}(s.Zb),Vd={embed:{placeholder:"Please paste the link here",submit:"submit",addressInvalid:"Link error, please check and re-enter",validUrl:"Illegal link, can't be embedded",canNotShowCard:"Card cannot be displayed",expand:"Expand",collapse:"Collapse"}},Gd={embed:{placeholder:"请在此粘贴链接",submit:"确定",addressInvalid:"链接错误,请检查后重新输入",validUrl:"非法链接,无法嵌入",canNotShowCard:"Card无法展示",expand:"嵌入预览",collapse:"紧凑展示"}},$d={"en-US":Vd,"zh-CN":Gd},Yd="parse:html",Xd="paste:schema",Jd="paste:each",eh=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a'));i.empty();var c=(null===a||void 0===a?void 0:a.url)||"",A=(0,s.$)('")),u=(0,s.$)('
'));l.attributes("src",c),u.append(A);var d=(0,s.$)('
');d.append(l),a.collapsed||u.append(d),n&&(u=n(u,a)),i.replaceWith(u),r.push(u)}else i.remove()})),r},e}return(0,i.Z)(n,[{key:"init",value:function(){var e=this.editor;e.language.add($d),e.on(Yd,this.parseHtml),e.on(Xd,this.pasteSchema),e.on(Jd,this.pasteHtml)}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"execute",value:function(){var e=this.options.renderBefore,t=this.editor.card,n=t.insert(jd.cardName,{url:(arguments.length<=0?void 0:arguments[0])||"",ico:arguments.length<=1?void 0:arguments[1],title:arguments.length<=2?void 0:arguments[2],collapsed:arguments.length<=3?void 0:arguments[3],isResize:arguments.length<=4?void 0:arguments[4]},e);t.activate(n.root)}},{key:"destroy",value:function(){var e=this.editor;e.off(Yd,this.parseHtml),e.off(Xd,this.pasteSchema),e.off(Jd,this.pasteHtml)}}],[{key:"pluginName",get:function(){return"embed"}}]),n}(s.Sy),th=eh,nh="mark-range",rh=(0,F.Z)("isRevoke"),ih=(0,F.Z)("isPreview"),oh=(0,F.Z)("isApply"),ah=(0,F.Z)("isCreateting"),sh=(0,F.Z)("previewAwating"),lh=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a-1&&i.push(o)})),i}},{key:"preview",value:function(e,t){var n=this,r=this.editor;if(t){var i=this.findElements(e,t);i.forEach((function(t){t.attributes(s.rN,n.getPreviewName(e)),t.attributes(n.getPreviewName(e),"true")}))}else if(this.range){this.startMutation();var o=r.block,a=r.node,l=r.card,c=this.range;if(c.collapsed){var A=o.closest(c.startNode);if(!a.isBlock(A))return;c.select(A,!0);var u=window.getSelection();null===u||void 0===u||u.removeAllRanges(),null===u||void 0===u||u.addRange(c.toRange())}var d=this.getSelectInfo(c,!0);if(d&&d.key===e)return void r.trigger("".concat(nh,":select"),c,d);r.mark.wrap("<".concat(this.tagName," ").concat(this.MARK_KEY,'="').concat(e,'" ').concat(s.rN,'="').concat(this.getPreviewName(e),'" ').concat(this.MARK_UUID,'="').concat(this.m_uuid,'" ').concat(this.getPreviewName(e),'="true" />'),c);var h="",p=c.getSubRanges(!0,!1);return p.forEach((function(t){var r=l.find(t.startNode);if(r&&!r.executeMark){if(h+="[card:".concat(r.constructor.cardName,",").concat(r.id,"]"),r.root.attributes(n.getIdName(e)))return;r.root.attributes(n.MARK_KEY,e),r.root.attributes(n.getPreviewName(e),"true")}else h+=t.getText()})),(0,S.Z)(this,ah)[ah]=!0,(0,S.Z)(this,ih)[ih]=!0,h}}},{key:"apply",value:function(e,t){var n=this,r=this.editor;r.container.find("[".concat(this.getPreviewName(e),"]")).each((function(i){var o=(0,s.$)(i),a=o.attributes(n.getIdName(e)).trim().split(","),l=[];if(""===a[0]&&a.splice(0,1),a.length>0){for(var c=0;c=0){l.push(t),l=l.concat(a.slice(c));break}}l.push(A)}l.length===a.length&&a.indexOf(t)<0&&l.push(t)}else l.push(t);o.attributes(s.rN,n.getPreviewName(e)),o.attributes(n.getIdName(e),l.join(",")),o.removeAttributes(n.getPreviewName(e));var v=o.closest(s.Su);if(v.length>0){var b=r.card.find(v,!0);b&&b.onChange&&b.onChange("local",b.root)}var y=r.card.find(o);y&&y.executeMark&&y.executeMark(o.clone(),!0)})),(0,S.Z)(this,oh)[oh]=!0,(0,S.Z)(this,ah)[ah]=!1}},{key:"revoke",value:function(e,t){var n=this,r=this.editor,i=r.node,o=[];o=t?this.findElements(e,t):r.container.find("[".concat(this.getPreviewName(e),"]")).toArray();var a=[];o.forEach((function(t){var r=(0,s.$)(t),o=r.attributes(n.getIdName(e)).trim().split(",");""===o[0]&&o.splice(0,1),0===o.length?r.isCard()?(r.removeAttributes(n.MARK_KEY),r.removeAttributes(n.getPreviewName(e))):i.unwrap(r):(r.removeAttributes(n.getPreviewName(e)),a.push(r))})),!t&&o.length>0&&(0,s.iC)(r)&&((0,S.Z)(this,rh)[rh]=!0,(0,S.Z)(this,ah)[ah]=!1,a.length>0&&r.mark.mergeMarks(a))}},{key:"remove",value:function(e,t){var n=this,r=this.editor,i=r.node,o=this.findElements(e,t);o.forEach((function(o){var a=(0,s.$)(o),l=a.attributes(n.getIdName(e)).trim().split(",");""===l[0]&&l.splice(0,1);var c=a.closest(s.Su);if(1===l.length&&l.find((function(e){return e===t})))a.isCard()?(a.removeAttributes(n.MARK_KEY),a.removeAttributes(n.getIdName(e)),a.removeAttributes(n.getPreviewName(e))):i.unwrap(a);else{a.removeAttributes(n.getPreviewName(e));var A=l.findIndex((function(e){return e===t}));l.splice(A,1),a.attributes(n.getIdName(e),l.join(","))}if(c.length>0){var u=r.card.find(c,!0);u&&u.onChange&&u.onChange("local",u.root)}}))}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"execute",value:function(){}},{key:"startMutation",value:function(){var e=this.editor;(0,s.iC)(e)&&e.model.mutation.isStopped&&e.model.mutation.start()}},{key:"stopMutation",value:function(){var e=this.editor;setTimeout((function(){(0,s.iC)(e)&&e.readonly&&!e.model.mutation.isStopped&&e.model.mutation.stop()}),10)}},{key:"action",value:function(e,t){var n=arguments.length<=2?void 0:arguments[2];switch(t){case"preview":var r=this.preview(e,n);return r;case"apply":if(!n)return;this.apply(e,n),this.stopMutation();break;case"revoke":this.revoke(e,n),this.stopMutation();break;case"find":return n?this.findElements(e,n):[];case"remove":if(!n)return;this.remove(e,n),this.stopMutation();break;case"filter":return this.filterValue(e,n);case"wrap":var i=arguments.length<=3?void 0:arguments[3];return this.wrapFromPath(e,n,i)}}},{key:"getIds",value:function(){var e=this,t={};return this.editor.container.find("[".concat(this.MARK_KEY,"]")).each((function(n){var r=(0,s.$)(n),i=r.attributes(e.MARK_KEY),o=r.attributes(e.getIdName(i)).split(",");o.forEach((function(e){e&&(t[i]||(t[i]=[]),t[i].indexOf(e)<0&&t[i].push(e))}))})),t}},{key:"triggerChange",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.editor,r={},i={},o=this.getIds();if(this.options.keys.forEach((function(t){var n=e.ids[t]||[],a=o[t]||[];a.forEach((function(e){n.indexOf(e)<0&&(r[t]||(r[t]=[]),r[t].push(e))})),n.forEach((function(e){a.indexOf(e)<0&&(i[t]||(i[t]=[]),i[t].push(e))}))})),t){var a=n.container.find("[".concat(this.MARK_UUID,'="').concat(this.m_uuid,'"]'));a.each((function(t,n){var r=a.eq(n),i=(null===r||void 0===r?void 0:r.attributes())||{},o=i[e.MARK_KEY],s=e.getPreviewName(o);!o||i[e.getIdName(o)]||i[s]||r.attributes(s,"true")}))}this.ids=o,n.trigger("".concat(nh,":change"),r,i,o)}},{key:"filterValue",value:function(e,t){var n,r,i=this,o=this.editor,a=o.container.clone(!t);a.css({position:"fixed",top:"-999px",width:o.container.css("width")||"100%",clip:"rect(0, 0, 0, 0)"}),(0,s.$)(document.body).append(a);var l=new s.G7(a,o.options),c=l.node,A=l.card;t&&a.html((0,s.Gg)(t)),A.render(a,void 0,!1);var u=null===(n=a.window)||void 0===n?void 0:n.getSelection(),d=(u&&s.e6.from(l,u)||s.e6.create(l)).cloneRange(),h=new s._b(a,l,void 0,!1),p=l.schema,f=l.conversion;if(!d){var g,m=null!==(g=t)&&void 0!==g?g:h.toValue(p,f);return l.destroy(),a.remove(),{value:m,paths:[]}}d.select(a,!0).collapse(!0);var v=[];a.traverse((function(t){var n=t.attributes(i.getIdName(e));if(n){var r=d.cloneRange();if(t.isCard()){var o=A.find(t);if(o&&o.executeMark){var s=i.getIdName(e),l=o.root.find("[".concat(s,'="').concat(n,'"]'));o.executeMark(l.clone(),!1)}else t.removeAttributes(i.getIdName(e));r.select(t)}else{r.select(t,!0);var u=r.createSelection();c.unwrap(t),u.move()}var h=r.shrinkToElementNode().shrinkToTextNode().toPath(void 0,a);v.unshift({id:n.split(","),path:h?[h.start.path,h.end.path]:[]})}}),!1,"editable");var b=a.find(s.Am);return b.each((function(e,t){var n=b.eq(t);if(null===n||void 0===n?void 0:n.isEditableCard()){var r=l.card.find(n);if(r){var i=r.getValue();r.setValue(i||{})}}})),t=null!==(r=t)&&void 0!==r?r:h.toValue(p,f),l.destroy(),a.remove(),{value:t,paths:v}}},{key:"wrapFromPath",value:function(e,t,n){var r,i=this,o=this.editor,a=o.container.clone(!n);n&&(n=s.Y1.removeTags(n)),a.css({position:"fixed",top:"-999px",width:o.container.css("width")||"100%",clip:"rect(0, 0, 0, 0)"}),(0,s.$)(document.body).append(a);var l=new s.G7(a,o.options),c=l.card;n&&a.html((0,s.Gg)(n)),c.render(a,void 0,!1);var A=null===(r=a.window)||void 0===r?void 0:r.getSelection(),u=(A&&s.e6.from(l,A)||s.e6.create(l)).cloneRange(),d=new s._b(a,l,void 0,!1),h=l.schema,p=l.conversion;if(!u){var f=n||d.toValue(h,p);return l.destroy(),a.remove(),f}u.select(a,!0).collapse(!0),(t||[]).forEach((function(t){var n=t.id,r=t.path,o=s.e6.fromPath(l,{start:{path:r[0],id:"",bi:-1},end:{path:r[1],id:"",bi:-1}},void 0,a),A=o.findElements();A.forEach((function(t){var r=(0,s.$)(t);if(r.isCard()){var o=c.find(r);o&&o.executeMark?o.executeMark((0,s.$)("<".concat(i.tagName," ").concat(i.MARK_KEY,'="').concat(e,'" ').concat(i.getIdName(e),'="').concat(n.join(","),'" />')),!0):r.attributes(i.getIdName(e),n.join(","))}})),l.mark.wrap("<".concat(i.tagName," ").concat(i.MARK_KEY,'="').concat(e,'" ').concat(i.getIdName(e),'="').concat(n.join(","),'" />'),o)}));var g=a.find(s.Am);return g.each((function(e,t){var n=g.eq(t);if(null===n||void 0===n?void 0:n.isEditableCard()){var r=l.card.find(n);if(r){var i=r.getValue();r.setValue(i||{})}}})),n=d.toValue(h,p),l.destroy(),a.remove(),n}},{key:"destroy",value:function(){var e=this.editor;if(e.off("beforeCommandExecute",this.onBeforeCommandExecute),e.off("afterCommandExecute",this.onAfterCommandExecute),(0,s.iC)(e))e.off("change",this.onChange),e.off("select",this.onSelectionChange),e.off("parse:value",this.parseValue),e.off("parse:node",this.parseNode),e.off("afterSetValue",this.onAfterSetValue);else if((0,s.D1)(e)){var t;e.off("".concat(nh,":set-range"),this.onSelectionChange),null===(t=e.container.document)||void 0===t||t.removeEventListener("selectionchange",this.handelSelectionChange)}}}],[{key:"pluginName",get:function(){return nh}}]),n}(s.Rw),ch=lh;const Ah={class:"lightblock-icon-theme"},uh=(0,Ft._)("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1777",width:"16",height:"16"},[(0,Ft._)("path",{d:"M515.100444 911.758222c-161.393778 0-260.494222-23.495111-302.990222-71.793778-22.442667-25.486222-21.333333-49.521778-20.48-56.291555 0.455111-6.030222 15.530667-189.923556 28.216889-275.655111-4.608-3.128889-14.392889-7.054222-20.053333-9.329778a229.831111 229.831111 0 0 1-13.880889-5.888c-18.716444-8.789333-57.571556-28.046222-57.571556-28.046222-48.298667-22.186667-76.942222-50.403556-83.996444-83.399111-5.660444-26.424889 3.982222-49.180444 14.876444-61.696 1.308444-1.479111 2.702222-2.872889 4.181334-4.124445l227.072-193.735111a39.907556 39.907556 0 0 1 63.800889 17.607111c24.888889 73.699556 97.024 84.736 137.841777 84.736 10.865778 0 17.777778-0.853333 17.834667-0.881778 3.441778-0.426667 7.111111-0.426667 10.552889 0.028445 0 0 6.769778 0.824889 17.265778 0.824889 40.021333 0 110.791111-10.979556 135.253333-84.565334a39.964444 39.964444 0 0 1 64.085333-17.607111l223.800889 193.735111c1.479111 1.28 2.872889 2.673778 4.124445 4.152889 10.780444 12.515556 20.280889 35.299556 14.592 61.639111-7.054222 32.824889-35.299556 60.984889-83.939556 83.626667 0 0.028444-37.489778 18.887111-55.694222 27.562667-4.096 1.934222-8.760889 3.868444-13.710222 5.888-5.518222 2.247111-15.104 6.144-19.598223 9.244444 12.572444 86.471111 27.392 269.880889 28.017778 277.703111 0.682667 5.006222 1.735111 29.184-20.878222 54.812445-42.325333 48.099556-140.032 71.452444-298.723556 71.452444z m-243.541333-125.354666c6.712889 7.936 48.952889 45.425778 243.541333 45.425777 192.227556 0 233.187556-37.575111 239.530667-45.312-2.986667-35.925333-16.384-195.242667-27.249778-268.686222-9.102222-61.582222 47.530667-84.593778 68.835556-93.240889 3.413333-1.393778 6.656-2.673778 9.472-4.010666 17.92-8.533333 55.096889-27.249778 55.153778-27.278223 24.462222-11.434667 34.474667-20.565333 38.4-25.287111l-175.36-151.779555c-52.792889 78.193778-144.355556 87.808-186.083556 87.808-9.927111 0-17.834667-0.540444-22.698667-0.967111a255.601778 255.601778 0 0 1-22.983111 0.967111c-42.325333 0-135.253333-9.671111-188.643555-88.291556l-178.488889 152.291556c4.067556 4.750222 14.108444 13.710222 37.831111 24.604444 1.137778 0.540444 38.855111 19.285333 57.059556 27.818667 2.872889 1.336889 6.172444 2.645333 9.642666 4.039111 21.589333 8.647111 78.904889 31.601778 69.660445 93.411555-11.178667 74.24-24.945778 236.344889-27.619556 268.487112z",fill:"#595959","p-id":"1778"})],-1),dh={class:"lightblock-theme-contain"},hh={class:"lightblock-theme-content",ref:"themeContent"},ph=(0,Ft._)("span",{class:"data-icon icon-reload"},"",-1),fh=(0,Ft._)("div",{class:"lightblock-theme-title"},"边框颜色",-1),gh={class:"lightblock-theme-box"},mh=["onClick"],vh=(0,Ft._)("div",{style:{height:"8px"}},null,-1),bh=(0,Ft._)("div",{class:"lightblock-theme-title"},"背景颜色",-1),yh={class:"lightblock-theme-box"},wh=["onClick"];function xh(e,t,n,r,i,o){return(0,Ft.wg)(),(0,Ft.iD)("span",Ah,[uh,(0,Ft._)("div",dh,[(0,Ft._)("div",hh,[(0,Ft._)("div",{class:"lightblock-theme-random",onClick:t[0]||(t[0]=(...t)=>e.randomColor&&e.randomColor(...t))},[ph,(0,Ft.Uk)(" 随机 ")]),fh,(0,Ft._)("div",gh,[((0,Ft.wg)(!0),(0,Ft.iD)(Ft.HY,null,(0,Ft.Ko)(e.border,((t,n)=>((0,Ft.wg)(),(0,Ft.iD)("span",{key:t,class:(0,Mt.C_)("lightblock-theme-box-item "+(e.bdColor===t?"active":"")),onClick:()=>e.changeColor("border",t,n)},[(0,Ft._)("span",{style:(0,Mt.j5)({background:t})},null,4)],10,mh)))),128))]),vh,bh,(0,Ft._)("div",yh,[((0,Ft.wg)(!0),(0,Ft.iD)(Ft.HY,null,(0,Ft.Ko)(e.background,(t=>((0,Ft.wg)(),(0,Ft.iD)("span",{key:t,class:(0,Mt.C_)("lightblock-theme-box-item "+(e.bgColor===t?"active":"")),onClick:()=>e.changeColor("background",t)},[(0,Ft._)("span",{style:(0,Mt.j5)({background:t})},null,4)],10,wh)))),128))])],512)])])}const kh={border:["#eff0f1","#fbbfbc","#fed4a4","#fff67a","#b7edb1","#bacefd","#cdb2fa"],background:["#f2f3f5","#fef1f1","#fff5eb","#fefff0","#f0fbef","#f0f4ff","#f6f1fe"]};var Ch=(0,Ft.aZ)({name:"lightblock-theme",props:{value:{type:Object,default:()=>({})},change:{type:Function,default:null}},setup(e){const{value:t,change:n}={...e},r=(0,Tt.iH)(null),{border:i,background:o}=kh,{borderColor:a,backgroundColor:s}=t,l=(0,Tt.iH)(a),c=(0,Tt.iH)(s),A=()=>{const e=Math.floor(Math.random()*i.length),t=i[e],r=o[e];l.value=t,c.value=r,n&&n({background:r,border:t})},u=(e,t,r)=>{"border"===e&&void 0!==r&&(l.value=t,c.value=o[r]),"background"===e&&(c.value=t),n&&n({border:l.value,background:c.value})};return{themeContent:r,border:i,background:o,bdColor:l,bgColor:c,randomColor:A,changeColor:u}}});const Bh=(0,Nu.Z)(Ch,[["render",xh]]);var _h=Bh;const Eh='\n\t\n\t\t\n\t\n';var Sh=new WeakMap,Fh=new WeakMap;class Th extends s.Zb{constructor(...e){super(...e),(0,Fe.Z)(this,"contenteditable",["div.lightblock-editor-container"]),qi(this,Sh,{writable:!0,value:void 0}),qi(this,Fh,{writable:!0,value:void 0}),(0,Fe.Z)(this,"updateColor",((e=this.getValue())=>{ji(this,Sh)?.css({borderColor:e.borderColor,backgroundColor:e.backgroundColor})})),(0,Fe.Z)(this,"onChange",((e="local")=>{const t=this.editor;(0,s.iC)(t)&&"local"===e&&t.model.mutation.isStopped||(ji(this,Fh)&&clearTimeout(ji(this,Fh)),Gi(this,Fh,setTimeout((()=>{const n=this.getValue();this.updateColor(n),"local"===e&&(0,s.iC)(t)&&n&&this.setValue(n)}),50)))}))}static get cardName(){return"lightblock"}static get cardType(){return s.eT.BLOCK}static get autoSelected(){return!1}static get singleSelectable(){return!1}toolbar(){if(!(0,s.iC)(this.editor)||this.editor.readonly)return[];const e=this.getValue();return[{type:"dnd"},{type:"copy"},{type:"node",title:"主题",node:(0,s.$)(Eh),didMount:t=>{console.log("node?.get",e,t?.get()),t?.get()&&(0,It.ri)(_h,{value:e,change:t=>{this.setValue({...e,backgroundColor:t.background,borderColor:t.border}),this.updateColor()}}).mount(t.get())}},{type:"separator"},{type:"delete"}]}getValue(){const e=super.getValue(),t=ji(this,Sh)?.find(this.contenteditable.join(","));if(!t)return e;const n=this.editor,{schema:r,conversion:i}=n,o=(0,s.$)("
");o.append(t.clone(!0).children());const a=new s._b(o,n),l=a.toValue(r,i,!1,!1);return(0,s.iC)(n),{...e,html:l}}render(e){const t=this.getValue(),{borderColor:n,backgroundColor:r}=t,i=t.html?new s._b(t.html,this.editor).toValue():"
";return Gi(this,Sh,(0,s.$)(`
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
${i}
\n\t\t\t
`)),e&&setTimeout((()=>{ji(this,Sh)?.find(".lightblock-editor-container")?.get()?.focus?.()}),0),ji(this,Sh)}didRender(){super.didRender(),this.updateColor()}}var Mh=Th,Ih=n(60041),Nh=n.n(Ih);function Uh(e){const t={borderColor:"#fed4a4",backgroundColor:"#fff5eb",text:"light-block"};e.use(Nh(),"tip",{render(e,n){return 1===e[n].nesting?`
`:"
"}})}var Lh=class extends s.Sy{constructor(...e){super(...e),(0,Fe.Z)(this,"markdownIt",(e=>{!1!==this.options.markdown&&Uh(e)})),(0,Fe.Z)(this,"pasteSchema",(e=>{e.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Mh.cardName},"data-value":"*"}})})),(0,Fe.Z)(this,"pasteHtml",(e=>{const t=this.editor,n=Mh.cardName;if((0,s.iC)(t)&&!t.readonly){if(e.isElement()){const r=e.attributes("data-type");if(r===n){const r=e.attributes("data-value"),i=(0,s.RW)(r);return t.card.replaceNode(e,n,i),e.remove(),!1}}return!0}})),(0,Fe.Z)(this,"parseHtml",(e=>{const t=Mh.cardName;e.find(`[${s.Jr}="${t}"],[${s.mV}="${t}"]`).each((e=>{const n=(0,s.$)(e),r=this.editor.card.find(n),i=r?.getValue();if(i){n.empty();const e=this.renderHtml(i,t);n.replaceWith(e)}else n.remove()}))})),(0,Fe.Z)(this,"renderHtml",((e,t)=>{const n=new s._b(e.html||e.text,this.editor).toHTML();return(0,s.$)(`
${n}
`)}))}static get pluginName(){return"lightblock"}init(){const e=this.editor;e.on("parse:html",this.parseHtml),e.on("paste:schema",this.pasteSchema),e.on("paste:each",this.pasteHtml),(0,s.iC)(e)&&e.on("markdown-it",this.markdownIt)}execute(){const e=this.editor;if(!(0,s.iC)(e)||e.readonly)return;const{card:t}=e;t.insert(Mh.cardName,{borderColor:"#fed4a4",backgroundColor:"#fff5eb",text:"light-block"},!0)}destroy(){const e=this.editor;e.off("parse:html",this.parseHtml),e.off("paste:schema",this.pasteSchema),e.off("paste:each",this.pasteHtml)}};class Qh extends s.Zb{constructor(...e){super(...e),(0,Fe.Z)(this,"container",void 0),(0,Fe.Z)(this,"onBeforeRender",((e,t)=>{const n=this.editor.plugin.components["audio"];if(n){const{onBeforeRender:r}=n["options"]||{};if(r)return r(e,t)}return t})),(0,Fe.Z)(this,"downloadFile",(()=>{const e=this.getValue();e?.download&&window.open((0,s.Nm)(this.onBeforeRender("download",e.url)))}))}static get cardName(){return"audio"}static get cardType(){return s.eT.BLOCK}static get autoSelected(){return!1}getLocales(){return this.editor.language.get("audio")}renderTemplate(e){const{name:t,status:n,size:r,message:i,percent:o}=e,a=this.getLocales(),l={audio:'
\n
',spin:'',warn:'
',error:'X'};if("error"===n)return`\n
\n
\n
\n
${(0,s.YU)(t)}
\n
\n ${l.error}\n ${i||a["loadError"]}\n
\n
\n
\n
`;const c=r?(0,s.hR)(r):"";if("uploading"===n)return`\n
\n
\n
\n ${l.audio}\n
\n ${(0,s.YU)(t)} (${(0,s.YU)(c)})\n
\n
\n ${l.spin}\n ${o||0}%\n
\n
\n
\n
`;const A="undefined"===typeof n;return"transcoding"===n||A?`\n
\n
\n
\n ${l.audio}\n
\n ${(0,s.YU)(t)} (${(0,s.YU)(c)})\n
\n
\n ${l.spin}\n ${A?a["loading"]:a["transcoding"]}%\n
\n
\n
\n
\n `:'\n
\n
\n
\n '}initPlayer(){const e=this.getValue();if(!e)return;const t=(0,s.Nm)(this.onBeforeRender("query",e.url)),n=document.createElement("audio");n.preload="none",n.setAttribute("src",t),n.setAttribute("webkit-playsinline","webkit-playsinline"),n.setAttribute("playsinline","playsinline"),this.container?.find(".data-audio-content").append(n),n.oncontextmenu=function(){return!1},setTimeout((()=>{n.controls=!0}),0)}toolbar(){const e=[],t=this.getValue();if(!t)return e;const{status:n,download:r}=t,i=this.getLocales();return"done"===n&&(r&&e.push({type:"button",content:'',title:i.download,onClick:this.downloadFile}),(0,s.iC)(this.editor)&&!this.editor.readonly&&(e.push({type:"copy"}),e.push({type:"separator"}))),(0,s.iC)(this.editor)&&!this.editor.readonly&&e.push({type:"delete"}),e}setProgressPercent(e){this.container?.find(".percent").html(`${e}%`)}onActivate(e){e?this.container?.addClass("data-audio-active"):this.container?.removeClass("data-audio-active")}checker(e,t,n){const{command:r}=this.editor,i=()=>{r.executeMethod("audio-uploader","query",e,(e=>{e&&"done"!==e.status?setTimeout(i,3e3):t(e)}),(e=>{n(e)}))};i()}render(){const e=this.getValue();if(!e)return;const t=this.getCenter();t.empty();const{command:n,plugin:r}=this.editor,{audio_id:i,status:o}=e,a=this.getLocales();if((0,s.iC)(this.editor)){if("transcoding"===o){if(this.container=(0,s.$)(this.renderTemplate(e)),!i)throw"audio id is undefined";return this.checker(i,(n=>{const r={...e,url:n?.url?n.url:e.url,name:n?.name?n.name:e.name,download:n?.download?n.download:e.download,status:"done"};this.setValue(r),this.container=(0,s.$)(this.renderTemplate(r)),t.empty(),t.append(this.container),this.initPlayer()}),(n=>{const r={...e,status:"error",message:n||a["loadError"]};this.setValue(r),this.container=(0,s.$)(this.renderTemplate(r)),t.empty(),t.append(this.container)})),this.container}return"done"===o?(this.container=(0,s.$)(this.renderTemplate({...e,status:void 0})),n.executeMethod("audio-uploader","query",i,(n=>{const r={...e,url:n?.url?n.url:e.url,name:n?.name?n.name:e.name,download:n?.download?n.download:e.download};this.container=(0,s.$)(this.renderTemplate(r)),t.empty(),t.append(this.container),this.initPlayer()}),(n=>{this.container=(0,s.$)(this.renderTemplate({...e,status:"error",message:n||a["loadError"]})),t.empty(),t.append(this.container)})),this.container):(0,s.$)(this.renderTemplate(e))}if("done"===o){this.container=(0,s.$)(this.renderTemplate({...e,status:void 0}));const o=n=>{const r={...e,url:n?.url?n.url:e.url,name:n?.name?n.name:e.name,download:n?.download?n.download:e.download};this.container=(0,s.$)(this.renderTemplate(r)),t.empty(),t.append(this.container),this.initPlayer()};return r.components["audio-uploader"]?n.executeMethod("audio-uploader","query",i,(e=>{o(e)}),(n=>{this.container=(0,s.$)(this.renderTemplate({...e,status:"error",message:n||a["loadError"]})),t.empty(),t.append(this.container)})):o(),this.container}return"error"===o?(0,s.$)(this.renderTemplate({...e,message:e.message||a["loadError"]})):void 0}didRender(){super.didRender(),this.container?.on(s.tq?"touchstart":"click",(()=>{(0,s.iC)(this.editor)&&!this.activated&&this.editor.card.activate(this.root)}))}}var Dh=Qh,Hh=class extends s.Sy{constructor(...e){super(...e),(0,Fe.Z)(this,"cardComponents",{}),(0,Fe.Z)(this,"extensionNames",["mp3"])}static get pluginName(){return"audio-uploader"}init(){(0,s.iC)(this.editor)&&(this.editor.on("drop:files",(e=>this.dropFiles(e))),this.editor.on("paste:event",(({files:e})=>this.pasteFiles(e))),this.editor.on("paste:each",(e=>this.pasteEach(e))));let{accept:e}=this.options;const t=[];"string"===typeof e&&(e=e.split(",")),(e||[]).forEach((e=>{e=e.trim();const n=e.split(".").pop();n&&t.push(n)})),t.length>0&&(this.extensionNames=t)}isAudio(e){const t=(0,s.Ym)(e);return this.extensionNames.indexOf(t)>=0}async execute(e,...t){if("string"===typeof e){switch(e){case"query":return this.query(t[0],t[1],t[2])}return}const{request:n,card:r,language:i}=this.editor,{action:o,data:a,type:l,contentType:c,multiple:A,crossOrigin:u,headers:d,name:h}=this.options,{parse:p}=this.options,f=this.options.limitSize||5242880;Array.isArray(e)||(e=await n.getFiles({event:e,accept:s.Dt?"audio/*":this.extensionNames.length>0?"."+this.extensionNames.join(",."):"",multiple:A})),0!==e.length&&n.upload({url:o,data:a,type:l,contentType:c,crossOrigin:u,headers:d,onBefore:e=>!(e.size>f)||(this.editor.messageError("upload-limit",i.get("audio","uploadLimitError").toString().replace("$size",(f/1024/1024).toFixed(0)+"M")),!1),onReady:e=>{if(!(0,s.iC)(this.editor)||this.cardComponents[e.uid])return;const t=r.insert("audio",{status:"uploading",name:e.name,size:e.size});this.cardComponents[e.uid]=t},onUploading:(e,{percent:t})=>{const n=this.cardComponents[e.uid||""];n&&n.setProgressPercent(t)},onSuccess:(e,t)=>{const n=this.cardComponents[t.uid||""];if(!n)return;const i=e.id||e.data&&e.data.id,o=e.url||e.data&&e.data.url,a=e.cover||e.data&&e.data.cover,s=e.download||e.data&&e.data.download;let l=e.status||e.data&&e.data.status;l="transcoding"===l?"transcoding":"done";let c={result:!0,data:{audio_id:i,url:o,cover:a,download:s,status:l}};if(p){const t=p(e);if(t.result){let e=c.data;"string"===typeof t.data?c.data={...e,url:t.data}:(e.url=t.data.url,void 0!==t.data.status&&(e={...e,status:t.data.status}),void 0!==t.data.id&&(e={...e,audio_id:t.data.id}),c.data={...e})}else c={result:!1,data:t.data.toString()}}else o||(c={result:!1,data:e.data});c.result?this.editor.card.update(n.id,"string"===typeof c.data?{url:c.data}:{...c.data}):r.update(n.id,{status:"error",message:c.data||this.editor.language.get("audio","uploadError")}),delete this.cardComponents[t.uid||""]},onError:(e,t)=>{const n=this.cardComponents[t.uid||""];n&&(r.update(n.id,{status:"error",message:e.message||this.editor.language.get("audio","uploadError")}),delete this.cardComponents[t.uid||""])}},e,h)}query(e,t,n=(()=>{})){const{request:r}=this.editor,{query:i,parse:o}=this.options;if(!i||!e)return t();const{action:a,type:s,contentType:l,data:c}=i;r.ajax({url:a,contentType:l||"",type:void 0===s?"json":s,data:"function"===typeof c?async()=>{const t=c();return{...t,id:e}}:{...c,id:e},success:e=>{const{result:r,data:i}=e;if(r){const r=o?o(e):e;!1===r.result?n(r.data||this.editor.language.get("audio","loadError")):t({...r.data,status:"transcoding"!==r.data.status?"done":"transcoding"})}else n(i)},error:e=>{n(e.message||this.editor.language.get("audio","loadError"))},method:"GET"})}dropFiles(e){if((0,s.iC)(this.editor)&&(e=e.filter((e=>this.isAudio(e))),0!==e.length))return this.editor.command.execute("audio-uploader",e),!1}pasteFiles(e){if((0,s.iC)(this.editor)&&(e=e.filter((e=>this.isAudio(e))),0!==e.length))return this.editor.command.execute("audio-uploader",e.filter((e=>this.isAudio(e))),e),!1}pasteEach(e){if(e.isCard()&&e.attributes(s.mV)){if("audio"!==e.attributes(s.mV))return;const t=(0,s.RW)(e.attributes(s.TM));return t&&t.url?void("uploading"===t.status&&(t.percent=0,e.attributes(s.TM,(0,s.it)({...t,status:"done"})))):void e.remove()}}},Oh={audio:{errorMessageCopy:"Copy error message",loadError:"The audio failed to load!",uploadError:"The audio failed to upload!",uploadLimitError:"Upload audio size is limited to $size",download:"Download",preview:"Preview",loading:"Loading...",transcoding:"Transcoding..."}},zh={audio:{errorMessageCopy:"复制错误信息",loadError:"音频加载失败!",uploadError:"上传音频失败!",uploadLimitError:"上传音频大小限制为 $size",download:"下载",preview:"预览",loading:"加载中...",transcoding:"转码中..."}},Zh={"en-US":Oh,"zh-CN":zh};class Rh extends s.Sy{static get pluginName(){return"audio"}init(){this.editor.language.add(Zh),(0,s.iC)(this.editor)&&(this.editor.on("parse:html",(e=>this.parseHtml(e))),this.editor.on("paste:each",(e=>this.pasteHtml(e))),this.editor.on("paste:schema",(e=>this.pasteSchema(e))))}execute(e,t,n,r,i,o){const a={status:e,audio_id:r,url:t,name:n||t,size:i,download:o};"error"===e&&(a.url="",a.message=t),this.editor.card.insert("audio",a)}async waiting(e){const{card:t}=this.editor,n=e=>e.root.inEditor()&&e.constructor.cardName===Dh.cardName&&"uploading"===e.getValue()?.status,r=()=>t.components.find(n),i=t=>{let r=6e4;return new Promise(((i,o)=>{if(e){const n=e(this.constructor.pluginName,t);if(!1===n)return o({name:this.constructor.pluginName,card:t});"number"===typeof n&&(r=n)}const a=(new Date).getTime(),s=(new Date).getTime(),l=()=>{if(s-a>=r)return i();setTimeout((()=>{n(t)?l():i()}),10)};l()}))};return new Promise(((e,t)=>{const n=r(),o=n=>{i(n).then((()=>{const t=r();t?o(t):e()})).catch(t)};n?o(n):e()}))}pasteSchema(e){e.add({type:"block",name:"div",attributes:{"data-value":"*","data-type":{required:!0,value:Dh.cardName}}})}pasteHtml(e){if((0,s.iC)(this.editor)){if(e.isElement()){const t=e.attributes("data-type");if(t===Dh.cardName){const t=e.attributes("data-value"),n=(0,s.RW)(t);if(!n.url)return;return this.editor.card.replaceNode(e,Dh.cardName,n),e.remove(),!1}}return!0}}parseHtml(e){e.find(`[${s.Jr}=${Dh.cardName}`).each((e=>{const t=(0,s.$)(e),n=this.editor.card.find(t),r=n?.getValue();if(r?.url&&"done"===r.status){const{onBeforeRender:e}=this.options,{url:n}=r,i=`
`;t.empty(),t.replaceWith((0,s.$)(i))}else t.remove()}))}}const Ph={id:"draw-view"},qh={key:0,class:"draw-view",ref:"xmlContainer"};function Kh(e,t,n,r,i,o){const a=(0,Ft.up)("Spin");return(0,Ft.wg)(),(0,Ft.iD)("div",Ph,[(0,Ft.Wm)(a,{spinning:e.loading,tip:"资源加载中..."},null,8,["spinning"]),e.loading?(0,Ft.kq)("",!0):((0,Ft.wg)(),(0,Ft.iD)("div",qh,null,512))])}var Wh=n(82450);const jh='\n\n \n \n \n \n \n \n \n \n \n \n \n\n',Vh=e=>{if(!e)return null;try{const t=new XMLSerializer;return t.serializeToString(e)}catch(t){return console.log("XmlToString Error: ",t),null}},Gh=e=>{try{const t=new DOMParser;return t.parseFromString(e,"text/xml")}catch(t){return console.log("StringToXml Error: ",t),null}};let $h=null;const Yh=()=>$h?Promise.resolve($h):n.e(617).then(n.bind(n,43617)).then((e=>($h=e,e)));var Xh=(0,Ft.aZ)({name:"draw-view",components:{Spin:Wh.Z},props:{value:{type:String,default:jh}},setup(e){const{value:t}={...e},n=(0,Tt.iH)(!0),r=(0,Tt.iH)(t),i=(0,Tt.iH)(null);(0,Ft.YP)(r,(()=>o())),(0,Ft.bv)((()=>{Yh().then((()=>{setTimeout((()=>{n.value=!1,(0,Ft.Y3)((()=>o()))}),400)}))}));const o=(e=r.value)=>{const t=i.value;t&&Yh().then((n=>{const r=new n.DiagramViewer(Gh(e)),i=r.renderSVG(null,1,1);i&&t.appendChild(i)}))};return{loading:n,xmlContainer:i}}});const Jh=(0,Nu.Z)(Xh,[["render",Kh]]);var ep=Jh;const tp={id:"draw-edit"},np={key:0};function rp(e,t,n,r,i,o){return(0,Ft.wg)(),(0,Ft.iD)("div",tp,[e.loading?((0,Ft.wg)(),(0,Ft.iD)("div",np,"资源加载中...")):(0,Ft.kq)("",!0)])}var ip=(0,Ft.aZ)({name:"draw-edit",components:{},props:{value:{type:String,default:jh},change:{type:Function,default:null}},setup(e){const{value:t,change:n}={...e};let r=null;const i=(0,Tt.iH)(!0),o=(0,Tt.iH)(t);(0,Ft.bv)((()=>{Yh().then((e=>{setTimeout((()=>{i.value=!1,a()}),400)}))}));const a=()=>{Yh().then((e=>{const t=e=>{const t=document.createElement("div");t.innerText="保存",t.style.marginRight="20px",t.onclick=s,e.appendChild(t)},n=document.body;r=new e.DiagramEditor(n,t),e.getLanguage("zh").then((e=>{r.start(e,Gh(o.value),(e=>{const t=Vh(e);o.value=t||""}))}))}))},s=()=>{r&&r.exit(),n&&n(o.value)};return{loading:i,xmlExample:o}}});const op=(0,Nu.Z)(ip,[["render",rp]]);var ap=op;const sp='\n \n \n \n';var lp=new WeakMap;class cp extends s.Zb{constructor(...e){super(...e),(0,Fe.Z)(this,"renderBefore",void 0),qi(this,lp,{writable:!0,value:void 0}),(0,Fe.Z)(this,"vm",void 0),(0,Fe.Z)(this,"resize",(()=>{const e=this.getValue();if(e?.isResize)return ji(this,lp)?.parent()}))}static get cardName(){return"draw"}static get cardType(){return s.eT.BLOCK}static get lazyRender(){return!0}static get singleSelectable(){return!1}static get autoSelected(){return!1}toolbar(){const e=()=>{if((0,s.iC)(this.editor)&&!this.editor.readonly){const e=[{type:"dnd"},{type:"node",node:(0,s.$)(sp),didMount:e=>{e?.get()&&e.on("click",(()=>{const t=this.getValue();(0,It.ri)(ap,{value:t.xml,change:e=>{this.setValue({...t,xml:e}),this.didRender()}}).mount(e.get())}))}},{type:"copy"},{type:"separator"},{type:"delete"}];return e}return[]};return e()}renderContainer(){const e=this.getValue(),t=e?.height||"auto",n=(0,s.$)(`\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n
\n \n \n \n\t\t\t\t
\n\t\t\t
\n\t\t`),r=n.find(".data-draw-content"),i=n.find(".data-draw-maximize");return i.on("click",(()=>{const e=this.getValue();Cu.Z.confirm({icon:null,content:(0,Ft.Wm)(ep,{value:e.xml}),wrapClassName:"draw-full-modal",width:"100%",cancelText:"关 闭",closable:!0})})),e?.height&&r.attributes("data-height",e.height),Gi(this,lp,r),n}render(e){this.renderBefore=e;const t=this.getCenter();t.empty(),t.append(this.renderContainer())}didRender(){super.didRender();const e=this.getValue();this.vm=(0,It.ri)(ep,{value:e.xml}),this.vm.mount(ji(this,lp)?.get())}destroy(){super.destroy(),this.vm?.unmount(),this.vm=void 0}}var Ap=cp,up=class extends s.Sy{static get pluginName(){return"draw"}init(){this.editor.on("paser:html",(e=>this.parseHtml(e))),this.editor.on("paste:schema",(e=>this.pasteSchema(e))),this.editor.on("paste:each",(e=>this.pasteHtml(e)))}execute(){if(!(0,s.iC)(this.editor))return;const{card:e}=this.editor;e.insert(Ap.cardName)}hotkey(){return this.options.hotkey||"mod+shift+0"}pasteSchema(e){e.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Ap.cardName},"data-value":"*"}})}pasteHtml(e){if((0,s.iC)(this.editor)){if(e.isElement()){const t=e.attributes("data-type");if(t===Ap.cardName){const t=e.attributes("data-value"),n=(0,s.RW)(t);return this.editor.card.replaceNode(e,Ap.cardName,n),e.remove(),!1}}return!0}}parseHtml(e){e.find(`[${s.Jr}=${Ap.cardName}`).each((e=>{const t=(0,s.$)(e),n=this.editor.card.find(t),r=n?.getValue();if(r){t.empty();const e=(0,s.$)(`
`);t.replaceWith(e)}else t.remove()}))}},dp={"en-US":{tag:{defaultTag:"Default Tag",customTag:"Custom Tag",historyTag:"History Tag",placeholder:"Press Enter to confirm",addTag:"Add Tag",abandon:"Abandon",must:"Require",add:"Add",delete:"Delete"}},"zh-CN":{tag:{defaultTag:"默认标签",customTag:"自定义标签",historyTag:"历史标签",placeholder:"输入标签内容, 回车确认",addTag:"请添加标签",abandon:"废弃",must:"必填",add:"添加",delete:"删除"}}},hp=n(25431);const pp=[{type:"abandon",background:"#FFE8E6",color:"#820014",text:"废弃"},{type:"must",background:"#ebf3ff",color:"#338aff",text:"必填"},{type:"add",background:"#d8eecd",color:"#5ca537",text:"新增"},{type:"delete",background:"#ffe9bc",color:"#dc9300",text:"删除"}],fp=(e,t,n)=>{const{tagType:r,tagValue:i,isCustom:o}=t,a=e.find((e=>e.type===r))||e[0];return o?{...a,text:i||n["addTag"],isCustom:!0}:{...a,text:r?a.type:n["addTag"],isCustom:!1}};var gp=(0,Ft.aZ)({name:"tag-comp",props:{value:{type:Object,required:!0},editor:{type:Object,required:!0},defaultVisible:{type:Boolean,required:!1},change:{type:Function}},setup(e){const{value:t,editor:n,defaultVisible:r,change:i}=(0,Tt.IU)(e),{tagType:o,tagValue:a,isCustom:s}=t,l=n.language.get("tag"),c=pp.map((e=>({...e,text:l[e.type]}))),A=fp(c,t,l),u=s?a:"",d=(0,Tt.iH)(o);let h=(0,Tt.qj)(A);const p=(0,Tt.iH)(u),f=(0,Tt.iH)(r),g=()=>{f.value=!1},m=e=>{f.value=e},v=e=>{d.value=e.type,p.value="",h=(0,Tt.qj)({...e,isCustom:!1}),i&&(i(h),g())},b=e=>{d.value=e.type,h=(0,Tt.qj)({...e,text:p.value,isCustom:!0}),i&&i(h)},y=e=>{p.value=e.target.value||"",h.isCustom=!0},w=()=>{d.value=h.type||"abandon",h=(0,Tt.qj)({...h,text:p.value}),i&&(i(h),g())};return()=>(0,Ft.Wm)(hp.Z,{visible:f.value,trigger:"click",placement:"bottomLeft",overlayClassName:"tag-plugin-tooltip",onVisibleChange:m,overlayStyle:{padding:0,boxShadow:"0px 2px 4px 0px rgba(225 225 225, .5)"},content:(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-contain"},[(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-default"},[(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-title"},[l["defaultTag"]]),c.map((e=>(0,Ft.Wm)("span",{key:e.type,style:{minWidth:22,color:e.color,background:e.background},onClick:()=>v(e)},[d.value===e.type&&!h.isCustom&&(0,Ft.Wm)("svg",{width:12,height:12,fill:e.color,viewBox:"0 0 18 18",style:{marginRight:2}},[(0,Ft.Wm)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null)]),e.text])))]),(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-custom"},[(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-title"},[l["customTag"]]),(0,Ft.Wm)("div",{class:"tag-plugin-tooltip-custom-theme"},[c.map((e=>(0,Ft.Wm)("span",{key:e.type,style:{color:e.color,background:e.background},onClick:()=>{b(e)}},[d.value===e.type&&h.isCustom&&(0,Ft.Wm)("svg",{width:12,height:12,fill:e.color,viewBox:"0 0 18 18",style:{marginRight:2}},[(0,Ft.Wm)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null)])])))]),(0,Ft.Wm)(Ut.ZP,{size:"small",value:p.value,placeholder:l["placeholder"],onChange:y,onPressEnter:w},null)])])},{default:()=>[(0,Ft.Wm)("div",{class:"tag-plugin-contain",style:{color:h.color,background:h.background}},[h.text||l["addTag"]])]})}}),mp=new WeakMap;class vp extends s.Zb{constructor(...e){super(...e),qi(this,mp,{writable:!0,value:void 0}),(0,Fe.Z)(this,"vm",void 0),(0,Fe.Z)(this,"defaultVisible",!1)}static get cardName(){return"tag"}static get cardType(){return s.eT.INLINE}static get autoSelected(){return!1}static get singleSelectable(){return!1}static get selectStyleType(){return s.dw.BACKGROUND}render(e){return Gi(this,mp,(0,s.$)("
Loading
")),this.defaultVisible=e??!1,ji(this,mp)}didRender(){super.didRender();const e=this.getValue(),{editor:t}=this;setTimeout((()=>{this.vm=(0,It.ri)(gp,{value:e,editor:t,defaultVisible:this.defaultVisible,change:e=>{this.setValue({tagType:e.type,tagValue:e.text,isCustom:e.isCustom})}}),this.vm.mount(ji(this,mp)?.get())}),20)}destroy(){super.destroy(),this.vm?.unmount(),this.vm=void 0}}var bp=vp,yp=class extends s.Sy{constructor(...e){super(...e),(0,Fe.Z)(this,"pasteSchema",(e=>{e.add({type:"inline",name:"span",attributes:{"data-type":{required:!0,value:bp.cardName},"data-value":"*"}})})),(0,Fe.Z)(this,"pasteHtml",(e=>{const{editor:t}=this;if((0,s.iC)(t)&&!t.readonly){if(e.isElement()){const n=e.attributes("data-type");if(n===bp.cardName){const n=e.attributes("data-value"),r=(0,s.RW)(n);return t.card.replaceNode(e,bp.cardName,r),e.remove(),!1}}return!0}})),(0,Fe.Z)(this,"parseHtml",(e=>{const t=bp.cardName;e.find(`[${s.Jr}="${t}"],[${s.mV}="${t}"]`).each((e=>{const n=(0,s.$)(e),r=this.editor.card.find(n),i=r?.getValue();if(i){n.empty();const e=i.tagValue?"":"qz-tag-hide",r=pp.find((e=>e.type===i.tagType))||pp[0],o=(0,s.$)(`${i.isCustom?i.tagValue||"请添加标签":r.text}
`);n.replaceWith(o)}else n.remove()}))}))}static get pluginName(){return"tag"}init(){const{editor:e}=this;e.language.add(dp),e.on("parse:html",this.parseHtml),e.on("paste:schema",this.pasteSchema),e.on("paste:each",this.pasteHtml)}execute(){const{editor:e}=this;if(!(0,s.iC)(e)||e.readonly)return;const{card:t}=e;t.insert(bp.cardName,{tagType:"",tagValue:"",isCustom:!1},!0)}hotkey(){return this.options.hotkey||""}destroy(){const{editor:e}=this;e.off("parse:html",this.parseHtml),e.off("paste:schema",this.pasteSchema),e.off("paste:each",this.pasteHtml)}};const wp=(0,Ft._)("div",null,"This is test plugin",-1),xp=[wp];function kp(e,t){return(0,Ft.wg)(),(0,Ft.iD)("div",null,xp)}const Cp={},Bp=(0,Nu.Z)(Cp,[["render",kp]]);var _p=Bp,Ep=new WeakMap,Sp=new WeakMap;class Fp extends s.Zb{constructor(...e){super(...e),qi(this,Ep,{writable:!0,value:void 0}),qi(this,Sp,{writable:!0,value:void 0})}static get cardName(){return"test"}static get cardType(){return s.eT.BLOCK}toolbar(){return!(0,s.iC)(this.editor)||this.editor.readonly?[]:[{type:"dnd"},{type:"copy"},{type:"delete"},{type:"node",node:(0,s.$)("测试按钮"),didMount:e=>{e.on("click",(()=>{alert("test button")}))}}]}render(){return Gi(this,Ep,(0,s.$)("
Loading
")),ji(this,Ep)}didRender(){super.didRender(),Gi(this,Sp,(0,It.ri)(_p,{})),ji(this,Sp).mount(ji(this,Ep)?.get())}destroy(){super.destroy(),ji(this,Sp)?.unmount()}}var Tp=Fp,Mp=class extends s.Sy{static get pluginName(){return"test"}init(){this.editor.on("paser:html",(e=>this.parseHtml(e))),this.editor.on("paste:schema",(e=>this.pasteSchema(e))),this.editor.on("paste:each",(e=>this.pasteHtml(e)))}execute(){if(!(0,s.iC)(this.editor))return;const{card:e}=this.editor;e.insert(Tp.cardName)}hotkey(){return this.options.hotkey||"mod+shift+0"}pasteSchema(e){e.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Tp.cardName},"data-value":"*"}})}pasteHtml(e){if((0,s.iC)(this.editor)){if(e.isElement()){const t=e.attributes("data-type");if(t===Tp.cardName){const t=e.attributes("data-value"),n=(0,s.RW)(t);return this.editor.card.replaceNode(e,Tp.cardName,n),e.remove(),!1}}return!0}}parseHtml(e){e.find(`[${s.Jr}=${Tp.cardName}`).each((e=>{const t=(0,s.$)(e),n=this.editor.card.find(t),r=n?.getValue();if(r){t.empty();const e=(0,s.$)(`
`);t.replaceWith(e)}else t.remove()}))}},Ip=n(46194),Np=n(73057),Up=n(43693);const Lp={class:"mention-container"},Qp=(0,Ft._)("p",null,"配置 mention 插件的 onMouseEnter 方法",-1),Dp=(0,Ft._)("p",null,"此处使用 createApp().mount 自定义渲染",-1),Hp=(0,Ft._)("p",null,"Use createApp().mount to customize rendering here",-1);function Op(e,t,n,r,i,o){return(0,Ft.wg)(),(0,Ft.iD)("div",Lp,[(0,Ft._)("p",null,"This is name: "+(0,Mt.zw)(e.name),1),Qp,Dp,Hp])}var zp=(0,Ft.aZ)({name:"am-mention",props:{name:String}});const Zp=(0,Nu.Z)(zp,[["render",Op]]);var Rp=Zp;const Pp="";let qp=localStorage.getItem("token");qp=JSON.parse(qp||"{}");const Kp=[c,u,g,x,C,_,N,Q,H,j,ke,Be,Se,Qe,De.Z,ze,Ke,$e,Je,at,ft,yt,xt,Bt,tn,In,sr,nr,ui,Ei,bi,Ri,Ui,zu,Ip.Mq,qu,ld,dd,Rd,th,ch,Lh,Rh,Hh,up,yp,Mp],Wp=[Z,fe,xn,Gn,oi,fi,Ti,Ou,Ip.nV,ed,Td,jd,Mh,Dh,Ap,bp,Tp];let jp=null;const Vp=e=>{jp=e},Gp={[ch.pluginName]:{keys:["mark"],onChange:(e,t)=>{e["comment"],t["comment"]},onSelect:(e,t)=>{const{key:n,id:r}=t||{};jp?.command.executeMethod("mark-range","action","comment","revoke"),"mark"===n&&r&&jp?.command.executeMethod("mark-range","action",n,"preview",r)}},[Q.pluginName]:{markdown:"*"},[nr.pluginName]:{file:{action:`${Pp}/resource/upload`,crossOrigin:!1,headers:{Authorization:`${qp}`},limitSize:52428800},remote:{action:`${Pp}/resource/upload`},isRemote:e=>e.indexOf(Pp)<0,parse:e=>{const t={};return"success"==e.msg?(t.result=!0,t.data=`${Pp}/file-bucket/${e.data.diskname}`):(t.result=!1,t.data=e.message||e.data.message),t}},[sr.pluginName]:{onBeforeRender:(e,t)=>t.startsWith("data:image/")?t:`${t}`},[bi.pluginName]:{action:`${Pp}/resource/upload`,crossOrigin:!1,headers:{Authorization:`${qp}`},parse:e=>{const t={data:{}};return"success"==e.msg?(t.result=!0,t.data.url=`${Pp}/file-bucket/${e.data.diskname}`,t.data.preview=`${Pp}/file-bucket/${e.data.diskname}`,t.data.download=`${Pp}/file-bucket/${e.data.diskname}`):(t.result=!1,t.data=e.message||e.data.message),t}},[Ei.pluginName]:{onBeforeRender:(e,t)=>t},[Ui.pluginName]:{action:`${Pp}/resource/upload`,crossOrigin:!1,headers:{Authorization:`${qp}`},limitSize:52428800,parse:e=>{const t={};return"success"==e.msg?(t.result=!0,t.data=`${Pp}/file-bucket/${e.data.diskname}`):(t.result=!1,t.data=e.message||e.data.message),t}},[Ri.pluginName]:{onBeforeRender:(e,t)=>t},[Hh.pluginName]:{action:`${Pp}/resource/upload`,crossOrigin:!1,headers:{Authorization:`${qp}`},limitSize:52428800,parse:e=>{const t={};return"success"==e.msg?(t.result=!0,t.data=`${Pp}/file-bucket/${e.data.diskname}`):(t.result=!1,t.data=e.message||e.data.message),t}},[Rh.pluginName]:{onBeforeRender:(e,t)=>`${t}`},[zu.pluginName]:{action:`${Pp}/latex`,parse:e=>e.success?{result:!0,data:e.svg}:{result:!1,data:""}},[Rd.pluginName]:{action:`${Pp}/user/search`,onLoading:e=>{const t=(0,It.ri)(Up.Z);t.mount(e.get())},onEmpty:e=>{const t=(0,It.ri)(Np.Z);t.mount(e.get())},onClick:(e,{key:t,name:n})=>{console.log("mention click:",t,"-",n)},onMouseEnter:(e,{name:t})=>{const n=(0,It.ri)(Rp,{name:t});n.mount(e.get())}},[N.pluginName]:{filter:e=>["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"].indexOf(e)>-1},[qu.pluginName]:{filter:e=>{const t=Ip.F7.find((t=>e.split(",").some((e=>t.value.toLowerCase().indexOf(e.replace(/"/,"").toLowerCase())>-1))));return!!t&&t.value}},[dd.pluginName]:{filter:e=>"14px"===e?"1":"16px"===e?"1.15":"21px"===e?"1.5":"28px"===e?"2":"35px"===e?"2.5":"42px"===e?"3":["1","1.15","1.5","2","2.5","3"].indexOf(e)>-1}}},41127:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(73396),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},o=i,a=n(9388);function s(e){for(var t=1;t0?e-1:e,t?t[e]:void 0}},{key:"resize",value:function(e,t){if(this.width!==e||this.height!==t){this.width=e,this.height=t;var n=this.options,r=n.limitHeight,i=n.canvasCount,o=n.container,a=this.options.canvasCache,s=Math.ceil(t/(r||0));if(s!==i){this.removeCanvas(),a=[];for(var l=0;l0&&void 0!==arguments[0]?arguments[0]:5;e<5&&(e=5);for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r1&&void 0!==arguments[1]?arguments[1]:r.LOWER;return~e.indexOf("-")?e.split("-").map((function(e,n){return"upper"===t||n>0?e.charAt(0).toUpperCase()+e.substr(1):"lower"===t&&0===n?e.charAt(0).toLowerCase()+e.substr(1):e})).join(""):e},Ze=function(e){var t=function(e){var t=parseInt(e,10).toString(16).toUpperCase();return t.length>1?t:"0"+t},n=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi;return e.replace(n,(function(e,n,r,i){return"#"+t(n)+t(r)+t(i)}))},Re=function(e){var t,n={},r=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g;while(t=r.exec(e)){var i=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),o=(t[2]?t[3]:t[4]?t[5]:t[7])||"";n[i]=o}return n},Pe=new Map,qe=function(e){var t=e.replace(/\s+/g,""),n={};if(!t)return n;var r=Pe.get(t);if(r)return Object.assign({},r);var i,o=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;e=e.toLowerCase();while(i=o.exec(e)){var a=i,s=(0,w.Z)(a,3),l=(s[0],s[1]),c=s[2];(l.endsWith("color")||c.includes("rgb"))&&(c=Ze(c)),n[l.trim()]=c.trim()}return Pe.set(t,n),Object.assign({},n)},Ke=function(e,t){var n=ze(t),r=window.getComputedStyle(e,null);return r?r[n]:""},We=function(e){return(e||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},je=function(e){return(e||"").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return e&&/^-?\d+(?:\.\d+)?$/.test(e.toString())?e+t:e},Ge=function(e){var t;return e&&(t=/^((-?\d+)(\.\d+)?)/.exec(e))?Math.floor(1e4*parseFloat(t[1]))/1e4:0},$e=function(e){var t="";try{t=encodeURIComponent(JSON.stringify(e||""))}catch(n){}return"data:".concat(t)},Ye=function(e){try{return e=e.substr(5),JSON.parse(decodeURIComponent(e))}catch(t){return{}}},Xe=function(e){return e.replace(//gi,"')).replace(//gi,"')).replace(//gi,"')).replace(/(]+>).*?<\/card>/gi,(function(e,t){var n=Re(t),r=n.type,i=n.name,o=n.value,a=n.editable,s="inline"===r,l=s?"span":"div",c=["<".concat(l)];return c.push(" ".concat(me,'="').concat(r||"",'"')),c.push(" ".concat(ge,'="').concat(i||"",'"')),""!==a&&c.push(" ".concat(we,'="').concat(a||"false",'"')),Object.keys(n).forEach((function(e){0===e.indexOf("data-")&&0!==e.indexOf("data-card")&&c.push(" ".concat(e,'="').concat(n[e]||"",'"'))})),void 0!==o&&c.push(" ".concat(ve,'="').concat(o,'"')),c.push(">")),c.join("")}))},Je=function(e){return"string"===typeof e&&(e=e.toLowerCase(),!e.startsWith("data:text/html")&&(!!e.match(/^\S*$/)&&(!!["http:","https:","data:","ftp:"].some((function(t){return e.startsWith(t)}))||(!(!e.startsWith("./")&&!e.startsWith("/"))||e.indexOf(":")<0))))},et=function(e){return Je(e)?e:""},tt=function(e){var t=e.toLowerCase().split("+");return t=t.map((function(e){return"mod"===e?De?"⌘":"Ctrl":"opt"===e?De?"Option":"Alt":e.length>1?e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase():e.toUpperCase()})),t.join("+")},nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t=+t))return"•";switch(null===e||void 0===e?void 0:e.toLowerCase()){case"disc":return"•";case"circle":return"◦";case"square":return"◼";case"lower-alpha":return String.fromCharCode("a".charCodeAt(0)+t);case"lower-roman":return String.fromCharCode(8559+t);case"decimal":default:return t}},rt=function(e){if("undefined"===typeof document&&"undefined"===typeof n.g["__amWindow"])throw"document is not defined,If you are using ssr, you can assign a value to the `__amWindow` global variable.";return e?e.ownerDocument||e["document"]||e:"undefined"===typeof document?n.g["__amWindow"].document:document},it=function(e){e instanceof Node||(e=e[0]),e.normalize()},ot=function e(t,n){var r=[];if(n&&!n(t))return r;for(var i=t.childNodes,o=0;o1&&void 0!==arguments[1]?arguments[1]:"default",n=new(y())(t,{html:!0,typographer:!0,linkify:!0});return e.trigger("markdown-it",n),n},At=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=t.renderer,o=t.options,a=!1,s=e.schema.getTags("blocks"),l="",c=[];return n.forEach((function(A,u){var d=A.type,h=A.tag,p=A.children,f=A.nesting,g=e.trigger("markdown-it-token",{token:A,markdown:t,callback:function(e){l+=e}});if(!1!==g){var m,v="";if("inline"===d&&p)v=null!==(m=i.renderInline(p,o,{}))&&void 0!==m?m:"",r&&p.find((function(e){return"image"===e.type||e.type.endsWith("_inline")||e.type.endsWith("_open")}))&&(a=!0);else if("undefined"!==typeof i.rules[d]){var b;v=null!==(b=i.rules[d](n,u,o,{},i))&&void 0!==b?b:""}else{var y;v=null!==(y=i.renderToken(n,u,o))&&void 0!==y?y:""}if(1===f)c.push(""),l+=v;else if(0===f)0===c.length?(l+=v,h&&!a&&(a=!0)):v&&(c[c.length-1]+=v);else if(-1===f){var w;c.length>0&&!c[c.length-1]&&s.includes(h)&&(c[c.length-1]+="
"),l+=null!==(w=c[c.length-1])&&void 0!==w?w:"",c.pop(),c.every((function(e){return!e}))&&(c=[]),l+=v,a||"p"===h||(a=!0)}}else a=!0})),a&&l?l:null},ut="data-uuid",dt="data-color",ht=function(){function e(){(0,l.Z)(this,e),this.listeners={}}return(0,c.Z)(e,[{key:"on",value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),"object"===(0,o.Z)(n)&&n.once||this.listeners[e].push(t)}},{key:"off",value:function(e,t){var n=this.listeners[e];if(n)for(var r=0;r1?t-1:0),r=1;r=0&&(null===r||void 0===r?void 0:r.item(i))!==e);return i>-1},r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.matchesSelector||n;return r.call(e,t)},vt=function(e){return e.nodeName===pe||!!e.getAttribute(me)},bt=function(e){return"block"===e.getAttribute(me)},yt=function(e){return"inline"===e.getAttribute(me)},wt=function(e){return e.getAttribute(G)===te||"true"===e.getAttribute(we)||!!(null===e||void 0===e?void 0:e.querySelector(ne))},xt=function(e,t){return e.getAttribute(G)===Y&&(!t||e===t)},kt=function(e){return xt(e)||e.getAttribute(G)===te},Ct=function(e,t){if(e.nodeType===Node.ELEMENT_NODE&&xt(e,t))return!1;var n=_t(e,X);return!!n&&(!t||n===t)},Bt=function(e){var t=e.getAttribute(G);return!!t&&[le,ce,Ae].indexOf(t)>-1},_t=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e.parentElement||void 0},r=e||void 0;while(r){if(mt(r,t))return r;r=n(r)}return r},Et=new Map;function St(e,t){if(!e)return[];if("string"===typeof e){var n=!1;if(!t||(n=/<[^>]+>/g.test(e))){var r=0===e.indexOf("]*-->/g,"");var o=Et.get(e);if(o){if(r){var a=o.querySelector("tbody");return a?a.cloneNode(!0).childNodes:[]}if(i){var s=o.querySelector("tr");return s?s.cloneNode(!0).childNodes:[]}return o.cloneNode(!0).childNodes}r&&(e="".concat(e,"
")),i&&(e="".concat(e,"
"));var l=rt().createElement("div");if(l.innerHTML=e,Et.set(e,l.cloneNode(!0)),r){var c=l.querySelector("tbody");return c?c.childNodes:[]}if(i){var A=l.querySelector("tr");return A?A.childNodes:[]}return l.childNodes}return t.querySelectorAll(e)}if(ft(e)||Array.isArray(e))return e;if(pt(e)){var u=[];return e.each((function(e){u.push(e)})),u}if(gt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var d,h=[],p=(0,k.Z)(e.childNodes);try{for(p.s();!(d=p.n()).done;){var f=d.value;h.push(f)}}catch(g){p.e(g)}finally{p.f()}return h}return[e]}var Ft,Tt,Mt,It,Nt=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this.events=[],this.document=null,this.context=void 0,this.name="",this.type=void 0,this.window=null,this.display=void 0,this.fragment=void 0,gt(t)&&(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(this.fragment=t),t=[t]),t.forEach((function(e,t){r[t]=e,r.events[t]=new ht}));var i=this[0];if(i){this.document=rt(n),this.context=n;var o=i.nodeName,a=i.nodeType;this.name=o.toLowerCase(),this.type=a,this.window=this.document.defaultView||window}}return(0,c.Z)(e,[{key:"length",get:function(){var e=0;while(this[e])e++;return e}},{key:"each",value:function(e){var t,n=0;while(t=this[n]){if(!1===e(t,n))break;n++}return this}},{key:"toArray",value:function(){var t=[];return this.each((function(n){t.push(new e(n))})),t}},{key:"isElement",value:function(){return this.type===Node.ELEMENT_NODE}},{key:"isText",value:function(){return this.type===Node.TEXT_NODE}},{key:"isCard",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&vt(e)}},{key:"isBlockCard",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&bt(e)}},{key:"isInlineCard",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&yt(e)}},{key:"isEditableCard",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&wt(e)}},{key:"isRoot",value:function(e){var t,n=this.get();return(null===n||void 0===n?void 0:n.nodeType)===Node.ELEMENT_NODE&&xt(n,e?null!==(t=e[0])&&void 0!==t?t:e:void 0)}},{key:"isEditable",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&kt(e)}},{key:"inEditor",value:function(e){var t,n=this.get();return!!n&&Ct(n,e?null!==(t=e[0])&&void 0!==t?t:e:void 0)}},{key:"isCursor",value:function(){var e=this.get();return(null===e||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE&&Bt(e)}},{key:"get",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0===this.length?null:this[e]}},{key:"eq",value:function(t){return t>-1&&t0){var i=this.getIndex(t);if(n){var o=n(i,r,this);o&&(r=o)}else r.unshift(i)}if(this.equal(e))return r;var a=this.parent();while(a&&!a.equal(e)){var s=a.getIndex(t);if(n){var l=n(s,r,a);l&&(r=l)}else r.unshift(s);a=a.parent()}return r}},{key:"contains",value:function(e){var t,n=gt(e)?e:e.get();if(0===this.length)return!1;if(this.get().nodeType===Node.DOCUMENT_NODE&&(null===(t=n)||void 0===t?void 0:t.nodeType)!==Node.DOCUMENT_NODE)return!0;if(n===this[0])return!0;while(n=(null!==(r=null===(i=n)||void 0===i?void 0:i.parentElement)&&void 0!==r?r:null===(o=n)||void 0===o?void 0:o.parentNode)||null){var r,i,o;if(n===this[0])return!0}return!1}},{key:"find",value:function(t){if(this.length>0&&(this.isElement()||this.fragment)){var n,r=null===(n=this.fragment?this.fragment:this.get())||void 0===n?void 0:n.querySelectorAll(t);return new e(r||[])}return new e([])}},{key:"closest",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){var t;return null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode||void 0},r=[],i=this.get()||void 0;while(i){if(mt(i,t))return r.push(i),new e(r);i=n(i)}return new e(r)}},{key:"on",value:function(e,t,n){var r=this;return this.each((function(i,o){i.addEventListener(e,t,n),r.events[o]&&r.events[o].on(e,t,n)})),this}},{key:"off",value:function(e,t,n){var r=this;return this.each((function(i,o){i.removeEventListener(e,t,n),r.events[o]&&r.events[o].off(e,t,n)})),this}},{key:"getBoundingClientRect",value:function(e){if(0!==this.length){try{var t=this.get(),n=t.getBoundingClientRect(),r=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:n.top-r,bottom:n.bottom-r,left:n.left-i,right:n.right-i}}catch(o){console.error(o)}return e}}},{key:"removeAllEvents",value:function(){var e=this;return this.each((function(t,n){e.events[n]&&Object.keys(e.events[n].listeners).forEach((function(r){for(var i=e.events[n].listeners[r],o=0;o0&&this.isElement()&&(null===A||void 0===A?void 0:A.getAttribute(e))||""}var u="style"===e&&""===t;return this.each((function(n){n instanceof Element&&(u?n.removeAttribute("style"):n.setAttribute(e,t.toString()))})),this}},{key:"removeAttributes",value:function(e){return this.each((function(t){t instanceof Element&&t.removeAttribute(e)})),this}},{key:"hasClass",value:function(e){if(0===this.length)return!1;var t=this.get();if(!t)return!1;var n=0,r=null,i=t.classList||{};while(r=i[n]){if(r===e)return!0;n++}return!1}},{key:"addClass",value:function(e){return this.each((function(t){t instanceof Element&&t.classList.add(e)})),this}},{key:"removeClass",value:function(e){return this.each((function(t){t instanceof Element&&t.classList.remove(e)})),this}},{key:"css",value:function(e,t){if(void 0===e)return qe(this.attributes("style")||"");if("object"===(0,o.Z)(e)){for(var n in e){var r=e[n];this.css(n,r)}return this}if(void 0===t){if(0===this.length||this.isText())return"";var i=this.get();return i&&(i.style[ze(e)]||Ke(this[0],e))||""}return this.each((function(n){var r=n;r.style[ze(e)]=t.toString(),0===r.style.length&&r.removeAttribute("style")})),this}},{key:"width",value:function(){var e=this.css("width");if("auto"===e){var t=this.get();e=t.offsetWidth.toString()}return e&&Ge(e)||0}},{key:"height",value:function(){var e=this.css("height");if("auto"===e){var t=this.get();e=t.offsetHeight.toString()}return e&&parseFloat(e)||0}},{key:"html",value:function(e){if(void 0!==e){var t=St(e);return this.each((function(e){if(e.nodeType===Node.ELEMENT_NODE){var n=e.firstChild;while(n){var r=n.nextSibling;e.removeChild(n),n=r}t.forEach((function(t){e.appendChild(t.cloneNode(!0))}))}})),this}return this.length>0&&this[0]instanceof Element?this[0].innerHTML:""}},{key:"text",value:function(e){var t;return void 0!==e?(this.each((function(t){t.textContent=e})),this):0===this.length?"":(null===(t=this.get())||void 0===t?void 0:t.textContent)||""}},{key:"show",value:function(e){return void 0===e&&(e=this.display||""),"none"===e&&(e=""),"none"!==this.css("display")?this:this.css("display",e)}},{key:"hide",value:function(){var e;return 0===this.length?this:(this.display=null===(e=this.get())||void 0===e?void 0:e.style.display,this.css("display","none"))}},{key:"remove",value:function(){var e=this;return this.each((function(t,n){var r,i=null!==(r=t.parentElement)&&void 0!==r?r:t.parentNode;i&&(i.removeChild(t),delete e[n])})),this}},{key:"empty",value:function(){return this.each((function(e){var t=e.firstChild;while(t){var n=t.nextSibling;e.removeChild(t),t=n}})),this}},{key:"equal",value:function(e){return gt(e)?this.get()===e:!!pt(e)&&this.get()===e.get()}},{key:"clone",value:function(t){var n=[];return this.each((function(e){n.push(e.cloneNode(t))})),new e(n)}},{key:"prepend",value:function(e){var t=St(e,this.context),n="string"===typeof e&&/<.+>/.test(e);return this.each((function(e){for(var r=t.length-1;r>=0;r--){var i=n?t[r].cloneNode(!0):t[r];e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}})),this}},{key:"append",value:function(e){var t=St(e,this.context),n="string"===typeof e&&/<.+>/.test(e);return this.each((function(r){for(var i=0;i/.test(e);return this.each((function(e){var r,i=null!==(r=e.parentElement)&&void 0!==r?r:e.parentNode;i&&t.forEach((function(t){n&&(t=t.cloneNode(!0)),i.insertBefore(t,e),e=t}))})),this}},{key:"after",value:function(e){var t=St(e,this.context),n="string"===typeof e&&/<.+>/.test(e);return this.each((function(e){var r,i=null!==(r=e.parentElement)&&void 0!==r?r:e.parentNode;i&&t.forEach((function(t){n&&(t=t.cloneNode(!0)),e.nextSibling?(i.insertBefore(t,e.nextSibling),e=t):i.appendChild(t)}))})),this}},{key:"replaceWith",value:function(t){var n=[],r=St(t,this.context),i="string"===typeof t&&/<.+>/.test(t);return this.each((function(e){var t,o=null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode;if(o){var a=i?r[0].cloneNode(!0):r[0];try{o.replaceChild(a,e),n.push(a)}catch(s){}}})),new e(n)}},{key:"getRoot",value:function(){return this.closest(X)}},{key:"traverse",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=function o(a){var s=a.isCard();if(!s||a.fragment&&1!==a.fragment.childNodes.length||n&&("editable"!==n||a.isEditableCard())){var l=t?a.first():a.last();while(l){var c=t?l.next():l.prev();r&&r(l);var A=e(l);if(!1===A)return void(i&&i(l,c));if(!0!==A){var u=A&&"boolean"!==typeof A;u&&(i&&i(l,A),l=A),s=l.isCard(),s?!0===n?(u&&e(l),o(l)):"editable"===n&&l.isEditableCard()&&function(){var e=l.find(ne);e.each((function(t,n){var r=e.eq(n);r&&o(r)}))}():(u&&e(l),o(l))}i&&i(l,c),l=c}}};e(this),o(this)}},{key:"getChildByPath",value:function(e,t){var n=this.get();if(0===e.length)return n;for(var r=function(e){var r,i=0,o=(0,k.Z)(n.childNodes);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!t||t(a)){if(i==e)return a;i++}}}catch(s){o.e(s)}finally{o.f()}},i=0;void 0!==e[i];){var o=r(e[i]);if(!o)break;n=o,i++}return n}},{key:"getIndex",value:function(e){var t,n=this[0],r=null!==(t=n.parentElement)&&void 0!==t?t:n.parentNode;if(!r)return 0;var i,o=0,a=(0,k.Z)(r.childNodes);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(!e||e(s)){if(s===this[0])return o;o++}}}catch(l){a.e(l)}finally{a.f()}return-1}},{key:"findParent",value:function(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.closest(X),i=null!==(t=r[0])&&void 0!==t?t:r,o=null!==(n=i.parentElement)&&void 0!==n?n:i.parentNode;if(0===this.length||!o)return null;var a=this[0];while((o=null!==(s=a.parentElement)&&void 0!==s?s:a.parentNode)&&o!==i){var s;a=o}return o?new e(a):null}},{key:"allChildren",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[];return this.traverse((function(e){t.push(e)}),void 0,e),t.shift(),t}},{key:"getViewport",value:function(){var e,t=this.window||{innerHeight:0,innerWidth:0},n=t.innerHeight,r=t.innerWidth,i=this.isText()?null===(e=this.parent())||void 0===e?void 0:e.get():this.get();if(!i)return{top:0,left:0,bottom:0,right:0};var o=i.getBoundingClientRect(),a=o.top,s=o.left,l=o.bottom,c=o.right;return{top:a,left:s,bottom:Math.min(l,n),right:Math.min(c,r)}}},{key:"inViewport",value:function(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=null;if(t.type!==Node.ELEMENT_NODE){var a;if(!t.document)return!1;o=t.document.createElement("span");var s=null!==(a=t[0].parentElement)&&void 0!==a?a:t[0].parentNode;t.next()?null===s||void 0===s||s.insertBefore(o,t[0].nextSibling):null===s||void 0===s||s.appendChild(o),t=new e(o)}var l=t.get();if(!l)return!0;var c=l.getBoundingClientRect(),A=c.top,u=c.left,d=c.right,h=c.bottom,p=this.getViewport();return o&&(null===(n=null!==(r=o.parentElement)&&void 0!==r?r:o.parentNode)||void 0===n||n.removeChild(o)),i?A>0&&A<=p.bottom||h>0&&h<=p.bottom:A>0&&A>=p.top&&u>0&&u>=p.left&&h<=p.bottom&&d<=p.right}},{key:"scrollIntoView",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nearest";if("function"===typeof(null===(n=t.document)||void 0===n?void 0:n.body.scrollIntoView)){var i,o,a,s,l,c=null;if(t.type!==Node.ELEMENT_NODE||"br"===t.name.toLowerCase())c=t.document.createElement("span"),c.innerHTML=" ",null===(a=null!==(s=t[0].parentElement)&&void 0!==s?s:t[0].parentNode)||void 0===a||a.insertBefore(c,t[0]),t=new e(c);if(!this.inViewport(t))null===(l=t.get())||void 0===l||l.scrollIntoView({block:r,inline:r});c&&(null===(i=null!==(o=c.parentElement)&&void 0!==o?o:c.parentNode)||void 0===i||i.removeChild(c))}}}]),e}(),Ut=function(e,t,n){void 0===t&&(t=rt());var r=St(e,t),i=new(n||Nt)(r,t||void 0);return gt(e)&&e.nodeType===window.Node.DOCUMENT_FRAGMENT_NODE&&(i.fragment=e),i},Lt=[{from:function(e,t,n){return!!n[fe]||!!n[ge]},to:function(e,t,n){var r=n[ve],i=(0,s.Z)({},n);for(var o in n=(0,x.Z)({type:n[me],name:(n[fe]||n[ge]).toLowerCase(),editable:n[we]},$,n[$]),i)o!==ge&&0===o.indexOf("data-")&&0!==o.indexOf("data-card")&&(n[o]=i[o]);void 0!==r&&(n.value=r);var a=Ut("");for(var l in n)a.attributes(l,n[l]);return a}},{from:function(e,t,n){return("div"===e||"section"===e)&&(!n[fe]||!n[ge])&&n[G]!==Y},to:function(e,t,n){var r=Ut("

");for(var i in r.css(t),n)r.attributes(i,n[i]);return r}},{from:function(e){return[Ae,le,ce].includes(e)},to:function(e){return{node:Ut("<".concat(e," />")),replace:!0}}}],Qt=[{type:"block",attributes:(0,x.Z)({},$,"*")},{name:"p",type:"block",allowIn:["$root"]},{name:"br",type:"inline",isVoid:!0},{name:le,type:"inline",isVoid:!0},{name:ce,type:"inline",isVoid:!0},{name:Ae,type:"inline",isVoid:!0},{name:"span",type:"mark",attributes:(0,x.Z)({},G,{required:!0,value:["anchor","cursor","focus"]})},{name:"card",type:"inline",attributes:{name:{required:!0,value:/\w+/},type:{required:!0,value:"inline"},editable:"*",value:"*"}},{name:"span",type:"inline",attributes:(Ft={},(0,x.Z)(Ft,fe,{required:!0,value:/\w+/}),(0,x.Z)(Ft,me,{required:!0,value:"inline"}),(0,x.Z)(Ft,ve,"*"),(0,x.Z)(Ft,we,"*"),(0,x.Z)(Ft,"class","*"),(0,x.Z)(Ft,"contenteditable","*"),Ft)},{name:"span",type:"inline",attributes:(Tt={},(0,x.Z)(Tt,ge,{required:!0,value:/\w+/}),(0,x.Z)(Tt,me,{required:!0,value:"inline"}),(0,x.Z)(Tt,ve,"*"),(0,x.Z)(Tt,we,"*"),(0,x.Z)(Tt,"class","*"),(0,x.Z)(Tt,"contenteditable","*"),Tt)},{name:"card",type:"block",attributes:{name:{required:!0,value:/\w+/},type:{required:!0,value:"block"},editable:"*",value:"*"}},{name:"div",type:"block",attributes:(Mt={},(0,x.Z)(Mt,fe,{required:!0,value:/\w+/}),(0,x.Z)(Mt,me,{required:!0,value:"block"}),(0,x.Z)(Mt,ve,"*"),(0,x.Z)(Mt,we,"*"),(0,x.Z)(Mt,"class","*"),(0,x.Z)(Mt,"contenteditable","*"),Mt)},{name:"div",type:"block",attributes:(It={},(0,x.Z)(It,ge,{required:!0,value:/\w+/}),(0,x.Z)(It,me,{required:!0,value:"block"}),(0,x.Z)(It,ve,"*"),(0,x.Z)(It,we,"*"),(0,x.Z)(It,"class","*"),(0,x.Z)(It,"contenteditable","*"),It)}],Dt="contenteditable",Ht=0,Ot=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Number(Math.random().toString().substring(2,7)+e+Date.now()).toString(36)},zt=new Map,Zt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";if("string"!==typeof e){var r,i=null!==(r=e[0])&&void 0!==r?r:e;if(i.nodeType===Node.ELEMENT_NODE){var o=i,a=o.localName;n=a.substring(0,1),e=a;for(var s=o.attributes,l=s.length;l--;){var c=s[l];~~[$,"id"].indexOf(c.name)&&(e+="".concat(c.name,'="').concat(c.value,'"'))}}else{var A;e=null!==(A=i.textContent)&&void 0!==A?A:""}}var u=zt.get(e);if(u)n=u;else{var d=window.btoa(encodeURIComponent(e)).replace(/=/g,""),h=[];["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"].forEach((function(e,t){var n=d.indexOf(e);h.push(~n?n:d.length%t?0:1)}));var p=Number(h.join("")).toString(36).replace(/0/g,"");n=n+p.substr(0,4)+p.substr(-4),zt.set(e,n)}var f=n;if(t){var g="".concat(f,"-").concat(Ot(Ht));return Ht++,g}return f},Rt=function(){function e(t){var n=this;(0,l.Z)(this,e),this.editor=void 0,this.addBrForBlock=function(e){if(!e.isText()){var t,r=e.get().childNodes,i=0,o=!0,a=!1,s="p"===e.name,l=(0,k.Z)(r);try{for(l.s();!(t=l.n()).done;){var c=t.value;if(o&&c.nodeType===Node.TEXT_NODE?o=!1:s||a||c.nodeType!==Node.ELEMENT_NODE||!n.isBlock(c)||(a=!0),c.nodeType===Node.ELEMENT_NODE&&[le,ce,Ae].indexOf(c.getAttribute(G)||"")<1&&i++,!o&&i>1)break}}catch(u){l.e(u)}finally{l.f()}if(s&&0===i){var A=document.createElement("br");e.each((function(e){e.appendChild(A.cloneNode())}))}!a&&o&&n.isBlock(e)&&(1!==r.length||"BR"!==r[0].nodeName)&&n.isEmptyWithTrim(e)&&(e.empty(),e.append(document.createElement("br")))}},this.editor=t}return(0,c.Z)(e,[{key:"isVoid",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema,n="string"===typeof e?e:"";return gt(e)?n=e.nodeName.toLowerCase():pt(e)&&(n=e.name),t.find((function(e){return e.name===n&&!0===e.isVoid})).length>0}},{key:"isMark",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("marks").includes((null!==(t=null===(n=e.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:e.name).toLowerCase())&&"mark"===r.getType(e)}},{key:"isInline",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("inlines").includes(null!==(t=null===(n=e.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:e.name)&&"inline"===r.getType(e)}},{key:"isBlock",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("blocks").includes((null!==(t=null===(n=e.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==t?t:e.name).toLowerCase())&&"block"===r.getType(e)}},{key:"isNestedBlock",value:function(e){if(!this.isBlock(e))return!1;var t=e.length?e[0]:e;if(!t)return!1;var n=t.firstChild;while(n){if(this.isBlock(n))return!1;n=n.nextSibling}return!0}},{key:"isRootBlock",value:function(e,t){var n;return!!(null===(n=e.parent())||void 0===n?void 0:n.isEditable())&&(!!this.isNestedBlock(e)&&(t||this.editor.schema).find((function(t){return t.name===e.name})).every((function(e){if("block"!==e.type)return!1;var t=e.allowIn;return!t||t.indexOf("$root")>-1})))}},{key:"isEmpty",value:function(e,t){var n,r;if(e.length>0&&e.isElement()){var i,o=e.attributes(),a=null!==(i=e.fragment)&&void 0!==i?i:e.get(),s=Array.from(a.querySelectorAll("".concat(xe,",").concat(ke,",").concat(ne,",br")));if(o[fe]||o[ge]||s.some((function(e){return e.hasAttribute(fe)||e.hasAttribute(ge)}))&&!s.some((function(e){return e.getAttribute(G)===te})))return!1;if("br"!==e.name&&this.isVoid(e))return!1;if(s.filter((function(e){return"br"===e.localName})).length>1)return!1}var l=e.isText()?e[0].nodeValue||"":e.text();return l=null===(n=l)||void 0===n?void 0:n.replace(/\u200B/g,""),l=null===(r=l)||void 0===r?void 0:r.replace(/\r\n|\n/,""),l&&t&&(l=l.trim()),""===l}},{key:"isEmptyWithTrim",value:function(e){return this.isEmpty(e,!0)}},{key:"isEmptyWidthChild",value:function(e){if(0===e.length)return!0;if(e.isCard())return!1;if(e.isText())return this.isEmpty(e);var t=e[0].childNodes;if(0===t.length)return!0;for(var n=0;n-1}},{key:"isCustomize",value:function(e){var t=this.editor.list;switch(e.name){case"li":return e.hasClass(t.CUSTOMZIE_LI_CLASS);case"ul":return e.hasClass(t.CUSTOMZIE_UL_CLASS);default:return!1}}},{key:"unwrap",value:function(e){var t=e.first(),n=[];while(t){var r=t.next();e.before(t),n.push(t),t=r}return e.remove(),n}},{key:"wrap",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.editor.mark;if(gt(e)&&(e=Ut(e)),t=this.clone(t,!1),e.isText())return t.append(this.clone(e,!1)),e.replaceWith(t);if(r&&this.isMark(t)){var o=this.clone(t,!1,!1);if(e.name===t.name){var a=e.attributes();delete a.style,delete a[$],Object.keys(a).forEach((function(e){if(t.attributes(e)){var n=t.attributes(e).split(",");void 0!==n[e]&&n.indexOf(n[e])<0&&n.push(n[e]),t.attributes(e,n.join(","))}else t.attributes(e,a[e])}));var s=e.css();Object.keys(s).forEach((function(e){t.css(e)||t.css(e,s[e])})),t.append(this.clone(e,!0,!1).children())}else t.append(this.clone(e,!0,!1));var l=t.allChildren();return l.forEach((function(e){!e.isText()&&n.isMark(e)&&i.compare(e,o)&&n.unwrap(e)})),e.replaceWith(t)}var c=e.parent(),A=this.clone(e,!1,!1);return e.after(A),t.append(e),c?A.replaceWith(t):t}},{key:"merge",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e.equal(t)){if(t.isText())return e.append(t),void this.removeSide(e);var r=this.editor,i=r.block,o=r.mark,a=r.list,s=t,l=this.isList(e),c=this.isList(t.name);if(l&&!c){var A=e.find("li");if(0===A.length)return;e=Ut(A[A.length-1])}if(!l&&c){var u=t.find("li");u.length>0&&(t=Ut(u[0])),u[1]&&(s=Ut(u[0]))}if(this.isCustomize(e)){var d,h,p=e.first();if(!(null===(d=p)||void 0===d?void 0:d.isCard())){var f=a.getPlugins(),g=a.getPluginNameByNode(e),m=f.find((function(e){return e.constructor.pluginName===g}));(null===m||void 0===m?void 0:m.cardName)&&(a.addCardToCustomize(e,m.cardName),p=e.first())}if(this.isCustomize(t)&&!(null===(h=p)||void 0===h?void 0:h.equal(t))){var v=t.first();(null===v||void 0===v?void 0:v.isCard())&&p.attributes(fe)===v.attributes(fe)&&v.remove()}}var b=e.last(),y=t.first(),w=i.findPlugin(e);while(y){var x,k,C=y.next(),B=o.findPlugin(y);if(w&&B&&w.disableMark&&w.disableMark.indexOf(B.constructor.pluginName)>-1){var _=this.unwrap(y);_.forEach((function(t){e.append(t)}))}else if(y.isText()&&/\u200b/.test(y.text())){var E=y.parent(),S=y.prev(),F=y.next();if(!E||!this.isMark(E)&&(S&&!this.isInline(S)||F&&!this.isInline(F))){y.remove(),y=F;continue}}else if(B&&1===(null===(x=y.get())||void 0===x?void 0:x.childNodes.length)){var T=y.prev();T&&!T.isText()||y.allChildren().forEach((function(e){var t,n=e.text();e.type===rt().TEXT_NODE&&n&&!(null===(t=e.next())||void 0===t?void 0:t.isCursor())&&e.text(n.replace(/\u200b/,""))}))}y.length>0&&!y.equal(e)&&!(null===(k=y.parent())||void 0===k?void 0:k.equal(e))&&e.append(y),y=C}if(n&&s.remove(),b&&"br"===b.name){var M=b.next();while(M){if(M.isCursor()){b.remove();break}M=M.next()}}this.removeSide(e)}}},{key:"replace",value:function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.clone(t,!1,i),a=this.isCustomize(e)&&"li"===e.name&&(null===(n=e.first())||void 0===n?void 0:n.isCard())?null===(r=e.first())||void 0===r?void 0:r.next():e.first();while(a){var s=a.next();o.append(a),a=s}return e.isText()&&o.append(e.clone()),e.replaceWith(o)}},{key:"insertText",value:function(e,t){var n,r=this.editor;if(st(r)){var i=r.change,o=t||i.range.toTrusty(),a=rt(o.startContainer);o.collapsed||i.delete(t);var s=a.createTextNode(e);return null===(n=this.insert(s,o))||void 0===n||n.handleBr(),t||i.apply(o),o}}},{key:"insert",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(pt(e)){if(0===e.length)throw"Not found node";e=e[0]}var i=this.editor;if(st(i)){var o=i.change,a=i.block,s=i.schema,l=i.mark;t=t||o.range.get();var c=t.cloneRange().shrinkToTextNode(),A=c.startNode,u=c.startOffset,d=A.prev(),h=A.parent(),p=A.text()||"",f=p.substr(0,u);if(A.isText()&&/\u200b$/.test(f)&&p.length>1&&(d&&!this.isInline(d)||!d&&h&&!this.isInline(h))){var g=A.get(),m=g.splitText(u-1),v=m.textContent;v&&v.length>0&&m.splitText(1),m.remove()}var b=null===h||void 0===h?void 0:h.attributes(be);if(!b&&A.isCard()&&t.setStartAfter(A),b&&h&&["left","right"].includes(b)){var y=i.card.find(h);y&&("left"===b?t.setStartBefore(y.root):t.setStartAfter(y.root))}if(this.isBlock(e)){var w=t,x=w.commonAncestorNode;x.isText()&&(x=i.block.closest(x));var k=null;if(this.isBlock(x)&&this.isEmpty(x))k=r?x:void 0;else{var C,B=!1;if(a.isFirstOffset(t,"start")&&(B=!0),k=a.split(t),B)k=null===(C=k)||void 0===C?void 0:C.prev()}var _=a.closest(t.startNode.isEditable()?t.cloneRange().shrinkToElementNode().shrinkToTextNode().startNode:t.startNode);if(_.isRoot()&&!t.startNode.next())_.append(e);else if(!_.isCard()&&s.isAllowIn(_.name,e.nodeName.toLowerCase()))_.find("br").remove(),_.append(e);else{var E,S=_.parent();while(S&&this.isBlock(S)&&!_.isEditable()&&(!S.isEditable()||S.isCard())&&!s.isAllowIn(S.name,e.nodeName.toLowerCase()))_=S,S=_.parent();var F=s.getCanMergeTags(),T=e.nodeName.toLowerCase(),M=null;if(k&&_.name===T&&F.includes(_.name)){var I;_=k;var N=document.createDocumentFragment(),U=[],L=null===(I=_.get())||void 0===I?void 0:I.nextSibling;e.childNodes.forEach((function(e){L?U.push(e):U.unshift(e)})),N.append.apply(N,U),e=N,M=N.lastChild}_.isEditable()&&0===(null===(E=_.get())||void 0===E?void 0:E.childNodes.length)?_.append(e):(this.isEmptyWidthChild(_)||a.isLastOffset(t,"start")?(_.after(e),this.isEmptyWidthChild(_)&&k&&_.remove()):(_.before(e),k&&this.isEmptyWidthChild(k)&&k.remove()),M&&(e=M))}(e instanceof Element||e instanceof DocumentFragment)&&i.nodeId.generate(e)}else{var Q=a.closest(t.startNode.isEditable()?t.cloneRange().shrinkToElementNode().shrinkToTextNode().startNode:t.startNode),D=Q?a.findPlugin(Q):void 0;if(D){var H=Ut(e),O=function(e){if(n.isMark(e)){var t=l.findPlugin(e);if(!t)return;if(D.disableMark&&D.disableMark.indexOf(t.constructor.pluginName)>-1)return!0}return!1};if(H.allChildren().forEach((function(e){O(e)&&n.unwrap(e)})),O(H)){var z=H.document.createDocumentFragment();H.children().each((function(e){z.appendChild(e)})),H.remove(),e=z.childNodes[z.childNodes.length-1],t.insertNode(z)}else t.insertNode(e);if(0===H.length)return t}else t.insertNode(e)}return e.nodeType===Node.ELEMENT_NODE&&(e.hasAttribute(ge)||e.hasAttribute(fe))?t.collapse(!1):t.select(e,!this.isVoid(e)&&e.nodeType!==Node.TEXT_NODE).shrinkToElementNode().collapse(!1)}}},{key:"setAttributes",value:function(e,t){var n=t.style;for(var r in t)if("style"!==r)if("className"===r){var i=t[r];Array.isArray(i)?i.forEach((function(t){return e.addClass(t)})):e.addClass(i)}else e.attributes(r,t[r].toString());"number"===typeof n?n={}:"string"===typeof n&&(n=qe(n)),n=n||{};var o=Object.keys(n);for(var a in n){var s=n[a];/^0(px|em)?$/.test(s.toString())&&(s=""),e.css(a,s.toString())}return 0!==o.length&&0!==Object.keys(e.attributes("style")).length||e.removeAttributes("style"),e}},{key:"removeMinusStyle",value:function(e,t){if(e.isElement()){var n=e.css();if(n[t]){var r=parseInt(n[t]||"0",10)||0;r<0&&e.css(t,"")}}}},{key:"mergeChild",value:function(e){var t=this.editor,n=t.schema,r=t.list,i=n.getAllowInTags(),o=e.first();while(o){var a=o.next();while(a&&o.name===a.name&&(i.indexOf(o.name)>-1&&!this.isList(o)||this.isList(o)&&r.isSame(o,a))){var s=a.next(),l=a.first();while(l){var c=l.next();o.append(l),l=c}a.remove(),this.mergeChild(o),a=s}o=a}}},{key:"removeSide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"br",n=e.first();(null===n||void 0===n?void 0:n.name)===t&&e.children().toArray().filter((function(e){return!e.isCursor()})).length>1&&n.remove();var r=e.last();(null===r||void 0===r?void 0:r.name)===t&&e.children().toArray().filter((function(e){return!e.isCursor()})).length>1&&r.remove()}},{key:"flat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.editor.block,r=e.first(),i=e.fragment?Ut("

"):this.clone(e,!1);while(r){var o=r.next();if(r.isBlockCard()||this.isNestedBlock(r))n.flat(r,t);else if(this.isBlock(r))r=this.flat(r,t);else{var a=this.clone(i,!1),s="li"===a.name;r.before(a);while(r){var l;o=r.next();var c="br"===r.name&&!s;if(c&&(null===(l=r.parent())||void 0===l?void 0:l.isRoot())&&a.append(r),r.isText()){var A=r.text(),u=/^((\n|\r)+)/.exec(A),d=!1;if(u&&(A=A.substring(u[1].length),d=!0,0===A.length&&r.remove()),u=/((\n|\r)+)$/.exec(A),u){r.text(A.substr(0,u.index)),a.append(r);break}d&&r.length>0&&r.text(A)}if(r.length>0&&a.append(r),o){var h=o.text(),p=/^(\n|\r)+/.exec(h);if(p)break}if(c||!o||this.isBlock(o)||o.isBlockCard())break;r=o}this.removeSide(a),n.flat(a,t),this.addBrForBlock(a)}this.addBrForBlock(r),this.removeSide(r),r=o}return e.fragment&&(e=Ut(e.fragment)),r=e.first(),r||e.remove(),e}},{key:"normalize",value:function(e){return e=this.flat(e),this.mergeChild(e),e}},{key:"html",value:function(e,t){var n,r=this;return void 0===t?e.length>0&&(null===(n=e.get())||void 0===n?void 0:n.innerHTML)||"":(e.each((function(e){e instanceof Element&&(e.innerHTML=t,r.editor.nodeId.generateAll(e))})),e)}},{key:"clone",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.editor.nodeId,i=[];return e.each((function(e){var o=e.cloneNode(t),a=Ut(o);n||(r.generateAll(a,!0),r.isNeed(a)&&r.generate(a,!0)),i.push(o)})),Ut(i)}},{key:"getBatchAppendHTML",value:function(e,t){var n;if(0===e.length)return t;var r=t.startsWith("\\u")||t.startsWith("&#")?Ut(t,null):Ut(t);return e.forEach((function(e){e=e.clone(!1),e.append(r),r=e})),(null===(n=r.get())||void 0===n?void 0:n.outerHTML)||""}},{key:"removeZeroWidthSpace",value:function(e){var t=this;e.traverse((function(e){var n=e[0];if(n.nodeType===Node.TEXT_NODE){var r=n.nodeValue;if(2===(null===r||void 0===r?void 0:r.length)){var i=n.nextSibling,o=n.previousSibling;if(!(8203===r.charCodeAt(1)&&i&&i instanceof Element&&[le,ce,Ae].indexOf(i.getAttribute(G)||"")>=0)){var a=e.parent();if((8203!==r.charCodeAt(1)||!(!i&&a&&t.isInline(a)||i&&t.isInline(i)))&&(8203!==r.charCodeAt(0)||!(!o&&a&&t.isInline(a)||o&&t.isInline(o)))&&8203===r.charCodeAt(0)){var s,l,c=n.splitText(1);c.previousSibling&&(null===(s=null!==(l=c.parentElement)&&void 0!==l?l:c.parentNode)||void 0===s||s.removeChild(c.previousSibling))}}}}}))}}]),e}(),Pt=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";(0,l.Z)(this,e),this.range=void 0,this.editor=void 0,this.key="",this.anchor=null,this.focus=null,this.editor=t,this.range=n,this.key=r}return(0,c.Z)(e,[{key:"has",value:function(){return!!this.focus&&!!this.anchor}},{key:"create",value:function(){var e=this.range,t=e.commonAncestorNode,n=e.startNode,r=e.endNode;if(t.isEditable()||t.inEditor()){var i=t.document;if(i){var o=t.closest(X);if(this.key)o.find('[data-anchor-id="'.concat(this.key,'"]')).remove(),o.find('[data-focus-id="'.concat(this.key,'"]')).remove(),o.find('[data-cursor-id="'.concat(this.key,'"]')).remove();else{var a=o.find(ue);a.each((function(e,t){var n=a.eq(t);n&&!n.attributes("data-anchor-id")&&n.remove()}));var s=o.find(de);s.each((function(e,t){var n=s.eq(t);n&&!n.attributes("data-focus-id")&&n.remove()}));var l=o.find(he);l.each((function(e,t){var n=l.eq(t);n&&!n.attributes("data-cursor-id")&&n.remove()}))}var c=n.closest(xe);if(c.length>0){var A=n.closest(Ce);A.length>0&&this.range.setStartBefore(c);var u=n.closest(_e);u.length>0&&this.range.setStartAfter(c)}if(!n.equal(r)){var d=r.closest(xe);if(d.length>0){var h=r.closest(Ce);h.length>0&&this.range.setEndBefore(d);var p=r.closest(_e);p.length>0&&this.range.setEndAfter(d)}}if(this.range.collapsed){var f=Ut(i.createElement("span"));return f.attributes(G,Ae),this.key&&f.attributes("data-cursor-id",this.key),this.range.insertNode(f),this.anchor=f,void(this.focus=f)}var g=this.range.cloneRange();g.collapse(!0);var m=Ut(i.createElement("span"));m.attributes(G,le),this.key&&m.attributes("data-anchor-id",this.key),g.insertNode(m),this.range.setStartAfter(m);var v=this.range.cloneRange();v.collapse(!1);var b=Ut(i.createElement("span"));b.attributes(G,ce),this.key&&b.attributes("data-focus-id",this.key),v.insertNode(b),this.anchor=m,this.focus=b}}}},{key:"move",value:function(){var e,t;if(this.focus&&this.anchor){if(this.key){var n,r,i=this.range.commonAncestorNode,o=i.closest(X);this.focus.inEditor()&&(null===(n=this.focus.get())||void 0===n?void 0:n.isConnected)||(this.focus=o.find("[data-".concat(this.focus.attributes(G),'-id="').concat(this.key,'"]'))),this.anchor.inEditor()&&(null===(r=this.anchor.get())||void 0===r?void 0:r.isConnected)||(this.anchor=o.find("[data-".concat(this.anchor.attributes(G),'-id="').concat(this.key,'"]')))}var a=this.editor.node;if((null===(e=this.anchor.get())||void 0===e?void 0:e.isConnected)||(this.anchor=this.range.commonAncestorNode.find("[".concat(G,'="anchor"]'))),(null===(t=this.focus.get())||void 0===t?void 0:t.isConnected)||(this.focus=this.range.commonAncestorNode.find("[".concat(G,'="focus"]'))),this.anchor.equal(this.focus)){var s,l=this.anchor,c=l.parent();if(!c)return;a.removeZeroWidthSpace(c),c[0].normalize();var A=!1,u=l.prev(),d=l.next();if(u&&u.isCard()){var h=u.find(_e);h.length>0&&(this.range.select(h,!0),this.range.collapse(!1),A=!0)}else if(d&&d.isCard()){var p=d.find(Ce);p.length>0&&(this.range.select(p,!0),this.range.collapse(!1),A=!0)}return A||(this.range.setStartBefore(l[0]),this.range.collapse(!0)),Te?(c[0].normalize(),l.remove()):(l.remove(),c[0].normalize()),void("p"===c.name&&0===(null===(s=c.get())||void 0===s?void 0:s.childNodes.length)&&c.append(Ut("
")))}var f,g=this.anchor.parent();if(g&&(a.removeZeroWidthSpace(g),this.anchor.length>0&&this.range.setStartBefore(this.anchor),this.anchor.remove(),g[0].normalize()),g=this.focus.parent(),g)if(a.removeZeroWidthSpace(g),this.focus.length>0&&this.range.setEndBefore(this.focus),this.focus.remove(),g[0].normalize(),"p"===g.name&&0===(null===(f=g.get())||void 0===f?void 0:f.childNodes.length)&&g.append(Ut("
")),Ne){var m=window.getSelection();null===m||void 0===m||m.removeAllRanges(),null===m||void 0===m||m.addRange(this.range.base)}}}},{key:"getNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"center",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},i=n?e.clone(!0):e;if(!this.focus||!this.anchor)return i;if("left"===t||"center"===t){var o="center"!==t?this.anchor:this.focus,a=Ut(this.key?"[data-".concat(o.attributes(G),'-id="').concat(this.key,'"]'):"[".concat(G,"=").concat(o.attributes(G),"]"),i.get());this.key||(a=a.toArray().find((function(e){return!e.attributes("data-".concat(o.attributes(G),"-id"))})));var s=!1;i.traverse((function(e){if(a&&e.equal(a)){var t,n=e.parent();return a.remove(),"p"===(null===n||void 0===n?void 0:n.name)&&0===(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&n.append(Ut("
")),void(s=!0)}s&&r(e)&&(e.attributes(G)!==o.attributes(G)||"cursor"===o.attributes(G))&&e.remove()}),!0)}if("right"===t||"center"===t){var l="center"!==t?this.focus:this.anchor,c=Ut(this.key?"[data-".concat(l.attributes(G),'-id="').concat(this.key,'"]'):"[".concat(G,"=").concat(l.attributes(G),"]"),i.get());this.key||(c=c.toArray().find((function(e){return!e.attributes("data-".concat(l.attributes(G),"-id"))})));var A=!1;i.traverse((function(e){if(c&&e.equal(c)){var t,n=e.parent();return c.remove(),"p"===(null===n||void 0===n?void 0:n.name)&&0===(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&n.append(Ut("
")),void(A=!0)}A&&r(e)&&(e.attributes(G)!==l.attributes(G)||"cursor"===l.attributes(G))&&e.remove()}),!1)}return i}}]),e}();function qt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Kt(e){if(!qt(e))return!1;var t=e.constructor;if(void 0===t)return!0;var n=t.prototype;return!1!==qt(n)&&!1!==n.hasOwnProperty("isPrototypeOf")}Pt.removeTags=function(e){return e.replace(//gi,"").replace(//gi,"").replace(//gi,"")};var Wt=new WeakMap,jt=function(e,t,n){var r=gt(e)?e:e[0],i=Wt.get(r);return void 0!==i||(i=Vt(r,t,n),Wt.set(r,i)),i},Vt=function(e,t,n){var r=gt(e)?e:e[0];if(r.nodeType===Node.ELEMENT_NODE){var i=r.getAttribute(G)||"";if([Ae,le,ce].indexOf(i)>-1)return!0;if(r.getAttribute(ie)||i===J)return!0;var o=r.parentElement,a=(null===o||void 0===o?void 0:o.getAttribute(G))||"";if(i===Y||a===Y)return!1;var s=vt(r),l=null===o||void 0===o?void 0:o.getAttribute(ye);if(l&&o&&(null===n||void 0===n||n.push(Ut(o))),!s&&o&&vt(o)&&!wt(o))return!0;if(t){if(s)return!1;var c=t.find((function(t){return t===e[0]}));if(c)return c["__card_root"]&&(null===n||void 0===n||n.push(c["__card_root"])),!0}var A=_t(r,"".concat(xe,",").concat(ee),at);if(!A||!(A instanceof Element))return!1;if(A.getAttribute(G)===J)return!0;if(A.getAttribute(ye)&&(null===n||void 0===n||n.push(Ut(A))),!s&&vt(A)&&!wt(A))return!0;if(!s||wt(r)||!o)return!1;var u=_t(o,xe,at);if(!u||!(u instanceof Element))return!1;var d=u.getAttribute(ye);if(d&&u&&(null===n||void 0===n||n.push(Ut(u))),u&&vt(u)&&!wt(u))return!0}else if(r.nodeType===Node.TEXT_NODE){var h=r.parentElement;return!!h&&jt(h)}return!1},Gt=function(e,t){var n=gt(e)?e:e[0];if(xt(n))return!0;if(vt(n)&&["id","class","style",ye].includes(t))return!0;var r=n.getAttribute(re);return!!("*"===r||r&&r.split(",").some((function(e){return e.trim().toLowerCase()===t.toLowerCase()})))},$t=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this.editor=void 0,this.base=void 0,this.toRange=function(){return r.base},this.collapse=function(e){return r.base.collapse(e),r},this.cloneRange=function(){return e.from(r.editor,r.base.cloneRange())},this.select=function(e,t){return t?r.base.selectNodeContents(pt(e)?e[0]:e):r.base.selectNode(pt(e)?e[0]:e),r},this.getText=function(){var e=r.cloneContents();return e.textContent},this.getClientRect=function(){var e=r.getClientRects().item(0);return e||(e=r.getBoundingClientRect()),e},this.enlargeFromTextNode=function(){var e=function(e,t,n){var i;if(e.nodeType===Node.TEXT_NODE)if(0===t)switch(n){case"start":r.setStartBefore(e);break;case"end":r.setEndBefore(e);break}else if(t===(null===(i=e.nodeValue)||void 0===i?void 0:i.length))switch(n){case"start":r.setStartAfter(e);break;case"end":r.setEndAfter(e);break}};return e(r.startContainer,r.startOffset,"start"),e(r.endContainer,r.endOffset,"end"),r},this.shrinkToTextNode=function(){var e=function(e,t,n){if(e.nodeType===Node.ELEMENT_NODE){var i=e.childNodes;if(0!==i.length){var o,a,s,l;if(t>0&&(o=i[t-1]),t0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=r.enlargeFromTextNode(),i=r.editor.node,o=function(r,o,a){var s,l,c=Ut(r);if(!(c.type===Node.TEXT_NODE||!e&&i.isBlock(c)||c.isEditable()))if(0===o){while(!c.prev()){if(l=c.parent(),!l||!e&&i.isBlock(l))break;if(!l.inEditor()||l.isEditable())break;if(!t){if(!e&&l.isElement())break;if(e&&i.isBlock(l))break}c=l}a?n.setStartBefore(c[0]):n.setEndBefore(c[0])}else if(o===(null===(s=c.get())||void 0===s?void 0:s.childNodes.length)){while(!c.next()){if(l=c.parent(),!l||!e&&i.isBlock(l))break;if(!l.inEditor()||l.isEditable())break;if(!t){if(!e&&l.isElement())break;if(e&&i.isBlock(l))break}c=l}a?n.setStartAfter(c[0]):n.setEndAfter(c[0])}};return o(n.startContainer,n.startOffset,!0),o(n.endContainer,n.endOffset,!1),r},this.shrinkToElementNode=function(){var e,t,n=r.editor.node;while(r.startContainer.nodeType===Node.ELEMENT_NODE&&(e=r.startContainer.childNodes[r.startOffset])&&(t=Ut(e))&&e.nodeType===Node.ELEMENT_NODE&&!t.isCursor()&&!n.isVoid(e)&&(!t.isCard()||t.isEditableCard()||t.find(Ce).length>0))r.setStart(e,0);while(r.endContainer.nodeType===Node.ELEMENT_NODE&&r.endOffset>0&&(e=r.endContainer.childNodes[r.endOffset-1])&&(t=Ut(e))&&e.nodeType===Node.ELEMENT_NODE&&!n.isVoid(e)&&!t.isCursor()&&(!t.isCard()||t.isEditableCard()||t.find(_e).length>0))r.setEnd(e,e.childNodes.length);return r},this.createSelection=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=new Pt(r.editor,r,e);return t.create(),t},this.getSubRanges=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=[];return r.commonAncestorNode.traverse((function(o){if(o.isText()){var a,s=0,l=o.get(),c=(null===(a=l.nodeValue)||void 0===a?void 0:a.length)||0,A=r.comparePoint(l,s),u=r.comparePoint(l,c),d=e.create(r.editor);if(A<0){if(u<0)return;0===u?d.setOffset(l,r.startOffset,c):d.setOffset(l,r.startOffset,r.endOffset)}else{if(0!==A)return;if(u<0)return;0===u?d.setOffset(l,s,c):d.setOffset(l,s,r.endOffset)}i.push(d)}else if(t&&o.isCard()&&!o.isEditableCard()){var h,p=r.editor.card.find(o);if(!p||n&&!1===p.constructor.singleSelectable)return;var f=p.getCenter(),g=f.get(),m=null!==(h=null===g||void 0===g?void 0:g.parentElement)&&void 0!==h?h:null===g||void 0===g?void 0:g.parentNode;if(!m||!f.inEditor())return;var v=f.index(),b=o.get(),y=r.comparePoint(m,v),w=r.comparePoint(m,v+1),x=e.create(r.editor);if(y<0){if(w<0)return;0===w?x.setOffset(b,r.startOffset,v+1):x.setOffset(b,r.startOffset,r.endOffset)}else{if(0!==y)return;if(w<0)return;0===w?x.setOffset(m,v,v+1):x.setOffset(m,v,r.endOffset)}i.push(x)}})),0===i.length&&i.push(r),i},this.setOffset=function(e,t,n){return pt(e)&&(e=e[0]),r.setStart(e,t),r.setEnd(e,n),r},this.findElements=function(){var e=r.startContainer,t=r.endContainer,n=r.startOffset,i=r.endOffset,o=r.collapsed,a=[];if(e!==t||!0===o||e.nodeType===Node.TEXT_NODE)return a;for(var s=e.childNodes,l=n;l0},this.getStartOffsetNode=function(){var e=r.startContainer,t=r.startOffset;return(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)&&(e.childNodes[t]||e.childNodes[t-1])||e},this.getEndOffsetNode=function(){var e=r.endContainer,t=r.endOffset;return(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)&&(e.childNodes[t]||e.childNodes[t-1])||e},this.scrollIntoView=function(){var e=r.endNode.get();Ue&&e&&e.scrollIntoView&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},this.scrollRangeIntoView=function(){var e,t=r.getEndOffsetNode(),n=t.nodeType===Node.TEXT_NODE?null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode:t,i=r.collapsed?n.getBoundingClientRect():r.getClientRect(),o=window.innerHeight;(i.bottom>=o||i.bottom<=0)&&n.scrollIntoView({block:"center"})},this.scrollIntoViewIfNeeded=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.editor.container,t=arguments.length>1?arguments[1]:void 0;if(r.collapsed)e.scrollIntoView(Ut(r.getEndOffsetNode()));else{var n=r.getStartOffsetNode(),i=r.getEndOffsetNode();Ut(n).scrollIntoView(t),Ut(i).scrollIntoView(t)}},this.containsCard=function(){var e=r.collapsed,t=r.commonAncestorNode;return!e&&(3!==t.type&&t.find(xe).length>0||t.closest(xe).length>0)},this.handleBr=function(e){var t,n=r.editor,i=n.list,o=n.block.closest(r.commonAncestorNode);o.find("br").each((function(t){var n,r=Ut(t),o=r.prev(),a=r.next(),s=r.parent();if((!o||(null===s||void 0===s?void 0:s.hasClass(i.CUSTOMZIE_LI_CLASS))&&(null===s||void 0===s||null===(n=s.first())||void 0===n?void 0:n.equal(o)))&&a&&"br"!==a.name&&!a.isCursor()||!a&&o&&"br"!==o.name){var l;if(e&&o&&(!(null===s||void 0===s?void 0:s.hasClass(i.CUSTOMZIE_LI_CLASS))||!(null===s||void 0===s||null===(l=s.first())||void 0===l?void 0:l.equal(r.prev()))))return;r.remove()}}));var a,s=o.first(),l=o.children();if(!s||1===l.length&&o.hasClass(i.CUSTOMZIE_LI_CLASS)&&(null===s||void 0===s?void 0:s.isCard()))return o.append(Ut("
")),r;if(1===l.length&&s.isText()&&0===s.text().replace(/\r\n|\n|\t|\u200b/g,"").length)return o.html("
"),r;2===l.length&&o.hasClass(i.CUSTOMZIE_LI_CLASS)&&(null===s||void 0===s?void 0:s.isCard())&&["cursor","anchor","focus"].includes((null===(t=o.last())||void 0===t?void 0:t.attributes(G))||"")&&(null===(a=o.first())||void 0===a||a.after("
"));return r},this.getPrevNode=function(){r.enlargeFromTextNode();var e=r.startNode,t=r.startOffset;if(!e.isText()){var n=e.children();if(0!==n.length)return n.eq(t-1)}},this.getNextNode=function(){r.enlargeFromTextNode();var e=r.endNode,t=r.endOffset;if(!e.isText()){var n=e.children();if(0!==n.length)return n.eq(t)}},this.editor=t,this.base=n}return(0,c.Z)(e,[{key:"collapsed",get:function(){return this.base.collapsed}},{key:"endOffset",get:function(){return this.base.endOffset}},{key:"startOffset",get:function(){return this.base.startOffset}},{key:"startContainer",get:function(){return this.base.startContainer}},{key:"endContainer",get:function(){return this.base.endContainer}},{key:"commonAncestorContainer",get:function(){return this.base.commonAncestorContainer}},{key:"cloneContents",value:function(){return this.base.cloneContents()}},{key:"deleteContents",value:function(){return this.base.deleteContents()}},{key:"extractContents",value:function(){return this.base.extractContents()}},{key:"getBoundingClientRect",value:function(){return this.base.getBoundingClientRect()}},{key:"getClientRects",value:function(){return this.base.getClientRects()}},{key:"insertNode",value:function(e){var t,n;pt(e)&&(e=e[0]);var r,i=this.startNode;Ut(e).isCursor()||1!==(null===(t=i.get())||void 0===t?void 0:t.childNodes.length)||"br"!==(null===(n=i.first())||void 0===n?void 0:n.name)?"br"===i.name&&i.remove():null===(r=i.first())||void 0===r||r.remove();e.nodeType!==Node.TEXT_NODE&&"BR"!==e.nodeName||!i.isEditable()||this.shrinkToElementNode().shrinkToTextNode(),(e instanceof Element||e instanceof DocumentFragment)&&this.editor.nodeId.generate(e),this.base.insertNode(e)}},{key:"isPointInRange",value:function(e,t){return pt(e)&&(e=e[0]),this.base.isPointInRange(e,t)}},{key:"comparePoint",value:function(e,t){return pt(e)&&(e=e[0]),this.base.comparePoint(e,t)}},{key:"setEnd",value:function(e,t){return pt(e)&&(e=e[0]),this.base.setEnd(e,t)}},{key:"setEndAfter",value:function(e){if(pt(e)&&(e=e[0]),e.parentNode)return this.base.setEndAfter(e)}},{key:"setEndBefore",value:function(e){if(pt(e)&&(e=e[0]),e.parentNode)return this.base.setEndBefore(e)}},{key:"setStart",value:function(e,t){return pt(e)&&(e=e[0]),this.base.setStart(e,t)}},{key:"setStartAfter",value:function(e){if(pt(e)&&(e=e[0]),e.parentNode)return this.base.setStartAfter(e)}},{key:"setStartBefore",value:function(e){if(pt(e)&&(e=e[0]),e.parentNode)return this.base.setStartBefore(e)}},{key:"toString",value:function(){return this.base.toString()}},{key:"startNode",get:function(){return Ut(this.base.startContainer)}},{key:"endNode",get:function(){return Ut(this.base.endContainer)}},{key:"commonAncestorNode",get:function(){return Ut(this.base.commonAncestorContainer)}},{key:"deepCut",value:function(){this.collapsed||this.extractContents();var e=this.startNode;if(!e.isEditable()){var t=e;if(t&&!t.isEditable()){var n=t.parent();while(n&&!n.isEditable())t=n,n=n.parent();this.setEndAfter(t[0]);var r=this.extractContents();this.insertNode(r),this.collapse(!0)}}}},{key:"equal",value:function(e){return this.startContainer===e.startContainer&&this.startOffset===e.startOffset&&this.endContainer===e.endContainer&&this.endOffset===e.endOffset}},{key:"getRootBlock",value:function(){if(this.startNode.isEditable())return this.startNode.children().eq(this.startOffset);var e=this.startNode;while((null===(t=e)||void 0===t?void 0:t.parent())&&!e.parent().isEditable()){var t;e=e.parent()}return e}},{key:"filterPath",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=[];return function(r){var i=Ut(r);if(t&&r instanceof HTMLElement&&~["left","right","center","body"].indexOf(r.getAttribute(be)||"")){var o=e.editor.card.closest(i);return o&&o.length>0&&n.push(o),!0}return!!(t&&i.isCard()&&n.includes(i))||!jt(i)}}},{key:"toPath",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.container,r=this.cloneRange(),i=r.commonAncestorNode;if(i.isRoot()||i.inEditor()){r.shrinkToElementNode().shrinkToTextNode();var o=function(r,i){var o,a=r.attributes($),s=a?0:-1,l=r.getPath(n,(null===(o=r.parent())||void 0===o?void 0:o.isRoot())?void 0:e.filterPath(t),(function(e,t,n){if(-1===e)return a="",s=-1,[];a||(a=n.attributes($),s=t.length),t.unshift(e)}));return s=l.length-s,l.push(i),{path:l,id:a,bi:s}};return{start:o(r.startNode,r.startOffset),end:o(r.endNode,r.endOffset)}}}}]),e}();$t.create=void 0,$t.from=void 0,$t.fromPath=void 0,$t.create=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0;return t=r?n.caretRangeFromPoint(r.x,r.y):n.createRange(),$t.from(e,t)},$t.from=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(!Xt(t)){var n=Yt(t)?t:t.getSelection();if(!(n&&n.rangeCount>0))return null;t=n.getRangeAt(0)}return new $t(e,t)},$t.fromPath=function(e,t){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.container,a=t.start.path.slice(),s=t.end.path.slice(),l=a.pop(),c=s.pop(),A=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.get(),n=t,r=0;rn.childNodes.length&&(r=n.childNodes.length),n.nodeType===Node.TEXT_NODE&&r>((null===(i=n.nodeValue)||void 0===i?void 0:i.length)||0))r=(null===(o=n.nodeValue)||void 0===o?void 0:o.length)||0;t[e](n,r)}},d=t.start.id?null===(n=o.get())||void 0===n?void 0:n.querySelector("[".concat($,'="').concat(t.start.id,'"]')):o.get(),h=A(t.start.bi>-1&&d instanceof Element?a.slice(t.start.bi):a,d instanceof Element?d:void 0),p=t.end.id?null===(r=o.get())||void 0===r?void 0:r.querySelector("[".concat($,'="').concat(t.end.id,'"]')):o,f=A(t.end.bi>-1&&p instanceof Element?s.slice(t.end.bi):s,p instanceof Element?p:void 0),g=$t.create(e,document);return u("setStart",g,h,void 0===l?0:l),u("setEnd",g,f,void 0===c?0:c),g};var Yt=function(e){return void 0!==e.getRangeAt},Xt=function(e){return void 0!==e.collapsed},Jt=function(e){return!!e&&void 0!==e.base};function en(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var tn=".data-drop-cursor {\r\n\tposition: absolute;\r\n\twidth: 2px;\r\n\tbackground-color: #347EFF;\r\n}\r\n\r\ndiv.data-drag-image {\r\n\tbackground-color: #f9f9f9;\r\n}";en(tn);var nn,rn,on,an=function(){function e(t,n){(0,l.Z)(this,e),this.x=0,this.y=0,this.doc=document,this.range=void 0,this.caretRange=void 0,this.targetCard=void 0,this.caretCard=void 0,this.isCardLeftRange=!1,this.engine=void 0,this.options={className:"data-drop-cursor"},this.engine=t,this.options=(0,s.Z)((0,s.Z)({},this.options),n)}return(0,c.Z)(e,[{key:"getRangeForPoint",value:function(){var e=this.doc,t=this.x,n=this.y;if(void 0!==e.caretRangeFromPoint){var r=$t.create(this.engine,e,{x:t,y:n});if(r)return r}if(event&&void 0!==event["rangeParent"]){var i=$t.create(this.engine,e);return i.setStart(event["rangeParent"],event["rangeOffset"]),i.collapse(!0),i}}},{key:"getCard",value:function(){return this.targetCard||this.caretCard}},{key:"parseEvent",value:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="move");var t=this.engine.card;this.x=e.clientX,this.y=e.clientY;var n=Ut(e.target||[]);this.doc=n.document||document,this.targetCard=t.find(n),this.caretRange=this.getRangeForPoint(),this.caretCard=this.caretRange?t.find(this.caretRange.commonAncestorContainer):void 0}},{key:"getRange",value:function(){var e,t=this.caretRange,n=this.doc,r=this.x,i=this.getCard();if(i&&i.root.length>0){e=$t.create(this.engine,n);var o=i.root.getBoundingClientRect()||{left:0,right:0},a=o.left,s=o.right,l=(a+s)/2;e.select(i.root.get()),l0&&void 0!==arguments[0]?arguments[0]:2,r=this.isCardLeftRange,i=this.range,o=this.getCard();if(o&&o.root.length>0&&i){if(r){i.setEnd(i.commonAncestorContainer,i.endOffset+1);var a=i.getBoundingClientRect(),s=a.left,l=a.bottom,c=a.top;return i.setEnd(i.commonAncestorContainer,i.endOffset-1),{x:s-n,y:c,height:l-c}}i.setStart(i.commonAncestorContainer,i.startOffset-1);var A=i.getBoundingClientRect(),u=A.right,d=A.top,h=A.bottom;return i.setStart(i.commonAncestorContainer,i.startOffset+1),{x:u-n,y:d,height:h-d}}var p=null===(e=this.range)||void 0===e?void 0:e.getBoundingClientRect();if(0===(null===(t=p)||void 0===t?void 0:t.height)){var f,g=null===(f=this.range)||void 0===f?void 0:f.startContainer;p=g.getBoundingClientRect()}var m=p||{},v=m.left,b=m.top,y=m.bottom;return{x:v,y:b,height:(y||0)-(b||0)}}},{key:"getCursor",value:function(){var e=this.options.className;return Ut("body > div.".concat(e))}},{key:"removeCursor",value:function(){this.getCursor().remove()}},{key:"setCursor",value:function(){this.removeCursor();var e=this.options.className,t=Ut('

'));Ut(document.body).append(t)}}]),e}(),sn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.Z)(this,e),this.events={},this.globalEvents={},this.engine=void 0,this.isComposing=void 0,this.isSelecting=void 0,this.dragoverHelper=void 0,this.options=void 0,this.keydownRange=null,this.engine=t,this.isComposing=!1,this.isSelecting=!1,this.dragoverHelper=new an(t),this.options=n}return(0,c.Z)(e,[{key:"isCardInput",value:function(e){var t=e.target?Ut(e.target):null;while(t){if(t.isEditable())return!1;if("center"===t.attributes(be))return!0;if(t.attributes(G)===J)return!0;var n=t.parent();if(!n)break;t=n}return!1}},{key:"onInput",value:function(e){var t=this,n=this.options.bindInput;if(!n||n()){var r=null;this.onContainer("compositionstart",(function(e){if(!t.engine.readonly){t.isCardInput(e)||t.engine.model.mutation.startCache();var n=t.engine,r=n.change,i=n.node,o=n.block,a=n.list,s=r.range.get().cloneRange().shrinkToTextNode().enlargeToElementNode();if(!s.collapsed){var l,c=o.closest(s.startNode),A=o.closest(s.endNode);if((i.isCustomize(c)||i.isCustomize(A))&&!c.equal(A))null===(l=a.backspaceEvent)||void 0===l||l.trigger(new KeyboardEvent(""))}t.isComposing=!0}}));var i=function(n){if(!t.isComposing){if(Qe&&r){var i=r.first(),o=null===i||void 0===i?void 0:i.next();if(null===o||void 0===o?void 0:o.isText()){var a=o.text();if(/^\u200b/.test(a)){var s=o.get();null===s||void 0===s||s.splitText(1),null===s||void 0===s||s.remove()}}var l=t.engine.change.range.get(),c=l.startNode,A=l.startOffset;if(l.collapsed&&(null===c||void 0===c?void 0:c.isText())){var u=c.text(),d=u.substring(A);/^\u200b/.test(d)&&(c.text(u.substring(0,A)+d.substring(1)),l.setOffset(c,A,A),t.engine.change.range.select(l))}r=null}e(n),t.engine.model.mutation.submitCache()}};this.onContainer("compositionend",(function(e){t.engine.readonly||(t.isComposing=!1,setTimeout((function(){t.engine.model.mutation.isCache&&i(e)}),40))})),this.onContainer("beforeinput",(function(e){if(!t.engine.readonly){var n=t.engine,i=n.change,o=n.card,a=n.node,s=n.block,l=n.list;if("@"===e.data&&!t.isCardInput(e)){var c=t.engine.trigger("keydown:at",e);!1===c&&(t.engine.model.mutation.submitCache(),e.preventDefault())}i.rangePathBeforeCommand||i.cacheRangeBeforeCommand();var A=i.range.get(),u=A.cloneRange().shrinkToTextNode().enlargeToElementNode(),d=u.startNode;if(Ne&&"deleteCompositionText"===e.inputType&&"li"===d.name&&d.length>0&&!a.isCustomize(d)){var h=d[0].childNodes;1===h.length&&"BR"!==h[0].nodeName&&(d.prepend("
"),setTimeout((function(){var e=d[0].childNodes;2===e.length&&"BR"===e[0].nodeName&&"BR"===e[1].nodeName&&e[0].remove()}),0))}if(Qe&&"li"===d.name&&1===u.startOffset&&a.isCustomize(d)&&t.isComposing){var p=d.first(),f=null===p||void 0===p?void 0:p.next(),g=function(){var e=Ut("​",null);null===p||void 0===p||p.after(e),u.setOffset(e,1,1),i.range.select(u),r=d};if(null===f||void 0===f?void 0:f.isText()){var m=f.text();/^\u200b/.test(m)||g()}else"br"===(null===f||void 0===f?void 0:f.name)&&f.remove(),g()}if(u.collapsed||("body"===u.commonAncestorNode.attributes(be)?o.remove(u.commonAncestorNode):("body"===u.startNode.attributes(be)&&o.remove(u.startNode),"body"===u.endNode.attributes(be)&&o.remove(u.endNode))),u.startNode.isRoot()){var v=u.getStartOffsetNode();if(v instanceof Element&&vt(v)&&!v.querySelector(Be)&&o.remove(v),!u.collapsed&&u.endNode.isRoot()){var b=u.getEndOffsetNode();b instanceof Element&&vt(b)&&!b.querySelector(Be)&&o.remove(b)}}if(!u.collapsed&&!t.isComposing){var y,w=s.closest(u.startNode),x=s.closest(u.endNode);if((a.isCustomize(w)||a.isCustomize(x))&&!w.equal(x))null===(y=l.backspaceEvent)||void 0===y||y.trigger(new KeyboardEvent("")),a.insertText(e.data||"")}var k=e.inputType;!t.isComposing||k&&k.includes("Composition")||t.engine.model.mutation.submitCache();var C=["format","history"];k&&C.forEach((function(n){if(0===k.indexOf(n)){e.preventDefault();var r=k.substring(n.length).toLowerCase();t.engine.command.queryEnabled(r)&&t.engine.command.execute(r)}}))}}));var o=null;this.onContainer("input",(function(e){var n;if(!t.engine.readonly&&!t.isCardInput(e)){t.engine.isEmpty()?t.engine.showPlaceholder():t.engine.hidePlaceholder();var r=t.engine,a=r.change,s=r.card;if(e.target instanceof Element&&kt(e.target)&&s.active&&s.active.root.isBlockCard()&&!s.active.isEditable&&(null===(n=s.active.root.get())||void 0===n?void 0:n.isContentEditable)){var l=a.range.get(),c=Ut("


");return s.active.root.before(c),s.remove(s.active.root),l.select(c,!0),void a.range.select(l)}o&&clearTimeout(o),o=setTimeout((function(){i(e)}),10)}}))}}},{key:"onSelect",value:function(e,t,n){var r=this,o=this.options.bindSelect;o&&!o()||(this.onContainer(Ue?"touchstart":"mousedown",(function(e){r.isCardInput(e)||(r.isSelecting=!0,t&&t(e))})),this.onDocument(Ue?"touchend":"mouseup",(function(t){r.isSelecting&&(r.isSelecting=!1,window.setTimeout((function(){e(t),n&&n(t)}),10))})),this.onContainer("keydown",(function(){var e=$t.from(r.engine);r.keydownRange=e})),this.onContainer("keyup",(function(t){if(!r.engine.readonly&&!r.isCardInput(t)&&((0,i.ZP)("left",t)||(0,i.ZP)("right",t)||(0,i.ZP)("up",t)||(0,i.ZP)("down",t)||"Meta"===t.key||(0,i.ZP)("shift+left",t)||(0,i.ZP)("shift+right",t)||(0,i.ZP)("shift+up",t)||(0,i.ZP)("shift+down",t)||(0,i.ZP)("ctrl+b",t)||(0,i.ZP)("ctrl+f",t)||(0,i.ZP)("ctrl+n",t)||(0,i.ZP)("ctrl+p",t)||(0,i.ZP)("ctrl+a",t)||(0,i.ZP)("ctrl+e",t)||(0,i.ZP)("home",t)||(0,i.ZP)("end",t))){var n=$t.from(r.engine);if(r.keydownRange&&n&&n.equal(r.keydownRange))return;r.isComposing||e(t)}})))}},{key:"onPaste",value:function(e){var t=this,n=this.options.bindPaste;if(!n||n()){var r=!1;this.onContainer("keydown",(function(e){t.engine.readonly||((0,i.ZP)("mod",e)&&(0,i.ZP)("shift",e)&&(0,i.ZP)("v",e)||(r=!1),((0,i.ZP)("mod+shift+v",e)||(0,i.ZP)("mod+alt+shift+v",e))&&(r=!0))})),this.onDocument("paste",(function(n){var i=t.engine.change.range.get();if(t.engine.container.contains(i.commonAncestorNode)&&!t.engine.readonly&&!t.isCardInput(n)){n.preventDefault();var o=t.engine.clipboard.getData(n),a=r;r=!1,e((0,s.Z)((0,s.Z)({},o),{},{isPasteText:a}))}}))}}},{key:"onDrop",value:function(e){var t=this,n=this.options.bindDrop;if(!n||n()){var r,i,o,a=function(e){if(e.target&&!t.engine.readonly){e.stopPropagation(),t.dragoverHelper.setCursor();var n=Ut(e.target),o=n.attributes("drag-card-trigger");if(r=t.engine.card.find(o||n),r){var a,s;if(null===(a=r.toolbarModel)||void 0===a||a.hideCardToolbar(),i=r.find("img.data-drag-image"),i.length>0)i=t.engine.node.clone(i);else{i=Ut('
');var l=r.root.get();l&&i.css({width:l.clientWidth+"px",height:l.clientHeight+"px"})}i.css({position:"absolute",top:"-99999px",right:"-99999px"}),Ut(document.body).append(i),null===(s=e.dataTransfer)||void 0===s||s.setDragImage(i[0],0,0)}}};this.onRoot("dragstart",a),this.onContainer("dragstart",a),this.onContainer("dragover",(function(e){if(!t.engine.readonly){var n=t.dragoverHelper,r=n.getCursor();if(0!==r.length){n.parseEvent(e),o=n.getRange();var i=n.getRect();r.css({height:i.height+"px",top:Math.round(window.pageYOffset+(i.y||0))+"px",left:Math.round(window.pageXOffset+(i.x||0))+"px"})}else t.dragoverHelper.setCursor()}})),this.onContainer("dragleave",(function(){t.dragoverHelper.removeCursor()})),this.onContainer("dragend",(function(){t.dragoverHelper.removeCursor(),i&&(i.remove(),i=void 0)})),this.onContainer("drop",(function(n){if(!t.engine.readonly){n.preventDefault(),t.dragoverHelper.removeCursor(),i&&(i.remove(),i=void 0);var a=n.dataTransfer,s=[];try{a&&a.items&&a.items.length>0?Array.from(a.items).forEach((function(e){if("file"===e.kind){var t=e.getAsFile();t&&s.push(t)}})):a&&a.files&&a.files.length>0&&(s=Array.from(a.files))}catch(c){a&&a.files&&a.files.length>0&&(s=Array.from(a.files))}var l={event:n,range:o,card:r,files:s};e(l),r=void 0}}))}}},{key:"onDocument",value:function(e,t,n){this.addEvent("document",e,t,n)}},{key:"onWindow",value:function(e,t,n){this.addEvent("window",e,t,n)}},{key:"onContainer",value:function(e,t,n){this.addEvent("container",e,t,n)}},{key:"onRoot",value:function(e,t,n){this.addEvent("root",e,t,n)}},{key:"addEvent",value:function(e,t,n,r){var i=this;if(this.globalEvents[e]||(this.globalEvents[e]=[]),!this.globalEvents[e].find((function(e){return e.type===t}))){var o=function(){for(var n,r=i.events[e].filter((function(e){return e.type===t})),o=0;o

").replace(/

<\/p>/g,"


").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  "),e.indexOf("

")>=0&&(e="

".concat(e,"

")),e}}]),e}(),cn=function(e){var t="";for(var n in e)if("style"!==n){var r=We(e[n]);t+=" ".concat(n,'="').concat(r,'"')}return t.trim()},An=function(e){var t="";for(var n in e){n=n.toLowerCase();var r=We(e[n]);/^(padding|margin|text-indent)/.test(n)&&0===Ge(r)||(n.endsWith("color")&&(r=(0,B.Vi)(r).toHex()),t+=" ".concat(n,": ").concat(r,";"))}return t.trim()},un=function(){function e(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if((0,l.Z)(this,e),this.root=void 0,this.editor=void 0,this.isNormalize=!0,this.editor=n,this.isNormalize=i,"string"===typeof t){var o;t=t.replace(//gi,""),t=t.replace(/]+?)\/>/gi,(function(e,t){return"")})),t=null===(o=t)||void 0===o?void 0:o.replace(//gi,(function(e){return e.replace(/\son[a-zA-Z]{1,20}=/g,"notallow=")})),t=t.replace(/|\s+[^>]*>)/gi,"|\s+[^>]*>)/gi,"|\s+[^>]*>)/gi,"|\s+[^>]*>)/gi,"".concat(s,"
"))}else pt(t)?this.root=t:this.root=Ut(t);r&&r(this.root)}return(0,c.Z)(e,[{key:"convert",value:function(e,t,n){var r=e.transform(t),i=[],o=this.editor.node,a=null;while(r){var l,c=r,A=c.rule;i.push(A);var u=r.node,d=u.name,h=u.attributes,p=u.style;"card"!==d&&delete h[$],delete h["id"];var f=Ut("<".concat(d," />"));if(o.setAttributes(f,(0,s.Z)((0,s.Z)({},h),{},{style:p})),null===(l=f.get())||void 0===l||l.append.apply(l,(0,C.Z)(t.get().childNodes)),t.isCard())return t.replaceWith(f),f;(r.replace?(t.replaceWith(f),t=f):f.each((function(e){var n=t.get();n&&n instanceof Element&&n.append(e)})),a&&0!==a.length||(a=f),o.isBlock(f,n))?r=e.transform(f,(function(e){return i.indexOf(e)<0})):r=e.transform(t,(function(e){return i.indexOf(e)<0}))}return a}},{key:"normalize",value:function(e,t,n){var r=this,i=this.editor,a=i.node,s=i.inline;if(this.isNormalize){var l=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mark",r=e.attributes(),i=qe(r.style||"");if(delete r.style,0!==Object.keys(r).length||0!==Object.keys(i).length){var o=Object.keys(r).length,a=Object.keys(i).length,s=e.clone();t.filter(e,r,i,!0),s.removeAttributes($);var l=Object.keys(r),c=0;l.forEach((function(e){r[e]&&(c++,s.removeAttributes(e))}));var A=0,u=Object.keys(i);if(u.forEach((function(e){i[e]&&(A++,s.css(e,""))})),(c===o&&A===a||0===c&&0===A)&&t.getType(s)===n){e.before(s);var d=e.children();return s.append(d.length>0?d:"block"===n?"
":Ut("​",null)),e.remove(),void(e=s)}return""===s.attributes("style").trim()&&s.removeAttributes("style"),s}};e.traverse((function(c){if(c[0]!==e[0]&&!["style","script","meta"].includes(c.name))if(c.isElement()){var A=c.isCard();if(n&&(!t.getType(c)||A)){var u=r.convert(n,c,t);if(u)return!!A||u}if(A)return;if(a.isMark(c,t)){var d=function(){var e=[],a=t.getRule(c);if(a){var s=function(){var o;e.push(a),0===(null===(o=c.get())||void 0===o?void 0:o.childNodes.length)&&i.mark.repairCursor(c);var s=l(c);if(!s)return{v:{v:void 0}};var A=t.getType(s,(function(t){return t.name===s.name&&"mark"===t.type&&e.indexOf(t)<0}));if(!A&&n){var u=r.convert(n,s,t);if(u&&u.length>0){var d=c.children();return u.append(d.length>0?d:Ut("​",null)),c.append(0===s.length?u:s.children()),{v:{v:void 0}}}}var h=c;while("mark"===A){var p=h.children(),f=s;while(1){var g=f.children();if(!(g.length>0))break;f=g}if(f.append(p.length>0?p:Ut("​",null)),h.append(s),h=s,s=l(s),!s)break;if(A=t.getType(s,(function(t){return t.name===s.name&&"mark"===t.type&&e.indexOf(t)<0})),!A){if(n){var m=r.convert(n,s,t);if(m&&m.length>0){s=s.length>0?s.children():m,A="mark";continue}}break}if(a=t.getRule(s),!a)break;e.push(a)}}();if("object"===(0,o.Z)(s))return s.v}}();if("object"===(0,o.Z)(d))return d.v}else if(a.isInline(c))return s.flat(c,t)}else if(c.isText()){var h=c.text();if(/^\n+$/.test(h)||/^\s+$/.test(h)){var p=c.get(),f=p.previousSibling,g=p.nextSibling,m=f?t.getType(f):void 0,v=g?t.getType(g):void 0;if(!f&&g&&(!v||"block"===v))return void c.remove();g||!f||m&&"block"!==m||c.remove()}}}))}else{if(!n)return;var c=e.find(xe);c.each((function(e,i){var o=c.eq(i);o&&r.convert(n,o,t)}));var A=e.find("".concat(he,",").concat(ue,",").concat(de));A.each((function(e,i){var o=A.eq(i);o&&r.convert(n,o,t)}))}}},{key:"traverse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=this.editor.node,a=e.first();while(a)if(["style","script","meta"].includes(a.name))a=a.next();else{if(a.isElement()){var s=a.name,l=a.attributes();if(l[G]===J){a=a.next();continue}var c=qe(l.style||"");if(delete l.style,["left","right"].indexOf(l[be])>=0){a=a.next();continue}var A=!0,u=void 0;if(t&&l[G]!==te)if(u=t.getType(a),void 0===u){var d,h;A=!1;var p=a.parent();if(p&&o.isBlock(p,t)&&1===(null===(d=p.get())||void 0===d?void 0:d.childNodes.length)&&0===(null===(h=a.get())||void 0===h?void 0:h.childNodes.length)){var f=Ut("
");a.before(f),a.remove(),a=f,s=f.name,l={},c={},A=!0}}else t.filter(a,l,c);if("center"!==l[be]&&r.onOpen&&A){var g=r.onOpen(a,s,l,c);if(!1===g){a=a.next();continue}}("card"===s||l[fe]&&"true"!==l[we])&&!i||this.traverse(a,t,n,r,i),"center"!==l[be]&&r.onClose&&A&&r.onClose(a,s,l,c)}else if(a.isText()){var m=a[0].nodeValue?We(a[0].nodeValue):"";""===m&&o.isBlock(a.parent(),t||void 0)&&(a.prev()||(m=m.replace(/^[ \n]+/,"")),a.next()||(m=m.replace(/[ \n]+$/,"")));var v=a.prev(),b=a.next();v&&o.isBlock(v,t||void 0)&&b&&o.isBlock(b,t||void 0)&&""===m.trim()&&(m=m.trim()),r.onText&&r.onText(a,m)}a=a.next()}}},{key:"toValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=this.editor,a=o.node,s=this.root.clone(!0);e&&this.normalize(s,e,t),o.trigger("parse:value-before",s),this.traverse(s,e,t,{onOpen:function(t,n,r,s){var l;if(!1===o.trigger("parse:value",t,r,s,i))return!1;if(i.push("<"),i.push(n),Object.keys(r).length>0&&i.push(" "+cn(r)),Object.keys(s).length>0){var c=An(s);""!==c&&(i.push(' style="'),i.push(c),i.push('"'))}a.isVoid(n,e||void 0)&&0===(null===(l=t.get())||void 0===l?void 0:l.childNodes.length)?i.push(" />"):i.push(">")},onText:function(e,t){n&&t.length>1&&(t=t.replace(/[\u00a0 ]+/g,(function(e){var t=[];e=e.replace(/\u00a0/g," ");for(var n=0;n"))}}),o.trigger("parse:value-after",i),i.length>0&&/^\n+/g.test(i[0])&&(i[0]=i[0].replace(/^\n+/g,"")),i.length>0&&/\n+$/g.test(i[i.length-1])&&(i[i.length-1]=i[i.length-1].replace(/\n+$/g,""));var l=i.join("");return r?Xe(l):l}},{key:"toHTML",value:function(e,t){var n=Ut("
"),r=this.editor,i=r.container.css();return e&&t?(Ut(e).append(this.root).css(i),n.append(t)):n.append(this.root),r.trigger("parse:html-before",this.root),r.trigger("parse:html",n),r.trigger("parse:html-after",n),n.html().replace(/\u200b/g,"")}},{key:"toDOM",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=this.toValue(e,t,!1,!0),r=(new DOMParser).parseFromString(n,"text/html"),i=r.createDocumentFragment(),o=r.body.childNodes;while(o.length>0){var a=o[0];i.appendChild(a)}return i}},{key:"toText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.root.clone(!0),i=[],o=this.editor;return this.traverse(r,null,null,{onOpen:function(e,t,r,a){if(!1===o.trigger("parse:text",e,r,a,i))return!1;if("br"===t&&i.push("\n"),n&&"li"===e.name){if(e.hasClass(o.list.CUSTOMZIE_LI_CLASS))return;var s=e.parent(),l=null===s||void 0===s?void 0:s.css("listStyleType");if("ol"===(null===s||void 0===s?void 0:s.name)){var c=s[0]["start"],A=c||1;i.push("".concat(nt(l,A),". ")),s.attributes("start",A+1)}else"ul"===(null===s||void 0===s?void 0:s.name)&&i.push(nt(l)+" ")}},onText:function(e,t){t=je(t),t=t.replace(/\u00a0/g," "),t=t.replace(/\u200b/g,""),i.push(t)},onClose:function(t,n){var r=o.node;if("p"===n||r.isBlock(t,e||o.schema)){var a=Array.from(t.get().childNodes);if(0===a.length||a.some((function(t){if(t instanceof Text)return!1;if("BR"===t.nodeName)return!0;var n=(e||o.schema).getType(t);return!n||"block"===n})))return;i.push("\n")}}},t),i.join("").trim()}}]),e}(),dn=function(){function e(t,n){(0,l.Z)(this,e),this.source=void 0,this.engine=void 0,this.schema=void 0,this.source=t,this.engine=n,this.schema=this.engine.schema.clone()}return(0,c.Z)(e,[{key:"parser",value:function(){var e=this,t=this.engine.conversion.clone();this.engine.trigger("paste:schema",this.schema);var n=new un(this.source,this.engine,(function(t){e.engine.trigger("paste:origin",t)}));return n.toDOM(this.schema,t)}},{key:"getDefaultStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container,t={color:(0,B.Vi)(e.css("color")).toHex(),"background-color":(0,B.Vi)(e.css("background-color")).toHex(),"font-size":e.css("font-size")};return t}},{key:"elementNormalize",value:function(e){var t=this,n=this.getDefaultStyle(),r=this.engine,i=r.inline,o=r.list,a=this.engine.node,s=this.engine.mark,l=this.engine.block,c=[];Ut(e).traverse((function(r){var A,u,d,h=r.parent();if(h&&!r.isCard()&&r.fragment!==e)if(r.isText()){var p=r.text();if(/\u200b/.test(p)){var f=!0,g=r.next(),m=r.prev(),v=r.parent();(v&&a.isMark(v,t.schema)||v&&a.isInline(v,t.schema)||g&&a.isInline(g,t.schema)||m&&a.isInline(m,t.schema))&&(f=!1),f&&(p=p.replace(/\u200b/g,""),r.text(p))}else{var b;if(/^\n(\t)[0,]$/.test(p))return r.remove(),void(0===(null===(b=h.get())||void 0===b?void 0:b.childNodes.length)&&(h.after("


"),h.remove()));if(/^\n$/.test(p)){if(a.isList(h))return void r.remove();var y=r.next();y&&a.isBlock(y)&&r.remove()}}if(a.isList(h)){var w=r.next(),x=r.prev(),k=function(e,t){if(a.isCustomize(e)){var n=e.first();if(n&&n.isCard()){var r=n.attributes(fe)||n.attributes(ge);r&&o.addCardToCustomize(t,r)}}},C=null;return"li"===(null===w||void 0===w?void 0:w.name)?(C=w.clone(),k(w,C)):"li"===(null===x||void 0===x?void 0:x.name)?(C=x.clone(),k(x,C)):C=Ut("
  • "),r.before(C),C.append(r),C}}else{var _=r.css();for(var E in n){var S=_[E];S&&(E.endsWith("color")&&(S=(0,B.Vi)(S).toHex()),S.toLowerCase()===n[E].toLowerCase()&&r.css(E,""))}var F=t.schema.getType(r);if(!F){var T=r.first();return a.unwrap(r),T}a.removeMinusStyle(r,"text-indent"),a.isList(r)&&r.css("padding-left","");var M=r.attributes();M.style&&""===M.style.trim()&&r.removeAttributes("style");while("span"===r.name&&a.isEmpty(r)){var I=r.children();if(I.length>0)break;if(h=r.parent(),r.remove(),!h)return;if(r=h,h=r.parent(),!h)return;F=void 0,M=void 0}if(M||(M=r.attributes()),!M[ge]){var N=F?"block"===F:a.isBlock(r,t.schema),U=a.isVoid(r,t.schema),L=a.isBlock(h,t.schema);if(!N||"p"===M["data-type"]||U||L||//!node.isSolid() && ""!==a.html(r)){var Q;if("p"===M["data-type"]&&r.removeAttributes("data-type"),N&&"p"===(null===(A=h)||void 0===A?void 0:A.name))a.unwrap(h),h=r.parent(),(null===(Q=h)||void 0===Q?void 0:Q.fragment)===e&&(h=void 0),L=!!h&&a.isBlock(h,t.schema);var D=!!h&&a.isList(h);if("li"===r.name&&h&&!D){var H=Ut("
      ");return r.before(H),void H.append(r)}if(a.isList(r)&&h&&a.isList(h)){var O=[],z=[],Z=!0,R=h.children().toArray(),P=h.clone(),q=function(){var e,t;return(null!==(e=null===(t=P.get())||void 0===t?void 0:t.childNodes.length)&&void 0!==e?e:0)>0&&(Z?O.push(P):z.push(P),P=h.clone(),!0)};R.forEach((function(e,t){if(e)return Z&&e.equal(r)?(R.length-1===t?(q(),z.push(r)):(0===t||q(),O.push(r)),void(Z=!1)):void("li"!==e.name?(q(),Z?O.push(e):z.push(e)):P.append(e))})),q();var K=h.attributes(o.INDENT_KEY)||"0";r.attributes(o.INDENT_KEY,K),o.addIndent(r,1);var W=h;return O.forEach((function(e){var t,n=Ut(e);n&&0!==(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&(W.after(n),W=n)})),z.forEach((function(e){var t,n=Ut(e);n&&0!==(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&(W.after(n),W=n)})),h.remove(),r||void 0}if("li"!==r.name&&D){if("br"===r.name)return void r.remove();var j=Ut("
    • ");return r.before(j),void j.append(r)}if(a.isList(r)&&"li"===(null===(u=h)||void 0===u?void 0:u.name)){var V,G,$,Y,X,J,ee=null===(V=h)||void 0===V?void 0:V.parent();if(!ee)return void a.unwrap(h);var te=ee.clone(),ne=ee.clone(),re=!0,ie=ee.children().toArray();ie.forEach((function(e){e&&(re&&e.equal(h)?re=!1:re?te.append(e):ne.append(e))}));var oe=null===(G=h)||void 0===G||null===($=G.parent())||void 0===$?void 0:$.hasClass("data-list"),ae=null===(Y=h)||void 0===Y?void 0:Y.children(),se=null,le=null;ae.each((function(e,n){var r=ae.eq(n);if(r&&(!a.isEmptyWithTrim(r)||a.isVoid(r))){var i=a.isList(r),s=te[te.length-1];if(i){var l,c=(null===(l=Ut(s))||void 0===l?void 0:l.attributes(o.INDENT_KEY))||"0";return r.attributes(o.INDENT_KEY,c),o.addIndent(r,1),te[te.length]=r[0],void(se=null)}if(a.isBlock(e,t.schema)){var A=te.length;return te[A]=r[0],te[A+1]=te.clone()[0],void(se=null)}if(!se){var u;se=Ut(oe?'
    • '):"
    • ");var d=null===(u=Ut(s))||void 0===u?void 0:u.last();d?null===d||void 0===d||d.after(se):Ut(s).append(se)}se.append(e),le||(le=se)}})),null===(X=h)||void 0===X||X.remove();var ce=ee;return te.each((function(e){var t,n=Ut(e);n&&0!==(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&(ce.after(n),ce=n)})),ne.each((function(e){var t,n=Ut(e);n&&0!==(null===(t=n.get())||void 0===t?void 0:t.childNodes.length)&&(ce.after(n),ce=n)})),ee.remove(),(null===(J=le)||void 0===J?void 0:J.next())||te.next()||void 0}if("p"===r.name&&D){var Ae=Ut("
    • ");return a.replace(r,Ae),Ae}if(N&&!U&&""===a.html(r).trim()&&(a.isRootBlock(r,t.schema)||"li"===r.name)&&a.html(r,"
      "),N&&"li"===(null===(d=h)||void 0===d?void 0:d.name)){var ue,de,he=null!==(ue=null===(de=r.get())||void 0===de?void 0:de.childNodes)&&void 0!==ue?ue:[];if("p"===r.name){var pe=r.next();0!==he.length||pe||r.append("
      ");var me=r.first();return pe&&"p"===pe.name&&r.append("
      "),a.unwrap(r),me}var ve=h.parent();if(!ve)return;var be=ve.clone(),ye=ve.clone(),we=h.prev();while(we)be.prepend(we),we=h.prev();var xe=h.next();while(xe)ye.append(xe),xe=h.next();var ke=h.clone(),Ce=h.clone(),Be=r.prev();while(Be)ke.prepend(Be),Be=r.prev();var _e=r.next();while(_e)Ce.append(_e),_e=r.next();return ve.after(r),ke.first()&&be.append(ke),Ce.first()&&ye.prepend(Ce),be.first()&&ve.before(be),ye.first()&&r.after(ye),void ve.remove()}if(!N&&a.isInline(r)&&!r.isCard()&&!U){var Ee=r.allChildren().some((function(e){return a.isVoid(e,t.schema)}));a.isEmptyWithTrim(r)&&!Ee?r.remove():i.repairCursor(r)}a.removeSide(r);var Se=h,Fe=function e(n){if(Se&&!Se.fragment&&a.isBlock(n,t.schema)&&a.isBlock(Se,t.schema)&&!t.schema.isAllowIn(Se.name,n.name)){var r=n.children();a.unwrap(n),r.each((function(t,n){e(r.eq(n))}))}};Fe(r);while(r.length>0&&Se&&!Se.fragment&&a.isBlock(r,t.schema)&&!a.isBlock(Se,t.schema)){var Te=r.clone();a.unwrap(r),Se.before(Te),Te.append(Se),r=Te,Se=r.parent()}var Me=a.isMark(r,t.schema);if(r.length>0&&Me){var Ie=l.closest(r);if(!Ie.equal(r)){var Ne,Ue=s.findPlugin(r),Le=l.findPlugin(Ie);if(Ue&&(null===Le||void 0===Le||null===(Ne=Le.disableMark)||void 0===Ne?void 0:Ne.includes(Ue.name))){var Qe=r.first();return a.unwrap(r),Qe||void 0}}}if(Me){var De=s.findPlugin(r),He=c.concat();if(He.pop(),De){var Oe,ze=He.find((function(e){var t;return(null===(t=e.plugin)||void 0===t?void 0:t.name)===De.name&&e.node.length>0&&!e.node.equal(r)}));if(ze)return void(1===(null===(Oe=ze.node.get())||void 0===Oe?void 0:Oe.childNodes.length)?a.unwrap(ze.node):a.unwrap(r))}}if(Se=h,r.length>0&&Se&&a.isMark(Se,t.schema)&&Me){var Ze,Re=s.findPlugin(Se),Pe=null===(Ze=c[c.length-1])||void 0===Ze?void 0:Ze.plugin;if(Re&&Pe&&Pe.mergeLeval>Re.mergeLeval){var qe=Se.clone(!1),Ke=Se.children().toArray(),We=qe.clone(),je=qe.clone(),Ve=!0,Ge=-1;if(Ke.forEach((function(e,t){if(e.equal(r)){var n=r.children();qe.append(n),r.append(qe),Ve=!1,Ge=t}else Ve?We.append(e):je.append(e)})),Ge>0&&Se.before(We),Ge-1)return Se.before(r),Se.remove(),c.splice(c.length-2,1),r}}}else r.remove()}}}),void 0,void 0,(function(e){if(a.isMark(e)){var t=s.findPlugin(e);e["is_mark"]=!0,c.push({plugin:t,node:e})}}),(function(e){e["is_mark"]&&c.pop()}))}},{key:"normalize",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.engine.node,r=this.parser();this.elementNormalize(r);var i=this.engine.change.range.get(),o=i.commonAncestorNode,a=this.engine.inline.closest(o);if(o.inEditor()&&!a.isCard()&&n.isInline(a,this.schema))return this.removeElementNodes(Ut(r)),r;if(o.inEditor()&&o.isText()&&i.startContainer===i.endContainer){var s=o[0].nodeValue,l=null===s||void 0===s?void 0:s.substr(0,i.startOffset),c=null===s||void 0===s?void 0:s.substr(i.endOffset);if(/\[.*?\]\($/.test(l||"")&&/^\)/.test(c||""))return this.removeElementNodes(Ut(r)),r}Ut(r).traverse((function(t){var i;if(t.fragment!==r){var o=null===(i=t.get())||void 0===i?void 0:i.firstChild;if(t.length>0&&t[0].parentNode&&e.engine.trigger("paste:each",t),t.isText()){var a=t.text();if(/^(\r|\n)+$/.test(a)){var s,l=t.prev(),c=t.next();(l&&!n.isBlock(l)||c&&!n.isBlock(c)||l&&n.isBlock(l)&&c&&n.isBlock(c)||"p"===(null===(s=t.parent())||void 0===s?void 0:s.name))&&t.remove()}var A=/((\n)+)/.exec(a),u=t;while(A&&A.index>0&&A.index0&&n.unwrap(t);return 0===t.length&&o?Ut(o):void 0}})),this.engine.trigger("paste:each-after",Ut(r));var A=n.normalize(Ut(r));A.fragment&&(r=A.fragment),r.normalize();var u=Ut(r),d=u.find("ul,ol");return d.each((function(t,r){var i=d.eq(r);i&&n.isList(i)&&e.engine.list.addStart(i)})),this.engine.nodeId.generateAll(Ut(r),t),r}},{key:"removeElementNodes",value:function(e){var t=this,n=e.allChildren();n.forEach((function(e){e.isElement()&&t.engine.node.unwrap(e)}))}}]),e}();(function(e){e["INLINE"]="inline",e["BLOCK"]="block"})(nn||(nn={})),function(e){e["CARD_CHANGE"]="card_change",e["CLICK"]="click",e["MOUSE_DOWN"]="mouse_down"}(rn||(rn={})),function(e){e["NONE"]="none",e["BACKGROUND"]="background",e["BORDER"]="border"}(on||(on={}));var hn=(0,E.Z)("lastePasteRange"),pn=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,Object.defineProperty(this,hn,{writable:!0,value:void 0}),this.prevSelection=null,this.engine=t}return(0,c.Z)(e,[{key:"repairInput",value:function(e,t){var n=t,r=n.commonAncestorNode,i=this.engine.card.find(r),o=this.engine,a=o.node,s=o.mark,l=o.change;if(i&&i.type===nn.INLINE)if(i.isLeftCursor(r)){var c=r.closest(Ce),A=c.text().replace(/\u200B/g,"");A&&(A=We(A),t.setStartBefore(i.root),t.collapse(!0),a.html(c,"​"),a.insertText(A,t),l.apply(t))}else if(i.isRightCursor(r)){var u=r.closest(_e),d=u.text().replace(/\u200B/g,"");if(d){d=We(d);var h=i.root.next(),p=i.queryMarks?i.queryMarks(!0):[];if(p.length>0){var f=p[p.length-1];f.append(d);for(var g=p.length-2;g>=0;g--)f=p[g].append(f);i.root.after(f),t.select(f,!0).collapse(!1)}else h&&(h.isText()||a.isMark(h))?(t.select(h,!0).collapse(!0),a.insertText(d,t)):(t.setEndAfter(i.root),t.collapse(!1),a.insertText(d,t));a.html(u,"​"),l.apply(t)}}else l.range.toTrusty(t);var m=t.cloneRange().shrinkToTextNode(),v=m.startNode,b=m.startOffset,y=v.parent();if(v.isText()&&y&&a.isMark(y)){var w=v.get(),x=v.text(),k=e.inputType;if(b===x.length&&e.data&&k&&0===k.indexOf("insert")){var C=y,B=[];while(C&&a.isMark(C)){var _,E,S=s.findPlugin(C);S&&!S.followStyle&&B.push(C),C=C.parent();var F=null===(_=C)||void 0===_?void 0:_.parent();if((null===(E=C)||void 0===E?void 0:E.next())&&F&&a.isMark(F))break}var T=v.next();if(B.forEach((function(e,t){if(y.equal(e)&&T)B.splice(t,1);else{var n=e.next(),r=e;while(!n&&r){var i=r.parent();if(i&&a.isBlock(i))break;n=(null===i||void 0===i?void 0:i.next())||null,r=i}var o=n;while(o&&!o.isText()){if(a.isMark(o)&&s.compare(o,e)){B.splice(t,1);break}o=o.first()}}})),B.length>0){var M=w.splitText(x.length-e.data.length);M.remove(),a.isEmpty(y)&&y.remove(),s.unwrap(B.map((function(e){return e.clone()}))),a.insertText(x.substr(x.length-e.data.length)),s.merge(),t=l.range.get().cloneRange().shrinkToTextNode(),v=t.startNode,b=t.startOffset,w=v.get(),x=v.text()}}else if(e.data&&b===e.data.length&&k&&0===k.indexOf("insert")){var I=y,N=[];while(I&&a.isMark(I)){var U,L,Q=s.findPlugin(I);Q&&!Q.followStyle&&N.push(I),I=I.parent();var D=null===(U=I)||void 0===U?void 0:U.parent();if((null===(L=I)||void 0===L?void 0:L.prev())&&D&&a.isMark(D))break}var H=v.prev();N.forEach((function(e,t){if(y.equal(e)&&H)N.splice(t,1);else{var n=e.prev(),r=e;while(!n&&r){var i=r.parent();if(i&&a.isBlock(i))break;n=(null===i||void 0===i?void 0:i.prev())||null,r=i}var o=n;while(o&&!o.isText()){if(a.isMark(o)&&s.compare(o,e)){N.splice(t,1);break}o=o.last()}}})),N.length>0&&(w.splitText(e.data.length),w.remove(),a.isEmpty(y)&&y.remove(),s.unwrap(N.map((function(e){return e.clone()}))),a.insertText(""===e.data?" ":e.data),s.merge(),t=l.range.get().cloneRange().shrinkToTextNode(),v=t.startNode,b=t.startOffset,w=v.get(),x=v.text())}x.length>0&&/^\u200B$/g.test(x.substr(0,1))&&(w.splitText(1),w.remove())}var O=v.prev();if(v.isText()&&O&&a.isMark(O)){var z=v.get(),Z=v.text();Z.length>0&&/^\u200B$/g.test(Z.substr(0,1))&&(z.splitText(1),z.remove())}}},{key:"handleSelectionChange",value:function(){var e,t,n,r,i=this,o=this.engine,a=o.change,s=o.container,l=o.card;if(!a.isComposing()){var c=s.window,A=null===c||void 0===c?void 0:c.getSelection();if(((null===(e=this.prevSelection)||void 0===e?void 0:e.anchorNode)!==(null===A||void 0===A?void 0:A.anchorNode)||(null===(t=this.prevSelection)||void 0===t?void 0:t.anchorOffset)!==(null===A||void 0===A?void 0:A.anchorOffset)||(null===(n=this.prevSelection)||void 0===n?void 0:n.focusNode)!==(null===A||void 0===A?void 0:A.focusNode)||(null===(r=this.prevSelection)||void 0===r?void 0:r.focusOffset)!==(null===A||void 0===A?void 0:A.focusOffset))&&(this.prevSelection=A?{anchorNode:A.anchorNode,anchorOffset:A.anchorOffset,focusNode:A.focusNode,focusOffset:A.focusOffset}:null,A&&A.anchorNode)){var u=$t.from(this.engine,A);if(!u.commonAncestorNode.inEditor(s))return;a.onSelect();var d=u.containsCard()||u.commonAncestorNode.closest(xe).length>0&&0===u.startNode.closest("".concat(Ce,",").concat(_e,",").concat(ee)).length,h=u.collapsed;if(!h){var p=u.startNode,f=u.endNode,g=u.startOffset,m=u.endOffset,v=p.isElement()&&!p.isCard()?p.children().eq(g):p,b=f.isElement()&&!f.isCard()?f.children().eq(m-1):f;v&&b&&v.isCard()&&v.equal(b)&&(h=!0)}l.each((function(e){var t=e.getCenter();if(t&&t.length>0){var n=!!A.containsNode&&A.containsNode(t[0]);if(!n&&d&&A.focusNode){var r=i.engine.card.find(A.focusNode);r&&(h=!A.anchorNode||r.root.contains(A.anchorNode),h&&e.root.equal(r.root)&&(n=!0)),n&&h&&(d=!1)}var o=e.constructor.autoSelected;e.select(n&&(!h||!1!==o))}}))}}}},{key:"init",value:function(){var e=this,t=this.engine,n=t.change,r=t.card,o=t.clipboard;n.event.onInput((function(t){var r=n.range.get();e.repairInput(t,r),n.range.select(r),n.onSelect(r),n.change()})),n.event.onDocument("selectionchange",(function(){e.handleSelectionChange()})),n.event.onSelect((function(e){var t=n.range.get();0!==t.startNode.closest(X).length&&(t.collapsed&&t.containsCard()&&n.range.toTrusty(t),n.range.select(t),(0,i.P6)("shift+left",e)||(0,i.P6)("shift+right",e)||(0,i.P6)("shift+up",e)||(0,i.P6)("shift+down",e)||r.activate(t.commonAncestorNode),n.onSelect(t))}),(function(){n.onSelectStart()}),(function(){n.onSelectEnd()})),n.event.onDocument("mousedown",(function(e){if(e.target){var t=Ut(e.target);if(0!==t.closest("body").length&&!(t.closest(".am-view").length>0)){var n=t;while(n){var i=n.attributes(G);if(i&&[Y,te].indexOf(i)<0)return;n=n.parent()}r.activate(t,rn.MOUSE_DOWN,e)}}})),n.event.onDocument("copy",(function(t){var r=n.range.get();e.engine.container.contains(r.commonAncestorNode)&&o.write(t)})),n.event.onDocument("cut",(function(t){var r=n.range.get();if(e.engine.container.contains(r.commonAncestorNode)&&!e.engine.readonly){var i=o.write(t,void 0);i&&(t.stopPropagation(),o.cut(),n.change())}}));var s=function(t){n.cacheRangeBeforeCommand();var r=ct(e.engine,"zero");r.enable(["paragraph","html_inline","newline"]);var i=r.parse(t,{});if(0!==i.length)return At(e.engine,r,i)},l=function(){var t=(0,a.Z)(g().mark((function t(r){var i,o,a;return g().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(o=s(r),null!==o){t.next=3;break}return t.abrupt("return");case 3:if(a=function(){e.engine.history.saveOp(),n.cacheRangeBeforeCommand(),e.paste(o,(0,_.Z)(e,hn)[hn],void 0,!1)},"confirm"===(null===(i=e.engine.options.markdown)||void 0===i?void 0:i.mode)){t.next=7;break}return a(),t.abrupt("return");case 7:e.engine.messageConfirm("markdown",e.engine.language.get("checkMarkdown","title")).then((function(){a()})).catch((function(t){t&&e.engine.messageError("markdown",t)}));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();n.event.onPaste((function(t){var r=t.html,i=t.text,o=t.files,a=t.isPasteText,s="";if(0===o.length)if(a){var c="";i?c=i:r&&(c=new un(r,e.engine).toText()),s=new ln(c).toHTML()}else r&&r.indexOf('')>-1||r?s=r:i&&(s=new ln(i).toHTML());if(!1!==e.engine.trigger("paste:event",t,s)&&0===o.length){n.cacheRangeBeforeCommand(),e.paste(s);var A=e.engine.options.markdown||{};if(!1!==A.mode)if(A.check||!i||/^https?:\/\/\S+$/i.test(i.trim()))A.check&&A.check(null!==i&&void 0!==i?i:"",null!==r&&void 0!==r?r:"").then((function(e){e&&l(e)}));else{if(!i)return;if(!r)return void setTimeout((function(){l(i)}),0);var u=i.split(/\r\n|\n/)||"",d=0,h=0,p=!1,f=(new DOMParser).parseFromString(r,"text/html"),g=f.querySelectorAll("li"),m=[];g.forEach((function(e){var t,n,r=null!==(t=e.textContent)&&void 0!==t?t:"";("OL"===(null===(n=e.parentElement)||void 0===n?void 0:n.nodeName)||/\d\.\s+/.test(r))&&m.push(r)}));for(var v=0;v){1,}\s+/.test(b)?h++:/^\d\.\s+/.test(b)?m.includes(b)||m.includes(b.replace(/^\d\./,"").trim())||h++:(/^(---|\*\*\*|\+\+\+)/.test(b)||/(\*|~|\^|_|\`|\]\(https?:\/\/)/.test(b))&&h++))}h>0&&(0===d||h/d>.5)&&setTimeout((function(){l(i)}),0)}}}));var c=function(e){return!e||r.closest(e.commonAncestorContainer)};n.event.onDrop((function(t){var r=t.event,i=t.range,o=t.card,a=t.files;if(o){if(r.preventDefault(),c(i))return;var s=o.constructor,l=s.cardName,A=o.getValue();e.engine.card.remove(o.root),n.range.select(i),e.engine.card.insert(l,A)}if(a.length>0){if(r.preventDefault(),c(i))return;n.range.select(i),e.engine.trigger("drop:files",a)}}))}},{key:"paste",value:function(e,t,n){var r=this,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this.engine.change,l=new dn(e,this.engine).normalize(a);this.engine.trigger("paste:before",l),o?o(l,t,void 0,i):s.insert(l,t,(function(e){var t;r.engine.trigger("paste:insert",e);var i=e.cloneRange(),o=i.endNode,a="";o.isCard()&&0===(null===(t=o.get())||void 0===t?void 0:t.childNodes.length)&&(i.setEndAfter(o),a=o.attributes($)),(0,_.Z)(r,hn)[hn]=i,e.collapse(!1);var l=e.startNode.closest("".concat(xe,",").concat(ke));if(l.length>0){var c=l.attributes();(c[ye]||c[ge])&&e.setStartAfter(l)}var A=e.createSelection();r.engine.card.render(void 0,(function(t){if(A.move(),a){var o=r.engine.container.find('[data-id="'.concat(a,'"]'));o.length>0&&(i.setEndAfter(o),(0,_.Z)(r,hn)[hn]=i)}e.scrollRangeIntoView(),s.range.select(e),n&&n(t),r.engine.trigger("paste:after")}))}),i)}}]),e}(),fn=(0,E.Z)("lastBlurRange"),gn=(0,E.Z)("otpions"),mn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.Z)(this,e),this.engine=void 0,Object.defineProperty(this,fn,{writable:!0,value:void 0}),Object.defineProperty(this,gn,{writable:!0,value:void 0}),this.engine=t,(0,_.Z)(this,gn)[gn]=n}return(0,c.Z)(e,[{key:"setLastBlurRange",value:function(e){(null===e||void 0===e?void 0:e.commonAncestorNode.inEditor())?(0,_.Z)(this,fn)[fn]=e:(0,_.Z)(this,fn)[fn]=void 0}},{key:"toTrusty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.get(),t=e.commonAncestorNode;t.isEditable()||t.inEditor()||e.select(this.engine.container,!0).shrinkToElementNode().collapse(!1);var n=e.cloneRange();if(n.collapse(!0),this.setCardRang(n),e.startNode.equal(n.startNode)&&e.startOffset===n.startOffset||e.setStart(n.startContainer,n.startOffset),n=e.cloneRange(),n.collapse(!1),this.setCardRang(n),e.endNode.equal(n.endNode)&&e.endOffset===n.endOffset||e.setEnd(n.endContainer,n.endOffset),e.collapsed){n=e.cloneRange(),n.enlargeFromTextNode();var r=Ut(n.startContainer),i=n.startOffset;this.engine.node.isInline(r)&&0===i&&e.setStartBefore(r[0]),this.engine.node.isInline(r)&&i===r[0].childNodes.length&&e.setStartAfter(r[0]),e.collapse(!0)}return e}},{key:"setCardRang",value:function(e){var t=this,n=e.startNode,r=e.startOffset,i=this.engine.card,o=i.find(n);if(o){var a,s=o.getCenter().get();if(s&&(!n.isElement()||(null!==(a=n[0].parentElement)&&void 0!==a?a:n[0].parentNode)!==o.root[0]||n.attributes(be))){var l=function(){var e=$t.create(t.engine);return e.select(s,!0),e.comparePoint(n,r)<0};if("inline"===o.type)return e.select(o.root),void e.collapse(l());l()?i.focusPrevBlock(o,e,!0):i.focusNextBlock(o,e,!0)}}}},{key:"get",value:function(){var e=this.engine.container,t=e.window,n=$t.from(this.engine,t,!1);return n||(n=$t.create(this.engine,t.document).select(e,!0).shrinkToElementNode().collapse(!1)),n}},{key:"select",value:function(e){var t,n,r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=this.engine,a=o.container,s=o.inline,l=o.node,c=o.change,A=a.window,u=null===A||void 0===A?void 0:A.getSelection();if(!c.isComposing()){if(e.collapsed){var d,h,p,f,g=e.startNode,m=e.startOffset;if((g.isElement()&&1===m&&1===(null===(d=g.get())||void 0===d?void 0:d.childNodes.length)||2===m&&2===(null===(h=g.get())||void 0===h?void 0:h.childNodes.length)&&(null===(p=g.first())||void 0===p?void 0:p.isCard()))&&"br"===(null===(f=g.last())||void 0===f?void 0:f.name)&&(e.setStart(g,m-1),e.collapse(!0)),g.isText()){var v=g.parent();"right"===(null===v||void 0===v?void 0:v.attributes(be))&&0===m?(e.setStart(g,1),e.collapse(!0)):"left"===(null===v||void 0===v?void 0:v.attributes(be))&&1===m&&(e.setStart(g,0),e.collapse(!0))}}var b=e.cloneRange().shrinkToTextNode(),y=b.startNode,w=b.endNode,x=b.startOffset,k=b.endOffset,C=y.prev(),B=w.next();if(C&&!C.isCard()&&!l.isVoid(C)&&l.isInline(C)){var E=y.text();/^\u200B/g.test(E)&&0===x&&(e.setStart(w,x+1),e.collapsed&&e.collapse(!0))}if(B&&!B.isCard()&&!l.isVoid(B)&&l.isInline(B)){var S=w.text();/\u200B$/g.test(S)&&k===S.length&&(e.setEnd(w,k-1),e.collapsed&&e.collapse(!1))}var F=s.closest(y);if(!F.isCard()&&l.isInline(F)&&!l.isVoid(F)){var T,M;if(y.isText()&&!y.prev()&&(null===(T=y.parent())||void 0===T?void 0:T.equal(F))&&0===x){var I=y.text();/^\u200B/g.test(I)&&(e.setStart(y,x+1),e.collapsed&&e.collapse(!0))}if(w.isText()&&!w.next()&&(null===(M=w.parent())||void 0===M?void 0:M.equal(F))){var N=w.text();k===N.length&&/\u200B$/g.test(N)&&(e.setEnd(w,k-1),e.collapsed&&e.collapse(!1))}}if(y=e.startNode,w=e.endNode,y.isText()||w.isText()){var U=e.cloneRange().enlargeFromTextNode();y=U.startNode,w=U.endNode}var L=y.children();l.isCustomize(y)&&0===x&&e.setStart(y,1),l.isCustomize(w)&&0===k&&e.setEnd(w,1);var Q=this.engine.model.mutation.isStopped;if("p"===y.name&&!Q)if(0===L.length)y.append("
      ");else if(!Ie&&L.length>1&&"BR"!==L[L.length-2].nodeName&&"BR"===L[L.length-1].nodeName){var D=y.last();null===D||void 0===D||D.remove()}e.collapsed||Q||"p"!==w.name||0!==(null===(t=w.get())||void 0===t?void 0:t.childNodes.length)||w.append("
      ");var H=y.children();if(l.isList(y)&&!Q&&(0===H.length||"BR"===H[0].nodeName)){var O=Ut("


      ");this.engine.nodeId.create(O),y.before(O),y.remove(),y=O}if("li"===y.name&&!Q){var z;if(l.isCustomize(y)&&!(null===(z=y.first())||void 0===z?void 0:z.isCard())){var Z,R,P=null===(Z=y.parent())||void 0===Z?void 0:Z.children().toArray().find((function(e){var t;return null===(t=e.first())||void 0===t?void 0:t.isCard()})),q=null===P||void 0===P||null===(R=P.first())||void 0===R?void 0:R.attributes(fe);q?this.engine.list.addCardToCustomize(y,q):this.engine.list.unwrapCustomize(y)}if(0===L.length)y.append("
      ");else if(!l.isCustomize(y)&&L.length>1&&"BR"!==L[L.length-2].nodeName&&"BR"===L[L.length-1].nodeName){var K;null===(K=y.last())||void 0===K||K.remove()}else if(l.isCustomize(y)&&1===L.length)y.append("
      ");else if(l.isCustomize(y)&&L.length>2&&"BR"!==L[L.length-2].nodeName&&"BR"===L[L.length-1].nodeName){var W;null===(W=y.last())||void 0===W||W.remove()}}if(!e.collapsed&&"li"===w.name&&!Q){var j=w.children();if(0===j.length)w.append("
      ");else if(!l.isCustomize(w)&&j.length>1&&"BR"!==j[j.length-2].nodeName&&"BR"===j[j.length-1].nodeName){var V;null===(V=y.last())||void 0===V||V.remove()}else if(l.isCustomize(w)&&1===j.length)w.append("
      ");else if(l.isCustomize(w)&&j.length>2&&"BR"!==j[j.length-2].nodeName&&"BR"===j[j.length-1].nodeName){var G;null===(G=y.last())||void 0===G||G.remove()}}!y.isEditable()||Q||0!==(null===(n=y.get())||void 0===n?void 0:n.childNodes.length)||this.engine.model.mutation.isStopped||y.html("


      "),u&&(e.collapsed||u.rangeCount>0&&!e.equal(u.getRangeAt(0)))&&(null===(r=e.startNode.get())||void 0===r?void 0:r.isConnected)&&(u.removeAllRanges(),u.addRange(e.toRange()));var $=(0,_.Z)(this,gn)[gn].onSelect;$&&i&&$(e)}}},{key:"focus",value:function(e){var t,n=this,r=(0,_.Z)(this,fn)[fn]||this.get();void 0!==e&&r.select(this.engine.container,!0).shrinkToElementNode().collapse(e),this.select(r);var i=r.commonAncestorNode.closest(ne);if(null===i||void 0===i||null===(t=i.get())||void 0===t||t.focus(),i.length>0&&!this.engine.container.equal(i)){var o,a=new MouseEvent("mousedown");null===(o=this.engine.container.get())||void 0===o||o.dispatchEvent(a),setTimeout((function(){var e,t=new MouseEvent("mouseup");null===(e=n.engine.container.get())||void 0===e||e.dispatchEvent(t)}),0)}}},{key:"blur",value:function(){var e,t,n=this.get();null===(e=n.commonAncestorNode.closest(ne).get())||void 0===e||e.blur(),null===(t=this.engine.container.get())||void 0===t||t.blur(),this.engine.trigger("blur")}}]),e}(),vn=new WeakMap,bn=new WeakMap,yn=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.Z)(this,e),this.engine=void 0,this.options=void 0,this.event=void 0,this.valueCached=null,this.onChange=void 0,this.onRealtimeChange=void 0,this.onSelect=void 0,this.onSelectStart=void 0,this.onSelectEnd=void 0,this.onSetValue=void 0,this.rangePathBeforeCommand=void 0,this.marks=[],this.blocks=[],this.inlines=[],this.changeTrigger=[],this.range=void 0,this.nativeEvent=void 0,this.options=r,this.engine=t,this.event=new sn(t,{}),this.onChange=this.options.onChange||function(){},this.onRealtimeChange=this.options.onRealtimeChange||function(){};var i=null;this.onSelect=function(e){var r,o,a,s,l=t.mark,c=t.block,A=t.inline;e=e||n.range.get(),n.marks=l.findMarks(e),n.blocks=c.findBlocks(e),n.inlines=A.findInlines(e),(null===(r=i)||void 0===r?void 0:r.startContainer)===e.startContainer&&(null===(o=i)||void 0===o?void 0:o.startOffset)===e.startOffset&&(null===(a=i)||void 0===a?void 0:a.endContainer)===e.endContainer&&(null===(s=i)||void 0===s?void 0:s.endOffset)===e.endOffset||(i={startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset},bn.get(n.engine)||(bn.set(n.engine,!0),Promise.resolve().then((function(){bn.set(n.engine,!1),n.options.onSelect&&n.options.onSelect()}))))},this.onSelectStart=function(){n.options.onSelectStart&&n.options.onSelectStart()},this.onSelectEnd=function(){n.options.onSelectEnd&&n.options.onSelectEnd()},this.onSetValue=this.options.onSetValue||function(){},this.range=new mn(t,{onSelect:function(e){n.onSelect(e)}}),this.nativeEvent=new pn(t)}return(0,c.Z)(e,[{key:"init",value:function(){this.nativeEvent.init()}},{key:"_change",value:function(){if(!this.isComposing()){this.engine.card.gc();var e=2===this.changeTrigger.length?"both":"remote"===this.changeTrigger[0]?"remote":"local";this.onChange(e),this.changeTrigger=[]}}},{key:"change",value:function(e,t){var n=this,r=e?"remote":"local",i=void 0;if(e)null===t||void 0===t||t.forEach((function(e){if(i=e.closest(ne),i&&i.length>0){var t=n.engine.card.find(i,!0);(null===t||void 0===t?void 0:t.onChange)&&(null===t||void 0===t||t.onChange(r,i))}}));else{var o=this.range.get(),a=o.startNode;if(a.inEditor())i=a.closest(ne);else{var s,l=a.closest(ee),c=l.attributes(Ee);if(c)i=null===(s=this.engine.card.find(c))||void 0===s?void 0:s.root.closest(ne)}if(i&&i.length>0){var A=this.engine.card.find(i,!0);(null===A||void 0===A?void 0:A.onChange)&&(null===A||void 0===A||A.onChange(r,i))}else null===t||void 0===t||t.forEach((function(e){if(i=e.closest(ne),i&&i.length>0){var t=n.engine.card.find(i,!0);(null===t||void 0===t?void 0:t.onChange)&&(null===t||void 0===t||t.onChange(r,i))}}))}this.onRealtimeChange(r),this.changeTrigger.indexOf(r)<0&&this.changeTrigger.push(r),vn.get(this.engine)||(vn.set(this.engine,!0),Promise.resolve().then((function(){vn.set(n.engine,!1),n._change()})))}},{key:"isComposing",value:function(){return this.event.isComposing}},{key:"isSelecting",value:function(){return this.event.isSelecting}},{key:"initValue",value:function(e){var t,n,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.engine.container,o=i.html(),a="


      ";if(!(o===a||((null===(t=i.get())||void 0===t?void 0:t.childNodes.length)||0)>0)){var s=o||a,l=Ut(s);0===(null===(n=l.get())||void 0===n?void 0:n.childNodes.length)&&l.html("
      "),i.empty().append(l);var c=e||this.range.get();!e&&r&&(c.select(l,!0).collapse(!1),this.apply(c))}}},{key:"setValue",value:function(e,t,n){var r=this.range.get(),i=this.engine,o=i.schema,a=i.conversion,s=i.container,l=i.history,c=i.mark,A=i.card;if(""===e)this.engine.container.html(e),this.initValue(void 0,!1),n&&n(0);else{var u=new un(e,this.engine,(function(e){c.removeEmptyMarks(e),e.allChildren("editable").forEach((function(e){t&&t(e)}))}),!1);s.html(u.toValue(o,a,!1,!0)),A.render(void 0,(function(e){n&&n(e)}));var d=s.find(he),h=new Pt(this.engine,r);d.length>0&&(h.anchor=d,h.focus=d);var p=s.find(ue),f=s.find(de);p.length>0&&f.length>0&&(h.anchor=p,h.focus=f),h.anchor&&h.focus&&(h.move(),this.range.select(r),this.onSelect()),this.onSetValue(),l.clear()}this.change()}},{key:"setHtml",value:function(e,t){var n=this,r=this.engine,i=r.card,o=r.container;this.nativeEvent.paste(e,void 0,t,!0,(function(e,r,a,s){o.empty().append(e),i.render(void 0,(function(e){n.initValue(void 0,!1),n.engine.trigger("paste:after"),t&&t(e)})),n.change()}),!1)}},{key:"setMarkdown",value:function(e,t){var n=this,r=ct(this.engine,"zero");r.enable(["paragraph","html_inline","newline"]);var i=r.parse(e,{});if(0!==i.length){var o=At(this.engine,r,i);o||(o=e);var a=this.engine,s=a.card,l=a.container;this.nativeEvent.paste(o,void 0,t,!0,(function(e,r,i,o){l.empty().append(e),s.render(void 0,(function(e){n.initValue(void 0,!1),n.engine.trigger("paste:after"),t&&t(e)})),n.change()}))}}},{key:"getOriginValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.engine,r=n.schema,i=n.conversion;return new un(t?e.clone(!0):e,this.engine,void 0,!1).toValue(r,i)}},{key:"getValue",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.ignoreCursor||this.isComposing())e=this.getOriginValue();else{var n=this.range.get(),r=this.engine.container.clone(!0);if(!n.inCard()){var i=n.toPath(!0);if(!i)return this.getOriginValue(r,!1);n=$t.fromPath(this.engine,i,!0,r),n.createSelection()}e=this.getOriginValue(r,!1)}return e}},{key:"cacheRangeBeforeCommand",value:function(){this.rangePathBeforeCommand=this.range.get().toPath()}},{key:"getRangePathBeforeCommand",value:function(){var e=this.rangePathBeforeCommand;return this.rangePathBeforeCommand=void 0,e}},{key:"isEmpty",value:function(){var e=this.engine,t=e.container,n=e.node,r=e.schema,i=r.getAllowInTags(),o=t.children();return 0===o.length||1===o.length&&n.isEmpty(t)&&!t.allChildren().some((function(e){return i.includes(e.name)}))}},{key:"combinText",value:function(){it(this.engine.container)}},{key:"apply",value:function(e){this.combinText();var t=this.engine,n=t.inline,r=t.mark,i=t.nodeId;if(e){var o=e.createSelection("change-apply");n.findInlines(e).forEach((function(e){return n.repairCursor(e)})),r.findMarks(e).forEach((function(e){return r.repairCursor(e)})),o.move(),e.shrinkToTextNode(),this.range.select(e)}this.change(),i.generateAll(this.engine.container)}},{key:"insert",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.engine,a=o.block,s=o.list,l=o.schema,c=o.mark,A=o.inline,u=this.engine.node;t=t||this.range.toTrusty();var d=a.closest(t.startNode),h=a.closest(t.endNode),p=h[0]===d[0],f=a.isLastOffset(t,"end"),g=l.getCanMergeTags(),m=l.getAllowInTags(),v=d.closest(g.join(",")),b=t.collapsed,y=e.childNodes,w=Ut(e.firstChild||[]),x=function(){var n,r=Ut(e),i=r.first(),o=t.cloneRange().shrinkToElementNode().shrinkToTextNode(),a=o.startNode;if(a.inEditor()&&i&&"p"===i.name&&(1!==i.length||"br"!==(null===(n=i.first())||void 0===n?void 0:n.name))){if("p"===a.name&&u.isEmptyWidthChild(a)){var s=i.css();a.css(s)}u.unwrap(i)}};if(b){if(x(),t.startNode.isText()){var k=A.closest(t.startNode),C=t.startNode.text();0===k.length&&!k.equal(t.startNode)&&/^\u200B/.test(C)&&t.startNode.text(C.substr(1))}}else this.delete(t,p||!f,i),u.isEmptyWidthChild(t.startNode)&&t.shrinkToElementNode().shrinkToTextNode(),x();var B=void 0,_=function(e){B&&B.node[0].isConnected&&(e.shrinkToElementNode().setStart(B.node,B.offset),e.enlargeToElementNode()),a.merge(e),s.merge(void 0,e),c.merge(e),A.flat(e),r&&r(e),n.apply(e)};if(u.isList(t.startNode)||t.startNode.closest("li").length>0){var E=t.startNode.children();return B={node:t.startNode,offset:1===E.length&&"BR"===E[0].nodeName?0:t.startOffset},s.insert(e,t),void _(t)}if(w[0]){if(!u.isBlock(w)){if(t.shrinkToElementNode(),y.length>0){var S=t.startNode.children();B={node:t.startNode,offset:1===S.length&&"BR"===S[0].nodeName?0:t.startOffset}}var F=w.next(),T=w,M=u.insert(w,t);M&&(t=M);while(F&&!u.isBlock(F)){t.startContainer.nodeType===Node.TEXT_NODE&&t.enlargeToElementNode().collapse(!1);var I=F.next();T.after(F),T=F,F=I}if(T!==w&&t.select(T,!0).collapse(!1),0===y.length)return void _(t)}var N=t.cloneRange().enlargeToElementNode(!0).collapse(!1),U=N.startContainer.childNodes[0===t.startOffset?0:t.startOffset-1],L=N.startContainer.childNodes[t.startOffset];if(0!==y.length){var Q=Ut(y[y.length-1]);if("br"===Q.name&&(Q.remove(),Q=Ut(y[y.length-1])),!B){var D=t.startNode.children();B={node:t.startNode,offset:1===D.length&&"BR"===D[0].nodeName?0:t.startOffset}}var H=Ut(y[0]),O=null,z=[];while(H&&H.length>0){var Z,R;u.removeSide(H);var P=H.next();if(P||(Q=H),O?O.after(H):(u.isInline(t.startNode)&&(t.setStartAfter(t.startNode),t.collapse(!0)),u.insert(H,t,!0),u.isInline(H)&&(t.setEndAfter(H),t.collapse(!1))),(null===(Z=H.get())||void 0===Z?void 0:Z.isConnected)&&z.push(H),u.isBlock(H)||(null===P||void 0===P?void 0:P.isText())?O=H:(O&&t.select(H,!0).collapse(!1),O=null),P||!(null===(R=H.get())||void 0===R?void 0:R.isConnected)||u.isInline(H)||t.select(H,!0).collapse(!1),B&&!B.node[0].isConnected){var q=H.parent();q&&(B={node:q,offset:H.index()})}H=P}v[0]&&z.forEach((function(e){g.indexOf(e.name)<0&&0===e.closest(v.name).length&&u.wrap(e,u.clone(v,!1,!1))}))}var K=function(e){var t=e.first();if(!t||!u.isBlock(t))return e;while(m.indexOf(t?t.name:"")>-1)t=t.first();return t},W=function(e){var t=e.last();if(!t||!u.isBlock(t))return e;while(m.indexOf(t?t.name:"")>-1)t=t.last();return t},j=function(e,t){if(!e.isCard()&&!w.isCard()){var n=t.parent(),r=e.parent(),i=n&&!n.isEditable()&&r&&!r.isEditable()&&n.name===r.name;return"p"===t.name&&i||e.name===t.name&&i&&!("li"===e.name&&!s.isSame(e.parent(),t.parent()))}},V=function(e){while(!e.isEditable()){var t=e.parent();if(e.remove(),!t||!u.isEmpty(t))break;e=t}},G=function(e,t){if(e.name===t.name&&"p"===e.name){var n=t.attributes();n[$]&&delete n[$],e.attributes(n)}u.isEmptyWidthChild(e)&&!u.isEmptyWidthChild(t)&&(e.get().innerHTML=""),u.isCustomize(e)===u.isCustomize(t)&&s.unwrapCustomize(t)};if(U){var Y=K(Ut(U.nextSibling||[])),X=W(Ut(U));"p"===X.name&&Y.name!==X.name&&j(X,Y)&&(G(X,Y),u.merge(X,Y,!1),V(Y))}if(L){var J=W(Ut(L.previousSibling||[])),ee=K(Ut(L));J&&j(J,ee)&&(u.merge(J,ee,!1),V(ee))}_(t)}else _(t)}},{key:"paste",value:function(e,t,n){this.nativeEvent.paste(e,t,n,!0)}},{key:"delete",value:function(e,t){var n,r,i,o,a,s,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=e||this.range.toTrusty();if(c.collapsed)return this.isEmpty()&&this.initValue(c),void(e||this.apply(c));var A=this.engine,u=A.mark,d=A.inline,h=A.card,p=this.engine.node,f=this.engine.block,g=c.cloneRange();g.collapse(!0);var m=l?u.findMarks(g):[];c.enlargeToElementNode();var v=f.closest(c.cloneRange().shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode);if(!v.inEditor()&&!v.isRoot())return this.isEmpty()&&this.initValue(c),void(e||this.apply(c));if(v.isRoot()){var b=v.children().eq(c.startOffset);while(null===(y=b)||void 0===y?void 0:y.isCard()){var y,w=b.equal(c.endNode)||b.contains(c.endNode),x=b.next()||void 0,k=h.find(b);if(k?h.removeNode(k):b.remove(),w){b=void 0;break}b=x}if(!b)return this.isEmpty()&&this.initValue(c),void(e||this.apply(c));v=b}var C=c.endNode,B=c.endOffset,_=!f.closest(c.startNode).equal(f.closest(C)),E=d.closest(C);if(E.length>0&&(null===(n=C.parent())||void 0===n?void 0:n.equal(E))&&C.isText()){var S=C.text();B===S.length-1&&c.setEndAfter(E)}var F=c.cloneRange().shrinkToElementNode().shrinkToTextNode().getEndOffsetNode();c.extractContents();var T=c.startNode;if(T.isEditable()&&0===(null===(r=T.get())||void 0===r?void 0:r.childNodes.length)&&(T.html("


      "),this.engine.nodeId.generate(T)),T=c.shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode,T.isCard()&&0===T.find(Be).length&&h.remove(T),c.collapse(!0),T=c.shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode,v.isElement()&&!v.equal(T)&&0===v.get().childNodes.length&&v.remove(),T.isText()||!v.inEditor())return this.isEmpty()&&this.initValue(c),void(e||this.apply(c));var M=!1;if(_&&0===(null===(i=T.get())||void 0===i?void 0:i.childNodes.length)){var I,N,U,L,Q=c.createSelection();T.remove(),(null===(I=Q.anchor)||void 0===I||null===(N=I.get())||void 0===N?void 0:N.isConnected)&&(null===(U=Q.focus)||void 0===U||null===(L=U.get())||void 0===L?void 0:L.isConnected)&&Q.move(),M=!0,T=c.startNode}var D,H,O=v,z=F&&F.isConnected?T:null,Z=0===(null===(o=T.get())||void 0===o?void 0:o.childNodes.length);!Z&&T.length>0&&T.inEditor()&&(1===T[0].childNodes.length&&(null===(D=T[0].firstChild)||void 0===D?void 0:D.nodeType)===Node.ELEMENT_NODE&&p.isCustomize(T)&&(null===(H=T.first())||void 0===H?void 0:H.isCard())&&(Z=!0));if(Z&&p.isBlock(T)&&T.inEditor()){if(p.isList(T))T.remove();else{var R=p.getBatchAppendHTML(m,"
      ");T.isEditable()&&(R="

      ".concat(R,"

      ")),T.append(Ut(R));var P=T.find("br"),q=P.parent();q&&p.isMark(q)&&p.replace(P,Ut("​",null)),c.select(T,!0)}return c.shrinkToElementNode().shrinkToTextNode(),c.collapse(!1),this.isEmpty()&&this.initValue(c),void(e||this.apply(c))}var K,W=function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(p.isBlock(n)&&!p.isVoid(n)&&!n.isCard()){t.select(n,!0),t.collapse(!1);var a=t.shrinkToElementNode().shrinkToTextNode().createSelection(),s=r.parent();p.merge(n,r);while(s&&p.isBlock(s)&&p.isEmpty(s))s.remove(),s=s.parent();a.move(),t.enlargeToElementNode(!0);var l=t.getPrevNode(),c=t.getNextNode(),A=t.startNode;l||c||!p.isBlock(A)||(A.append(Ut(p.getBatchAppendHTML(i,"
      "))),t.select(A.find("br"),!0),t.collapse(!1)),l&&c&&!l.isCard()&&!c.isCard()&&o&&e(t,l,c,i)}};if(O&&z&&z.length>0&&p.isBlock(O)&&p.isBlock(z)&&!O.equal(z)&&!(null===(a=O.parent())||void 0===a?void 0:a.equal(z))&&z.inEditor()&&W(c,O,z,m,t),T.children().each((function(e){var t=Ut(e);!p.isVoid(t)&&t.isElement()&&""===p.html(t)&&t.remove(),p.isInline(t)&&d.repairCursor(t)})),p.isList(T)&&p.isEmpty(T)&&T.remove(),g=c.cloneRange().shrinkToTextNode(),g.startNode.isText()&&/^\u200B/g.test(g.startNode.text())&&0===g.startOffset){var j=g.startNode.prev();j&&this.engine.node.isInline(j)&&(c.select(j,!0),c.collapse(!1))}(p.isBlock(T)&&0===(null===(s=T.get())||void 0===s?void 0:s.childNodes.length)&&T.html("
      "),M)&&(p.isBlock(O)&&0===(null===(K=O.get())||void 0===K?void 0:K.childNodes.length)&&O.html("
      "),O.inEditor()&&c.select(O,!0).collapse(!1));this.isEmpty()&&this.initValue(c),e||this.apply(c)}},{key:"unwrap",value:function(e){var t=this.engine.block,n=this.range.get();if(e=e||t.closest(n.startNode),e.inEditor()){var r=n.createSelection();this.engine.node.unwrap(e),r.move(),this.range.select(n)}}},{key:"mergeAfterDelete",value:function(e){var t,n,r=this.engine,i=r.block,o=r.card,a=r.list,s=r.mark,l=this.engine.node,c=this.range.get();e=e||i.closest(c.startNode);var A=e.children();if(0===A.length)return e.append(Ut("
      ")),void this.apply(c);var u=e.first();if(A.length>1&&"br"===(null===u||void 0===u?void 0:u.name))null===u||void 0===u||u.remove();else{var d=e.prev();if(d){if(d.isCard()){(1===A.length&&"br"===(null===u||void 0===u?void 0:u.name)||l.isEmpty(e))&&e.remove();var h=o.find(d);if(h)return void o.focus(h)}if(l.isVoid(d))return d.remove(),void this.apply(c);if(l.isRootBlock(d)&&l.isEmpty(d))return d.remove(),void this.apply(c);if(d.isText()){var p=Ut("

      ");d.before(p),p.append(d),d=p}if(l.isList(d)&&(d=d.last()),1===A.length&&"br"===(null===u||void 0===u?void 0:u.name))null===u||void 0===u||u.remove();else if(d&&1===(null===(t=d.get())||void 0===t?void 0:t.childNodes.length)&&"br"===(null===(n=d.first())||void 0===n?void 0:n.name)){var f;null===(f=d.first())||void 0===f||f.remove()}if(!d||d.isText())this.unwrap(e);else{var g=c.createSelection();l.merge(d,e),g.move(),this.range.select(c),s.merge(),a.merge()}}else{var m=e.parent();(null===m||void 0===m?void 0:m.inEditor())&&!(null===m||void 0===m?void 0:m.isEditable())&&this.unwrap(e)}}}},{key:"destroy",value:function(){this.event.destroy()}}]),e}(),wn=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},xn=function(e){return Cn(e)&&1===e.nodeType},kn=function(e){return!!xn(e)&&("undefined"!==typeof HTMLElement?e instanceof HTMLElement:e.style instanceof CSSStyleDeclaration)},Cn=function(e){var t,n=null!==(t=wn(e))&&void 0!==t?t:globalThis.window;return!!n&&e instanceof n.Node},Bn=function(e){return Cn(e)&&3===e.nodeType},_n={isText:function(e){return Kt(e)&&"string"===typeof e.text},create:function(e){return{text:e}}},En={isElement:function(e){return Kt(e)&&Array.isArray(e.children)},create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,s.Z)((0,s.Z)({type:e},t),{},{children:n})}},Sn=function e(t){if(_n.isText(t))return document.createTextNode(t.text);if(En.isElement(t)){var n=t.type,r=t.children,i=null;try{i=document.createElement(n.replace(/[-_\[\]\s]/g,""))}catch(h){i=document.createElement("span")}for(var o=0,a=Object.entries(t);o3&&void 0!==arguments[3])||arguments[3];if(i&&xn(n)&&n.hasAttribute(ye)){var o=t.card,a=o.find(n);a&&(a.getCenter().empty(),o.renderComponent(a))}var s,l=r[0],c=0,A=(0,k.Z)(n.childNodes);try{for(A.s();!(s=A.n()).done;){var u=s.value;if(!jt(u)){if(l===c)return 1===r.length?{parent:n,node:u,offset:-1}:e(t,u,r.slice(1));c++}}}catch(d){A.e(d)}finally{A.f()}if(r.length>1)throw new Error("Cannot find element");return{parent:n,node:n,offset:l}},Tn=function(e,t,n){var r=e.card,i=t.path,o=Fn(e,e.container[0],i),a=o.parent,s=o.node,l=o.offset;if("insert_node"===t.type){var c=t.node,A=Sn(c),u=Ut(A);a!==s?a.insertBefore(A,s):a.appendChild(A),xn(A)&&vt(A)&&A.setAttribute(ye,n?"remote":"true");var d=c[$];if(e.card.render(u),u[0].isConnected||!d)return u;var h=a.querySelector("[".concat($,'="').concat(d,'"]'));return h?Ut(h):u}if("remove_node"===t.type)return-1===l?(xn(s)&&vt(s)?n?r.removeRemote(s):r.remove(s,!1):a.removeChild(s),xt(a)?void 0:Ut(a)):void 0;if("set_node"===t.type){if(-1===l&&xn(s)){for(var p=t.properties,f=t.newProperties,g=0,m=Object.entries(p);g0&&i.emit("change",r),r=[])}),20)},destroyCache:function(){t&&setTimeout((function(){t=!1,r=[]}),20)},getCaches:function(){return r},destroy:function(){i.removeAllListeners(),a.stop()}};return a},Dn={from:function(e){var t=Ln.get(e);return t||(t=Qn(e),Ln.set(e,t)),t},destroy:function(e){var t=Ln.get(e);null===t||void 0===t||t.destroy()}},Hn=new WeakMap,On=new WeakMap,zn={isPath:function(e){return Array.isArray(e)&&e.every((function(e){return"number"===typeof e}))},setPath:function(e,t,n){Hn.set(e,n),On.set(e,t)},getPath:function(e){var t=[],n=e;while(n){var r=On.get(n);if(!r)break;var i=Hn.get(n);if(void 0===i)throw new Error("Invalid index in ".concat(JSON.stringify(n)));t.unshift(i),n=r}return t},getIndex:function(e){var t=Hn.get(e);if(void 0===t)throw new Error("Invalid index in ".concat(e));return t},isEqual:function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))},isReverse:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(e.length!==t.length)return!1;var r=e.length-1,i=t.slice();return i[r]=i[r]-n,zn.isEqual(e,i)},commonLength:function(e,t){var n=e.length,r=t.length;if(0===n)return-1;if(0===r)return null;n--,r--;for(var i=0;i=r||o!==t[i])return null}return n},next:function(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)}},Zn=new WeakMap,Rn=new WeakMap,Pn=new WeakMap,qn={createFromDOM:function(e,t){if(!jt(e)){var n=e.nodeName,r=e.nodeValue;if(xn(e)){var i,o=e.attributes,a=e.childNodes,s={},l=(0,k.Z)(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,A=c.name,u=c.value;Gt(e,A)||("style"===A&&kn(e)?s["style"]=Ze(e.style.cssText||u):s[A]=String(u))}}catch(w){l.e(w)}finally{l.f()}var d,h=[],p=(0,k.Z)(a);try{for(p.s();!(d=p.n()).done;){var f=d.value,g=qn.createFromDOM(f,t);g&&h.push(g)}}catch(w){p.e(w)}finally{p.f()}for(var m=En.create(n.toLowerCase(),s,h),v=0;v0;Pn.set(e,i)},isBlock:function(e){return!!En.isElement(e)&&"block"===Rn.get(e)},isInline:function(e){return!!En.isElement(e)&&"inline"===Rn.get(e)},isMark:function(e){return!!En.isElement(e)&&"mark"===Rn.get(e)},isVoid:function(e){return!!En.isElement(e)&&(!0===Pn.get(e)||~["img","br","area","col","embed","hr","input","link","meta","param","source","track","wbr"].indexOf(e.type))},get:function(e,t){var n,r=e,i=(0,k.Z)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!En.isElement(r))throw new Error("Cannot find element");r=r.children[o]}}catch(a){i.e(a)}finally{i.f()}return r}},Kn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&t.isConnected||(t=n),!t)return n;while(t.parentNode!==e){var r=t.parentNode;if(!r||!e.contains(r))return n;t=r}return t},Wn=function(e,t){var n,r=[],i=function(e,t,n,r){var i,o,a=e.previousSibling,s=e.nextSibling;(n&&(!a||a.compareDocumentPosition(n)&globalThis.Node.DOCUMENT_POSITION_PRECEDING)||(null===a||void 0===a?void 0:a.parentNode)!==e.node)&&(e.previousSibling=Kn(e.node,n,a)),(r&&(!s||s.compareDocumentPosition(r)&globalThis.Node.DOCUMENT_POSITION_FOLLOWING)||(null===s||void 0===s?void 0:s.parentNode)!==e.node)&&(e.nextSibling=Kn(e.node,r,s)),e.previousSibling===t&&(e.previousSibling=t.previousSibling),e.nextSibling===t&&(e.nextSibling=t.nextSibling),e.previousSibling!==n&&(null===(i=e.previousSibling)||void 0===i?void 0:i.contains(n))&&(e.previousSibling=e.previousSibling.previousSibling),e.nextSibling!==r&&(null===(o=e.nextSibling)||void 0===o?void 0:o.contains(r))&&(e.nextSibling=e.nextSibling.nextSibling)},o=function(e,t,n){var o,a=!1,s=(0,k.Z)(r);try{for(s.s();!(o=s.n()).done;){var l=o.value,c=l.node;if(e===c||c.contains(e))a=!0,i(l,c,t,n);else if(e.contains(c)){a=!0,l.node=e;var A=l.previousSibling,u=l.nextSibling;l.previousSibling=Kn(e,t,A),l.nextSibling=Kn(e,n,u),i(l,c,A,u)}}}catch(d){s.e(d)}finally{s.f()}return a},a=(0,k.Z)(t);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=s.type,c=s.attributeName,A=s.target,u=!1;if(xn(A)&&xt(A)&&(u=!0),!(!A.isConnected||jt(A)||"attributes"===l&&(u||c&&Gt(A,c)))){var d=s.previousSibling,h=s.nextSibling;if("childList"===l){var p=s.addedNodes;p.length>0&&(d||(d=p[0].previousSibling),h||(h=p[p.length-1].nextSibling)),!d&&h&&(d=h.previousSibling),!h&&d&&(h=d.nextSibling)}else if(("characterData"===l||"attributes"===l)&&(d||(d=A.previousSibling),h||(h=A.nextSibling),"attributes"===l||!xn(A))){var f=A.parentElement;if(!f||jt(f))continue;A=f}o(A,d,h)||r.push({node:A,previousSibling:Kn(A,d),nextSibling:Kn(A,h)})}}}catch(O){a.e(O)}finally{a.f()}for(var g=[],m=0,v=r;m4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=Math.max(n.length,r.length),l=[],c=0;c3&&void 0!==arguments[3]&&arguments[3],i=[],o=(new Q.diff_match_patch).patch_make(e,t);return Object.keys(o).forEach((function(e){var t=o[e];if(null!==t.start1){var a=t.start1;t.diffs.forEach((function(e){var t=(0,w.Z)(e,2),o=t[0],s=t[1];o!==Q.DIFF_DELETE?o!==Q.DIFF_INSERT?o===Q.DIFF_EQUAL&&(a+=s.length):i.push({type:"insert_text",text:s,path:n,offset:a,undoable:r}):i.unshift({type:"remove_text",text:s,path:n,offset:a,undoable:r})}))}})),i},Gn=function(e,t){var n=t[fe],r=t[me],i=t[$];if(n&&r&&i){var o,a=null===(o=e.container.get())||void 0===o?void 0:o.querySelector("[".concat($,'="').concat(i,'"]'));if(null===a||void 0===a?void 0:a.getAttribute(ye))return!0}return!1},$n={transform:Wn,diff:jn,inverse:function(e){switch(e.type){case"insert_node":return(0,s.Z)((0,s.Z)({},e),{},{type:"remove_node"});case"remove_node":return(0,s.Z)((0,s.Z)({},e),{},{type:"insert_node"});case"insert_text":return(0,s.Z)((0,s.Z)({},e),{},{type:"remove_text"});case"remove_text":return(0,s.Z)((0,s.Z)({},e),{},{type:"insert_text"});case"set_node":var t=e.properties,n=e.newProperties;return(0,s.Z)((0,s.Z)({},e),{},{type:"set_node",properties:n,newProperties:t})}},isReverse:function(e,t){if("insert_node"===e.type&&"remove_node"===t.type||"remove_node"===e.type&&"insert_node"===t.type)return L()(e.node,t.node)&&zn.isEqual(e.path,t.path);if("insert_text"===e.type&&"remove_text"===t.type){var n=e.path.concat(e.offset),r=t.path.concat(t.offset);return L()(e.text,t.text)&&(L()(n,r)||zn.isReverse(n,r,e.text.length)||zn.isReverse(r,n,e.text.length))}if("remove_text"===e.type&&"insert_text"===t.type){var i=e.path.concat(e.offset),o=t.path.concat(t.offset);return L()(e.text,t.text)&&L()(i,o)}return!1},canOpAffectPath:function(e,t){return null!==zn.commonLength(t,e.path)}},Yn={adjustX:!0,adjustY:!0},Xn=[0,0],Jn={left:{points:["cr","cl"],overflow:Yn,offset:[-4,0],targetOffset:Xn},right:{points:["cl","cr"],overflow:Yn,offset:[4,0],targetOffset:Xn},top:{points:["bc","tc"],overflow:Yn,offset:[0,-4],targetOffset:Xn},bottom:{points:["tc","bc"],overflow:Yn,offset:[0,4],targetOffset:Xn},topLeft:{points:["bl","tl"],overflow:Yn,offset:[0,-4],targetOffset:Xn},leftTop:{points:["tr","tl"],overflow:Yn,offset:[-4,0],targetOffset:Xn},topRight:{points:["br","tr"],overflow:Yn,offset:[0,-4],targetOffset:Xn},rightTop:{points:["tl","tr"],overflow:Yn,offset:[4,0],targetOffset:Xn},bottomRight:{points:["tr","br"],overflow:Yn,offset:[0,4],targetOffset:Xn},rightBottom:{points:["bl","br"],overflow:Yn,offset:[4,0],targetOffset:Xn},bottomLeft:{points:["tl","bl"],overflow:Yn,offset:[0,4],targetOffset:Xn},leftBottom:{points:["br","bl"],overflow:Yn,offset:[-4,0],targetOffset:Xn}},er=".data-tooltip {\r\n\tfont-size: 14px;\r\n\tfont-variant: tabular-nums;\r\n\tline-height: 1.5;\r\n\tcolor: rgba(0, 0, 0, 0.65);\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\tlist-style: none;\r\n\tposition: absolute;\r\n\tz-index: 1060;\r\n\tdisplay: block;\r\n\tvisibility: visible;\r\n\tmax-width: 320px;\r\n\tword-wrap:break-word;\r\n top: 0;\r\n}\r\n\r\n.data-tooltip-hidden {\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\ttransition: opacity 0.3s ease-in-out;\r\n}\r\n\r\n.data-tooltip-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-tooltip-placement-top,.data-tooltip-placement-topLeft,.data-tooltip-placement-topRight {\r\n\tpadding-bottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-right,.data-tooltip-placement-rightTop,.data-tooltip-placement-rightBottom {\r\n\tpadding-left: 8px;\r\n}\r\n\r\n.data-tooltip-placement-bottom,.data-tooltip-placement-bottomLeft,.data-tooltip-placement-bottomRight {\r\n\tpadding-top: 8px;\r\n}\r\n\r\n.data-tooltip-placement-left,.data-tooltip-placement-leftTop,.data-tooltip-placement-leftBottom {\r\n\tpadding-right: 8px;\r\n}\r\n\r\n.data-tooltip-inner {\r\n\tpadding: 6px 8px;\r\n\tcolor: #fff;\r\n\ttext-align: left;\r\n\ttext-decoration: none;\r\n\tbackground-color: rgba(0, 0, 0, 0.75);\r\n\tborder-radius: 4px;\r\n\t-webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\r\n\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\r\n\tword-wrap: break-word;\r\n}\r\n\r\n.data-tooltip-arrow {\r\n\tposition: absolute;\r\n\twidth: 0;\r\n\theight: 0;\r\n\tborder-color: transparent;\r\n\tborder-style: solid;\r\n}\r\n\r\n.data-tooltip-placement-top .data-tooltip-arrow,.data-tooltip-placement-topLeft .data-tooltip-arrow,.data-tooltip-placement-topRight .data-tooltip-arrow {\r\n\tbottom: 3px;\r\n\tborder-width: 5px 5px 0;\r\n\tborder-top-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-top .data-tooltip-arrow {\r\n\tleft: 50%;\r\n\tmargin-left: -5px;\r\n}\r\n\r\n.data-tooltip-placement-topLeft .data-tooltip-arrow {\r\n\tleft: 16px;\r\n}\r\n\r\n.data-tooltip-placement-topRight .data-tooltip-arrow {\r\n\tright: 16px;\r\n}\r\n\r\n.data-tooltip-placement-right .data-tooltip-arrow,.data-tooltip-placement-rightTop .data-tooltip-arrow,.data-tooltip-placement-rightBottom .data-tooltip-arrow {\r\n\tleft: 3px;\r\n\tborder-width: 5px 5px 5px 0;\r\n\tborder-right-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-right .data-tooltip-arrow {\r\n\ttop: 50%;\r\n\tmargin-top: -5px;\r\n}\r\n\r\n.data-tooltip-placement-rightTop .data-tooltip-arrow {\r\n\ttop: 8px;\r\n}\r\n\r\n.data-tooltip-placement-rightBottom .data-tooltip-arrow {\r\n\tbottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-left .data-tooltip-arrow,.data-tooltip-placement-leftTop .data-tooltip-arrow,.data-tooltip-placement-leftBottom .data-tooltip-arrow {\r\n\tright: 3px;\r\n\tborder-width: 5px 0 5px 5px;\r\n\tborder-left-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-left .data-tooltip-arrow {\r\n\ttop: 50%;\r\n\tmargin-top: -5px;\r\n}\r\n\r\n.data-tooltip-placement-leftTop .data-tooltip-arrow {\r\n\ttop: 8px;\r\n}\r\n\r\n.data-tooltip-placement-leftBottom .data-tooltip-arrow {\r\n\tbottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-bottom .data-tooltip-arrow,.data-tooltip-placement-bottomLeft .data-tooltip-arrow,.data-tooltip-placement-bottomRight .data-tooltip-arrow {\r\n\ttop: 3px;\r\n\tborder-width: 0 5px 5px;\r\n\tborder-bottom-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-bottom .data-tooltip-arrow {\r\n\tleft: 50%;\r\n\tmargin-left: -5px;\r\n}\r\n\r\n.data-tooltip-placement-bottomLeft .data-tooltip-arrow {\r\n\tleft: 16px;\r\n}\r\n\r\n.data-tooltip-placement-bottomRight .data-tooltip-arrow {\r\n\tright: 16px;\r\n}";en(er);var tr=function(e){return"\n

      \n
      \n
      \n
      \n
      \n
      ')},nr=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,null,[{key:"show",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{placement:"top"};e.hide();var i=Ut(tr(r));"string"===typeof n?i.find("[data-role=tooltip]").html(n):i.find("[data-role=tooltip]").append(n);var o=rt(),a=Ut(o.body);a.append(i);var l=(0,D.ZP)(i.get(),t.get(),(0,s.Z)({},Jn[r.placement])),c=Object.keys(Jn).find((function(e){var t=Jn[e].points;return t[0]===l.points[0]&&t[1]===l.points[1]}));c!==r.placement&&i.removeClass("data-tooltip-placement-".concat(r.placement)).addClass("data-tooltip-placement-".concat(c)),i.addClass("data-tooltip-active")}},{key:"hide",value:function(){var e=rt();Ut(e.body).find("div[".concat(G,"=tooltip]")).remove()}}]),e}(),rr=function(e){return'\n \n \n ").concat(e.content,"\n \n ")},ir=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.options=t,this.root=Ut(rr(t)),t.style&&this.root.attributes("style",t.style),t.class&&this.root.addClass(t.class)}return(0,c.Z)(e,[{key:"getPlacement",value:function(){var e=this.root.closest(".data-toolbar").attributes("data-placement")||"top";return e.startsWith("top")?"top":"bottom"}},{key:"render",value:function(e){var t=this,n=this.options,r=n.title,i=n.didMount,o=n.onClick,a=n.link;e.append(this.root),r&&(this.root.on("mouseenter",(function(){var e=t.getPlacement();nr.show(t.root,"function"===typeof r?r():r,{placement:e})})),this.root.on("mouseleave",(function(){nr.hide()})),this.root.on("mousedown",(function(){nr.hide()}))),!a&&o&&this.root.find("a").on("click",(function(e){e.preventDefault(),e.stopPropagation(),o(e,t.root)})),i&&i(this.root)}}]),e}(),or=function(e){var t=!!e.checked;return e.getState&&(t=e.getState()),'\n
      \n ").concat(e.content,'\n \n
      ')},ar=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.switch=void 0,this.options=t}return(0,c.Z)(e,[{key:"renderTo",value:function(e){var t=this;this.root=Ut(or(this.options)),this.switch=this.root.find(".switch-btn"),e.append(this.root),this.root.on("mousedown",(function(e){return e.preventDefault()}));var n=this.options.onClick;this.root.on("click",(function(e){e.stopPropagation(),n&&(n(e,t.root),t.updateSwitch())}))}},{key:"updateSwitch",value:function(){var e,t;this.options.getState&&(this.options.getState()?null===(e=this.switch)||void 0===e||e.addClass("switch-checked"):null===(t=this.switch)||void 0===t||t.removeClass("switch-checked"))}}]),e}(),sr=function(e){return'\n
      \n \n ").concat(e.content,"\n \n
      ")},lr=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.options=t}return(0,c.Z)(e,[{key:"renderTo",value:function(e){var t=this;this.root=Ut(sr(this.options)),e.append(this.root);var n=this.options.onClick;n&&this.root.on("click",(function(e){return n(e,t.root)}))}}]),e}(),cr=function(e){return'\n \n ").concat(e.content,'\n \n ')},Ar=function(){function e(t){var n=this;(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.dropdown=void 0,this.documentMouseDown=function(e){var t;n.root&&!n.root[0].contains(e.target)&&(null===(t=n.dropdown)||void 0===t?void 0:t.hasClass("show"))&&n.hideDropdown()},this.options=t}return(0,c.Z)(e,[{key:"initToggleEvent",value:function(){var e=this,t=this.root.find(".data-toolbar-dropdown");t.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation()})),t.on("click",(function(t){t.stopPropagation(),e.toggleDropdown()})),document.addEventListener("mousedown",this.documentMouseDown,!0)}},{key:"toggleDropdown",value:function(){var e;(null===(e=this.dropdown)||void 0===e?void 0:e.hasClass("show"))?this.hideDropdown():this.showDropdown()}},{key:"showDropdown",value:function(){var e;null===(e=this.dropdown)||void 0===e||e.addClass("show")}},{key:"hideDropdown",value:function(){var e;null===(e=this.dropdown)||void 0===e||e.removeClass("show")}},{key:"getPlacement",value:function(){var e=this.root.closest(".data-toolbar").attributes("data-placement")||"top";return e.startsWith("top")?"top":"bottom"}},{key:"renderTooltip",value:function(){var e=this,t=this.options.title;t&&(this.root.on("mouseenter",(function(){var n=e.getPlacement();nr.show(e.root,"function"===typeof t?t():t,{placement:n})})),this.root.on("mouseleave",(function(){nr.hide()})),this.root.on("mousedown",(function(){nr.hide()})))}},{key:"renderDropdown",value:function(){var e=this;this.dropdown=this.root.find(".dropdown-container");var t=this.options.items;t.forEach((function(t){switch(t.type){case"switch":return new ar(t).renderTo(e.dropdown);case"button":return new lr(t).renderTo(e.dropdown)}})),this.dropdown.on("click",(function(t){t.stopPropagation(),e.hideDropdown()}))}},{key:"render",value:function(e){this.root=Ut(cr(this.options)),e.append(this.root),this.initToggleEvent(),this.renderTooltip(),this.renderDropdown();var t=this.options.didMount;t&&t(this.root)}},{key:"destroy",value:function(){document.removeEventListener("mousedown",this.documentMouseDown,!0)}}]),e}(),ur=function(e){return'\n \n '.concat(e.prefix?""+We(e.prefix)+"":"",'').concat(e.suffix?""+We(e.suffix)+"":"","\n ")},dr=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.onEnter=void 0,this.onInput=void 0,this.onChange=void 0,this.options=t,this.root=Ut(ur(t)),this.onEnter=t.onEnter||function(){},this.onInput=t.onInput||function(){},this.onChange=t.onChange||function(){}}return(0,c.Z)(e,[{key:"find",value:function(e){var t="[data-role=".concat(e,"]");return this.root.find(t)}},{key:"render",value:function(e){var t=this,n=this.options,r=n.value,o=n.didMount,a=this.find("input"),s=a.get();s&&(s.value=(void 0!==r?r:"").toString(),a.on("keydown",(function(e){e.stopPropagation(),(0,i.ZP)("enter",e)&&(e.preventDefault(),s.blur(),t.onEnter(s.value))})),a.on("input",(function(){t.onInput(s.value)})),a.on("change",(function(){setTimeout((function(){t.onChange(s.value)}),10)})),e.append(this.root),o&&o(this.root))}}]),e}(),hr=function(e){var t=!!e.checked;return e.getState&&(t=e.getState()),'\n
      \n ").concat(e.content,'\n \n
      ')},pr=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.switch=void 0,this.options=t,this.root=Ut(hr(t)),this.switch=this.root.find(".switch-btn"),t.class&&this.root.addClass(t.class)}return(0,c.Z)(e,[{key:"render",value:function(e){var t=this,n=this.options,r=n.didMount,i=n.onClick;e.append(this.root),this.root.on("mousedown",(function(e){return e.preventDefault()})),this.root.on("click",(function(e){e.stopPropagation(),i&&(i(e,t.root),t.updateSwitch())})),r&&r(this.root)}},{key:"updateSwitch",value:function(){var e,t;this.options.getState&&(this.options.getState()?null===(e=this.switch)||void 0===e||e.addClass("switch-checked"):null===(t=this.switch)||void 0===t||t.removeClass("switch-checked"))}}]),e}(),fr='.data-toolbar {\r\n\tposition: absolute;\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\twidth: auto;\r\n\tline-height: 26px;\r\n\tdisplay: flex;\r\n\tflex-direction: row;\r\n\tfont-size: 14px;\r\n\tfont-weight: normal;\r\n\ttext-indent: 0;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t user-select: none;\r\n z-index: 127;\r\n}\r\n\r\n.data-toolbar-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-toolbar-block {\r\n\ttop: auto;\r\n\tbottom: -46px;\r\n\tleft: -1px;\r\n\tright: auto;\r\n\theight: 40px;\r\n}\r\n\r\n.data-toolbar-btn {\r\n\tline-height: 26px;\r\n\tmin-width: 28px;\r\n\tdisplay: inline-block;\r\n\ttext-align: center;\r\n\tcolor: #595959;\r\n\ttransition: background-color 0.3s ease-in-out;\r\n\tcursor: pointer;\r\n}\r\n\r\n.data-toolbar-btn-disabled,.data-toolbar-btn-disabled:hover {\r\n\tbackground-color: transparent;\r\n\tbox-shadow: none;\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-toolbar-group {\r\n\tborder: 1px solid rgba(226, 226, 226, 0.84);\r\n border-radius: 4px;\r\n box-shadow: 0px 2px 4px 0px rgb(225 225 225 / 50%);\r\n background: #fff;\r\n position: relative;\r\n display: inline-flex;\r\n padding: 5px;\r\n align-items: center;\r\n}\r\n\r\n.data-toolbar-item {\r\n\tposition: relative;\r\n\tdisplay: inline-block;\r\n\tline-height: 26px;\r\n\ttext-align: left;\r\n\tcolor: #595959;\r\n\tflex: 0 0 auto;\r\n font-size: 12px;\r\n cursor: pointer;\r\n}\r\n\r\n.data-toolbar-item:not(.data-toolbar-item-input):hover, .data-toolbar-item.active:not(.data-toolbar-item-input){\r\n background-color: #f4f4f4;\r\n border-radius: 2px;\r\n}\r\n\r\n.data-toolbar-item > * {\r\n font-size: 12px !important;\r\n}\r\n\r\n.data-toolbar-item[disabled] {\r\n\topacity: 0.5;\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-toolbar-item-split {\r\n\twidth: 1px;\r\n\theight: 16px;\r\n\tline-height: 16px;\r\n\tmargin: 6px 4px;\r\n\tborder-left: 1px solid #e8e8e8;\r\n\tdisplay: inline-block;\r\n}\r\n\r\n.data-toolbar-item-dropdown-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n\ttransform: translateY(0px);\r\n}\r\n\r\n.data-toolbar-item-input {\r\n\tdisplay: flex;\r\n margin: 0 4px;\r\n}\r\n\r\n.data-toolbar-item-input .data-toolbar-input {\r\n width: 46px;\r\n line-height: 12px;\r\n font-size: 12px;\r\n outline: none;\r\n border: 1px solid #dadada;\r\n border-radius: 4px;\r\n}\r\n\r\n.data-toolbar-item-input .data-toolbar-input::-moz-selection {\r\n color: inherit;\r\n background:transparent\r\n}\r\n\r\n.data-toolbar-item-input .data-toolbar-input::selection {\r\n color: inherit;\r\n background:transparent\r\n}\r\n\r\n.data-toolbar-item-input .data-toolbar-input:focus::-moz-selection\r\n{\r\n color: #fff;\r\n background: #1890ff;\r\n}\r\n\r\n.data-toolbar-item-input .data-toolbar-input:focus::selection\r\n{\r\n color: #fff;\r\n background: #1890ff;\r\n}\r\n\r\n.data-toolbar-item-dropdown .dropdown-container {\r\n\tdisplay: none;\r\n\tposition: absolute;\r\n\tpadding: 8px 0;\r\n\ttop: 100%;\r\n\tmargin-top: 6px;\r\n\tborder-radius: 2px;\r\n\tbackground-color: #fff;\r\n\tbox-shadow: 0 1px 4px -2px rgba(0, 0, 0, 0.13), 0 2px 8px 0 rgba(0, 0, 0, 0.08), 0 8px 16px 4px rgba(0, 0, 0, 0.04);\r\n z-index: 99999;\r\n}\r\n\r\n.data-toolbar-item-dropdown .dropdown-container.show {\r\n\tdisplay: block;\r\n}\r\n\r\n.data-toolbar-dropdown-item {\r\n\tpadding: 2px 16px;\r\n\tmargin: 0;\r\n\twhite-space: nowrap;\r\n\tline-height: 26px;\r\n\tcolor: #404040;\r\n\tcursor: pointer;\r\n display: block;\r\n}\r\n\r\n.data-toolbar-dropdown-item:hover {\r\n\tbackground-color: #f5f5f5;\r\n}\r\n\r\n.data-toolbar-dropdown-switch {\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .data-toolbar-dropdown-item-content {\r\n\tflex: 1;\r\n margin-right: 4px;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn {\r\n margin: 0;\r\n padding: 0;\r\n color: #595959;\r\n font-size: 14px;\r\n font-variant: tabular-nums;\r\n line-height: 1.5;\r\n list-style: none;\r\n -webkit-font-feature-settings: "tnum";\r\n font-feature-settings: "tnum";\r\n position: relative;\r\n display: inline-block;\r\n -webkit-box-sizing: border-box;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n background-color: rgba(0,0,0,.25);\r\n border: 0;\r\n border-radius: 100px;\r\n cursor: pointer;\r\n -webkit-transition: all .2s;\r\n transition: all .2s;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n min-width: 28px;\r\n height: 16px;\r\n line-height: 16px;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn.switch-checked {\r\n background-color: #347EFF\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn .switch-handle {\r\n top: 2px;\r\n left: 2px;\r\n width: 12px;\r\n height: 12px;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn .switch-handle, .data-toolbar-dropdown-switch .switch-btn .switch-handle:before {\r\n position: absolute;\r\n -webkit-transition: all .2s ease-in-out;\r\n transition: all .2s ease-in-out;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn.switch-checked .switch-handle {\r\n left: calc(100% - 14px);\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn .switch-handle:before {\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n background-color: #fff;\r\n border-radius: 9px;\r\n -webkit-box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\r\n box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\r\n content: "";\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn .switch-inner {\r\n display: block;\r\n margin: 0 5px 0 18px;\r\n font-size: 12px;\r\n color: #fff;\r\n -webkit-transition: margin .2s;\r\n transition: margin .2s;\r\n}\r\n\r\n.data-toolbar-dropdown-switch .switch-btn.switch-checked .switch-inner {\r\n margin: 0 18px 0 5px;\r\n}\r\n.data-toolbar-switch {\r\n\tdisplay: flex;\r\n\talign-items: center;\r\n padding: 0 4px;\r\n cursor: pointer;\r\n width: -webkit-max-content;\r\n width: -moz-max-content;\r\n width: max-content;\r\n}\r\n\r\n.data-toolbar-switch:hover {\r\n background-color: #f4f4f4;\r\n border-radius: 2px;\r\n}\r\n\r\n.data-toolbar-switch .switch-content {\r\n\tflex: 1;\r\n margin-right: 4px;\r\n}\r\n\r\n.data-toolbar-switch .switch-btn {\r\n margin: 0;\r\n padding: 0;\r\n color: #595959;\r\n font-size: 14px;\r\n font-variant: tabular-nums;\r\n line-height: 1.5;\r\n list-style: none;\r\n -webkit-font-feature-settings: "tnum";\r\n font-feature-settings: "tnum";\r\n position: relative;\r\n display: inline-block;\r\n -webkit-box-sizing: border-box;\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n background-color: rgba(0,0,0,.25);\r\n border: 0;\r\n border-radius: 100px;\r\n cursor: pointer;\r\n -webkit-transition: all .2s;\r\n transition: all .2s;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n min-width: 28px;\r\n height: 16px;\r\n line-height: 16px;\r\n}\r\n\r\n.data-toolbar-switch .switch-btn.switch-checked {\r\n background-color: #347EFF\r\n}\r\n\r\n.data-toolbar-switch .switch-btn .switch-handle {\r\n top: 2px;\r\n left: 2px;\r\n width: 12px;\r\n height: 12px;\r\n}\r\n\r\n.data-toolbar-switch .switch-btn .switch-handle, .data-toolbar-switch .switch-btn .switch-handle:before {\r\n position: absolute;\r\n -webkit-transition: all .2s ease-in-out;\r\n transition: all .2s ease-in-out;\r\n}\r\n\r\n.data-toolbar-switch .switch-btn.switch-checked .switch-handle {\r\n left: calc(100% - 14px);\r\n}\r\n\r\n.data-toolbar-switch .switch-btn .switch-handle:before {\r\n top: 0;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n background-color: #fff;\r\n border-radius: 9px;\r\n -webkit-box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\r\n box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\r\n content: "";\r\n}\r\n\r\n.data-toolbar-switch .switch-btn .switch-inner {\r\n display: block;\r\n margin: 0 5px 0 18px;\r\n font-size: 12px;\r\n color: #fff;\r\n -webkit-transition: margin .2s;\r\n transition: margin .2s;\r\n}\r\n\r\n.data-toolbar-switch .switch-btn.switch-checked .switch-inner {\r\n margin: 0 18px 0 5px;\r\n}';en(fr);var gr=function(){return"
      ')},mr=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.items=[],this.options=(0,s.Z)({},t),this.root=Ut(gr())}return(0,c.Z)(e,[{key:"getPlacement",value:function(){var e=this.root.attributes("data-placement")||"top";return e.startsWith("top")?"top":"bottom"}},{key:"addItems",value:function(e){var t=this;this.options.items.forEach((function(n){var r;if("button"===n.type&&(r=new ir(n),r.render(e)),"switch"===n.type&&(r=new pr(n),r.render(e)),"input"===n.type){var i=n;r=new dr(i),r.render(e)}if("dropdown"===n.type&&(r=new Ar(n),r.render(e)),"node"===n.type){var o=n,a=o.node;a.addClass("data-toolbar-item");var s=o.title;s&&(a.on("mouseenter",(function(){var e=t.getPlacement();nr.show(a,"function"===typeof s?s():s,{placement:e})})),a.on("mouseleave",(function(){nr.hide()})),a.on("mousedown",(function(){nr.hide()}))),e.append(a),n.didMount&&n.didMount(a)}r&&t.items.push(r)}))}},{key:"find",value:function(e){var t="[data-role=".concat(e,"]");return this.root.find(t)}},{key:"destroy",value:function(){this.root.remove()}},{key:"hide",value:function(){this.root.removeClass("data-toolbar-active")}},{key:"show",value:function(){this.root.addClass("data-toolbar-active")}},{key:"renderGroup",value:function(){return Ut('
      ')}},{key:"render",value:function(e){var t=this.renderGroup();return this.root.append(t),this.addItems(t),e&&e.append(this.root),this.root.addClass("data-toolbar-block"),this.root}},{key:"update",value:function(e){this.options=e,this.root.empty();var t=this.renderGroup();this.root.append(t),this.addItems(t)}}]),e}(),vr="ot-user-background",br="ot-user-cursor",yr="ot-user-cursor-card",wr="ot-card-mask",xr="ot-user-cursor-trigger",kr="ot-user-cursor-trigger-active",Cr=new Map,Br=new Map,_r=new Map,Er=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.root=void 0,this.hideCursorInfoTimeoutMap=void 0,this.engine=t,this.root=t.root,this.hideCursorInfoTimeoutMap={}}return(0,c.Z)(e,[{key:"destroy",value:function(){var e,t=(0,k.Z)(Cr);try{for(t.s();!(e=t.n()).done;){var n=(0,w.Z)(e.value,2),r=n[0],i=n[1];i.remove(),Cr.delete(r)}}catch(f){t.e(f)}finally{t.f()}var o,a=(0,k.Z)(Br);try{for(a.s();!(o=a.n()).done;){var s=(0,w.Z)(o.value,2),l=s[0],c=s[1];c.remove(),Br.delete(l)}}catch(f){a.e(f)}finally{a.f()}var A,u=(0,k.Z)(_r);try{for(u.s();!(A=u.n()).done;){var d=(0,w.Z)(A.value,2),h=d[0],p=d[1];p.remove(),_r.delete(h)}}catch(f){u.e(f)}finally{u.f()}}},{key:"getRectWithRange",value:function(e,t){var n,r=t.getClientRect(),i=null===(n=e.get())||void 0===n?void 0:n.getBoundingClientRect();return new DOMRect(r.left-((null===i||void 0===i?void 0:i.left)||0),r.top-((null===i||void 0===i?void 0:i.top)||0),r.right-r.left,r.bottom-r.top)}},{key:"isWrapByRange",value:function(e){var t=e.cloneRange().collapse(!0).getClientRect(),n=e.cloneRange().collapse(!1).getClientRect();return t.bottom!==n.bottom}},{key:"drawSubRang",value:function(e,t,n,r){var i=n.startOffset,o=n.startNode,a=n.endNode,l=n.startOffset,c=n.endOffset,A=n.getClientRect().top,u=i;while(lA||l===c-1){n.setStart(n.commonAncestorContainer,u),u=l,A=d.top;var h=this.getRectWithRange(e,n);t.clearRect(h),t.drawRect((0,s.Z)((0,s.Z)({},h.toJSON()),r))}l++}n.setStart(o,i),n.setEnd(a,c)}},{key:"drawBackground",value:function(e,t){var n,r,i,o,a=this,l=this.engine.card,c=t.uuid,A=t.color,u=Cr.get(c),d=null!==(n=this.engine.scrollNode)&&void 0!==n?n:this.root,h=function(){if(u&&u.length>0){u.attributes(dt,A.toString());var e=u[0]["__canvas"];return u[0]["__clear"]||(e.clear(),u[0]["__clear"]=!0),e}};if(e.collapsed)return h(),[e];u&&u.length>0?o=h():(u=Ut('
      ')),d.append(u),Cr.set(c,u),o=new V({container:u.get()}),u[0]["__canvas"]=o),u.get().style.cssText="position: absolute; top: 0; left: 0; transform: translateX(0) translateY(0); will-change: transform; pointer-events: none;",u[0]["__range"]=e.cloneRange();var p=(null===(r=d.get())||void 0===r?void 0:r.clientWidth)||d.width(),f=this.root.height();o.resize(p,f),u[0]["__clear"]=!1;var g=l.find(e.commonAncestorNode,!0);g&&!g.isCenter(e.commonAncestorNode)&&(g=void 0);var m=(0,B.Vi)(A),v=m.alpha(.3).toRgbString(),b={fill:v},y=e.getSubRanges();if((null===(i=g)||void 0===i?void 0:i.isEditable)&&g.drawBackground){var w=g.drawBackground(u,e,o);if(!1===w)return[e];if(w){if(!Array.isArray(w))return w.x<0&&(o.resize(p-w.x,f),u.css("transform","translateX(".concat(w.x,"px) translateY(0)")),w.x=0),o.clearRect(w),o.drawRect((0,s.Z)((0,s.Z)({},w.toJSON()),b)),[e];y=w}}else if(g)return[e];return y.forEach((function(e){if(a.isWrapByRange(e))a.drawSubRang(u,o,e,b);else{var t=a.getRectWithRange(u,e);o.clearRect(t),o.drawRect(Object.assign({},t.toJSON(),b))}})),y}},{key:"getNodeRect",value:function(e,t){var n,r=e.parent();if(e.isCard()&&(null===r||void 0===r?void 0:r.hasClass(this.engine.list.CUSTOMZIE_LI_CLASS))&&(null===r||void 0===r||null===(n=r.first())||void 0===n?void 0:n.equal(e))&&e.next()&&(e=e.next()),e.isElement()&&(t=e.get().getBoundingClientRect()),e.isText()){var i=$t.create(this.engine).cloneRange();i.select(e,!0),t=i.getClientRect()}return t}},{key:"getCursorRect",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=(null===(t=this.root.get())||void 0===t?void 0:t.getBoundingClientRect())||{top:0,left:0};if(Jt(e)){var o=e,a=o.startNode;o.shrinkToElementNode();var s=o.getClientRect();if(a.isElement()&&0===s.height){var l=Ut(a[0].childNodes[o.startOffset]);l&&l.length>0?s=this.getNodeRect(l,s):(l=a.first(),l&&l.length>0&&(s=this.getNodeRect(l,s)))}var c=s.top-(i.top||0),A=s.left-(i.left||0)-r,u=s.height;return{top:c+"px",left:A+"px",height:u>0?u+"px":-1,elementHeight:s.height||0}}var d=e,h=Ge(d.css("outline-width")),p=(null===(n=d.get())||void 0===n?void 0:n.getBoundingClientRect())||{top:0,left:0,height:0},f=p.top-i.top-1,g=p.left-i.left;return h&&(f-=h+1,g-=2),{left:g+"px",top:f+"px",height:0,elementHeight:p.height||0}}},{key:"setCursorRect",value:function(e,t,n){var r=t.get();if(r)if(-1!==n.height){if(r.style.cssText+="top: 0; left: 0; height: ".concat(n.height,"; transform: translateX(").concat(n.left,") translateY(").concat(n.top,"); will-change: transform, height;"),0===n.height)return void t.addClass(yr);t.removeClass(yr)}else t.remove(),Br.delete(e)}},{key:"showCursorInfo",value:function(e,t){var n=t.uuid,r=t.color;this.hideCursorInfoTimeoutMap[n]&&clearTimeout(this.hideCursorInfoTimeoutMap[n]);var i=e.find(".".concat(xr)),o=e.css("background-color");e.attributes("data-old-background-color",o),i.addClass("".concat(kr)),e.css("background-color",r),i.css("background-color",r)}},{key:"hideCursorInfo",value:function(e){var t=e.find(".".concat(xr)),n=e.attributes("data-old-background-color");t.removeClass("".concat(kr)),e.css("background-color",n),t.css("background-color",n)}},{key:"drawCursor",value:function(e,t,n){var r=this,i=t.uuid,o=t.name,a=t.color,s=this.getCursorRect(e),l=Br.get(i);if(l&&l.length>0)this.setCursorRect(i,l,s);else{var c='\n
      \n
      ').concat(We(o||""),"
      \n
      ");l=Ut(c),Br.set(i,l);var A=l.find(".".concat(xr));if(0===s.elementHeight){var u=0,d=function t(){u++,s=r.getCursorRect(e),s.elementHeight<20&&u<=50?setTimeout((function(){t()}),20):r.setCursorRect(i,l,s)};d()}else this.setCursorRect(i,l,s);l.on("mouseenter",(function(){return r.showCursorInfo(l,t)}));var h=!0;l.on("transitionstart",(function(){h=!1})),l.on("transitionend",(function(){h=!0})),l.on("mouseleave",(function(){h&&r.hideCursorInfo(l)})),l.css("background-color",a),A.css("background-color",a),this.root.append(l)}if(l&&l[0]){l.css("z-index","");var p=this.engine.card.components.find((function(e){return e.isMaximize}));if(p){var f=this.engine.card.closest(Jt(e)?e.startNode:e,!0);f&&p.root.equal(f)||l.css("z-index",120)}return l[0]["__target"]=Jt(e)?e.toPath(!0):e,!1===n?l:(this.showCursorInfo(l,t),this.hideCursorInfoTimeoutMap[i]&&clearTimeout(this.hideCursorInfoTimeoutMap[i]),this.hideCursorInfoTimeoutMap[i]=setTimeout((function(){r.hideCursorInfo(l)}),2e3),l)}}},{key:"drawCard",value:function(e,t,n){var r,i,o=this,a=this.engine.language,s=(null===(r=this.root.get())||void 0===r?void 0:r.getBoundingClientRect())||{left:0,top:0,width:0,height:0},l=(null===(i=e.get())||void 0===i?void 0:i.getBoundingClientRect())||{left:0,top:0,width:0,height:0},c="top: 0; left: 0; transform: translateX(".concat(l.left-s.left,"px) translateY(").concat(l.top-s.top,"px); will-change: transform;"),A=_r.get(n.uuid);if(A&&A.length>0)return A[0]["__node"]=e[0],void(A.get().style.cssText=c);if(A=Ut('
      ')),_r.set(n.uuid,A),A[0]["__node"]=e[0],0===l.height){var u=0,d=function t(){var n;u++,l=(null===(n=e.get())||void 0===n?void 0:n.getBoundingClientRect())||{left:0,top:0,width:0,height:0},l.height<20&&u<=50?setTimeout((function(){t()}),20):A&&A.length>0&&(A.get().style.cssText=c+"height: ".concat(l.height,"px; width: ").concat(l.width,"px;"))};d()}else A.get().style.cssText=c+"height: ".concat(l.height,"px; width: ").concat(l.width,"px;");A.on("mouseenter",(function(){o.showCursorInfo(t,n),A&&A.length>0&&nr.show(A,a.get("card","lockAlert").toString(),{placement:"bottomLeft"})})),A.on("mousemove",(function(e){var t=Ut("div[".concat(G,"=tooltip]")),n=t.get();n&&(n.style.cssText="left: 0; top: 0; transform: translateX(".concat(e.pageX-16,"px) translateY(").concat(e.pageY+32,"px); will-change: transform;"))})),A.on("mouseleave",(function(){o.hideCursorInfo(t),nr.hide()})),A.on("click",(function(e){e.preventDefault(),e.stopPropagation()})),A.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation()})),this.root.append(A)}},{key:"setCardSelectedByOther",value:function(e,t){var n=t||{},r=n.uuid,i=n.color;if(i){var o,a=(0,B.Vi)(i),s=a.alpha(.3).toRgbString();return e.selectedByOther||(o=e.onSelectByOther(!0,{color:i,rgb:s})),e.selectedByOther=r,o}e.selectedByOther&&e.onSelectByOther(!1),e.selectedByOther=!1}},{key:"setCardActivatedByOther",value:function(e,t){if(!e.isEditable){var n=t||{},r=n.uuid,i=n.color;if(i){var o,a=(0,B.Vi)(i),s=a.alpha(.3).toRgbString();return e.activatedByOther||(o=e.onActivateByOther(!0,{color:i,rgb:s})),e.activatedByOther=r,o}e.activatedByOther&&e.onActivateByOther(!1),e.activatedByOther=!1}}},{key:"drawRange",value:function(e,t,n){var r=this,i=this.engine.card,o=t.uuid,a=e,s=a.commonAncestorNode,l=i.find(s);l&&!l.isCenter(s)&&(l=void 0);var c=[];if(i.each((function(e){e.isEditable||l&&e.root.equal(l.root)||(e.activatedByOther===o&&r.setCardActivatedByOther(e),c.push(o))})),c.length>0){for(var A=0;A0){if(n.isEditable&&i.contains(e.startNode)&&i.contains(e.endNode)&&(e.startNode.closest(ne).length>0||e.endNode.closest(ne).length>0))return void r.setCardSelectedByOther(n);e.isPointInRange(i.get(),0)?r.setCardSelectedByOther(n,t):n.selectedByOther===o&&r.setCardSelectedByOther(n)}}));var v=i.getSingleSelectedCard(e);if(v){if(v.isEditable){var b=v.getCenter();if(b.contains(e.startNode)&&b.contains(e.endNode)&&(e.startNode.closest(ne).length>0||e.endNode.closest(ne).length>0))return}var y=this.setCardSelectedByOther(v,t)||v.root;this.drawCursor(y,t,n)}else{e.shrinkToElementNode();var w=this.drawBackground(e,t);e.collapsed||(w.forEach((function(t){t.collapsed||(e=t)})),e.shrinkToElementNode(),e.collapse(!1)),this.drawCursor(e,t,n)}}}},{key:"updateBackgroundPosition",value:function(){var e,t=(0,k.Z)(Cr.values());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=n.get();if(r){var i=r["__range"],o=n.attributes(ut),a=n.attributes(dt);this.drawBackground(i,{uuid:o,color:a})}}}catch(s){t.e(s)}finally{t.f()}}},{key:"updateCursorPosition",value:function(){var e,t=(0,k.Z)(Br);try{for(t.s();!(e=t.n()).done;){var n=(0,w.Z)(e.value,2),r=n[0],i=n[1],o=i.get();if(o&&o instanceof HTMLElement){var a=o["__target"];if(!a)return i.remove(),void Br.delete(r);if(a.name||(a=$t.fromPath(this.engine,a,!0)),a.startContainer||a.length>0&&a[0].isConnected){var s=this.getCursorRect(a);this.setCursorRect(r,i,s)}else i.remove(),Br.delete(r)}}}catch(l){t.e(l)}finally{t.f()}}},{key:"updateCardPosition",value:function(){var e,t,n=(null===(e=this.root.get())||void 0===e?void 0:e.getBoundingClientRect())||{left:0,top:0},r=(0,k.Z)(_r);try{for(r.s();!(t=r.n()).done;){var i=(0,w.Z)(t.value,2),o=i[0],a=i[1],s=a.get();if(s&&s instanceof HTMLElement){var l=s["__node"];if(null===l||void 0===l?void 0:l.isConnected){var c=l.getBoundingClientRect();s.style.left=c.left-n.left+"px",s.style.top=c.top-n.top+"px"}else{var A,u;null===(A=null!==(u=s.parentElement)&&void 0!==u?u:s.parentNode)||void 0===A||A.removeChild(s),_r.delete(o)}}}}catch(d){r.e(d)}finally{r.f()}}},{key:"updatePosition",value:function(){this.updateBackgroundPosition(),this.updateCursorPosition(),this.updateCardPosition()}},{key:"updateBackgroundAlpha",value:function(e){var t,n=this.getCursorRect(e),r=(0,k.Z)(Br.values());try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.get();if(o&&o instanceof HTMLElement){var a=o.querySelector(".".concat(xr)),s=o.style.left,l=o.style.top,c=(0,B.Vi)(o.style.backgroundColor);n.left===s&&n.top===l?c.alpha(.3):c.alpha(1);var A=c.toRgbString();o.style.backgroundColor=A,a&&(a.style.backgroundColor=A)}}}catch(u){r.e(u)}finally{r.f()}}},{key:"render",value:function(e,t,n){var r=e.path,i=e.uuid,o=e.active;if(r){var a=$t.fromPath(this.engine,r,!0);this.drawRange(a,t,o||n)}else this.remove(i)}},{key:"remove",value:function(e){var t,n,r,i=this;null===(t=null!==(n=null===(r=this.engine.scrollNode)||void 0===r?void 0:r.get())&&void 0!==n?n:this.root.get())||void 0===t||t.querySelectorAll("[".concat(ut,'="').concat(e,'"]')).forEach((function(t){var n,r;if(t.classList.contains(wr)){var o=t["__node"],a=o?i.engine.card.find(o):null;a&&!a.isEditable&&a.activatedByOther===e&&i.setCardActivatedByOther(a)}null===(n=null!==(r=t.parentElement)&&void 0!==r?r:t.parentNode)||void 0===n||n.removeChild(t)})),this.engine.card.each((function(t){t.isEditable||t.selectedByOther!==e||i.setCardSelectedByOther(t)}))}}]),e}(),Sr=new WeakMap,Fr=function(e){(0,h.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,l.Z)(this,n),r=t.call(this),r.engine=void 0,r.rangeColoring=void 0,r.currentRangePath=void 0,r.data=new Map,r.member=void 0,r.handleResize=function(){r.rangeColoring.updatePosition()},r.handleScroll=function(e){var t,n=null===(t=r.engine.container.get())||void 0===t?void 0:t.childNodes;if(n){var i,o=(0,k.Z)(r.data);try{for(o.s();!(i=o.n()).done;){var a,s,l=(0,w.Z)(i.value,2),c=l[0],A=l[1];if(c!==(null===(a=r.member.getCurrent())||void 0===a?void 0:a.uuid)&&(null===(s=A.path)||void 0===s?void 0:s.start.id)){var u=A.path.start.path[0],d=n.item(u);if(d&&e.equal(d)){r.rangeColoring.updatePosition();break}}}}catch(h){o.e(h)}finally{o.f()}}},r.handleMouseDown=function(){var e=r.engine.container;e.off("mouseup",r.handleMouseUp),e.off("mousemove",r.emitSelectChange),e.on("mouseup",r.handleMouseUp),e.on("mousemove",r.emitSelectChange)},r.mouseUpTimeout=null,r.handleMouseUp=function(){var e=r.engine.container;e.off("mouseup",r.handleMouseUp),e.off("mousemove",r.emitSelectChange),r.mouseUpTimeout&&clearTimeout(r.mouseUpTimeout),r.mouseUpTimeout=setTimeout((function(){r.emitSelectChange()}),10)},r.observer=null,r.emitSelectChange=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!r.engine.change.isComposing()){var n=r.engine.change.range.get();null===(e=r.observer)||void 0===e||e.disconnect();var i=r.engine.card.find(n.commonAncestorContainer,!0);if(null===i||void 0===i?void 0:i.getSelectionNodes){var o=r.getCardResizeRange(i);o&&(n=o.cloneRange(),r.observer=new ResizeObserver((function(){var e;(o=r.getCardResizeRange(i),o)?r.onSelectionChange(o,!0,t):null===(e=r.observer)||void 0===e||e.disconnect()})),r.observer.observe(i.root.get()))}if(n.commonAncestorNode.isRoot()||n.commonAncestorNode.inEditor())r.onSelectionChange(n,!0,t,!1);else{var a=r.member.getCurrent();a&&r.removeAttirbute(a.uuid)}}},r.engine=e,r.member=Nn.fromEngine(e),r.rangeColoring=new Er(e),e.container.on("keyup",r.emitSelectChange),e.container.on("mousedown",r.handleMouseDown),e.on("scroll",r.handleScroll,{passive:!0}),window.addEventListener("resize",r.handleResize,{passive:!0}),r}return(0,c.Z)(n,[{key:"getCardResizeRange",value:function(e){if(null===e||void 0===e?void 0:e.getSelectionNodes){var t=e.getSelectionNodes();if(t.length>0){var n,r=$t.create(this.engine);r.setStart(t[0],0);var i=t[t.length-1];return r.setEnd(i,i.isText()?i.text().length:(null===(n=i.get())||void 0===n?void 0:n.childNodes.length)||0),r}}return null}},{key:"setAttribute",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.data.get(e.uuid);if(e.force||!L()(o||{},e)){this.data.set(e.uuid,Object.assign({},e,{active:!o}));var a=this.member.getCurrent();e.uuid===(null===a||void 0===a?void 0:a.uuid)?Sr.get(this.engine)||(Sr.set(this.engine,!0),Promise.resolve().then((function(){Sr.set(n.engine,!1),!0===r&&n.rangeColoring.updatePosition(),n.emit("change",e)}))):this.rangeColoring.render(e,t,i)}}},{key:"removeAttirbute",value:function(e){if(this.data.has(e)){this.data.delete(e);var t=this.member.getCurrent();e===(null===t||void 0===t?void 0:t.uuid)?this.emit("change",{uuid:e,remove:!0}):this.rangeColoring.remove(e)}}},{key:"getAttribute",value:function(e){return this.data.get(e)}},{key:"onSelectionChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.member.getCurrent();if(i){var o=this.engine.card;e=e.cloneRange();var a=o.active;if(a&&!a.isEditable){var s=a.getCenter();if(jt(a.root)){var l=a.root.prev();l?e.select(l,!0).collapse(!1):(e.setStartBefore(a.root),e.collapse(!0))}else s&&s.length>0&&e.select(s.get(),!0)}if(!a&&!e.collapsed){var c=this.engine.card.find(e.startNode,!0);c&&c.type===nn.BLOCK&&e.setStart(c.getCenter().parent(),1);var A=this.engine.card.find(e.endNode,!0);A&&A.type===nn.BLOCK&&e.setEnd(A.getCenter().parent(),1)}var u=e.toPath(!0);this.currentRangePath=e.toPath();var d=this.getAttribute(i.uuid);this.setAttribute(Object.assign({},d,{path:u,uuid:i.uuid,force:t}),i,n,r),this.rangeColoring.updateBackgroundAlpha(e)}}},{key:"refreshAttributes",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0){var i=r.attributes($),o=$t.create(e),a=$t.create(e);return o.setStart(r[0],0),o.setEnd(t[0],n),a.setStart(t[0],n),a.setEnd(r[0],r[0].childNodes.length),{id:i,leftText:o.toString(),rightText:a.toString()}}},Ir=function(e){try{var t;if(0===(null===(t=window.getSelection())||void 0===t?void 0:t.rangeCount))return;var n=$t.from(e);if(!n||n.inCard())return;n.startNode.isRoot()&&n.shrinkToElementNode();var r=n.startNode,i=n.startOffset,o=n.endNode,a=n.endOffset;return{start:Mr(e,r,i),end:Mr(e,o,a)}}catch(s){return void e.messageError("apply-remote-path",s)}},Nr=function(e,t){var n;if(t){var r=t.id,i=t.leftText,o=t.rightText,a=null===(n=e.container.get())||void 0===n?void 0:n.querySelector("[".concat($,'="').concat(r,'"]'));if(a){var s=a.textContent||"";if(""===s)return{container:a,offset:0};if(null===s||void 0===s?void 0:s.startsWith(i)){var l=a.firstChild,c=i.length;while(l&&(3!==l.nodeType||((null===(A=l.textContent)||void 0===A?void 0:A.length)||0)";var d,h=(0,k.Z)(i);try{for(h.s();!(d=h.n()).done;){var p=d.value;o+=e(p)}}catch(f){h.e(f)}finally{h.f()}return o+=u?" />":""),o.replace(/\u200b/g,"")}throw new Error("Cannot convert node to value")},Qr=function(e){var t=e[me];if(!t)return"";var n=(0,x.Z)({type:t,value:e[ve],name:(e[fe]||e[ge]).toLowerCase(),editable:e[we]},$,e[$]);for(var r in e)r!==ge&&0===r.indexOf("data-")&&0!==r.indexOf("data-card")&&(n[r]=e[r]);var i="";s+=">";var h,p=(0,k.Z)(o);try{for(p.s();!(h=p.n()).done;){var f=h.value;s+=e(f)}}catch(g){p.e(g)}finally{p.f()}return s+=""),s}throw new Error("Cannot convert node to value")},Hr=function(e,t){return"ol"===e?t%3===1?"lower-alpha":t%3===2?"lower-roman":"decimal":t%3===1?"circle":t%3===2?"square":"disc"},Or=function(e){var t=e["data-indent"];if(!t){var n=e["style"];if(!n)return 0;var r=n.match(/text-indent: (\d+)(px|em|rem);/);if(!r)return 0;t=r[1]}var i=t?parseInt(t):0;return i},zr=function(e){var t=Or(e);return" ".repeat(2*t)},Zr=function(e){var t=e["start"],n=e["class"];if(n&&n.includes("data-list-task"))return Rr(e);var r=Or(e),i=Hr(e.type,r),o=zr(e),a=zr(e),s="ol"===e.type,l=t?parseInt(t):1;s||(a="".concat(nt(i)," "));var c="";return e.children.forEach((function(e,t){En.isElement(e)?"li"===e.type?(s&&(a="".concat(nt(i,l+t),". ")),c+=o+a+Rr(e)):c+=o+Rr(e):c+=Pr(e)})),c},Rr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.children,r=zr(e),i=!qn.isBlock(e)||0===n.length;if("checkbox"===e[fe]){var o=Ye(e[ve]),a=o.checked;return a?"✅":"🔲"}if(t||!e[fe]||"true"===e[we]){var s,l=(0,k.Z)(n);try{for(l.s();!(s=l.n()).done;){var c=s.value;r+=Pr(c),!i&&En.isElement(c)&&("br"===c.type||qn.isBlock(c))&&(i=!0)}}catch(A){l.e(A)}finally{l.f()}}return r+(i?"":"\n")},Pr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(_n.isText(e)){var n=e.text;return je(n).replace(/\u00a0/g," ").replace(/\u200b/g,"")}if(En.isElement(e)){var r=e.type;return"br"===r?"\n":"ol"===r||"ul"===r?Zr(e):Rr(e,t)}throw new Error("Cannot convert node to text")},qr=new WeakMap,Kr=new WeakMap,Wr=function(e,t){var n=new(N()),r=e.history,i=e.change,s=Dn.from(e);s.onChange((function(t){var o=v()(e.model.root),a=$n.transform(e,t);0!==a.length&&(n.emit("change",a,o),r.handleSelfOps(a.filter((function(e){return!0===e.undoable&&"set_node"===e.type&&e.newProperties[ve]&&r.handleNLCardValue(e),!e.undoable&&("set_node"!==e.type||!e.newProperties[ge])}))),e.trigger("operations",a),a.find((function(e){return"set_node"===e.type&&e.newProperties[ve]}))&&i.change(!1))})),e.readonly||s.start();var l=new Fr(e);l.on("change",(function(e){n.emit("selection-change",e)}));var c=Nn.fromEngine(e),A=function(t){var n,r=[],i=(0,k.Z)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=Tn(e,o,!1);if(a&&a.length>0&&r.push(a),"insert_node"===o.type||"remove_node"===o.type){var s=o.path,l=o.node,c=qn.get(u.root,s.slice(0,s.length-1));if(En.isElement(c)){var A="insert_node"===o.type,d=s[s.length-1];A?c.children.splice(d,0,l):c.children.splice(d,1),A&&a&&a.length>0&&function(){var t=function t(n,r,i,o){if(qn.setDOM(n,o,e.schema),zn.setPath(n,r,i),En.isElement(n))for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{type:"div",children:[]},n=qr.get(e);return n||(n=Wr(e,t),qr.set(e,n)),n},destroy:function(e){var t=qr.get(e);null===t||void 0===t||t.destroy()}},Vr=function(e,t){if(t){var n=t.start,r=t.end;if(n&&r){var i=n.path[n.path.length-1],o=r.path[r.path.length-1],a=n.path.slice(),s=r.path.slice();a.pop(),s.pop();var l=e.container,c=e.change,A=l.getChildByPath(a,(function(e){return!jt(Ut(e))}));if(!A)return;var u=l.getChildByPath(s,(function(e){return!jt(Ut(e))}));if(!u)return;var d=function(e,t){if(e.nodeType===rt().TEXT_NODE){var n=e.textContent||"";return n.length0&&m.length>0&&!g.equal(m)&&h.collapse(!0)}}c.range.select(h),h.scrollRangeIntoView()}catch(v){e.messageError("history setRangeByPath",v)}}}},Gr=(0,E.Z)("selfWaiting"),$r=function(){function e(t){var n=this;(0,l.Z)(this,e),this.actionOps=[],this.engine=void 0,this.currentAction={ops:[]},this.currentActionIndex=0,this.filterEvents=[],this.selfEvents=[],Object.defineProperty(this,Gr,{writable:!0,value:void 0}),this.lazySave=F()((function(){n.saveOp()}),200),this.handlePath=function(e,t,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(e){return!jt(Ut(e))},a=n.engine.container.find("[".concat($,'="').concat(t,'"]'));if(a.length>0&&a.inEditor()){var s,l=a.getPath(n.engine.container,(null===(s=a.parent())||void 0===s?void 0:s.isRoot())?void 0:o);return(i?l.map((function(e){return e+2})):l).concat(e.slice(r))}return e},this.engine=t}return(0,c.Z)(e,[{key:"resetCurrentAction",value:function(){this.currentAction={ops:[]}}},{key:"reset",value:function(){this.actionOps=[],this.currentActionIndex=0}},{key:"onFilter",value:function(e){this.filterEvents.push(e)}},{key:"onSelf",value:function(e){this.selfEvents.push(e)}},{key:"hasUndo",value:function(){return!!this.getUndoOp()}},{key:"hasRedo",value:function(){return!!this.getRedoOp()}},{key:"undo",value:function(){this.saveOp();var e=this.getUndoOp();if(e){var t=!1,n=this.engine,r=n.change,i=n.model;i.mutation.stop();try{i.emitChange(e.ops),i.apply(e.ops),this.currentActionIndex--,t=!0}catch(o){this.reset(),n.messageError("history-undo",o)}n.isEmpty()&&r.initValue(),t&&(r.getRangePathBeforeCommand(),e.startRangePath&&Vr(n,e.startRangePath),r.change(),n.trigger("undo")),Promise.resolve().then((function(){i.mutation.start()}))}}},{key:"redo",value:function(){this.saveOp();var e=this.getRedoOp();if(e){var t=!1,n=this.engine,r=n.change,i=n.model;try{i.mutation.stop(),i.emitChange(e.ops),i.apply(e.ops),this.currentActionIndex++,t=!0}catch(o){this.reset(),n.messageError("history-redo",o)}t&&(r.getRangePathBeforeCommand(),e.rangePath&&Vr(this.engine,e.rangePath),r.change(),n.trigger("redo")),Promise.resolve().then((function(){i.mutation.start()}))}}},{key:"clear",value:function(){var e=this;setTimeout((function(){e.reset()}),10)}},{key:"saveOp",value:function(){this.currentAction&&this.currentAction.ops&&this.currentAction.ops.length>0&&(this.currentAction.self&&(this.currentAction.rangePath=this.getCurrentRangePath(),this.currentAction.id=Oe(8),this.actionOps.splice(this.currentActionIndex),this.actionOps.push(this.currentAction),this.currentActionIndex=this.actionOps.length,this.engine.trigger("historyChange")),this.resetCurrentAction(),this.engine.change.getRangePathBeforeCommand())}},{key:"handleSelfOps",value:function(e){var t,n=this;(null===(t=this.currentAction)||void 0===t?void 0:t.self)||this.saveOp();var r=!1;if(e.forEach((function(e){if(r=!0,n.filterEvents.some((function(t){return t(e)}))){var t;n.actionOps.length>0&&!e.undoable&&(null===(t=n.actionOps[n.actionOps.length-1].ops)||void 0===t||t.push(e))}else{n.currentAction.self=!0,n.currentAction.ops||(n.currentAction.ops=[]),n.currentAction.startRangePath||(n.currentAction.startRangePath=n.getRangePathBeforeCommand());var i=n.currentAction.ops[n.currentAction.ops.length-1];i&&$n.isReverse(e,i)?n.currentAction.ops.pop():n.currentAction.ops.push(e)}})),r){var i=void 0;if(this.selfEvents.some((function(t){return i=t(e),void 0!==i})),(0,_.Z)(this,Gr)[Gr])return;"boolean"===typeof i?i?this.saveOp():this.resetCurrentAction():"object"===(0,o.Z)(i)?((0,_.Z)(this,Gr)[Gr]=i,i.then((function(e){e?n.saveOp():n.resetCurrentAction()})).finally((function(){return(0,_.Z)(n,Gr)[Gr]=void 0}))):void 0===i&&this.lazySave()}}},{key:"handleNLCardValue",value:function(e){if(!0===e.undoable&&"set_node"===e.type){var t=e.newProperties,n=t[ve];if(!n)return;var r=Ye(n);this.actionOps.forEach((function(e){e.ops.forEach((function(e){if("set_node"===e.type){var t=e.newProperties,n=t[ve],i=Ye(n);r.id===i.id&&(t[ve]=r)}else if("insert_node"===e.type){var o=e.node,a=o[ve];if(!a)return;var s=Ye(a);r.id===s.id&&(o[ve]=r)}}))}))}}},{key:"handleRemoteOps",value:function(e){var t=this;this.currentAction.self&&!(0,_.Z)(this,Gr)[Gr]&&this.saveOp();var n=this.engine.change.range.get();this.actionOps.forEach((function(e){if(e.rangePath){var r=e.rangePath,i=r.start,o=r.end;i.id&&void 0!==i.bi&&(i.path=t.handlePath(i.path,i.id,i.bi,!1,n.filterPath(!0))),o.id&&void 0!==o.bi&&(o.path=t.handlePath(o.path,o.id,o.bi,!1,n.filterPath(!0)))}if(e.startRangePath){var a=e.startRangePath,s=a.start,l=a.end;s.id&&void 0!==s.bi&&(s.path=t.handlePath(s.path,s.id,s.bi,!1,n.filterPath(!0))),l.id&&void 0!==l.bi&&(l.path=t.handlePath(l.path,l.id,l.bi,!1,n.filterPath(!0)))}})),e.forEach((function(e){t.currentAction.ops||(t.currentAction.ops=[]);var n=t.currentAction.ops[t.currentAction.ops.length-1];n&&$n.isReverse(e,n)?t.currentAction.ops.pop():t.currentAction.ops.push(e),t.actionOps.some((function(n,r){var i,o=null===(i=n.ops)||void 0===i?void 0:i.some((function(t){return $n.canOpAffectPath(e,t.path)}));if(o){for(var a=[n],s=function(e){var r,i=t.actionOps[e],o=null===(r=i.ops)||void 0===r?void 0:r.some((function(e){var t;return null===(t=n.ops)||void 0===t?void 0:t.some((function(t){return $n.canOpAffectPath(e,t.path)}))}));if(o){var s;a.push(i);var l=e+1,c=t.actionOps[l];c&&(null===(s=c.ops)||void 0===s?void 0:s.some((function(e){var t;return null===(t=i.ops)||void 0===t?void 0:t.some((function(t){return $n.canOpAffectPath(e,t.path)}))})))&&a.push(c)}},l=r+1;l0)return s.forEach((function(e){e.html("


      ")})),void n.apply(i.cloneRange().select(s[0],!0).collapse(!0));var l=i.startNode,c=i.startOffset;if(l.isEditable()){var A=l[0].childNodes[c-1],u=Ut(A);if("br"===u.name)return e.preventDefault(),u.remove(),void n.apply(i)}for(var d=!0,h=0;h1&&void 0!==arguments[1]&&arguments[1];if(Ut(e).isEditable())return null;if(!t){var n=this.getNext(e);if(!n)return null;e=n}while(e){var r=Ut(e);if(r.attributes(fe)){if(!e.ownerDocument)return null;var i=$t.create(this.engine,e.ownerDocument);return i.setStartAfter(e),i.collapse(!0),i}if(this.engine.node.isBlock(r)){if(!e.ownerDocument)return null;var o=$t.create(this.engine,e.ownerDocument);return o.select(r,!0).collapse(!0),o}if("br"===r.name){var a,s;if(1===(null===(a=null!==(s=e.parentElement)&&void 0!==s?s:e.parentNode)||void 0===a?void 0:a.childNodes.length))return null;if(!e.ownerDocument)return null;var l=$t.create(this.engine,e.ownerDocument);return l.setStartAfter(e),l.collapse(!0),l}if(e.nodeType===Node.TEXT_NODE){if(0===e["data"].length)return this.getRange(e);if(!e.ownerDocument)return null;var c=$t.create(this.engine,e.ownerDocument);return c.setStart(e,1),c.collapse(!0),c}if(0===e.childNodes.length)return this.getRange(e);e=e.childNodes[0]}return null}},{key:"trigger",value:function(e){var t=this.engine.change;t.cacheRangeBeforeCommand();var n=t.range.get();if(!n.collapsed)return e.preventDefault(),void t.delete();var r,i=this.engine.card.find(n.startNode),o=!1;if(i){if(i.isLeftCursor(n.startNode))return e.preventDefault(),this.engine.card.select(i),void t.delete();if(!i.isRightCursor(n.startNode))return;r=i.root[0]}else if(n.endContainer.nodeType===Node.TEXT_NODE){if(n.endContainer["data"].length>n.endOffset){e.preventDefault();var a=n.cloneRange();return a.setEnd(n.endContainer,n.endOffset+1),t.range.select(a),t.delete(),void t.range.select(t.range.get().shrinkToTextNode())}r=n.endContainer}else{if(n.endContainer.nodeType!==Node.ELEMENT_NODE)return;if(0===n.endContainer.childNodes.length)r=n.endContainer;else if(0===n.endOffset){var s;1===n.endContainer.childNodes.length&&"BR"===(null===(s=n.endContainer.firstChild)||void 0===s?void 0:s.nodeName)||(o=!0),r=n.endContainer.childNodes[n.endOffset]}else r=n.endContainer.childNodes[n.endOffset-1]}var l=this.getRange(r,o);if(l){e.preventDefault();var c=n.startOffset;1===c&&1===n.startContainer.childNodes.length&&"BR"===n.startContainer.childNodes[0].nodeName&&(c=0),l.setStart(n.startContainer,c),t.range.select(l),t.delete()}for(var A=0;A");for(var i=0;i");if(r.insert(c,a),i.isLastOffset(a,"end")&&(!c.next()||"br"!==(null===(s=c.next())||void 0===s?void 0:s.name))&&(!c.prev()||"br"!==(null===(l=c.prev())||void 0===l?void 0:l.name))){var A=c.clone();c.after(A),a.select(A).collapse(!1)}for(var u=0;u

      "),u=c.closest("".concat(ne,",").concat(X)),d=u.first();d||n.change.initValue(void 0,!0,c);var h=u.last(),p=!1;if(!1!==o&&d&&e.offsetY<((null===(a=d.get())||void 0===a?void 0:a.offsetTop)||0)&&!n.node.isEmptyWidthChild(d)?(u.prepend(A),p=!0):!1!==i&&h&&e.offsetY>((null===(s=h.get())||void 0===s?void 0:s.offsetTop)||0)+((null===(l=h.get())||void 0===l?void 0:l.clientHeight)||0)&&!n.node.isEmptyWidthChild(h)&&(u.append(A),p=!0),p){var f=n.change.range.get();f.select(A,!0).collapse(!1),n.change.apply(f)}}},this.handleFocus=function(){var e=r.options.engine;r.triggerFoucs(),!e.model.mutation.isStopped&&e.isEmpty()&&e.change.initValue()},this.focusTimeout=null,this.triggerFoucs=function(){var e=r.options.engine;r.focusTimeout&&clearTimeout(r.focusTimeout),r.focusTimeout=setTimeout((function(){if(!r._focused){var t=e.change.range.get();(t.commonAncestorNode.isRoot(e.container)||t.commonAncestorNode.inEditor(e.container))&&(e.change.range.setLastBlurRange(),e.trigger("focus"))}}),0)},this.onInput=function(e){var t=r.options.engine;if(!t.readonly&&(!e.target||!t.card.find(Ut(e.target)))){var n=t.change.range.get();n.handleBr(!0)}},this.onRealtimeChange=function(){var e=r.options.engine;e.isEmpty()?e.showPlaceholder():e.hidePlaceholder()},this.blurTimeout=null,this.docMouseDown=function(e){if(e.target){var t=Ut(e.target),n=r.options.engine;if(r._focused&&0===t.closest(ee).length&&!t.inEditor(n.container)){r.blurTimeout&&clearTimeout(r.blurTimeout);var i=n.change.range.get();r.blurTimeout=setTimeout((function(){var e=n.change.range.get();e.commonAncestorNode.inEditor(n.container)||(n.change.range.setLastBlurRange(i),n.trigger("blur"))}),0)}}},this.node=Ut(t),this.options=n,this._init(),this._focused=null!==document.activeElement&&this.node.equal(document.activeElement);var i=n.engine;i.on("blur",this._setBlur),i.on("focus",this._setFocus)}return(0,c.Z)(e,[{key:"_init",value:function(){var e,t=this,n=this.options,r=n.lang,i=n.tabIndex,o=n.className;this.node.attributes((e={},(0,x.Z)(e,Dt,"true"),(0,x.Z)(e,"role","textbox"),(0,x.Z)(e,"autocorrect","en-US"===r?"on":"off"),(0,x.Z)(e,"autocomplete","off"),(0,x.Z)(e,"spellcheck","en-US"===r?"true":"false"),(0,x.Z)(e,"data-gramm","false"),e)),void 0!==i&&this.node.attributes("tabindex",i),this.node.hasClass(oe)||this.node.addClass(oe),Ue&&this.node.addClass(ae),void 0!==o&&(Array.isArray(o)?o:o.split(/\s+/)).forEach((function(e){""!==e.trim()&&t.node.addClass(e)}))}},{key:"init",value:function(){var e=this.options.engine;this.node.on("input",this.onInput),e.on("realtimeChange",this.onRealtimeChange),this.node.on("click",this.handleClick),document.addEventListener("mousedown",this.docMouseDown),this.node.on(Ue?"touchstart":"mousedown",this.triggerFoucs,{passive:!0}),this.node.on("focus",this.handleFocus)}},{key:"isFocus",value:function(){return this._focused}},{key:"getNode",value:function(){return this.node}},{key:"setReadonly",value:function(e){this.node.attributes(Dt,e?"false":"true")}},{key:"showPlaceholder",value:function(){var e=this.options.placeholder;e&&(this.node.attributes((0,x.Z)({},yi,e)),this.node.addClass(wi))}},{key:"hidePlaceholder",value:function(){this.node.removeAttributes(yi),this.node.removeClass(wi)}},{key:"destroy",value:function(){var e=this,t=this.options,n=t.className,r=t.engine;r.on("blur",this._setBlur),r.on("focus",this._setFocus),r.off("realtimeChange",this.onRealtimeChange),document.removeEventListener("mousedown",this.docMouseDown),this.node.removeAttributes(Dt),this.node.removeAttributes("role"),this.node.removeAttributes("autocorrect"),this.node.removeAttributes("autocomplete"),this.node.removeAttributes("spellcheck"),this.node.removeAttributes("data-gramm"),this.node.removeAttributes("tabindex"),this.node.removeAttributes(yi),this.options.className&&(Array.isArray(n)?n:(n||"").split(/\s+/)).forEach((function(t){""!==t.trim()&&e.node.removeClass(t)})),r.card.closest(this.node)&&this.node.removeClass(oe),this.node.removeAllEvents()}}]),e}(),ki=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.Z)(this,e),this.data={},this.locale="zh-CN",this.locale=t,this.data=n}return(0,c.Z)(e,[{key:"add",value:function(e){this.data=O()(this.data,e)}},{key:"get",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1?arguments[1]:void 0,i=n;i1?n-1:0),i=1;i1?n-1:0),i=1;i-1?(0,B.Vi)(e.css(r)||"").toHex():e.css(r),a=t.style[r];"object"===(0,o.Z)(a)&&(i=a.format(i)),i&&(n[r]=i)})),n}},{key:"getAttributes",value:function(e){var t=this;gt(e)&&(e=Ut(e));var n={};return this.attributes&&this.isSelf(e)&&Object.keys(this.attributes).forEach((function(r){var i=e.attributes(r),a=t.attributes[r];"object"===(0,o.Z)(a)&&(i=a.format(i)),i&&(n[r]=i)})),n}},{key:"isSelf",value:function(e){gt(e)&&(e=Ut(e));var t=this.schema();return Array.isArray(t)&&(t=t.find((function(t){var n=t.name;return n===e.name}))),!!t&&((Array.isArray(this.tagName)?this.tagName.indexOf(e.name)>-1:e.name===this.tagName)&&this.editor.schema.checkNode(e,t.attributes))}},{key:"schema",value:function(){var e=this;if(this.sechamCache)return this.sechamCache;var t={};if(this.attributes&&Object.keys(this.attributes).forEach((function(n){var r,i=e.attributes[n];"object"===(0,o.Z)(i)&&(i=i.value),t[n]=i,null===(r=i.match(/@var\d/g))||void 0===r||r.forEach((function(r){if(!e.variable)throw"Please specify the variable type";t[n]=e.variable[r]}))})),this.style){var n={};Object.keys(this.style).forEach((function(t){var r,i=e.style[t];"object"===(0,o.Z)(i)&&(i=i.value),null===(r=i.match(/@var\d/g))||void 0===r||r.forEach((function(r){if(!e.variable)throw"Please specify the variable type";n[t]=e.variable[r]}))})),t=(0,s.Z)((0,s.Z)({},t),{},{style:n})}if(this.sechamCache={type:this.kind,attributes:t},"string"===typeof this.tagName)this.sechamCache.name=this.tagName.toLowerCase();else if(Array.isArray(this.tagName)){var r=[];this.tagName.forEach((function(t){r.push((0,s.Z)((0,s.Z)({},e.sechamCache),{},{name:t}))})),this.sechamCache=r}return this.sechamCache}},{key:"createElement",value:function(){for(var e=Ut("<".concat(this.tagName," />")),t=arguments.length,n=new Array(t),r=0;r")),n=arguments.length,r=new Array(n),i=0;i0&&s.each((function(t){var n=Ut(t);0===n.find("[".concat(fe,"=").concat(e.cardName,"],[").concat(ge,"=").concat(e.cardName,"]")).length&&r.addReadyCardToCustomize(n,e.cardName)}))}},e.pasteAfter=function(){var t;e.isPasteList&&(null===(t=e.editor)||void 0===t||t.list.merge())},e}return(0,c.Z)(n,[{key:"init",value:function(){(0,u.Z)((0,d.Z)(n.prototype),"init",this).call(this);var e=this.editor;st(e)&&(e.on("paste:before",this.pasteBefore),e.on("paste:insert",this.pasteInsert),e.on("paste:after",this.pasteAfter))}},{key:"queryState",value:function(){var e=this.editor;return!!st(e)&&e.list.getPluginNameByNodes(e.change.blocks)===this.constructor.pluginName}},{key:"destroy",value:function(){var e=this.editor;st(e)&&(e.off("paste:before",this.pasteBefore),e.off("paste:insert",this.pasteInsert),e.off("paste:after",this.pasteAfter))}}]),n}(Ti),Qi=function(e){(0,h.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,l.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o1?r-1:0),o=1;o0){var o=r.attributes(Ee);if(o){var a=t.card;i=a.find(o),i&&a.select(i)}}i||t.focus()}e.cacheRangeBeforeCommand()}return e}},{key:"execute",value:function(e){var t=this.editor,n=t.plugin.components[e];if(n&&n.execute){for(var r=this.handleExecuteBefore(),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a2?i-2:0),a=2;a1&&void 0!==arguments[1]&&arguments[1];e=v()(e),Array.isArray(e)||(e=[e]),e.forEach((function(e){var r=t.data["".concat(e.type,"s")];Pi(e)?(e.attributes&&Object.keys(e.attributes).forEach((function(n){t.data.globals[e.type]&&("style"===n?Object.keys(e.attributes.style).forEach((function(r){t.data.globals[e.type][n]&&t.data.globals[e.type][n][r]===e.attributes.style[r]&&delete e.attributes.style[r]})):t.data.globals[e.type][n]===e.attributes[n]&&delete e.attributes[n])})),r&&(n?t.data["".concat(e.type,"s")]=r.map((function(t){return t.name===e.name&&(t.attributes=O()(Object.assign({},t.attributes),e.attributes)),t})):r.push(e))):r&&(t.data.globals[e.type]=O()(Object.assign({},t.data.globals[e.type]),e.attributes))})),this.updateTagMap();var r=function(e){var t=e.attributes||{},n=t.style||{},r=0,i=0;return Object.keys(t).forEach((function(e){var n=t[e];Ri(n)&&n.required&&r++})),Object.keys(n).forEach((function(e){var t=n[e];Ri(t)&&t.required&&i++})),[r,i]},i=this.data,o=i.blocks,a=i.marks,s=i.inlines;this._all=[].concat((0,C.Z)(o),(0,C.Z)(a),(0,C.Z)(s)).sort((function(e,t){var n=r(e),i=(0,w.Z)(n,2),o=i[0],a=i[1],s=r(t),l=(0,w.Z)(s,2),c=l[0],A=l[1];return o>c?-1:o===c?a===A?0:a>A?-1:1:1}))}},{key:"updateTagMap",value:function(){var e=this;this._tagMap.marks=[],this.data.marks.forEach((function(t){~~e._tagMap.marks.indexOf(t.name)&&e._tagMap.marks.push(t.name)})),this._tagMap.blocks=[],this.data.blocks.forEach((function(t){~~e._tagMap.blocks.indexOf(t.name)&&e._tagMap.blocks.push(t.name)})),this._tagMap.inlines=[],this.data.inlines.forEach((function(t){~~e._tagMap.inlines.indexOf(t.name)&&e._tagMap.inlines.push(t.name)}))}},{key:"getTags",value:function(e){return this._tagMap[e]}},{key:"remove",value:function(e){var t=this._all.findIndex((function(t){return L()(t,e)}));t>-1&&this._all.splice(t,1);var n=this.data["".concat(e.type,"s")];n&&(t=n.findIndex((function(t){return L()(t,e)})),t>-1&&n.splice(t,1)),this._typeMap={},this.updateTagMap()}},{key:"clone",value:function(){var t=new e;return t._all=v()(this._all),t._typeMap=v()(this._typeMap),t._tagMap=v()(this._tagMap),t.data=v()(this.data),t}},{key:"find",value:function(e){var t=this,n=[];return zi.forEach((function(r){if("globals"!==r){var i=t.data[r].filter(e);n.push.apply(n,(0,C.Z)(i))}})),n}},{key:"getType",value:function(e,t){var n=gt(e)?e:e[0];if(n&&n.nodeType===Node.ELEMENT_NODE){var r=n.getAttribute($);if(r=r?r.split("-")[0]:Zt(n,!1),"CARD"===n.nodeName||!~this._invalidKeys.indexOf(r)){var i=this._typeMap[r];if(i&&(!t||t(i)))return i.type;var o=this.getRule(n,t);return o?this._typeMap[r]=o:this._invalidKeys.push(r),null===o||void 0===o?void 0:o.type}}}},{key:"getRule",value:function(e,t){var n=this,r=gt(e)?e:e[0];return t=t||function(e){return e.name===r.localName},this._all.find((function(e){return t(e)&&n.checkNode(r,e.attributes)}))}},{key:"checkNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=gt(e)?e:e[0];for(var r in t){var i;if("style"!==r){var o=t;if(!o[r])return!1;if(!this.checkValue(o,r,null!==(i=n.getAttribute(r))&&void 0!==i?i:void 0))return!1}}var a=qe(n.getAttribute("style")||""),s=t.style||{};for(var l in s){if(!s[l])return!1;if(!this.checkValue(s,l,a[l]))return!1}return!0}},{key:"checkValue",value:function(e,t,n,r){if(!e[t])return!1;var i=e[t];if(Ri(i)){if(void 0===n)return!i.required;i=i.value}else if(!r||void 0===n)return!0;if("string"===typeof i&&"@"===i.charAt(0))switch(i){case"@number":i=/^-?\d+(\.\d+)?$/;break;case"@length":i=/^-?\d+(\.\d+)?(\w*|%)$/;break;case"@color":i=/^(rgb(.+?)|#\w{3,8}|\w+)$/i;break;case"@url":i=Je;break}return"string"===typeof i?"*"===i||("class"===t?(n||"").split(/\s+/).some((function(e){return e.trim()===i})):i===n):Array.isArray(i)?"class"===t?(n||(n="*"),n.split(/\s+/).every((function(e){return""===e.trim()||~i.indexOf(e.trim())}))):i.indexOf(n)>-1:"object"===(0,o.Z)(i)&&"function"===typeof i.test?"class"===t?(n||"").split(/\s+/).every((function(e){return""===e.trim()||i.test(e.trim())})):i.test(n||""):"function"!==typeof i||i(n)}},{key:"filterStyles",value:function(e,t,n){var r=this;Object.keys(e).forEach((function(i){var o;(null===(o=t.attributes)||void 0===o?void 0:o.style)&&r.checkValue(t.attributes.style,i,e[i],!0)||(n&&n(i,e[i]),delete e[i])}))}},{key:"filterAttributes",value:function(e,t,n){var r=this;Object.keys(e).forEach((function(i){t.attributes&&r.checkValue(t.attributes,i,e[i],!0)||(n&&n(i,e[i]),delete e[i])}))}},{key:"filter",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.getRule(e);if(i){var o=this.data.globals,a=o[i.type]?i.type:void 0,s=Object.assign({},i,{attributes:O()({},i.attributes,a?o[a]:{})});this.filterAttributes(t,s,r?function(t){return e.removeAttributes(t)}:void 0),this.filterStyles(n,s,r?function(t){return e.css(t,"")}:void 0)}}},{key:"closest",value:function(e){var t=this,n=e;return this.data.blocks.forEach((function(r){if(r.name===e){var i=r;i.allowIn&&(i.allowIn.forEach((function(e){t.isAllowIn(e,n)&&(n=e)})),n=t.closest(n))}})),n}},{key:"isAllowIn",value:function(e,t){return"p"!==e&&this.data.blocks.some((function(n){if(n.name===t){var r=n;return!!(r.allowIn&&r.allowIn.indexOf(e)>-1)||void 0}}))}},{key:"addAllowIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"p",n=this.data.blocks.find((function(e){return e.name===t}));n.allowIn||(n.allowIn=[]),~~n.allowIn.indexOf(e)&&n.allowIn.push(e)}},{key:"getAllowInTags",value:function(){var e=[];return this.data.blocks.forEach((function(t){var n=t;n.allowIn&&n.allowIn.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),e}},{key:"getCanMergeTags",value:function(){var e=[];return this.data.blocks.forEach((function(t){var n=t;!0===n.canMerge&&e.indexOf(n.name)<0&&e.push(n.name)})),e}}]),e}(),Ri=function(e){return void 0!==e.required},Pi=function(e){return!!e["name"]},qi=function(){function e(t){(0,l.Z)(this,e),this.editor=void 0,this.data=[],this.editor=t}return(0,c.Z)(e,[{key:"getData",value:function(){return this.data}},{key:"clone",value:function(){var t=v()(this.data),n=new e(this.editor);return n.data=t,n}},{key:"add",value:function(e,t){this.data.push({from:e,to:t})}},{key:"transform",value:function(e,t){var n=e.name,r=e.attributes(),i=qe(r.style||""),o=!1;delete r.style,e.isCursor()&&(n=r[G].toLowerCase(),r={},i={});var a=this.data.find((function(e){if(!t||t(e)){var a=e.from,s=e.to,l=!1;if("string"===typeof a)l=a===n;else if("function"===typeof a)l=a(n,i,r);else{var c=Object.keys(a);l=c.indexOf(n)>=0&&c.some((function(e){var t=a[e];return Object.keys(t.style||{}).every((function(e){var n=t.style[e];return i[e]&&Array.isArray(n)?n.indexOf(i[e])>-1:n===i[e]}))&&Object.keys(t.attributes||{}).every((function(e){var n=t.attributes[e];return i[e]&&Array.isArray(n)?n.indexOf(i[e])>-1:n===i[e]}))}))}if(l)if("string"===typeof s)n=s,i={},r={};else{var A="function"===typeof s?s(n,i,r):s,u=A;if(A.hasOwnProperty("replace")){var d=A;u=d.node,o=d.replace}n=u.name,i=u.css(),r=u.attributes()}return l}}));return a?{rule:a,node:{name:n,style:i,attributes:r},replace:o}:void 0}}]),e}(),Ki=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"insertNewline",value:function(e,t,n){var r=this.engine.change,i=Ut("


      ");this.engine.nodeId.generate(i),n?t.root.before(i):t.root.after(i),e.select(i,!0),e.collapse(!1),r.range.select(e)}},{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.card,i=n.range.get(),o=r.find(i.startNode);if(!o)return!0;if(o.type===nn.INLINE){var a=i.startNode.closest(Ce);a.length>0&&(i.select(o.root),i.collapse(!0),n.range.select(i));var s=i.startNode.closest(_e);s.length>0&&(i.select(o.root),i.collapse(!1),n.range.select(i))}else{var l=i.startNode.closest(Ce);if(l.length>0){e.preventDefault();var c=o.root.prev();return!c||c.isCard()?(r.focusPrevBlock(o,i,!0),n.range.select(i)):this.insertNewline(i,o,!0),!1}var A=i.startNode.closest(_e);if(A.length>0){e.preventDefault();var u=o.root.next();return!u||u.isCard()?(r.focusNextBlock(o,i,!0),n.range.select(i)):this.insertNewline(i,o,!1),!1}}return!0}}]),e}(),Wi=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"focusPrevBlock",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.engine.change,r=n.range.get();e=e||this.engine.block.closest(r.startNode);var i=e.prev();if(i)if(i.isCard()){var o=this.engine.card.find(i);o&&o.focus(r)}else this.engine.node.isList(i)&&(i=i.last()),i&&(t&&this.engine.node.isEmptyWithTrim(i)?i.remove():(r.select(i,!0),r.collapse(!1),n.range.select(r.shrinkToTextNode())))}},{key:"trigger",value:function(e){var t=this.engine.change,n=t.range.get().cloneRange().shrinkToElementNode().shrinkToTextNode();if(n.collapsed){var r=this.engine.card.find(n.startNode);if(!r){var i=n.getPrevNode(),o=null===i||void 0===i?void 0:i.parent();if(!e["isDelete"]&&i&&i.isCard()&&(!o||!this.engine.node.isCustomize(o))){e.preventDefault();var a=n.cloneRange();return a.setStartBefore(i),a.collapse(!0),this.engine.card.remove(i),t.range.select(a.shrinkToTextNode()),a.handleBr(),!1}return!0}if(e["isDelete"])return!0;if(r.type===nn.INLINE){var s=n.startNode.closest(Ce);if(s.length>0){var l=r.root.prev();if(!l)return e.preventDefault(),t.mergeAfterDelete(),!1;var c=this.engine.card.find(l);if(c)return this.engine.card.remove(c.id),n.handleBr(),!1;n.select(r.root).collapse(!0),t.range.select(n)}var A=n.startNode.closest(_e);if(A.length>0){e.preventDefault();var u=n.cloneRange();return u.setStartBefore(r.root),u.collapse(!0),this.engine.card.remove(r.id),t.range.select(u.shrinkToTextNode()),u.handleBr(),!1}}else{var d,h=n.startNode.closest(Ce);if(h.length>0)return e.preventDefault(),(null===(d=r.root.parent())||void 0===d?void 0:d.inEditor())?t.unwrap(r.root.parent()):this.focusPrevBlock(r.root,!0),!1;var p=n.startNode.closest(_e);if(p.length>0)return e.preventDefault(),this.focusPrevBlock(r.root),this.engine.card.remove(r.id,!1),t.isEmpty()&&t.initValue(),!1}return!1!==this.engine.trigger("keydown:backspace",e)}}}]),e}(),ji=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"inline",value:function(e,t){var n=this.engine.change,r=n.range.get().cloneRange(),i=e.constructor.singleSelectable,o=r.commonAncestorNode.closest(Ce);if(o.length>0){var a=e.root.prev();return a?(r.setStartBefore(e.root[0]),r.collapse(!0)):e.focus(r,!0),n.range.select(r),!0}var s=r.commonAncestorNode.closest(_e),l=0===o.length&&0===s.length;if(s.length>0||l){var c,A;if(t.preventDefault(),l)e.select(!1),null===(c=e.toolbarModel)||void 0===c||c.hide(),e.activate(!1);else if(r.collapsed){var u=this.engine.card.find(r.startNode);if(u&&u.onSelectLeft)return u.onSelectLeft(t)}if(l||!1===i)e.focus(r,!0),e.select(!1),null===(A=e.toolbarModel)||void 0===A||A.hide(),n.range.select(r);else this.engine.card.select(e,t);return!1}return!0}},{key:"block",value:function(e,t){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ce);if(a.length>0){var s=e.root.prev();return s?(t.preventDefault(),i.focusPrevBlock(e,o,!1),r.range.select(o),!1):void 0}var l,c,A=o.commonAncestorNode.closest(_e),u=0===a.length&&0===A.length;u&&(e.select(!1),null===(l=e.toolbarModel)||void 0===l||l.hide(),e.activate(!1));if(A.length>0){if(o.collapsed){var d=i.find(o.startNode);if(d&&d.onSelectLeft)return d.onSelectLeft(t)}return t.preventDefault(),i.select(e,t),!1}return!i.getSingleSelectedCard(o)||(t.preventDefault(),e.focus(o,!0),e.select(!1),null===(c=e.toolbarModel)||void 0===c||c.hide(),r.range.select(o),!1)}},{key:"fincPrevCard",value:function(e){if(!e.collapsed)return null;var t=e.startNode,n=e.startOffset;if(t.isText()&&0===n){var r=t.prevElement();if(r&&r.isCard())return this.engine.card.find(r)}return null}},{key:"trigger",value:function(e){var t=this.engine.change,n=t.range.get(),r=this.engine.card.getSingleCard(n);if(!r){var o=this.fincPrevCard(n);return!o||(e.preventDefault(),o.focus(n,!1),t.range.select(n),!1)}return!(0,i.ZP)("shift+left",e)&&(r.type===nn.INLINE?this.inline(r,e):this.block(r,e))}}]),e}(),Vi=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"inline",value:function(e,t){var n=this.engine.change,r=n.range.get(),i=e.constructor.singleSelectable,o=r.commonAncestorNode.closest(Ce),a=r.commonAncestorNode.closest(_e),s=0===o.length&&0===a.length;if(o.length>0||s){var l,c;if(t.preventDefault(),s)e.select(!1),e.activate(!1),null===(l=e.toolbarModel)||void 0===l||l.hide();else if(r.collapsed){var A=this.engine.card.find(r.startNode);if(A&&A.onSelectRight)return A.onSelectRight(t)}if(s||!1===i)e.focus(r,!1),e.select(!1),null===(c=e.toolbarModel)||void 0===c||c.hide(),n.range.select(r);else this.engine.card.select(e,t);return!1}if(a.length>0){var u=e.root.next();u?(r.setEndAfter(e.root[0]),r.collapse(!1)):e.focus(r,!1),n.range.select(r)}return!0}},{key:"block",value:function(e,t){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ce);if(a.length>0){if(o.collapsed){var s=this.engine.card.find(o.startNode);if(s&&s.onSelectRight)return s.onSelectRight(t)}return t.preventDefault(),i.select(e,t),!1}var l,c,A=o.commonAncestorNode.closest(_e),u=0===a.length&&0===A.length;u&&(e.select(!1),null===(l=e.toolbarModel)||void 0===l||l.hide(),e.activate(!1));if(A.length>0){var d=e.root.next();return d?(t.preventDefault(),i.focusNextBlock(e,o,!1),r.range.select(o),!1):void 0}return!this.engine.card.getSingleSelectedCard(o)||(t.preventDefault(),e.focus(o,!1),e.select(!1),null===(c=e.toolbarModel)||void 0===c||c.hide(),r.range.select(o),!1)}},{key:"fincNextCard",value:function(e){if(!e.collapsed)return null;var t=e.startNode,n=e.startOffset;if(t.isText()){var r=t.text();if(r.length===n){var i=t.nextElement();if(i&&i.isCard())return this.engine.card.find(i)}}return null}},{key:"trigger",value:function(e){var t=this.engine.change,n=t.range.get(),r=this.engine.card.getSingleCard(n);if(!r){var o=this.fincNextCard(n);return!o||(e.preventDefault(),o.focus(n,!0),t.range.select(n),!1)}if(!(0,i.ZP)("shift+right",e))return r.type===nn.INLINE?this.inline(r,e):this.block(r,e)}}]),e}(),Gi=function(e,t){var n,r=e.change,i=r.range.get(),o=i.commonAncestorNode.closest(Ce),a=i.commonAncestorNode.closest(_e),s=0===o.length&&0===a.length;return!!s&&(t.select(!1),t.activate(!1),null===(n=t.toolbarModel)||void 0===n||n.hide(),!0)},$i=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"common",value:function(e,t){var n=this.engine,r=n.change,i=n.card,o=r.range.get();Gi(this.engine,e);var a=e.root.prev();if(a)return t.preventDefault(),i.focusPrevBlock(e,o,!1),r.range.select(o),!1}},{key:"inline",value:function(e,t){return this.common(e,t)}},{key:"block",value:function(e,t){return this.common(e,t)}},{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.card,o=t.block,a=n.range.get();if(a.collapsed){var s=o.closest(a.startNode),l=s.prev();if(null===l||void 0===l?void 0:l.isCard()){var c=r.find(l);if(c&&c.onSelectUp)return c.onSelectUp(e)}}var A=r.getSingleCard(a);return!A||((0,i.ZP)("shift+up",e)?void 0:A.type===nn.INLINE?this.inline(A,e):this.block(A,e))}}]),e}(),Yi=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"common",value:function(e,t){var n=this.engine,r=n.change,i=n.card,o=r.range.get();Gi(this.engine,e);var a=e.root.next();if(a)return t.preventDefault(),i.focusNextBlock(e,o,!1),r.range.select(o),!1}},{key:"inline",value:function(e,t){return this.common(e,t)}},{key:"block",value:function(e,t){return this.common(e,t)}},{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.block,o=t.card,a=n.range.get(),s=o.getSingleCard(a);if(a.collapsed){var l=r.closest(a.startNode),c=l.next();if(null===c||void 0===c?void 0:c.isCard()){var A=o.find(c);if(A&&A.onSelectDown)return A.onSelectDown(e)}}return!s||(!!(0,i.ZP)("shift+down",e)||(s.type===nn.INLINE?this.inline(s,e):this.block(s,e)))}}]),e}(),Xi=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"block",value:function(e,t){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ce);if(a.length>0)return t.metaKey||t.ctrlKey||(i.focusPrevBlock(e,o,!0),r.range.select(o)),!0;var s=o.commonAncestorNode.closest(_e);return s.length>0&&(t.metaKey||t.ctrlKey||(i.focusNextBlock(e,o,!0),r.range.select(o))),!0}},{key:"trigger",value:function(e){var t=this.engine.change,n=t.range.get(),r=this.engine.card.getSingleCard(n);return!r||(r.type!==nn.BLOCK||this.block(r,e))}}]),e}(),Ji='.am-engine .card-selected [data-card-element="center"].data-card-background-selected {\n background: rgba(27, 162, 227, 0.2);\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected {\n outline: 2px solid #1890FF;\n border-radius: 2px;\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected::-moz-selection {\n background: transparent;\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected::selection {\n background: transparent;\n}\n\n.am-engine-view [data-card-element="center"] .data-card-loading,.am-engine [data-card-element="center"] .data-card-loading {\n display: inline-block;\n font-style: normal;\n vertical-align: -0.125em;\n text-align: center;\n text-transform: none;\n line-height: 0;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n margin-right: 5px;\n padding: 16px;\n width: 100%;\n}\n\n.am-engine-view [data-card-element="center"] .data-card-loading .data-card-spin,.am-engine [data-card-element="center"] .data-card-loading .data-card-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n';en(Ji);var eo=function(){function e(t){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(0,l.Z)(this,e),this.classes=void 0,this.components=void 0,this.lazyRender=void 0,this.asyncComponents=[],this.editor=void 0,this.renderTimeout=void 0,this.renderAsyncComponents=(0,a.Z)(g().mark((function e(){var t;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:n.renderTimeout&&clearTimeout(n.renderTimeout),t=n.editor,n.renderTimeout=setTimeout((function(){var e=n.asyncComponents.concat();e.forEach(function(){var e=(0,a.Z)(g().mark((function e(r){return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:(0===r.root.length||t.root.inViewport(r.root,!0)&&!1!==t.trigger("card:async-render-component",r))&&(n.asyncComponents.splice(n.asyncComponents.findIndex((function(e){return e===r})),1),r.root.length>0&&r.loading&&(r.destroy&&r.destroy(),r.getCenter().empty(),n.renderComponent(r)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),50);case 3:case"end":return e.stop()}}),e)}))),this.classes={},this.components=[],this.editor=t,this.lazyRender=r}return(0,c.Z)(e,[{key:"active",get:function(){return this.components.find((function(e){return e.activated}))}},{key:"length",get:function(){return this.components.length}},{key:"init",value:function(e){var t,n,r=this,i=this.editor;if(st(i)){var o,a,s,l,c,A,u,d=i.typing,h=new Ki(i);null===(o=d.getHandleListener("enter","keydown"))||void 0===o||o.on((function(e){return h.trigger(e)}));var p=new Wi(i);null===(a=d.getHandleListener("backspace","keydown"))||void 0===a||a.on((function(e){return p.trigger(e)}));var f=new ji(i);null===(s=d.getHandleListener("left","keydown"))||void 0===s||s.on((function(e){return f.trigger(e)}));var g=new Vi(i);null===(l=d.getHandleListener("right","keydown"))||void 0===l||l.on((function(e){return g.trigger(e)}));var m=new $i(i);null===(c=d.getHandleListener("up","keydown"))||void 0===c||c.on((function(e){return m.trigger(e)}));var v=new Yi(i);null===(A=d.getHandleListener("down","keydown"))||void 0===A||A.on((function(e){return v.trigger(e)}));var b=new Xi(i);null===(u=d.getHandleListener("default","keydown"))||void 0===u||u.on((function(e){return b.trigger(e)}))}e.forEach((function(e){r.classes[e.cardName]=e})),this.lazyRender&&(window.addEventListener("resize",this.renderAsyncComponents,{passive:!0}),null===(t=i.scrollNode)||void 0===t||null===(n=t.get())||void 0===n||n.addEventListener("scroll",this.renderAsyncComponents,{passive:!0}),window.addEventListener("scroll",this.renderAsyncComponents,{passive:!0}),i.on("card:async-render",this.renderAsyncComponents))}},{key:"add",value:function(e){this.classes[e.cardName]=e}},{key:"each",value:function(e){this.components.every((function(t,n){return!e||!1!==e(t,n)}))}},{key:"closest",value:function(e,t){if(gt(e)&&(e=Ut(e)),!e.isCard()){var n=e.closest(xe,(function(e){var n;if(!(e&&t?Ut(e).isRoot():Ut(e).isEditable()))return(null!==(n=e.parentElement)&&void 0!==n?n:e.parentNode)||void 0}));if(!n||0===n.length)return;e=n}return e}},{key:"find",value:function(e,t){if("string"!==typeof e){var n=this.closest(e,t);if(!n)return;e=n}var r=function(e){gt(e)&&(e=Ut(e));var t=e.attributes(ve);return Ye(t)},i=this.components.filter((function(t){return"string"===typeof e?t.id===e:t.root.name===(gt(e)?e.nodeName.toString().toLowerCase():e.name)&&(t.root.equal(e)||t.id===r(e).id)}));if(0!==i.length)return i[0]}},{key:"findBlock",value:function(e){if(gt(e)&&(e=Ut(e)),e.get()){var t=e.parent();if(t){var n=this.find(t);if(n)return n.type===nn.BLOCK?n:this.findBlock(n.root)}}}},{key:"getSingleCard",value:function(e){var t=this.find(e.commonAncestorNode);return t||(t=this.getSingleSelectedCard(e)),t}},{key:"getSingleSelectedCard",value:function(e){var t=e.findElements(),n=t[0];if(1===t.length&&n){var r=Ut(n);if(r.isCard())return this.find(r)}}},{key:"insertNode",value:function(e,t){var n="inline"===t.type,r=this.editor;!e.collapsed&&st(r)&&r.change.delete(e),this.gc();var i=r.inline,o=r.block,a=r.node,s=[];if(n){if(st(r)&&t.executeMark){s=r.change.marks.map((function(e){return e.clone()}));var l,c=r.card.find(e.startNode);if(null===c||void 0===c?void 0:c.queryMarks)(l=s).push.apply(l,(0,C.Z)(c.queryMarks()))}i.insert(t.root,e)}else o.insert(t.root,e,(function(e){var t=e.parent();while(t&&!t.isEditable()){e=t;var n=t.parent();if(!n||!a.isBlock(n))break;t=n}return e}),!0);this.components.push(t);var A=t.root.parent();!n&&A&&A.inEditor()&&a.isBlock(A)&&o.unwrap(A,e);for(var u=arguments.length,d=new Array(u>2?u-2:0),h=2;h2?r-2:0),o=2;o
      ')),s=Ut(a);return e.before(s),s.append(e),s}},{key:"activate",value:function(e,t,n){var r=this.editor;if(st(r)&&!r.readonly){var i=e.getRoot(),o=this.active;if(!i.get()||r.container.equal(i)){var a=this.find(e),s=e.closest(ne);if(!a&&s.length>0){var l=s.parent();a=l?this.find(l):void 0}var c=a?this.findBlock(a.root):void 0;if(c&&(a=c),a&&a.isCursor(e))if(s.length>0){var A=s.parent();a=A?this.find(A):void 0}else a=void 0;var u,d=a&&o&&o.root.equal(a.root);if(o&&!d)null===(u=o.toolbarModel)||void 0===u||u.hide(),o.select(!1),o.activate(!1);if(a){if(a.activatedByOther)return;var h;if(d)a.isEditable?a.select(!1):t===rn.MOUSE_DOWN&&"input"!==e.name&&0===a.root.find(".data-drag-image").length&&(null===n||void 0===n||n.preventDefault());else!1===a.constructor.singleSelectable||t===rn.CLICK&&!st(r)||this.select(a,n),a.isEditable||!1===a.constructor.autoSelected||a.select(!a.isEditable),a.activate(!0),null===(h=a.toolbarModel)||void 0===h||h.show(n);r.change.onSelect()}}else if(o){var p;null===(p=o.toolbarModel)||void 0===p||p.hide(),o.select(!1),o.activate(!1)}}}},{key:"select",value:function(e,t){var n=this.editor;if(st(n)&&!1!==e.constructor.singleSelectable&&(e.type!==nn.BLOCK||!e.activated)){var r=n.change.range.get().cloneRange();if(r.startNode.closest(ne).length>0&&(!t||t instanceof MouseEvent&&(!t.target||!this.closest(t.target,!1)))||e.isEditable||e.isMaximize)return;null===t||void 0===t||t.preventDefault();var i=e.root,o=i.parent(),a=o.children().toArray().findIndex((function(e){return e.equal(i)}));r.setStart(o,a),r.setEnd(o,a+1),n.change.range.select(r)}}},{key:"focus",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.editor;if(st(n)){var r=n.change,i=n.container,o=n.scrollNode,a=r.range.get();e.focus(a,t),r.range.select(a),this.activate(a.startNode,rn.MOUSE_DOWN),r.onSelect(),o&&a.scrollIntoViewIfNeeded(i,o)}}},{key:"insert",value:function(e,t){var n=this.editor;if(!st(n))throw"Engine not found";for(var r=this.create(e,{value:t}),i=n.change,o=i.range.toTrusty(),a=arguments.length,s=new Array(a>2?a-2:0),l=2;l2?o-2:0),s=2;s3?r-3:0),o=3;o1&&void 0!==arguments[1])||arguments[1],n=this.editor;if(st(n)){var r=n.change,i=n.list,o=n.node,a=r.range.get(),s=this.find(e);if(s){s.type===nn.INLINE?(a.setEndAfter(s.root[0]),a.collapse(!1)):this.focusPrevBlock(s,a,t);var l=s.root.parent();this.removeNode(s),i.addBr(a.startNode),l&&o.isEmpty(l)&&!n.model.mutation.isStopped&&(l.isEditable()?(o.html(l,"


      "),a.select(l,!0),a.shrinkToElementNode(),a.collapse(!1)):(o.html(l,"
      "),a.select(l,!0),a.collapse(!1))),t?r.apply(a):(r.range.select(a),r.change())}}}},{key:"removeRemote",value:function(e){var t=this.editor;if(st(t)){var n=t.node,r=this.find(e);if(r){var i=r.root.parent();this.removeNode(r),i&&n.isEmpty(i)&&!t.model.mutation.isStopped&&(i.isEditable()?n.html(i,"


      "):n.html(i,"
      "))}}}},{key:"create",value:function(e,t){var n,r=this.classes[e];if(!r)throw"".concat(e,": This card does not exist");var i=(null===t||void 0===t||null===(n=t.value)||void 0===n?void 0:n.type)||r.cardType;if(["inline","block"].indexOf(i)<0)throw"".concat(e,': the type of card must be "inline", "block"');(null===t||void 0===t?void 0:t.root)&&t.root.empty();var o=this.editor,a=new r({editor:o,value:null===t||void 0===t?void 0:t.value,root:null===t||void 0===t?void 0:t.root}),s=a.root;s.attributes(me,i),s.attributes(fe,e),s.attributes(ye,"true");var l=i===nn.INLINE?"span":"div",c=Ut("<".concat(l," ").concat(a.isEditable?re+"='*'":"","/>"));c.attributes(be,"center");var A=Ut("<".concat(l," ").concat(be,'="body" />'));return A.append(c),s.append(A),this.createCursor(a),i===nn.BLOCK&&o.nodeId.generate(a.root),a.init(),a}},{key:"createCursor",value:function(e){var t=this.editor,n=e.constructor,r=void 0!==n.focus?n.focus:st(t)&&!t.readonly,i=e.getCenter();i.removeAttributes(Dt);var o=e.root;o.removeAttributes(Dt);var a=e.findByKey("left"),s=e.findByKey("right");r?(i.attributes(Dt,"false"),a||i.before(Ut("'))),s||i.after(Ut("')))):(null===a||void 0===a||a.remove(),null===s||void 0===s||s.remove(),o.attributes(Dt,"false"))}},{key:"reRender",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:this.lazyRender,i=e?e.isCard()?e:e.find("".concat(ke)):this.editor.container.find(ke);this.gc();var o=[],a=[],s=i.toArray();s.forEach((function(e){a.find((function(t){return t.equal(e)}))||a.push(e);var t=e.find("".concat(xe,",").concat(ke)).toArray();t.forEach((function(t){if(!t.equal(e)){var n=a.findIndex((function(e){return e.equal(t)}));n>-1&&a.splice(n,1)}}))})),a.forEach((function(e){var t=e.attributes(),r=t[ge],i=t[fe],a=r||i;if(n.classes[a]){var s,l=t[ve];i&&(s=n.find(e),s&&s.root.equal(e)&&(s.destroy&&s.destroy(),n.removeComponent(s)),e.attributes(ye,"true"),t[ye]="true",e.empty()),s=n.create(a,{value:Ye(l),root:i?e:void 0}),Object.keys(t).forEach((function(e){(0===e.indexOf("data-")&&0!==e.indexOf("data-card")||e===ye)&&s.root.attributes(e,t[e])})),r&&(e.replaceWith(s.root),e.remove()),n.components.push(s),o.push(s),r&&s.root.removeAttributes(ge)}}));var l=!1;o.forEach((function(e){if(r&&e.constructor.lazyRender&&!e.isEditable){if(e.beforeRender){var t=e.beforeRender(),i=e.getCenter();void 0!==t&&i.append("string"===typeof t?Ut(t):t)}l=!0,n.asyncComponents.push(e)}else n.renderComponent(e)})),t&&t(o.length),l&&this.renderAsyncComponents()}},{key:"renderComponent",value:function(e){for(var t=this.editor,n=e.getCenter(),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o0){var s=!st(t)||t.readonly?"false":"true";n.find(e.contenteditable.join(",")).each((function(e){var n=Ut(e);n.attributes(Dt)!==s&&n.attributes(Dt,s),n.attributes(G)!==te&&n.attributes(G,te),st(t)&&t.normalize(n)})),this.render(n)}e.didRender()}},{key:"removeComponent",value:function(e){var t=this;this.each((function(n,r){if(n.root.equal(e.root))return t.components.splice(r,1),!1}))}},{key:"gc",value:function(){for(var e=0;e

      ");return e.root.before(a),t.select(a,!0),t.collapse(!1),void i.nodeId.generate(a)}}else{if(!r)return;var s;if(r.attributes(fe))return void(null===(s=i.card.find(r))||void 0===s||s.focus(t,!1))}t.select(r,!0).shrinkToElementNode().shrinkToTextNode().collapse(!1)}},{key:"focusNextBlock",value:function(e,t,n){var r,i=this.editor;if(!st(i))throw"Engine not initialized";if("inline"===e.type){var o=i.block.closest(e.root);r=o.isEditable()?e.root.nextElement():o.nextElement()}else r=e.root.nextElement();if(n){if(!r||r.attributes(fe)){var a=Ut("


      ");return e.root.after(a),t.select(a,!0),t.collapse(!1),void i.nodeId.generate(a)}}else{if(!r)return;var s;if(r.attributes(fe))return void(null===(s=i.card.find(r))||void 0===s||s.focus(t,!0))}t.select(r,!0).shrinkToElementNode().shrinkToTextNode().collapse(!0)}}]),e}(),to=(0,E.Z)("rules"),no=function(){function e(t){(0,l.Z)(this,e),this.schema=void 0,Object.defineProperty(this,to,{writable:!0,value:{}}),this.schema=t}return(0,c.Z)(e,[{key:"init",value:function(){(0,_.Z)(this,to)[to]=this.getRules()}},{key:"getRules",value:function(){var e={};return this.schema.data.blocks.forEach((function(t){e[t.name]||(e[t.name]=[]),e[t.name].push(t)})),e}},{key:"create",value:function(e){gt(e)&&(e=Ut(e));var t=Zt(e);return e.attributes($,t),t}},{key:"generateAll",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(0,_.Z)(this,to)[to],i=Object.keys(r).join(",");pt(e)&&e.fragment&&(e=e.fragment);var o=gt(e)?e:e.get();if(o&&o.nodeType!==Node.TEXT_NODE){var a=gt(e)?e:e.get(),s=null===a||void 0===a?void 0:a.querySelectorAll(i),l=function(e){!n&&e.getAttribute($)||t.generate(e,n)};a instanceof Element&&i.includes(a.nodeName.toLowerCase())&&l(a),null===s||void 0===s||s.forEach(l)}}},{key:"generate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(gt(e)&&(e=Ut(e)),!e.isText()){var r=(0,_.Z)(this,to)[to],i=r[e.name];if(i&&0!==i.length&&i.some((function(n){return t.schema.checkNode(e,n.attributes)}))){var o=e.closest("".concat(xe,",").concat(ee),at);if(!(o.length>0&&o.attributes(G)===J)&&(!(!e.isCard()&&o.length>0&&o.isCard())||o.isEditableCard())){if(!n){var a=e.attributes($);if(a)return a}return this.create(e)}}}}},{key:"isNeed",value:function(e){var t=this,n=(0,_.Z)(this,to)[to],r=n[e.name];return!(!r||0===r.length||!r.some((function(n){return t.schema.checkNode(e,n.attributes)})))}}]),e}(),ro=function(e){return!!e.dataTransfer},io=function(){function e(t){(0,l.Z)(this,e),this.editor=void 0,this.editor=t}return(0,c.Z)(e,[{key:"getData",value:function(e){var t,n=ro(e)?e.dataTransfer:e.clipboardData,r=null===n||void 0===n?void 0:n.getData("text/html"),i=null===n||void 0===n?void 0:n.getData("text"),o=[];try{(null===n||void 0===n?void 0:n.items)&&n.items.length>0?Array.from(n.items).forEach((function(e){var t,n="file"===e.kind?e.getAsFile():null;null!==n&&(n.type&&n.type.indexOf("image/png")>-1&&!n.lastModified&&(n=new File([n],"image.png",{type:n.type})),n["ext"]=null===(t=i)||void 0===t?void 0:t.split(".").pop());n&&o.push(n)})):(null===n||void 0===n?void 0:n.files)&&n.files.length>0&&(o=Array.from(n.files))}catch(a){(null===n||void 0===n?void 0:n.files)&&n.files.length>0&&(o=Array.from(n.files))}return""===r&&i&&/^.+\.\w+$/.test(i)&&o.length>0?i="":""===i&&r&&/^()?$/.test(r)&&o.length>0?r="":(r||i)&&o.length>0&&!(null===(t=r)||void 0===t?void 0:t.startsWith("'+o.replace(/\u200b/g,"")),null===e||void 0===e||null===(r=e.clipboardData)||void 0===r||r.setData("text",a.replace(/\u200b/g,"")),i}}},{key:"copy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){var r=/<[^>]+>/g.test(e);return r?Z()(e,{format:"text/html",onCopy:function(n){n.setData("text/plain",new un(e,t.editor).toText())}}):Z()(e,{format:"text/plain"}),!0}var i=this.editor,o=window.getSelection(),a=o&&$t.from(i,o)||$t.create(i),s=a.cloneRange(),l=Ut('
      '));l.css({position:"fixed",top:0,clip:"rect(0, 0, 0, 0)"});var c=function(){l.remove(),null===o||void 0===o||o.removeAllRanges(),null===o||void 0===o||o.addRange(s.toRange())};l.on("copy",(function(e){e.stopPropagation(),t.write(e,a),c()})),Ut(document.body).append(l),l.append(i.node.clone(Ut(e),!0)),n&&l.traverse((function(e){e.equal(l)||i.trigger("copy",e)})),l.append(Ut("​",null));var A=l.first(),u=l.last();a.select(l,!0),a.setStartAfter(A),a.setEndBefore(u),null===o||void 0===o||o.removeAllRanges(),null===o||void 0===o||o.addRange(a.toRange());var d=!1;try{if(d=document.execCommand("copy"),!d)throw"Copy failed"}catch(h){i.messageError("copy","The copy command was not executed successfully ",h),c()}return d}},{key:"cut",value:function(){var e=this.editor,t=$t.from(e);if(t&&st(e)){var n=t.commonAncestorNode,r=e.change;r.cacheRangeBeforeCommand(),r.delete(t);for(var i=e.node.isList(n)?n:n.find("ul,ol"),o=0;o1&&void 0!==arguments[1]&&arguments[1],n=void 0,r=[],i=function(e,t){"function"===typeof t?t=t():null!==t&&void 0!==t||(t=""),r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(Array.isArray(e))for(var o=0;o-1&&"object"===(0,o.Z)(m)&&!lo(m)&&(m=JSON.stringify(m)),m=!1!==l&&m&&"string"!==typeof m&&!lo(m)?so(m,c||vo.traditional):m||null,v=void 0,b=!1,"jsonp"!==A&&"GET"!==a||!m||(f=ao(f,m),m=null),"jsonp"!==A){e.next=17;break}return e.abrupt("return",Promise.resolve(this.handleJsonp(f,t,n)));case 17:if(y=this.options.headers||{},"function"!==typeof y){e.next=22;break}return e.next=21,y();case 21:y=e.sent;case 22:if(v=("function"===typeof d?d(this.options):d)||this.defaultXHR(),v){e.next=25;break}return e.abrupt("return");case 25:return v.open(a,f,!1!==h),this.setHeaders(v,y),this.setCredentials(v),u[mo]&&v instanceof u[mo]?(v.onload=t,v.onerror=function(){n("http error",v)},v.onprogress=this.noop,b=!0):v.onreadystatechange=function(){w.handleReadyState(t,n)},p&&p(v),b?setTimeout((function(){var e;null===(e=v)||void 0===e||e.send(m)}),200):v.send(m),e.abrupt("return",Promise.resolve(v));case 32:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()},{key:"getType",value:function(e){if(e)return e.match("json")?"json":e.match("javascript")?"js":e.match("text")?"html":e.match("xml")?"xml":void 0}},{key:"triggerSuccess",value:function(e){var t=this.options,n=t.dataFilter,r=t.context,i=t.success;if(r){var o=this.options.type,a=(n||vo.dataFilter)(e.responseText,o);o||(o=e&&this.getType(e.getResponseHeader("Content-Type")));var s="jsonp"!==o?this.request:e;try{s["responseText"]=a}catch(l){}if(a)switch(o){case"json":try{s=r.JSON.parse(a)}catch(c){return this.triggerError("Could not parse JSON in response",s)}break;case"html":s=a;break;case"xml":s=s.responseXML&&s.responseXML.parseError&&s.responseXML.parseError.errorCode&&s.responseXML.parseError.reason?null:s.responseXML;break}i&&i(s),this.triggerComplete(s),this.__resolve&&this.__resolve(s)}}},{key:"triggerError",value:function(e,t){var n=this.options.error,r=new Error(e);r["xhr"]=t,n&&n(r),this.triggerComplete(r),this.__reject&&this.__reject(r)}},{key:"triggerComplete",value:function(e){var t=this.options.complete;this.timeout&&clearTimeout(this.timeout),this.timeout=void 0,t&&t(e)}},{key:"retry",value:function(){this.initPromise(),this.init()}},{key:"then",value:function(e,t){var n;return null===(n=this.promise)||void 0===n?void 0:n.then(e,t)}},{key:"always",value:function(e){var t;return null===(t=this.promise)||void 0===t?void 0:t.then(e,e)}},{key:"fail",value:function(e){var t;return null===(t=this.promise)||void 0===t?void 0:t.then(void 0,e)}},{key:"catch",value:function(e){return this.fail(e)}}]),e}();bo.setup=function(e){Object.keys(e).forEach((function(t){vo[t]&&(vo[t]=e[t])}))};var yo={"image/jpeg":["jpeg","jpg","jpe"],"image/png":["png"],"image/gif":["gif"],"image/vnd.wap.wbmp":["wbmp"],"image/tiff":["tiff","tiff"],"image/vnd.adobe.photoshop":["psd"],"image/svg+xml":["svg","svgz"],"text/jsx":["jsx"],"text/less":["less"],"text/css":["css"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/csv":["cvs"],"text/xml":["xml"],"text/x-vcard":["vcf"],"text/x-vcalendar":["vcs"],"text/markdown":["md"],"text/plain":["txt"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js"],"text/yaml":["yaml","yml"],"audio/mp3":["mp3"],"audio/mp4":["mp4","mp4a"],"video/mp4":["mp4"],"audio/mpeg":["mpeg","mp2","mp3"],"audio/ogg":["oga"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"video/x-msvideo":["avi"],"video/quicktime":["mov","qt"],"video/ogg":["ogv"],"video/x-sgi-movie":["movie"],"application/rss+xml":["rss"],"application/json":["json"],"application/zip":["zip"],"application/gzip":["gzip"],"application/pdf":["pdf"],"application/postscript":["ai","eps","ps"],"application/msword":["doc","dot"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.ms-fontobject":["eot"],"application/vnd.android.package-archive":["apk"],"application/x-apple-diskimage":["dmg"],"application/x-iwork-keynote-sffkey":["key"],"application/x-iwork-pages-sffpages":["pages"],"application/x-iwork-keynote-sffnumbers":["numbers"],"application/x-iwork-numbers-sffnumbers":["numbers"]},wo=function(e){var t;if("string"===typeof e)return null!==(t=e.split(".").pop())&&void 0!==t?t:"";var n,r=yo[e.type]?yo[e.type][0]:"";!r&&"name"in e&&(r=null!==(n=e.name.split(".").pop())&&void 0!==n?n:"");return r},xo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He?2:10;if("number"!==typeof e)return"0B";var n={exponent:2,round:1};return e<1024&&(n.exponent=-1,n.round=0),e<1048576&&(n.exponent=1,n.round=0),K()(e,(0,s.Z)({base:t},n))},ko=function(){function e(t){(0,l.Z)(this,e),this.options=void 0,this.uploadingFiles=[],this.options=t}return(0,c.Z)(e,[{key:"createUid",value:function(e){return Date.now()+"-"+e}},{key:"request",value:function(){var e=(0,a.Z)(g().mark((function e(t,n){var r,i;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r1&&void 0!==i[1]?i[1]:"file",t.forEach(function(){var e=(0,a.Z)(g().mark((function e(t){var i,o,a,s,l,c,A,u,d,h,p,f,m,v,b;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=new FormData,o=r.options,a=o.url,s=o.onUploading,l=o.onSuccess,c=o.onError,A=o.withCredentials,u=o.crossOrigin,d=o.headers,h=r.options.data,"function"!==typeof h){e.next=7;break}return e.next=6,h();case 6:h=e.sent;case 7:if(h)if(lo(h)){p=(0,k.Z)(h);try{for(p.s();!(f=p.n()).done;)m=(0,w.Z)(f.value,2),v=m[0],b=m[1],i.append(v,b)}catch(g){p.e(g)}finally{p.f()}}else Object.keys(h).forEach((function(e){i.append(e,h[e])}));return t.data&&Object.keys(t.data).forEach((function(e){i.append(e,t.data[e])})),i.append(n,t,t.name),e.next=12,new bo({xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",(function(e){e.lengthComputable&&s&&s(t,{percent:parseInt((e.loaded/e.total*100).toString(),10)})}),!1),e},url:a,data:i,contentType:r.options.contentType,type:r.options.type||"json",withCredentials:A,crossOrigin:u,headers:d,success:function(e){l&&l(e,t)},error:function(e){c&&c(e,t)},method:"POST",processData:!0});case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"handleBefore",value:function(){var e=(0,a.Z)(g().mark((function e(t,n){var r,i,o,s,l,c,A=this;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r=t.type,i=t.uid,o=t.name,s=t.size,l=wo(t),c=this.options.onBefore,e.t0=c,!e.t0){e.next=9;break}return e.next=7,c(t);case 7:e.t1=e.sent,e.t0=!1===e.t1;case 9:if(!e.t0){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",new Promise((function(e,c){var u=new FileReader;u.addEventListener("load",(function(){A.uploadingFiles[i]={uid:i,src:u.result,name:o,size:s,type:r,ext:l},n.every((function(e){return!!A.uploadingFiles[e.uid]}))?Promise.all((0,C.Z)(n.map((function(e){return new Promise(function(){var t=(0,a.Z)(g().mark((function t(n){return g().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!A.options.onReady){t.next=3;break}return t.next=3,A.options.onReady(A.uploadingFiles[e.uid],e);case 3:n(!0);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})))).then((function(){e(!0)})):e(!0)}),!1),u.addEventListener("error",(function(){c(!1)})),u.readAsDataURL(t)})));case 12:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()}]),e}(),Co=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"ajax",value:function(e){return new bo(e)}},{key:"upload",value:function(e,t,n){return new ko(e).request(t,n)}},{key:"getFiles",value:function(e){var t=e||{},n=t.event,r=t.accept,i=t.multiple;r=r||"*",!1===i?i=1:void 0!==i&&!0!==i||(i=100);var o=document.createElement("input");o.type="file",o.accept=r,o.style.display="none",o.multiple=i>1;var a=function e(){o.remove(),document.removeEventListener("mousedown",e)};return new Promise((function(e){var t=function t(){for(var n,r=[],s=null!==(n=o.files)&&void 0!==n?n:[],l=Math.min(s.length,i),c=0;c0&&a.isList(y)&&k(y),w&&w.length>0&&a.isList(w)&&k(w),o.addBr(d),d.equal(h)||o.addBr(h),s.setStart(p.startContainer,p.startOffset),s.collapse(!0),o.merge(),r.isEmpty()&&r.initValue(s),r.apply(s),!1}}if(l.isFirstOffset(s,"start")){var C=l.closest(s.startNode);if(a.isList(C)){var B=C.first();if(!B||B.isText())return e.preventDefault(),r.mergeAfterDelete(C),!1;C=B,s.setStart(C[0],0),s.collapse(!0),r.range.select(s)}if("li"===C.name){var _;if(a.isCustomize(C))return;e.preventDefault();var E=C.closest("ul");return(null===(_=C.parent())||void 0===_?void 0:_.isEditable())?(r.mergeAfterDelete(C),!1):(E.length>0?i.execute(o.getPluginNameByNode(E)):r.unwrap(C),!1)}return!0}}}]),e}(),_o=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.backspace=void 0,this.engine=t,this.backspace=new Bo(t)}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.command,i=t.list,o=n.range.get();o.shrinkToElementNode();var a=this.engine.block.closest(o.startNode),s=this.engine.block.closest(o.endNode);if("li"===a.name||"li"===s.name){o.collapsed||(this.backspace.trigger(e,a.name!==s.name),o=n.range.get()),e.preventDefault();var l=i.getPluginNameByNode(a);if(i.isLast(o)&&i.isFirst(o))r.execute(l);else{this.engine.block.split(),o=n.range.get();var c=this.engine.block.closest(o.endNode),A=i.getPlugins().find((function(e){return l===e.constructor.pluginName}));if(!A)return;if(A.cardName){var u=c.prev();u&&(i.addCardToCustomize(u,A.cardName),i.addBr(u)),i.addCardToCustomize(c,A.cardName),i.addBr(c);var d=c.next();d&&(i.addCardToCustomize(d,A.cardName),i.addBr(d))}i.merge(void 0,o),i.addBr(o.startNode.closest("ul")),o.setStart(c,this.engine.node.isCustomize(c)?1:0),o.collapse(!0).shrinkToTextNode(),n.apply(o)}return o.scrollIntoView(),!1}return!0}}]),e}(),Eo=function(){function e(t){(0,l.Z)(this,e),this.editor=void 0,this.CUSTOMZIE_UL_CLASS="data-list",this.CUSTOMZIE_LI_CLASS="data-list-item",this.INDENT_KEY="data-indent",this.STYLE_POSITION_NAME="list-style-position",this.STYLE_POSITION_VALUE="inside",this.backspaceEvent=void 0,this.editor=t}return(0,c.Z)(e,[{key:"init",value:function(){var e=this,t=this.editor;if(st(t)){var n,r,i=new _o(t);null===(n=t.typing.getHandleListener("enter","keydown"))||void 0===n||n.on((function(e){return i.trigger(e)})),this.backspaceEvent=new Bo(t),null===(r=t.typing.getHandleListener("backspace","keydown"))||void 0===r||r.on((function(t){var n;return null===(n=e.backspaceEvent)||void 0===n?void 0:n.trigger(t)}))}}},{key:"isEmptyItem",value:function(e){var t=e.children().toArray().filter((function(e){return!e.isCursor()})),n=this.editor.node;return"li"===e.name&&(n.isEmpty(e)||(1===t.length?n.isCustomize(e)&&t[0].isCard()||"br"===t[0].name:2===t.length&&n.isCustomize(e)&&!!t[0].isCard()&&"br"===t[1].name))}},{key:"isSame",value:function(e,t){if(e.name!==t.name)return!1;var n=this.editor.node;if(n.isCustomize(e)!==n.isCustomize(t))return!1;var r=parseInt(e.attributes(this.INDENT_KEY),10)||0,i=parseInt(t.attributes(this.INDENT_KEY),10)||0;return r===i}},{key:"isSpecifiedType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ul",n=arguments.length>2?arguments[2]:void 0,r=this.editor.node,i=!0;return e.forEach((function(e){var o;if(-1!==["li","p"].indexOf(e.name)||!(e.name===t||e.find(t).length>0))switch(e.name){case"li":if(n){var a,s,l=e.first();(null===(a=l)||void 0===a?void 0:a.isCursor())&&(l=l.next()),i=i&&r.isCustomize(e)&&((null===(s=l)||void 0===s?void 0:s.attributes(fe))||"")===n}else i=i&&!r.isCustomize(e);break;case"p":e.parent()&&"li"!==(null===(o=e.parent())||void 0===o?void 0:o.name)&&(i=!1);break;default:i=!1;break}})),i}},{key:"getPlugins",value:function(){var e=[],t=this.editor.plugin;return Object.keys(t.components).forEach((function(n){var r=t.components[n];r.isCurrent&&e.push(r)})),e}},{key:"getPluginNameByNode",value:function(e){var t=this,n=e.name,r=function(e){var n="";return t.getPlugins().some((function(t){if(t.isCurrent(e))return n=t.constructor.pluginName,!0})),n};return this.editor.node.isCustomize(e)?r(e):"li"===n&&e.parent()?r(e.parent()):""}},{key:"getPluginNameByNodes",value:function(e){for(var t="",n=0;n0)break;return""}if(t&&o&&t!==o)return"";t=o}return t}},{key:"unwrapCustomize",value:function(e){var t=this.editor.node;if(t.isCustomize(e))switch(e.name){case"li":if(t.isCustomize(e)){var n=e.first();(null===n||void 0===n?void 0:n.isCard())&&n.remove()}return e.removeAttributes("class"),e;case"ul":return e.removeAttributes("class"),e;default:return e}return e}},{key:"unwrap",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ut("

      "),r=0,i=this.editor,o=i.node,a=i.schema,s=a.data.globals["block"]||{},l=s.style||{};e.forEach((function(e){if(t.unwrapCustomize(e),o.isList(e)&&(r=parseInt(e.attributes(t.INDENT_KEY),10)||0,o.unwrap(e)),"li"===e.name){var i=o.clone(n,!1,!1);0!==r&&i.css("text-indent",2*r+"em"),e.removeAttributes(t.INDENT_KEY);var a=e.attributes();Object.keys(a).forEach((function(e){e!==$&&"id"!==e&&s[e]&&i.attributes(e,a[e])}));var c=e.css();c["text-align"]&&t.addAlign(i,c["text-align"]),delete c["text-align"],c[t.STYLE_POSITION_NAME]="",Object.keys(c).forEach((function(e){l[e]||(c[e]="")})),i.css(c),o.replace(e,i)}}))}},{key:"normalize",value:function(e){var t=this.editor;if(!st(t))return[];var n=t.change,r=t.block,i=t.node;e=e||n.range.get();var o=r.getBlocks(e),a=[];o.forEach((function(e,t){var n=e.parent();if("p"===e.name){if("li"===(null===n||void 0===n?void 0:n.name))return 0===t&&a.push(n),void i.unwrap(e);if(n&&["ul","ol"].indexOf(n.name)>-1)return e=i.replace(e,Ut("

    • ")),void a.push(e)}if("li"===e.name&&"li"===(null===n||void 0===n?void 0:n.name))return 0===t&&a.push(n),void i.unwrap(e);["ul","ol"].indexOf(e.name)>-1&&"li"===(null===n||void 0===n?void 0:n.name)?i.unwrap(e):a.push(e)}));var s=e.endNode.closest("li");return a.some((function(e){return e[0]===s[0]}))||a.push(s),a}},{key:"split",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=t.node,i=e||n.range.toTrusty(),o=this.normalize(e);if(o.length>0&&("li"===o[0].name||"li"===o[o.length-1].name)){var a,s,l,c,A=i.createSelection(),u=o[0],d=o[o.length-1],h=[],p=[];if(u.prev()){a=u.parent();var f=0;while(o[f]&&"li"===o[f].name)h.push(o[f]),f+=1}if(d.next()){s=d.parent();var g=d.next();while(g&&"li"===g.name)p.push(g),g=g.next()}if(p.length>0&&s&&(l=r.clone(s,!1,!1),p.forEach((function(e){var t;null===(t=l)||void 0===t||t.append(e[0])})),s.after(l)),h.length>0&&a&&(c=r.clone(a,!1,!1),h.forEach((function(e){var t;null===(t=c)||void 0===t||t.append(e[0])})),a.after(c)),a&&s&&s.equal(a)&&"ol"===a.name){var m=(parseInt(a.attributes("start"),10)||1)+a.find("li").length;l.attributes("start",m)}A.move()}e||n.apply(i)}}},{key:"merge",value:function(e,t){var n=this,r=this.editor;if(st(r)){var i=r.change,o=r.block,a=r.node,s=r.schema,l=s.getCanMergeTags();if(0!==l.length){var c=t||i.range.toTrusty(),A=c.cloneRange(),u=e?void 0:A.shrinkToElementNode().createSelection();e=e||o.getBlocks(c);var d=!1;if(e.forEach((function(e){if(e=e.closest("ul,ol"),a.isList(e)&&-1!==l.indexOf(e.name)){var t=e.prev(),r=e.next();t&&n.isSame(t,e)&&(a.merge(t,e),e=t,d=!0),r&&n.isSame(r,e)&&(a.merge(e,r),d=!0)}})),d&&(e=o.getBlocks(c),e.length>0)){var h=e[0].closest("ul,ol");this.addStart(h)}null===u||void 0===u||u.move(),t||void 0===u||i.apply(A)}}}},{key:"addStart",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=t.node;if(!e){var i=t.block.getBlocks(n.range.get());if(0===i.length)return;e=i[0].closest("ul,ol")}if(e&&r.isList(e)){var o=parseInt(e.attributes(this.INDENT_KEY),10)||0,a=[],s=o,l=e.prev();while(l&&r.isList(l)){if("ol"===l.name){var c=parseInt(l.attributes(this.INDENT_KEY),10)||0,A=parseInt(l.attributes("start"),10)||1,u=l.find("li").length;if(0===c){a[c]=A+u;break}c<=s&&(s=c,a[c]=a[c]||A+u)}else s=parseInt(l.attributes(this.INDENT_KEY),10)||0;l=l.prev()}var d=e;while(d){if(r.isList(d)){var h=parseInt(d.attributes(this.INDENT_KEY),10)||0,p=parseInt(d.attributes("start"),10),f=d.find("li").length;if("ol"===d.name){var g=a[h];h>0?(g=g||1,g>1?d.attributes("start",g):d.removeAttributes("start"),a[h]=g+f):g&&g!==p?(g>1?d.attributes("start",g):d.removeAttributes("start"),a[h]=g+f):(a[h]=(p||1)+f,a=a.slice(0,h+1))}}else a=[];var m=d.next();if(!m)break;d=m}}}}},{key:"addIndent",value:function(e,t,n){if(this.editor.node.isList(e)){var r=this.getIndent(e);t=r+(t<0?-1:1),n&&t>n&&(t=n),t<1?e.removeAttributes(this.INDENT_KEY):e.attributes(this.INDENT_KEY,t)}}},{key:"getIndent",value:function(e){return this.editor.node.isList(e)&&parseInt(e.attributes(this.INDENT_KEY),10)||0}},{key:"addAlign",value:function(e,t){var n;"li"===e.name&&(t&&"left"!==t?(["center","right"].indexOf(t)>-1&&e.css((0,x.Z)({},this.STYLE_POSITION_NAME,this.STYLE_POSITION_VALUE)),e.css({"text-align":t})):e.css((n={},(0,x.Z)(n,this.STYLE_POSITION_NAME,""),(0,x.Z)(n,"text-align",""),n)))}},{key:"addCardToCustomize",value:function(e,t,n){var r,i;if(gt(e)&&(e=Ut(e)),"li"===e.name){var o=e.first();if(!((null===o||void 0===o?void 0:o.isBlockCard())||(null===o||void 0===o?void 0:o.isCard())&&o.attributes(fe)===t)){var a,s=this.editor,l=s.card,c=l.create(t,{value:n}),A=$t.create(s),u=Ut("
      ");if((null!==(r=null===(i=e.get())||void 0===i?void 0:i.childNodes.length)&&void 0!==r?r:0)>0)null===(a=e.first())||void 0===a||a.before(u);else e.append(u);A.select(u,!0),l.insertNode(A,c);var d=e.last();return"br"===(null===d||void 0===d?void 0:d.name)&&d.remove(),c}}}},{key:"addReadyCardToCustomize",value:function(e,t,n){if(gt(e)&&(e=Ut(e)),"li"===e.name){var r=e.first();if(!((null===r||void 0===r?void 0:r.isBlockCard())||(null===r||void 0===r?void 0:r.isCard())&&r.attributes(fe)===t)){var i=Ut("");return e.prepend(i),this.editor.card.replaceNode(i,t,n),i}}}},{key:"addBr",value:function(e){var t=this,n=this.editor.node;if(n.isList(e))e.find("li").each((function(e){t.addBr(Ut(e))}));else if(n.isCustomize(e)){var r=e.last();while(null===(i=r)||void 0===i?void 0:i.isCursor()){var i;r=r.prev()}if(r){var o,a=e.children();if(1===a.length&&r.isCard())return void e.append(Ut("
      "));if(a.length>2&&"br"===r.name)return void("br"!==(null===(o=r.prev())||void 0===o?void 0:o.name)&&r.remove());while(r){if(r.equal(e.first())&&(r.isCard()||""===r.text()))return void e.append(Ut("
      "));if(r.type===Node.TEXT_NODE){if(""!==r.text())return;r=r.prev()}else if(r.type===Node.ELEMENT_NODE){if(!n.isMark(r)||""!==r.text())return;r=e.prev()}else r=r.prev()}}else e.append(Ut("
      "))}}},{key:"insert",value:function(e,t){var n,r,i,o=this,a=this.editor;if(st(a)&&0!==e.childNodes.length){var s=a.change,l=a.node,c=a.block,A=t||s.range.toTrusty();A.collapsed||s.delete(A,!0,!0);var u=A.cloneRange().shrinkToElementNode(),d=u.startNode,h=u.startOffset,p=d;if(l.isList(d)&&(p=d.children().eq(h)),p=null===(n=p)||void 0===n?void 0:n.closest("li",(function(e){return l.isBlock(e)&&"LI"!==e.nodeName?void 0:e.parentElement||void 0})),0!==(null===(r=p)||void 0===r?void 0:r.length)&&"li"===(null===(i=p)||void 0===i?void 0:i.name)){A.shrinkToElementNode().shrinkToTextNode(),c.split(A);var f=A.createSelection("list-insert");this.split(A);var g=function(e){c.merge(e),o.merge(void 0,e),null===f||void 0===f||f.move(),t||s.apply(e)},m=Ut(e).toArray().some((function(e){return l.isBlock(e)}))?Ut(e.childNodes[0]):Ut("

      ").append(Ut(e)),v=A.startNode.closest("ul,ol");if(v&&l.isList(v)){var b=A.startNode.closest("li");if(l.isCustomize(v)){var y,w,x=null===(y=v.prev())||void 0===y||null===(w=y.first())||void 0===w?void 0:w.first();if(x){var k=a.card.find(x);k&&this.addCardToCustomize(b,k.name,k.getValue())}}var C=!l.isList(m)||this.isSame(v,m);if(C){var B,_;while(l.isBlock(m)){var E=m.first();if(!E||!l.isBlock(E))break;m=E}var S=null===(B=b.parent())||void 0===B||null===(_=B.prev())||void 0===_?void 0:_.last();if("li"===(null===S||void 0===S?void 0:S.name)){var F,T,M=null===S||void 0===S?void 0:S.children();if(null===M||void 0===M||M.each((function(e,t){var n;"BR"===e.nodeName&&(null===(n=M.eq(t))||void 0===n||n.remove())})),l.isCustomize(m))null===(F=m.first())||void 0===F||F.remove();if(m.isBlockCard())null===(T=S.parent())||void 0===T||T.after(m);else null===S||void 0===S||S.append(l.isBlock(m)?m.children():m),S&&this.addBr(S),l.isBlock(m)&&m.remove()}}else{var I,N,U,L,Q,D=null===(I=b.parent())||void 0===I||null===(N=I.prev())||void 0===N?void 0:N.last();if(D&&(l.isEmpty(D)||this.isEmptyItem(D)))D.remove(),0===(null===(U=D.parent())||void 0===U||null===(L=U.get())||void 0===L?void 0:L.childNodes.length)&&(null===(Q=D.parent())||void 0===Q||Q.remove())}if(0===e.childNodes.length||1===e.childNodes.length&&l.isList(e.childNodes[0])&&0===e.childNodes[0].childNodes.length){var H=b.parent();if(m.isBlockCard()){if(H){var O;this.isEmptyItem(b)&&1===(null===(O=H.get())||void 0===O?void 0:O.childNodes.length)&&H.remove();var z=[H],Z=m.prev();Z&&l.isList(Z)&&z.push(Z),this.merge(z)}}else{var R,P,q;if(l.isCustomize(b))null===(q=b.first())||void 0===q||q.remove();b.find("br").remove(),null===H||void 0===H||null===(R=H.prev())||void 0===R||null===(P=R.last())||void 0===P||P.append(b.children()),null===H||void 0===H||H.remove()}g(A)}else{var K=A.startNode.closest("li").parent();if(K){for(var W=e.childNodes.length,j=Ut(e.childNodes[W-1]),V=(!l.isList(j)||this.isSame(v,j))&&!j.isBlockCard(),G=!1,$=0;$0&&this.merge(J),!C&&l.isEmptyWidthChild(K)&&K.remove(),0!==e.childNodes.length){while(l.isBlock(j)){var le=j.last();if(!le||!l.isBlock(le))break;j=le}var ce=b;if(ce){var Ae;if(!(null===(Ae=j.parent())||void 0===Ae?void 0:Ae.fragment)){var ue=ce,de=j.prev();while(de&&de.length>0){var he=de.prev();ue.before(de),ue=de,de=he}}if("br"===j.name)j.remove();else{var pe=j.children();if(pe.each((function(e,t){var n;"BR"===e.nodeName&&(null===(n=pe.eq(t))||void 0===n||n.remove())})),l.isCustomize(ce)){var ge;if(l.isCustomize(j)){var me=j.first();(null===me||void 0===me?void 0:me.isCard())&&me.remove()}null===(ge=ce.first())||void 0===ge||ge.after(l.isBlock(j)?j.children():j)}else ce.prepend(l.isBlock(j)?j.children():j);this.addBr(ce),l.isBlock(j)&&j.remove()}}g(A)}else{if(l.isEmpty(b)||this.isEmptyItem(b)){var ve,be,ye,we,xe=null===(ve=b.parent())||void 0===ve?void 0:ve.prev();b.find("br").remove(),l.isCustomize(b)&&(null===(be=b.first())||void 0===be||be.remove()),xe&&l.isList(xe)?null===(ye=xe.last())||void 0===ye||ye.append(b.children()):xe&&xe.append(b.children()),null===(we=b.parent())||void 0===we||we.remove()}g(A)}}else g(A)}}else g(A)}}}},{key:"blockToItem",value:function(e,t,n,r){var i=Ut("
    • "),o=this.editor,a=o.node,s=o.schema;if(!a.isList(t))return t;var l=Ge(e.css("text-indent"))/2,c=s.data.globals["block"]||{},A=e.attributes();Object.keys(A).forEach((function(e){e!==$&&"id"!==e&&c["name"]&&i.attributes(e,A[e])}));var u=c.style||{},d=e.css();return d["text-align"]&&this.addAlign(i,d["text-align"]),delete d["text-align"],delete d[this.STYLE_POSITION_NAME],Object.keys(d).forEach((function(e){u[e]||delete d[e]})),i.css(d),e=a.replace(e,i),n&&(e.addClass(this.CUSTOMZIE_LI_CLASS),this.addCardToCustomize(e,n,r)),l&&t.attributes(this.INDENT_KEY,l),a.wrap(e,t)}},{key:"toCustomize",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ul",o=this.editor.node;if(Array.isArray(e)){var a=[];return e.forEach((function(e){o.isCustomize(e)&&r.unwrapCustomize(e),a=a.concat(r.toCustomize(e,t,n,i))})),a}var s=Ut("<".concat(i,' class="').concat(this.CUSTOMZIE_UL_CLASS,'"/>'));switch(e.name){case"li":return e.addClass(this.CUSTOMZIE_LI_CLASS),this.addCardToCustomize(e,t,n),e;case"ul":case"ol":return s.attributes(e.attributes()),e=o.replace(e,s),e;default:if("p"===e.name||o.isNestedBlock(e)&&!e.isBlockCard()){var l;if("li"===(null===(l=e.parent())||void 0===l?void 0:l.name))return o.unwrap(e),e;e=this.blockToItem(e,s,t,n)}return e}}},{key:"toNormal",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ul",r=arguments.length>2?arguments[2]:void 0,i=this.editor.node;if(Array.isArray(e)){var o=[];return e.forEach((function(e){var i=t.toNormal(e,n,r);o=o.concat(i)})),o}this.unwrapCustomize(e);var a=Ut("<".concat(n," />"));switch(e.name){case"li":case n:return e;case"ol":case"ul":return a.attributes(e.attributes()),"ul"===a.name&&a.removeAttributes("start"),e=i.replace(e,a),e;default:if("p"===e.name||i.isNestedBlock(e)&&!e.isBlockCard()){var s;if("li"===(null===(s=e.parent())||void 0===s?void 0:s.name))return i.unwrap(e),e;e=this.blockToItem(e,a),r&&e.attributes("start",r)}return e}}},{key:"isFirst",value:function(e){var t=e.startNode,n=e.startOffset,r=e.cloneRange(),i="li"===t.name?t:t.closest("li");if(!i[0])return!1;r.select(i,!0),r.setEnd(t[0],n);var o=r.cloneContents();if(!o.firstChild)return!0;var a=Ut(o.firstChild),s=Ut(o.lastChild||[]);if(1===o.childNodes.length&&"br"===a.name)return!0;if(1===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard())return!0;var l=this.editor.node;if(2===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard()&&l.isEmpty(s))return!0;var c=Ut("
      ");return c.append(o),l.isEmpty(c)}},{key:"isLast",value:function(e){var t=e.endNode,n=e.endOffset,r=e.cloneRange(),i="li"===t.name?t:t.closest("li");if(!i[0])return!1;r.select(i,!0),r.setStart(t,n);var o=r.cloneContents();if(!o.firstChild)return!0;var a=Ut(o.firstChild),s=Ut(o.lastChild||[]);if(1===o.childNodes.length&&"br"===a.name)return!0;if(1===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard())return!0;var l=this.editor.node;if(2===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard()&&l.isEmpty(s))return!0;var c=Ut("
      ");return c.append(o),l.isEmpty(c)}}]),e}(),So=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.node,i=t.block,o=n.range.get(),a=o.cloneRange().shrinkToTextNode(),s=a.collapsed,l=a.endNode,c=a.startNode,A=a.startOffset,u=a.endOffset;if(s){var d=i.closest(c);if(d.length>0&&r.isEmpty(d))return}if(l.type===Node.TEXT_NODE||c.type===Node.TEXT_NODE){if(!s){var h=l.parent();if(h&&l.type===Node.TEXT_NODE&&r.isMark(h)){var p=l.text(),f=p.substr(u);if(!/^\u200b$/.test(f))return!0;o.setEnd(l,u+1)}return!0}var g=c.parent();if(g&&c.type===Node.TEXT_NODE&&r.isMark(g)){if(A<1)return!0;var m=c.text(),v=m.substr(A-1,1);if(!/^\u200b$/.test(v))return!0;if(1===A){var b=g.prev();if(b&&!r.isEmpty(b)){var y=o.cloneRange().select(b,!0).shrinkToTextNode().collapse(!1),w=y.startNode,x=y.startOffset;o.setStart(w,x-1)}else if(!b&&r.isEmpty(g)){var k=g.parent(),C=g.getIndex();g.remove(),k&&o.setStart(k,C<=0?0:C-1)}}else o.setStart(c,A-1);return!0}if(g=c.prev()||void 0,g&&c.type===Node.TEXT_NODE&&r.isMark(g)){var B=c.text(),_=B.substr(A-1,1);if(!/^\u200b$/.test(_))return!0;if(1===A){var E=o.cloneRange().select(g,!0).shrinkToTextNode().collapse(!1),S=E.startNode,F=E.startOffset;o.setStart(S,F-1)}else o.setStart(c,A>0?A-1:0)}}return!0}}]),e}(),Fo=function(){function e(t){var n=this;(0,l.Z)(this,e),this.editor=void 0,this.pluginCaches=new Map,this.findSameParent=function(e,t){var r=n.editor.node;if(r.isMark(e)){var i=void 0;if(n.compare(e,t,!0))return!0;if(i=e.parent())return n.findSameParent(i,t)}return!1},this.editor=t}return(0,c.Z)(e,[{key:"init",value:function(){var e=this,t=this.editor;if(st(t)){var n,r=new So(t);null===(n=t.typing.getHandleListener("backspace","keydown"))||void 0===n||n.on((function(e){return r.trigger(e)})),t.on("keydown:space",(function(t){return e.triggerMarkdown(t)})),t.on("keydown:enter",(function(t){return e.triggerMarkdown(t)}))}}},{key:"triggerMarkdown",value:function(e){var t,n=this.editor;if(st(n)&&!1!==(null===(t=n.options.markdown)||void 0===t?void 0:t.mode)){var r=n.change,i=r.range.get();if(i.collapsed&&!r.isComposing()){var o=i.cloneRange().shrinkToTextNode(),a=o.startNode,s=o.startOffset,l=a.type===Node.TEXT_NODE?a:a.children().eq(s-1);if(l){var c=i.toPath(),A=l.type===Node.TEXT_NODE?l.text().substr(0,s):l.text(),u=ct(n,"zero"),d=u.renderer,h=u.options,p=u.parseInline(A,{});if(0!==p.length){var f=!1,g="";if(p.forEach((function(e){var t="",r=e.children||[];r.forEach((function(i,o){var a=i.type,s=n.trigger("markdown-it-token",{token:e,markdown:u,callback:function(e){t+=e}});!1!==s?(f||"text"===a||(f=!0),"undefined"!==typeof d.rules[a]?t+=d.rules[a](r,o,h,{},d):t+=d.renderToken(r,o,h)):f=!0})),g+=t})),f){var m=n.node;e.preventDefault(),i.setStart(l[0],0),i.setEnd(l[0],s),r.paste(g,i),r.rangePathBeforeCommand=c,i.collapse(!1),i.enlargeToElementNode();var v=Ut(g),b=v.last(),y=v.eq(v.length-1);(m.isMark(v)||b&&m.isMark(b)||y&&m.isMark(y))&&m.insertText(" ",i),r.range.select(i)}return!f}}}}}},{key:"findPlugin",value:function(e){var t=this.editor,n=t.node,r=t.plugin,i=t.schema;if(0!==e.length&&n.isMark(e)){var o=e.get().cloneNode(),a=o.outerHTML,s=this.pluginCaches.get(a);if(s)return s;for(var l in r.components){var c=r.components[l];if(Di(c)&&e.name===c.tagName){var A=c.schema();if(Array.isArray(A)?A.find((function(t){return i.checkNode(e,t.attributes)})):i.checkNode(e,A.attributes))return this.pluginCaches.set(a,c),c}}return s}}},{key:"closest",value:function(e){var t=this.editor.node,n=e.parent();while(n&&!n.isEditable()&&!t.isBlock(n)){if(t.isMark(n))return n;var r=n.parent();if(!r)break;n=r}return e}},{key:"closestNotMark",value:function(e){while(this.editor.node.isMark(e)||e.isText()){if(e.isEditable())break;var t=e.parent();if(!t)break;e=t}return e}},{key:"compare",value:function(e,t,n){if(e.name!==t.name)return!1;var r=e.attributes();delete r["style"],delete r[$];var i=t.attributes();delete i["style"],delete i[$];var o=e.css(),a=t.css();delete r["class"],delete i["class"];var s=e.get().className.trim(),l=t.get().className.trim(),c=""!==s?s.split(/\s+/):[],A=""!==l?l.split(/\s+/):[],u=this.editor.schema,d=u.find((function(t){return t.name===e.name})),h=function(e){for(var t=0;t0?[h(c)]:[],A=A.length>0?[h(A)]:[]),Object.keys(r).length===Object.keys(i).length&&(!!Object.keys(r).every((function(e){return n?r[e]===i[e]:!!i[e]}))&&(Object.keys(o).length===Object.keys(a).length&&(!!Object.keys(o).every((function(e){return n?o[e]===a[e]:!!a[e]}))&&(c.length===A.length&&!!c.every((function(e){return-1!==A.indexOf(e)}))))))}},{key:"contain",value:function(e,t){var n=t.attributes(),r=n["style"]||{};delete n["style"];var i=e.attributes(),o=i["style"]||{};return delete i["style"],Object.keys(n).every((function(e){return!!i[e]}))&&Object.keys(r).every((function(e){return!o[e]}))}},{key:"unwrapEmptyMarks",value:function(e,t){var n=this.editor.node,r=e.allChildren();r.forEach((function(e){if(n.isEmpty(e)&&n.isMark(e)&&(!t||t(e))){var r=e.children();1===r.length&&r.isText()?e.remove():n.unwrap(e)}}))}},{key:"splitOnCollapsed",value:function(e,t,n){var r=this;if(e.collapsed){e.enlargeFromTextNode(),e.shrinkToElementNode();var i=e.startNode,o=i.parent(),a=i.isCard()?i:i.closest(xe),s=this.editor.node;if((0===a.length||"inline"!==a.attributes(me))&&(s.isMark(i)||o&&s.isMark(o))){var l,c,A=this.closestNotMark(i),u=e.createSelection(),d=u.getNode(A,"left"),h=void 0,p=void 0,f=[];if(n){gt(n)&&(n=Ut(n));var g=n.getPath(A.get()),m=A.clone(!0);f=g.slice(1),p=Ut(m.getChildByPath(g.slice(0,1))),h=u.getNode(m,"right",!1)}else h=u.getNode(A,"right");this.unwrapEmptyMarks(d,(function(e){return!e.isCursor()})),this.unwrapEmptyMarks(h,(function(e){t&&!Array.isArray(t)&&(t=[t]);var n=!t||0===t.length||!e.isCard()&&t.some((function(t){return r.compare(e,t)}));return n}));var v=A.children();v.each((function(e,t){var n=v.eq(t);(null===n||void 0===n?void 0:n.isCard())||null===n||void 0===n||n.remove()}));var b=void 0,y=function(e){e.each((function(t,n){var r=e.eq(n);if(null===r||void 0===r?void 0:r.isCard())return b=b?b.next():A.first(),void(b&&(e[n]=b[0]));b?(b.after(t),b=r):(b=r,A.prepend(t))}))},w=d.children(),x=w.toArray();y(w);var k=h.children(),C=k.toArray();p&&(n=null===(l=C.find((function(e){return e.equal(p)})))||void 0===l?void 0:l.getChildByPath(f)),y(k),C=k.toArray();var B=Ut("​",null);if(1===x.length&&"br"===x[0].name&&(x[0].remove(),x.splice(0,1)),1===C.length&&"br"===C[0].name&&(C[0].remove(),C.splice(0,1)),C.filter((function(e){return!e.isCursor()})).length>0){for(var _=C[0],E=0;E0&&F&&s.isMark(F))M();_.before(T)}e.select(B).collapse(!1)}else if(x.filter((function(e){return!e.isCursor()})).length>0){var I=x[x.length-1];I.after(B),e.select(B).collapse(!1)}else e.select(A,!0).collapse(!0);var N=!1;A.children().each((function(e){var t=Ut(e);if(t.isText()){var n=e.textContent,r=(null===n||void 0===n?void 0:n.replace(/\u200b+/g,"​"))||"";if(n!==r&&(e.textContent=r),N){var i=t.next(),o=t.parent();(!i&&o&&!s.isInline(o)||i&&!s.isInline(i))&&r.startsWith("​")?(r=r.substring(1),r?e.textContent=r:t.remove()):N=!1}r.endsWith("​")&&(N=!0)}else N=!1}));var U=s;if(null!==(c=B[0].parentElement)&&void 0!==c?c:B[0].parentNode){var L=B[0],Q=null,D=0,H=function(e,t){var n=function(e){return t?e.previousSibling:e.nextSibling};while(e){if(e.nodeType!==L.nodeType)return;var r=n(e);if(e.textContent===Q){var i,o=null!==(i=e.parentElement)&&void 0!==i?i:e.parentNode;if(r&&U.isInline(r)||!r&&o&&U.isInline(o))break;null===o||void 0===o||o.removeChild(e),e=r}else{var a,s;if(t)while(Q&&(null===(l=e.textContent)||void 0===l?void 0:l.endsWith(Q))){var l,c,A=null!==(c=e.parentElement)&&void 0!==c?c:e.parentNode;if(r&&U.isInline(r)||!r&&A&&U.isInline(A))break;e.textContent=e.textContent.substring(0,e.textContent.length-D)}else while(Q&&(null===(u=e.textContent)||void 0===u?void 0:u.startsWith(Q))){var u,d,h=null!==(d=e.parentElement)&&void 0!==d?d:e.parentNode;if(r&&U.isInline(r)||!r&&h&&U.isInline(h))break;e.textContent=e.textContent.substring(Q.length)}if(0!==(null===(a=e.textContent)||void 0===a?void 0:a.length))return;var p=null!==(s=e.parentElement)&&void 0!==s?s:e.parentNode;null===p||void 0===p||p.removeChild(e),e=r}}};if(L.nodeType===Node.TEXT_NODE){var O=L.textContent;Q=O,D=Q.length,H(L.previousSibling,!0),H(L.nextSibling,!1)}}}return n}}},{key:"splitOnExpanded",value:function(e,t){if(!e.collapsed){e.enlargeToElementNode(),e.shrinkToElementNode();var n=e.startNode,r=e.endNode,i=n.isCard()?n:n.closest(xe),o=r.isCard()?r:r.closest(xe);if(!(i.length>0&&"inline"===i.attributes(me)||o.length>0&&"inline"===o.attributes(me))){var a=this.closestNotMark(n),s=this.closestNotMark(r);if(!a.equal(s)){var l=e.cloneRange();l.collapse(!0);var c=e.cloneRange();c.collapse(!1);var A=void 0,u=l.startOffset,d=c.endOffset;return void(a.contains(s)?(A=this.splitOnCollapsed(l,t,c.endNode),e.setStart(l.startContainer,l.startOffset),A&&c.setOffset(A,d,d),this.splitOnCollapsed(c,t),e.setEnd(c.startContainer,c.startOffset)):(A=this.splitOnCollapsed(c,t,l.startNode),e.setEnd(c.startContainer,c.startOffset),A&&l.setOffset(A,u,u),this.splitOnCollapsed(l,t),e.setStart(l.startContainer,l.startOffset)))}var h=this.editor.node,p=n.parent(),f=h.isMark(n)||p&&h.isMark(p),g=r.parent(),m=h.isMark(r)||g&&h.isMark(g);if(!f&&!m)return;var v=e.commonAncestorNode;v.isText()&&(v=v.parent());var b=this.closestNotMark(v),y=e.createSelection(),w=y.getNode(b,"left"),x=y.getNode(b),k=y.getNode(b,"right");this.unwrapEmptyMarks(w),this.unwrapEmptyMarks(k);var C=b.children();C.each((function(e,t){var n=C.eq(t);(null===n||void 0===n?void 0:n.isCard())||null===n||void 0===n||n.remove()}));var B=void 0,_=function(e){e.each((function(t,n){var r=e.eq(n);if(null===r||void 0===r?void 0:r.isCard())return B=B?B.next():b.first(),void(B&&(e[n]=B[0]));B?(B.after(t),B=r):(B=r,b.prepend(t))}))},E=w.children();_(E);var S=x.children(),F=S.toArray();_(S);var T=k.children();_(T),e.setStartBefore(F[0][0]),e.setEndAfter(F[F.length-1][0])}}}},{key:"split",value:function(e,t){var n=this.editor;if(st(n)){var r=n.change,i=e||r.range.toTrusty(),o=rt(i.startContainer),a=i.collapsed;if(("string"===typeof t||!Array.isArray(t)&&t&>(t))&&(t=Ut(t,o)),a)this.splitOnCollapsed(i,t);else{var s=i.createSelection("mark-split");this.splitOnExpanded(i,t),s.move()}e||r.apply(i)}}},{key:"wrapByNode",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.findPlugin(t),i=arguments.length>3?arguments[3]:void 0,o=this.editor.node;if(o.isMark(e)){var a;0===(null===(a=e.get())||void 0===a?void 0:a.childNodes.length)&&e.html("​");var s=e,l=s.children().toArray(),c=this.findPlugin(s),A=!1;while(o.isMark(s)&&1===l.filter((function(e){return!e.isCursor()})).length&&r&&c&&r.mergeLeval<=c.mergeLeval){var u=l.find((function(e){return!e.isCursor()}));if(o.isMark(u))s=u,l=s.children().toArray();else{if(!u.isText())break;s=u}if(r.name===c.name){A=!0;break}c=this.findPlugin(s)}o.removeZeroWidthSpace(s);var d=s.parent();if(s.isText()||A){var h=!1;while(d&&o.isMark(d)){if(this.compare(d.clone(),t,!0)){h=!0;break}if(1===d.children().toArray().filter((function(e){return!e.isCursor()})).length){var p=this.findPlugin(d);if(r&&r===p&&!0===r.combineValueByWrap){o.wrap(d,t,!0),h=!0;break}if(r&&r===p){o.unwrap(d),h=!1;break}}d=d.parent()}if(h)return!1}var f=s.allChildren();return f.forEach((function(e){if(e.type!==rt().TEXT_NODE&&o.isMark(e)){var t=n.findPlugin(e);t!==r||(null===r||void 0===r?void 0:r.combineValueByWrap)||o.unwrap(e)}})),o.wrap(s,t)}if("br"===e.name){var g=e.parent();if(g&&o.isBlock(g)){var m=t.clone(!0);return m.html("​"),o.replace(e,m),m}}else if(e.isCard()){var v=this.editor.card.find(e);if(v&&v.executeMark)return v.executeMark(t,!0)}else if(e.isText()&&!o.isEmpty(e)){o.removeZeroWidthSpace(e);var b=e.parent(),y=!1;while(b&&o.isMark(b)){if(this.compare(b.clone(),t,!0)){y=!0;break}if(1===b.children().toArray().filter((function(e){return!e.isCursor()})).length||i&&i.equal(b)){var w=this.findPlugin(b);if(r&&r===w&&!0===r.combineValueByWrap){o.wrap(b,t,!0),y=!0;break}if(r&&r===w){var x=o.unwrap(b),k=x.find((function(e){return!e.isCursor()&&o.isMark(e)}));k?b=k:x.length>0&&(b=x[0].parent()),y=!1;break}}var C=b.parent();if(!C||!o.isMark(b))break;b=C}if(y)return!1;var B=e.parent(),_=B?this.findPlugin(B):void 0,E=!1,S=function(){E=!0;var r=B.children().toArray(),i=B.clone();r.forEach((function(n){n.isCursor()||3===n.type&&/^\u200b$/.test(n.text()||"")||(e.equal(n)||n.contains(e)?e=o.wrap(o.replace(e,i),t):(n=o.wrap(n,i),o.wrap(n,t)))})),o.unwrap(B),B=n.closest(e)};while(B&&o.isMark(B)&&r&&_&&r.mergeLeval>_.mergeLeval)S();return E||o.wrap(e,t),e}}},{key:"wrap",value:function(e,t){var n=this,r=this.editor,i=st(r)?r.change:void 0;if(t||i){var o=r.node,a=t||i.range.toTrusty(),s=rt(a.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,s)),o.isMark(e)){var l=a.commonAncestorNode;l.type===Node.TEXT_NODE&&(l=l.parent());var c=r.card.find(l,!0),A=null===c||void 0===c?void 0:c.isEditable,u=A?(null===c||void 0===c?void 0:c.getSelectionNodes)?c.getSelectionNodes():[]:[l];0===u.length&&(A=!1,u.push(l));var d=o,h=this.findPlugin(e);if(a.collapsed&&(!A||!(null===c||void 0===c?void 0:c.getSelectionNodes)||1===u.length)){0===e.children().toArray().filter((function(e){return!e.isCursor()})).length&&e.append(s.createTextNode("​"));var p=a.shrinkToTextNode(),f=p.startNode,g=f.parent(),m=[],v=!1;if(f.isText()){var b=!1;while(g&&d.isMark(g)){var y;if(this.compare(g.clone(),e,!0)){b=!0;break}var w=this.findPlugin(g);if(1===(null===(y=g.get())||void 0===y?void 0:y.childNodes.length)){if(h&&h===w&&!0===h.combineValueByWrap){d.wrap(g,e,!0),b=!0;break}if(h&&h===w){if(this.split(a),a.collapsed){var x=g.parent();while(x&&d.isMark(x))e=d.wrap(e,x),x=x.parent()}b=!1;break}}h&&(!w||h.mergeLeval>w.mergeLeval)?m.push(g.clone(!1)):!v&&m.length>0&&(m.push(e.clone(!1)),v=!0),g=g.parent()}if(b)return}if(m.length>0){var k=m[0];k.append(e.children());for(var C=1;C0&&t.mergeMarks(a)}}))}},{key:"merge",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=e||n.range.toTrusty(),i=this.findMarks(r);if(0!==i.length){var o=r.shrinkToElementNode().createSelection();this.mergeMarks(i),o.move(),r.handleBr(),e||n.apply(r)}}}},{key:"unwrapByNodes",value:function(e,t){var n=this,r=this.editor,i=r.node;e.forEach((function(e){!t||!e.isCard()&&(Array.isArray(t)?t:[t]).some((function(t){return n.compare(e,t)}))?i.unwrap(e):t?(Array.isArray(t)?t:[t]).forEach((function(t){var n,i=t.css();Object.keys(i).forEach((function(t){e.css(t,"")}));var o=null===(n=t.get())||void 0===n?void 0:n.className.split(/\s+/);o&&function(){for(var t=r.schema,n=t.find((function(t){return t.name===e.name})),i=function(r){var i=n[r];o.forEach((function(n){n=n.trim(),""!==n&&i.attributes&&t.checkValue(i.attributes,"class",n)&&e.removeClass(n)}))},a=0;a1)break}}}),!0,"editable")})),this.unwrapByNodes(d,e),null===u||void 0===u||u.move(),c){var p=[];A.forEach((function(e){e.allChildren().forEach((function(e){e.isElement()&&i.isMark(e)&&p.push(e)}))})),this.mergeMarks(p)}else this.merge(o);t||r.apply(o)}else t||r.apply(o)}}},{key:"insert",value:function(e,t){var n,r=this.editor;if(st(r)){var i=r.change,o=r.node,a=t||i.range.toTrusty();if("string"===typeof e||gt(e)){var s=rt(a.startContainer);e=Ut(e,s)}a.collapsed||i.delete(a),null===(n=o.insert(e,a))||void 0===n||n.handleBr().select(e).collapse(!1),t||i.apply(a)}}},{key:"findMarks",value:function(e){var t=this.editor,n=e.cloneRange();if(n.startNode.isRoot()&&n.shrinkToElementNode(),!n.startNode.inEditor()||t.card.find(n.startNode))return[];var r=t.node,i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.collapsed){var i=t.startNode,o=t.startOffset,a=i.findParent();if(a){var s=t.cloneRange();if(s.select(a,!0),n){s.setEnd(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var l=i.get().childNodes,c=s.endNode,A=s.endOffset,u=c.get().childNodes,d=u.item(A),h=l.item(o)||l.item(o-1);if(!e&&c.type===Node.ELEMENT_NODE&&d&&r.isBlock(d)&&(i.type!==Node.ELEMENT_NODE||h&&!r.isBlock(h)))return;s.select(a,!0),s.setStart(c,A),s.shrinkToElementNode(),s.shrinkToTextNode(),t.setStart(s.startContainer,s.startOffset),t.collapse(!0)}else{s.setStart(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var p=i.get().childNodes,f=s.startNode,g=s.startOffset,m=f.get().childNodes,v=m.item(g),b=p.item(o)||p.item(o-1);if(!e&&f.type===Node.ELEMENT_NODE&&v&&r.isBlock(v)&&(i.type!==Node.ELEMENT_NODE||b&&!r.isBlock(b)))return;s.select(a,!0),s.setEnd(f,g),s.shrinkToElementNode(),s.shrinkToTextNode(),t.setEnd(s.endContainer,s.endOffset),t.collapse(!1)}}}};if(!n.collapsed){var o=n.cloneRange(),a=n.cloneRange();o.collapse(!0),a.collapse(!1),i(!0,o,!0),i(!0,a),n.setStart(o.startContainer,o.startOffset),n.setEnd(a.startContainer,a.startOffset)}i(!1,n);var s=n.startContainer,l=n.startOffset,c=n.endContainer,A=n.endOffset,u=s,d=c;s.nodeType===Node.ELEMENT_NODE&&s.childNodes[l]&&(u=s.childNodes[l]||s),c.nodeType===Node.ELEMENT_NODE&&A>0&&c.childNodes[A-1]&&(d=c.childNodes[A-1]||s),n.collapsed&&(u=d);var h=function(e,t){e.push(t)},p=r,f=function(e){var n=[];while(e){if(e.type===Node.ELEMENT_NODE&&e.isEditable())break;if(!p.isMark(e)||e.attributes(fe)||e.attributes(be)){if(e.isCard()){var r=t.card.find(e);(null===r||void 0===r?void 0:r.queryMarks)&&n.push.apply(n,(0,C.Z)(r.queryMarks()))}}else n.push(e);var i=e.parent();if(!i)break;e=i}return n},g=f(Ut(u)),m=n.commonAncestorNode,v=t.card.find(m,!0),b=null===v||void 0===v?void 0:v.isEditable,y=b?(null===v||void 0===v?void 0:v.getSelectionNodes)?v.getSelectionNodes():[]:[m];if(0===y.length&&(b=!1,y.push(m)),(!n.collapsed||b)&&(f(Ut(d)).forEach((function(e){return h(g,e)})),s!==c||b)){var w=!1,x=!1;y.forEach((function(e){e.traverse((function(e){if(x)return!1;if(e[0]!==s){if(w){if(e[0]===c)return x=!0,!1;if(!p.isMark(e)||e.attributes(fe)||e.attributes(be)){if(e.isCard()){var n=t.card.find(e);(null===n||void 0===n?void 0:n.queryMarks)&&n.queryMarks().forEach((function(e){h(g,e)}))}}else h(g,e)}}else w=!0}),!0,"editable")}))}for(var k=0;k"));var a=n.html(e);""!==a&&"​"!==a||(n.isMark(e)?(e.remove(),o&&this.removeEmptyMarks(o,!0)):t&&n.isBlock(e)&&n.html(e,"
      "))}}}},{key:"repairCursor",value:function(e){var t=this.editor.node;e=gt(e)?Ut(e):e;var n=t.isMark(e);if(n&&!e.isCursor()){var r=e.children();r.each((function(e,t){var n,i=r.eq(t);if((null===i||void 0===i?void 0:i.isText())&&!(null===(n=i.next())||void 0===n?void 0:n.isCursor())){var o=i.text();if(1===o.length&&/\u200b/.test(o))return void i.remove();i.text(o.replace(/\u200b/g,""))}}));var i=e.children().toArray().filter((function(e){return!e.isCursor()}));i.length<2&&(0===i.length||1===i.length&&i[0].isText()&&0===i[0].text().length)&&(i.length>0&&i[0].remove(),e.prepend(Ut("​",null)));var o=e.next(),a=null===o||void 0===o?void 0:o.next();o&&a&&o.isText()&&/^\u200b$/g.test(o.text())&&!t.isInline(a)&&o.remove();var s=e.prev(),l=null===s||void 0===s?void 0:s.prev();s&&l&&s.isText()&&/^\u200b$/g.test(s.text())&&!t.isInline(l)&&s.remove()}}}]),e}(),To=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=(t.mark,t.inline),i=t.node,o=n.range.get(),a=o.cloneRange().shrinkToTextNode(),s=a.collapsed,l=a.endNode,c=a.startNode,A=a.startOffset;if(l.type===Node.TEXT_NODE||c.type===Node.TEXT_NODE){if(!s){var u=r.closest(l);if(i.isInline(u)&&!u.isCard()&&i.isEmpty(u)){if(A>1)return!0;var d=l.prev(),h=l.parent();if(h&&i.isInline(h)){if(d)return!0;var p=l.text(),f=p.substr(0,A);if(!/^\u200b$/.test(f))return!0;var g=u.next(),m=null===g||void 0===g?void 0:g.text();if(g&&g.isText()&&m&&/^\u200b/.test(m))return o.setEnd(g,1),!1}}return i.isInline(u)&&!u.isCard()&&setTimeout((function(){r.repairCursor(u)}),100),!0}var v=r.closest(c);if(i.isInline(v)){if(v.isCard())return!0;if(A>1)return!0;var b=c.prev(),y=c.parent();if(y&&i.isInline(y)){if(b)return!0;var w=c.text(),x=w.substr(0,A);if(!/\u200b$/.test(x))return!0}else{if(0!==A)return!0;while(!b&&y&&!i.isInline(y)){var k;b=y.prev(),y=null===(k=y)||void 0===k?void 0:k.parent()}if(b&&!b.isText())return!0;if(b&&!/\u200b$/.test(b.text()))return!0}var C=v.prev(),B=null===C||void 0===C?void 0:C.text();if(C&&C.isText()&&B&&/\u200b$/.test(B)){if(o.setStart(C,B.length-1),i.isEmpty(v)){var _=v.next(),E=null===_||void 0===_?void 0:_.text();_&&_.isText()&&E&&/^\u200b/.test(E)&&o.setEnd(_,1)}else o.collapse(!0);return n.range.select(o),!1}return!0}var S=c.prev(),F=c.parent(),T=void 0;if(S){if(i.isInline(S)&&!S.isCard()){var M=c.text(),I=M.substr(0,A);if(!/^\u200b$/.test(I))return!0;T=S}}else{if(0!==A)return!0;while(!S&&F&&!i.isBlock(F)){var N;S=F.prev(),F=null===(N=F)||void 0===N?void 0:N.parent()}if(S&&!S.isText())return!0;if(S){if(!/^\u200b$/.test(S.text()))return!0;if(S=S.prev(),!S||!i.isInline(S))return!0;T=S}}if(T){var U=T.last(),L=null===U||void 0===U?void 0:U.text();if(U&&U.isText()&&L&&/\u200b$/.test(L))return e.preventDefault(),o.setStart(U,L.length-1),o.collapse(!0),n.range.select(o),!1}}return!0}}]),e}(),Mo=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.inline,o=t.node,a=n.range.get().cloneRange().shrinkToTextNode(),s=a.startNode,l=a.startOffset,c=this.engine.card.getSingleCard(a);if(!c&&s.type===Node.TEXT_NODE){var A=r.closest(s);if(o.isInline(A)){if(A.isCard())return;if(l>1)return!0;var u=s.prev(),d=s.parent();if(d&&o.isInline(d)){if(u)return!0;var h=s.text(),p=h.substr(0,l);if(!/^\u200b$/.test(p))return!0}else{if(0!==l)return!0;while(!u&&d&&!o.isInline(d)){var f;u=d.prev(),d=null===(f=d)||void 0===f?void 0:f.parent()}if(u&&!u.isText())return!0;if(u&&!/^\u200b$/.test(u.text()))return!0}var g=A.prev(),m=null===g||void 0===g?void 0:g.text();if(g&&g.isText()&&m&&/\u200b$/.test(m)){e.preventDefault();var v=a.cloneRange(),b=v.collapsed;return a.setStart(g,m.length-1),b&&a.collapse(!0),n.range.select(a),!1}return!0}var y=s.prev(),w=s.parent(),x=void 0;if(y){if(o.isInline(y)&&!y.isCard()){var k=s.text(),C=k.substr(0,l);if(!/^\u200b$/.test(C))return!0;x=y}}else{if(0!==l)return!0;while(!y&&w&&!o.isBlock(w)){var B;y=w.prev(),w=null===(B=w)||void 0===B?void 0:B.parent()}if(y&&!y.isText())return!0;if(y){if(!/^\u200b$/.test(y.text()))return!0;if(y=y.prev(),!y||!o.isInline(y))return!0;x=y}}if(x){e.preventDefault();var _=x.last(),E=null===_||void 0===_?void 0:_.text();if(_&&_.isText()&&E&&/\u200b$/.test(E)){var S=a.cloneRange(),F=S.collapsed;return a.setStart(_,E.length-1),F&&!(0,i.ZP)("shift+left",e)&&a.collapse(!0),n.range.select(a),!1}}}return!0}}]),e}(),Io=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.inline,o=t.node,a=n.range.get().cloneRange().shrinkToTextNode(),s=a.endNode,l=a.endOffset,c=this.engine.card.getSingleCard(a);if(!c&&s.type===Node.TEXT_NODE){var A=r.closest(s),u=s.text();if(o.isInline(A)){if(A.isCard())return;if(l=g.text().length-1){var m=!0,v=o;while(v&&!v.equal(f)){if(v.next()){m=!1;break}v=v.parent()}if(m){var b=f.next(),y=(null===b||void 0===b?void 0:b.text())||"";b&&b.isText()&&/^\u200B/g.test(y)&&e.setEnd(b,1)}}return e}},{key:"closest",value:function(e){var t=this.editor.node,n=e.parent();while(n&&!n.isEditable()&&!t.isBlock(n)){if(t.isInline(n))return n;var r=n.parent();if(!r)break;n=r}return e}},{key:"closestNotInline",value:function(e){var t=this.editor.node;while(t.isInline(e)||t.isMark(e)||e.isText()){if(e.isEditable())break;var n=e.parent();if(!n)break;e=n}return e}},{key:"wrap",value:function(e,t){var n=this,r=this.editor;if(st(r)){var i=r.change,o=r.mark,a=r.node,s=t||i.range.toTrusty(),l=rt(s.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,l)),a.isInline(e)){if(s.collapsed)return this.insert(e,s),void(t||i.apply(s));o.split(s),this.split(s);var c=s.commonAncestorNode;if(c.type===Node.TEXT_NODE||a.isMark(c)){c=c.parent();while(a.isMark(c))c=c.parent()}var A=s.enlargeToElementNode().createSelection();if(A.has()){var u=!1,d=a.clone(e,!1),h=[];c.traverse((function(e){if(e.equal(A.anchor))u=!0;else if(u){if(e.equal(A.focus))return u=!1,!1;if(a.isInline(e))if(e.isCard())h.push(e);else{var t=e.children();a.unwrap(e),e=t}if(a.isMark(e)&&!e.isCard()||e.isText())return a.isEmpty(e)?(e.remove(),!0):(d.parent()||e.before(d),d.append(e),n.repairCursor(d),h.push(d),!0);0!==d[0].childNodes.length&&d.parent()&&(d=a.clone(d,!1,!1))}}));var p=A.anchor,f=A.focus,g=null===p||void 0===p?void 0:p.parent();if(g&&a.isRootBlock(g)&&!p.prev()&&!p.next()&&p.after("
      "),!p.equal(f)){var m=null===f||void 0===f?void 0:f.parent();m&&a.isRootBlock(m)&&!f.prev()&&!f.next()&&f.before("
      ")}if(A.move(),h.length>0){var v=h[0];if(!v.isCard()){var b=v.first();s.setStart(b,1)}var y=h[h.length-1];if(!y.isCard()){var w=y.last();s.setEnd(w,w.text().length-1)}}t||i.apply(s)}else t||i.apply(s)}}}},{key:"unwrap",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=t.mark,i=e&&Jt(e)?e:n.range.toTrusty();this.repairRange(i),r.split(i);var o=e&&!Jt(e)?[e]:this.findInlines(i),a=i.createSelection();o.forEach((function(e){var n,r,i,o,a=e.prev();a&&a.isCursor()&&(a=a.prev());var s=e.next();s&&s.isCursor()&&(s=s.prev());var l=e.first();l&&l.isCursor()&&(l=l.next());var c=(null===(n=a)||void 0===n?void 0:n.text())||"",A=(null===(r=s)||void 0===r?void 0:r.text())||"",u=(null===(i=l)||void 0===i?void 0:i.text())||"";a&&a.isText()&&/\u200B$/g.test(c)&&(/^\u200B$/g.test(c)?a.remove():a.text(c.substr(0,c.length-1))),s&&s.isText()&&/^\u200B/g.test(A)&&(/^\u200B$/g.test(A)?s.remove():s.text(A.substr(1))),l&&l.isText()&&/^\u200B/g.test(u)&&(/^\u200B$/g.test(u)||l.get().splitText(1),l.remove());var d=e.last();d&&d.isCursor()&&(d=d.prev());var h=(null===(o=d)||void 0===o?void 0:o.text())||"";d&&d.isText()&&/\u200B$/g.test(h)&&(/^\u200B$/g.test(h)?d.remove():d.get().splitText(h.length-1).remove()),t.node.unwrap(e)})),a.move(),r.merge(i),e||n.apply(i)}}},{key:"insert",value:function(e,t){var n,r,i=this.editor;if(st(i)){var o=i.change,a=i.node,s=i.mark,l=t||o.range.toTrusty(),c=rt(l.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,c)),a.isInline(e)){l.collapsed||o.delete(l),s.split(l),this.split(l),null===(n=a.insert(e,l))||void 0===n||n.select(e).collapse(!1),"br"!==e.name&&l.handleBr();var A=0!==(null===(r=e.get())||void 0===r?void 0:r.childNodes.length);if(this.repairCursor(e),!e.isCard()&&!a.isVoid(e))if(A){var u=e.next();l.setStart(u,1),l.setEnd(u,1)}else{var d=e.last(),h=d.text();l.setStart(d,h.length-1),l.setEnd(d,h.length-1)}t||o.apply(l)}}}},{key:"unwrapEmptyInlines",value:function(e,t){var n=this.editor.node,r=e.allChildren();r.forEach((function(e){n.isEmpty(e)&&n.isInline(e)&&(!t||t(e))&&n.unwrap(e)}))}},{key:"splitOnCollapsed",value:function(e,t){var n=this;if(e.collapsed){e.enlargeFromTextNode(),e.shrinkToElementNode();var r=e.startNode,i=r.parent(),o=this.editor.node,a=r.isCard()?r:r.closest(xe);if((0===a.length||"inline"!==a.attributes(me))&&(o.isInline(r)||i&&o.isInline(i))){var s,l=this.closestNotInline(r),c=e.createSelection(),A=c.getNode(l,"left"),u=void 0,d=void 0,h=[];if(t){gt(t)&&(t=Ut(t));var p=t.getPath(l.get()),f=l.clone(!0);h=p.slice(1),d=Ut(f.getChildByPath(p.slice(0,1))),u=c.getNode(f,"right",!1)}else u=c.getNode(l,"right");this.unwrapEmptyInlines(A),this.unwrapEmptyInlines(u);var g=l.children();g.each((function(e,t){var n,r;(null===(n=g.eq(t))||void 0===n?void 0:n.isCard())||(null===(r=g.eq(t))||void 0===r||r.remove())}));var m=void 0,v=function(e){e.each((function(t,n){var r=e.eq(n);if(null===r||void 0===r?void 0:r.isCard())return m=m?m.next():l.first(),void(m&&(e[n]=m[0]));m?(m.after(t),m=r):(m=r,l.prepend(t))}))},b=A.children(),y=b.toArray();v(b);var w=u.children(),x=w.toArray();if(d&&(t=null===(s=x.find((function(e){return e.equal(d)})))||void 0===s?void 0:s.getChildByPath(h)),v(w),x=w.toArray(),1===y.length&&"br"===y[0].name&&(y[0].remove(),y.splice(0,1)),1===x.length&&"br"===x[0].name&&(x[0].remove(),x.splice(0,1)),x.filter((function(e){return!e.isCursor()})).length>0){for(var k=x[0],C=0;C0){for(var B=y[y.length-1],_=y.length-1;_>=0;_--)if(B=y[_],!B.isCursor())break;e.setStartAfter(B),e.collapse(!0)}else e.select(l,!0).collapse(!0);l.traverse((function(e){o.isInline(e)&&n.repairCursor(e)}))}return e.enlargeToElementNode(!o.isBlock(e.startNode),!1),t}}},{key:"splitOnExpanded",value:function(e){var t=this;if(!e.collapsed){e.enlargeToElementNode(),e.shrinkToElementNode();var n=e.startNode,r=e.endNode,i=n.isCard()?n:n.closest(xe),o=r.isCard()?r:r.closest(xe);if(!(i.length>0&&"inline"===i.attributes(me)||o.length>0&&"inline"===o.attributes(me))){var a=this.closestNotInline(n),s=this.closestNotInline(r);if(!a.equal(s)){var l=e.cloneRange();l.collapse(!0);var c=e.cloneRange();c.collapse(!1);var A=void 0,u=l.startOffset,d=c.endOffset;return void(a.contains(s)?(A=this.splitOnCollapsed(l,c.endNode),e.setStart(l.startContainer,l.startOffset),A&&c.setOffset(A,d,d),this.splitOnCollapsed(c),e.setEnd(c.startContainer,c.startOffset)):(A=this.splitOnCollapsed(c,l.startNode),e.setEnd(c.startContainer,c.startOffset),A&&l.setOffset(A,u,u),this.splitOnCollapsed(l),e.setStart(l.startContainer,l.startOffset)))}var h=this.editor.node,p=n.parent(),f=h.isInline(n)||p&&h.isInline(p),g=r.parent(),m=h.isInline(r)||g&&h.isInline(g);if(!f&&!m)return;var v=e.commonAncestorNode;v.isText()&&(v=v.parent());var b=this.closestNotInline(v),y=e.createSelection(),w=y.getNode(b,"left"),x=y.getNode(b),k=y.getNode(b,"right");this.unwrapEmptyInlines(w),this.unwrapEmptyInlines(k);var C=b.children();C.each((function(e,t){var n,r;(null===(n=C.eq(t))||void 0===n?void 0:n.isCard())||(null===(r=C.eq(t))||void 0===r||r.remove())}));var B=void 0,_=function(e){e.each((function(t,n){var r;if(null===(r=e.eq(n))||void 0===r?void 0:r.isCard())return B=B?B.next():b.first(),void(B&&(e[n]=B[0]));B?(B.after(t),B=e.eq(n)):(B=e.eq(n),b.prepend(t))}))};_(w.children());var E=x.children(),S=E.toArray();_(E),_(k.children()),b.traverse((function(e){h.isInline(e)&&t.repairCursor(e)})),e.setStartBefore(S[0][0]),e.setEndAfter(S[S.length-1][0])}}}},{key:"split",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=e||n.range.toTrusty();r.collapsed?this.splitOnCollapsed(r):this.splitOnExpanded(r),e||n.apply(r)}}},{key:"findInlines",value:function(e){var t=this.editor,n=e.cloneRange();if(n.startNode.isRoot()&&n.shrinkToElementNode(),!n.startNode.inEditor()||t.card.find(n.startNode))return[];var r=t.node,i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.collapsed){var i=t.startNode,o=t.startOffset,a=i.findParent();if(a){var s=t.cloneRange();if(s.select(a,!0),n){s.setEnd(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var l=i.children(),c=s.endNode,A=s.endOffset,u=c.children(),d=u.eq(A),h=l.eq(o)||l.eq(o-1);if(!e&&c.type===Node.ELEMENT_NODE&&d&&r.isBlock(d)&&(i.type!==Node.ELEMENT_NODE||h&&!r.isBlock(h)))return;s.select(a,!0),s.setStart(c,A),s.shrinkToElementNode(),s.shrinkToTextNode(),t.setStart(s.startContainer,s.startOffset),t.collapse(!0)}else{s.setStart(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var p=i.children(),f=s.startNode,g=s.startOffset,m=f.children(),v=m.eq(g),b=p.eq(o)||p.eq(o-1);if(!e&&f.type===Node.ELEMENT_NODE&&v&&r.isBlock(v)&&(i.type!==Node.ELEMENT_NODE||b&&!r.isBlock(b)))return;s.select(a,!0),s.setEnd(f,g),s.shrinkToElementNode(),s.shrinkToTextNode(),t.setEnd(s.endContainer,s.endOffset),t.collapse(!1)}}}};if(!n.collapsed){var o=n.cloneRange(),a=n.cloneRange();o.collapse(!0),a.collapse(!1),i(!0,o,!0),i(!0,a),n.setStart(o.startContainer,o.startOffset),n.setEnd(a.startContainer,a.startOffset)}i(!1,n);var s=n.startContainer,l=n.startOffset,c=n.endContainer,A=n.endOffset,u=s,d=c;s.nodeType===Node.ELEMENT_NODE&&s.childNodes[l]&&(u=s.childNodes[l]||s),c.nodeType===Node.ELEMENT_NODE&&A>0&&c.childNodes[A-1]&&(d=c.childNodes[A-1]||s),n.collapsed&&(u=d);var h=function(e,t){e.some((function(e){return e[0]===t[0]}))||e.push(t)},p=function(e){var t=[];while(e){if(e.isEditable())break;r.isInline(e)&&t.push(e);var n=e.parent();if(!n)break;e=n}return t},f=p(Ut(u)),g=n.commonAncestorNode,m=t.card.find(g,!0),v=null===m||void 0===m?void 0:m.isEditable,b=v?(null===m||void 0===m?void 0:m.getSelectionNodes)?m.getSelectionNodes():[]:[g];if(0===b.length&&(v=!1,b.push(g)),(!n.collapsed||v)&&(p(Ut(d)).forEach((function(e){return h(f,e)})),s!==c||v)){var y=!1,w=!1;b.forEach((function(e){e.traverse((function(e){if(w)return!1;if(e.equal(s))y=!0;else if(y){if(e.equal(c))return w=!0,!1;!r.isInline(e)||e.attributes(fe)||e.attributes(be)||h(f,e)}}))}))}return f}},{key:"repairCursor",value:function(e){var t,n,r=this.editor.node;if(gt(e)&&(e=Ut(e)),!r.isInline(e)||"false"===e.closest(xe).attributes(we)||r.isVoid(e)||e.isCard()){var i=e.prev(),o=(null===i||void 0===i?void 0:i.isText())?i.text():void 0;if(o&&/\u200b$/.test(o)){var a=null===i||void 0===i?void 0:i.prev();a&&r.isInline(a)||(1===o.length?null===i||void 0===i||i.remove():null===i||void 0===i||i.text(o.slice(0,-1)))}var s=e.next(),l=(null===s||void 0===s?void 0:s.isText())?s.text():void 0;if(l&&/^\u200b/.test(l)){var c=null===s||void 0===s?void 0:s.next();c&&r.isInline(c)||(1===l.length?null===s||void 0===s||s.remove():null===s||void 0===s||s.text(l.slice(1)))}}else{var A=e.children();A.each((function(e,t){var n=A.eq(t);if(null===n||void 0===n?void 0:n.isText()){var r=n.text();if(1===r.length&&/\u200b/.test(r))return void n.remove();n.text(r.replace(/\u200b/g,""))}})),this.repairBoth(e);var u=e.first();(null===(t=u)||void 0===t?void 0:t.isCursor())&&(u=u.next()),u&&u.type===Node.TEXT_NODE&&/^\u200B/g.test(u.text())||(u?u.isText()?u.text("​"+u.text()):u.before(Ut("​",null)):e.append(Ut("​",null)));var d=e.last();(null===(n=d)||void 0===n?void 0:n.isCursor())&&(d=d.prev()),!d||!/^\u200B$/g.test(e.text())&&d.type===Node.TEXT_NODE&&/\u200B$/g.test(d.text())||(d.isText()?d.text(d.text()+"​"):d.after(Ut("​",null)))}}},{key:"repairBoth",value:function(e){var t,n=this.editor.node;gt(e)&&(e=Ut(e));var r=e.get();if((null!==(t=null===r||void 0===r?void 0:r.parentElement)&&void 0!==t?t:null===r||void 0===r?void 0:r.parentNode)&&!n.isVoid(e)){var i=Ut("​",null),o=e.prev(),a=null===o||void 0===o?void 0:o.prev(),s=(null===o||void 0===o?void 0:o.text())||"";!o||!o.isText()||!/\u200B$/g.test(s)||a&&n.isInline(a)&&!/\u200B.*\u200B$/g.test(s)?o&&o.isText()?o.text(s+"​"):e.before(n.clone(i,!0,!1)):o&&o.isText()&&/\u200B\u200B$/g.test(s)&&a&&!n.isInline(a)&&o.text(s.substr(0,s.length-1));var l=e.next(),c=(null===l||void 0===l?void 0:l.text())||"",A=null===l||void 0===l?void 0:l.next();!l||!l.isText()||!/^\u200B/g.test(c)||A&&n.isInline(A)&&!/^\u200B\u200B/g.test(c)?l&&l.isText()?l.text("​"+l.text()):(e.after(n.clone(i,!0,!1)),"br"===(null===l||void 0===l?void 0:l.name)&&l.remove()):l&&l.isText()&&/\u200B\u200B$/g.test(c)&&A&&!n.isInline(A)&&l.text(c.substr(0,c.length-1))}}},{key:"flat",value:function(e,t){var n=this,r=this.editor;if(Jt(e)){var i=e.cloneRange().shrinkToElementNode().createSelection(),a=this.findInlines(e),s=[];a.forEach((function(e){if(!e.isCard()){var t=n.flat(e);t&&s.push(t)}})),i.move();var l=r.node;s.forEach((function(e){var t,n,r=null===(t=e.prev())||void 0===t?void 0:t.prev(),i=null===(n=e.next())||void 0===n?void 0:n.next();r&&l.isMark(r)&&0===r.get().childNodes.length&&r.remove(),i&&l.isMark(i)&&0===i.get().childNodes.length&&i.remove()}))}else if(!e.isCard()){var c=r.node,A=r.mark;if(c.isInline(e,t)&&"br"!==e.name){var u=this.closest(e);if(!u.equal(e)&&c.isInline(u,t))c.unwrap(e);else{var d=function(){var r=A.closest(e),i=e,o=function(){var t=r.clone(),o=e.clone(),a=r.children();a.each((function(e){if(3!==e.nodeType||!/^\u200b$/.test(e.textContent||"")){var r=Ut(e);i.equal(r)||r.contains(i)?(i=c.wrap(c.replace(i,t),o),n.repairBoth(i)):c.wrap(r,t)}})),c.unwrap(r),r=A.closest(i)};while(r&&!r.equal(e)&&c.isMark(r,t))o();return{v:i}}();if("object"===(0,o.Z)(d))return d.v}}}}}]),e}(),Uo=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.node,i=(t.list,n.range.get().shrinkToElementNode().shrinkToTextNode()),o=this.engine.block,a=o.closest(i.endNode),s=a.parent();if(s&&s.inEditor()&&r.isBlock(s)){var l;if("li"===s.name&&"p"===a.name){var c,A;1===(null===(c=a.get())||void 0===c?void 0:c.childNodes.length)&&"br"===(null===(A=a.first())||void 0===A?void 0:A.name)&&a.first().remove();var u=i.createSelection();n.unwrap(a),u.move(),a=o.closest(i.endNode)}if(i.collapsed&&(1===i.startContainer.childNodes.length&&"BR"===(null===(l=i.startContainer.firstChild)||void 0===l?void 0:l.nodeName)||o.isLastOffset(i,"end")&&o.isFirstOffset(i,"end")))return e.preventDefault(),["li"].indexOf(s.name)>=0?(o.unwrap("<".concat(s.name," />")),o.setBlocks("<".concat(s.name," />"))):(o.unwrap("<".concat(s.name," />")),o.setBlocks("

      ")),!1}return!r.isBlock(a)||s&&r.isList(s)||a.isCard()?"li"!==a.name||void 0:(e.preventDefault(),o.insertOrSplit(i,a),!1)}}]),e}(),Lo=function(){function e(t){(0,l.Z)(this,e),this.engine=void 0,this.engine=t}return(0,c.Z)(e,[{key:"trigger",value:function(e){var t=this.engine,n=t.change,r=t.node,i=t.block,o=t.card,a=n.range.get();if(a.collapsed){var s=a.getPrevNode();if(s&&r.isBlock(s)&&r.isEmptyWithTrim(s)){e.preventDefault();var l=s.parent();return s.remove(),l&&this.engine.node.isEmpty(l)&&(l.isEditable()?(this.engine.node.html(l,"


      "),a.select(l,!0).shrinkToElementNode().collapse(!1)):(this.engine.node.html(l,"
      "),a.select(l,!0).collapse(!1)),n.apply(a)),!1}var c=!!o.closest(a.startNode);if(c||i.isFirstOffset(a,"start")){var A=i.closest(a.startNode);return!(!c&&r.isRootBlock(A))||(e.preventDefault(),r.isEmpty(A)&&A.html("
      "),n.mergeAfterDelete(A),n.change(!1),!1)}var u=a.cloneRange().shrinkToElementNode().shrinkToTextNode();u.startContainer.nodeType===Node.TEXT_NODE&&function(e){var t,i,o,a,s=e,l=s.commonAncestorContainer,c=s.commonAncestorNode,A=c.parent(),u=null===A||void 0===A?void 0:A.attributes();if(e.collapsed&&1===e.startOffset&&e.startContainer===l&&l.nodeType===Node.TEXT_NODE&&(!u||!["left","right"].includes(u[be]))&&(e=e.cloneRange(),((null===(t=null!==(o=l.parentElement)&&void 0!==o?o:l.parentNode)||void 0===t||null===(i=t.childNodes)||void 0===i?void 0:i.length)||0)<=1&&1===(null===(a=l.textContent)||void 0===a?void 0:a.length))){var d=e,h=d.startNode,p=d.startOffset,f=h.parent();if(f&&r.isMark(f)&&p>0){var g=h.text(),m=g.substr(p-1,1);if(/^\u200b$/.test(m))if(1===p){var v=f.prev();if(v&&!r.isEmpty(v)){var b=e.cloneRange().select(v,!0).shrinkToTextNode().collapse(!1),y=b.startNode,w=b.startOffset;e.setStart(y,w-1)}}else e.setStart(h,p-1)}return e.collapsed&&e.select(l,!0),n.delete(e,!0),n.apply(e),!0}return!1}(u)&&(e.preventDefault(),e["isDelete"]=!0,n.change())}}}]),e}(),Qo=function(){function e(t){(0,l.Z)(this,e),this.editor=void 0,this.pluginCaches=new Map,this.editor=t}return(0,c.Z)(e,[{key:"init",value:function(){var e=this,t=this.editor;if(st(t)){var n,r,i=t.typing,o=t.event,a=new Uo(t);null===(n=i.getHandleListener("enter","keydown"))||void 0===n||n.on((function(e){return a.trigger(e)}));var s=new Lo(t);null===(r=i.getHandleListener("backspace","keydown"))||void 0===r||r.on((function(e){return s.trigger(e)})),o.on("keyup:space",(function(t){return e.triggerMarkdown(t)})),o.on("keydown:enter",(function(t){return e.triggerMarkdown(t)}))}}},{key:"triggerMarkdown",value:function(e){var t,n=this.editor;if(st(n)&&!1!==(null===(t=n.options.markdown)||void 0===t?void 0:t.mode)){var r=n.change,i=r.range.get();if(i.collapsed&&!r.isComposing()){var o=i.startNode,a=i.startOffset,s=o.type===Node.TEXT_NODE?o:o.children().eq(a-1);if(s){var l=this.closest(s);if(n.node.isRootBlock(l)){var c=s.text().trim();if(""!==c.replace(/\s|\t|\n|\r\n|\u200b/g,"")){var A=i.toPath(),u=ct(n,"zero"),d=u.parse(c,{});if(0!==d.length){var h=At(n,u,d,!1);if(h){var p=l.children();e.preventDefault(),i.select(l,!0),r.paste(h,i);var f=this.closest(i.startNode);return f.isRoot()||f.isCard()||p.each((function(e,t){t>0&&f.append(e)})),r.rangePathBeforeCommand=A,r.range.select(i),!1}return!0}}}}}}}},{key:"findPlugin",value:function(e){var t=this.editor,n=t.node,r=t.schema,i=t.plugin;if(0!==e.length&&n.isBlock(e)){var o=e.get().cloneNode(),a=o.outerHTML,s=this.pluginCaches.get(a);if(s)return s;for(var l in i.components){var c=i.components[l];if(Mi(c)&&(c.tagName&&"string"!==typeof c.tagName?c.tagName.indexOf(e.name)>-1:e.name===c.tagName)){var A=c.schema();if(Array.isArray(A)?A.find((function(t){return r.checkNode(e,t.attributes)})):r.checkNode(e,A.attributes))return this.pluginCaches.set(a,c),c}}return s}}},{key:"findTop",value:function(e,t){var n=this.editor,r=n.schema,i=n.node,o=n.list,a=r.closest(e.name),s=r.closest(t.name);if(a===parent.name||s===t.name)return t;if(r.isAllowIn(e.name,t.name))return e;if(i.isList(e)&&i.isList(t)){var l=parseInt(t.attributes(o.INDENT_KEY),10)||0,c=parseInt(e.attributes(o.INDENT_KEY),10)||0;t.attributes(o.INDENT_KEY,c?c+1:l+1)}return t}},{key:"closest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=e;while(e){if((e.isEditable()||this.editor.node.isBlock(e))&&t(e))return e;var r=e.parent();if(!r)break;e=r}return n}},{key:"wrap",value:function(e,t){var n,r=this,i=this.editor;if(st(i)){var o=i.change,a=i.node,s=i.schema,l=i.list,c=i.mark,A=t||o.range.toTrusty(),u=rt(A.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,u)),a.isBlock(e)){var d=this.getBlocks(A),h=this.findPlugin(e);if(d=d.map((function(t){var n;if(!t||t.isCard())return null;var i=e,o=null===(n=t)||void 0===n?void 0:n.parent();while(o&&!o.isEditable()){t=o;var l=o.parent();if(!l||!a.isBlock(l))break;o=l}return s.isAllowIn(i.name,t.name)?t:r.findPlugin(t)===h?t.children():null})).filter((function(e){return null!==e})),0===d.length){var p=this.closest(A.startNode);if(p.isCard()||p.isEditable()||!s.isAllowIn(e.name,p.name))return;var f=A.createSelection();return p.children().each((function(t){e.append(t)})),p.append(e),void f.move()}var g=A.createSelection();null===(n=d[0])||void 0===n||n.before(e),d.forEach((function(t){t&&(h&&t.allChildren().forEach((function(e){if(a.isMark(e)){var t,n=c.findPlugin(e);if(!n)return;(null===(t=h.disableMark)||void 0===t?void 0:t.indexOf(n.constructor.pluginName))&&a.unwrap(e)}})),e.append(t))})),g.move(),this.merge(A),l.merge(void 0,A),t||o.apply(A)}}}},{key:"unwrap",value:function(e,t){var n=this.editor;if(st(n)){var r=n.change,i=n.node,o=t||r.range.toTrusty(),a=rt(o.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,a)),i.isBlock(e)){var s=this.getSiblings(o,e);if(0!==s.length){var l=s[0].node.parent();if(null===l||void 0===l?void 0:l.inEditor()){var c=s.some((function(e){return"left"===e.position})),A=s.some((function(e){return"right"===e.position})),u=void 0;if(c){var d=l;u=i.clone(d,!1,!1),d.before(u)}var h=void 0;if(A){var p=s[s.length-1].node.parent();p&&(h=i.clone(p,!1,!1),null===p||void 0===p||p.after(h))}var f=o.createSelection(),g=i;s.forEach((function(t){var n,r,i,o=t.position,a=t.node,s=a.parent();"left"===o&&(null===(n=u)||void 0===n||n.append(a));"center"===o&&((null===s||void 0===s?void 0:s.name)===(null===(r=e)||void 0===r?void 0:r.name)&&(null===s||void 0===s?void 0:s.inEditor())&&g.unwrap(s));"right"===o&&(null===(i=h)||void 0===i||i.append(a))})),u&&"ol"===u.name&&h&&"ol"===h.name&&h.attributes("start",(parseInt(u.attributes("start"),10)||1)+u.find("li").length),f.move(),t||r.apply(o)}}}}}},{key:"getSiblings",value:function(e,t){var n=this,r=[],i=this.editor.node;if(!i.isBlock(t))return r;var o=function(e,t){var r=n.closest(e);while(r){var i=r.parent();if(!i)break;if(!r.inEditor())break;if(r.text().trim()!==i.text().trim())break;if(i.name===t)break;r=i}return r},a=o(e.startNode,t.name),s=o(e.endNode,t.name),l=a.parent(),c="left",A=null===l||void 0===l?void 0:l.first();while(A){if(A=Ut(A),!i.isBlock(A))return r;if(!A.inEditor())return r;A[0]===a[0]&&(c="center"),r.push({position:c,node:A}),A[0]===s[0]&&(c="right"),A=A.next()}return r}},{key:"split",value:function(e){var t,n,r=this.editor;if(st(r)){var i=r.change,o=r.mark,a=r.nodeId,s=e||i.range.toTrusty();s.collapsed||i.delete(s);var l=this.closest(s.startNode);if(l.isEditable()||l.inEditor()){if(l.isEditable()){var c=s.getStartOffsetNode();return c&&s.select(c,!0).shrinkToElementNode().collapse(!1),void(e||i.apply(s))}var A=s.cloneRange();A.shrinkToElementNode().shrinkToTextNode().collapse(!0);var u=o.findMarks(A).filter((function(e){var t=r.mark.findPlugin(e);return!1!==(null===t||void 0===t?void 0:t.copyOnEnter)&&!1!==(null===t||void 0===t?void 0:t.followStyle)})),d=this.getBlockByRange({block:l[0],range:s,isLeft:!1,keepDataId:!0}),h=r.node;d.traverse((function(e){!h.isVoid(e)&&(h.isInline(e)||h.isMark(e))&&h.isEmpty(e)&&e.remove()}),!0);var p=function(e){return h.isBlock(e)&&(0===e.childNodes.length||""===e.innerText)};return p(l[0])&&!p(d[0])?a.generate(l,!0):a.generate(d,!0),l.after(d),h.isEmpty(l)&&h.html(l,h.getBatchAppendHTML(u,u.length>0?"​":"
      ")),h.isEmpty(d)&&h.html(d,h.getBatchAppendHTML(u,u.length>0?"​":"
      ")),l.children().each((function(e){h.isInline(e)&&r.inline.repairCursor(e)})),d.children().each((function(e){h.isInline(e)&&r.inline.repairCursor(e)})),s.select(d,!0).shrinkToElementNode(),1===(null===(t=d.get())||void 0===t?void 0:t.childNodes.length)&&"br"===(null===(n=d.first())||void 0===n?void 0:n.name)?s.collapse(!1):s.collapse(!0),e||i.apply(s),d}}}},{key:"insert",value:function(e,t,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=this.editor;if(st(a)){var s=a.change,l=a.node,c=a.list,A=a.inline,u=t||s.range.toTrusty(),d=rt(u.startContainer);if(("string"===typeof e||gt(e))&&(e=Ut(e,d)),l.isBlock(e)){u.collapsed||s.delete(u);var h=this.closest(u.startNode);if(h.isEditable()||h.inEditor()){if(h.isEditable())return l.insert(e,u,o),u.collapse(!1),void(t||s.apply(u));if(l.isList(u.startNode)||u.startNode.closest("li").length>0){var p=d.createDocumentFragment();return p.appendChild(e[0]),c.insert(p,u),void(t||s.apply(u))}1===(null===(r=h.get())||void 0===r?void 0:r.childNodes.length)&&"br"===(null===(i=h.first())||void 0===i?void 0:i.name)&&u.select(h,!0).collapse(!1);var f=u.enlargeToElementNode().createSelection();if(f.has()){h=n?n(h):h;var g=f.getNode(h,"left");g.traverse((function(e){e.equal(g)||l.isBlock(e)&&(l.isEmpty(e)||c.isEmptyItem(e))&&e.remove()}));var m=f.getNode(h,"right",!0,(function(e){if(e.isCard()){var t=e.parent();if(t&&l.isCustomize(t))return!1}return!0})),v=h.children();if(l.isEmpty(h)||v.each((function(e,t){var n,r=v.eq(t);(null===r||void 0===r?void 0:r.isCard())||(null===(n=v.eq(t))||void 0===n||n.remove())})),m.traverse((function(e){e.equal(m)&&(l.isBlock(e)&&(l.isEmpty(e)||c.isEmptyItem(e))?e.remove():l.isList(e)&&c.addBr(e))})),m.length>0&&!l.isEmpty(m)&&!c.isEmptyItem(m)){var b=m.clone(!1);a.nodeId.generate(b,!0);var y=m.children();y.each((function(e,t){var n;if(null===(n=y.eq(t))||void 0===n?void 0:n.isCard()){var r=a.card.find(e);r&&b.append(r.root)}else b.append(e)})),m=b,h.after(b)}if(g.length>0&&!l.isEmpty(g)&&!c.isEmptyItem(g)){var w=void 0,x=function(e){e.each((function(t,n){var r=e.eq(n);if(r&&l.isInline(r)&&A.repairCursor(r),null===r||void 0===r?void 0:r.isCard())return w=w?w.next():h.first(),void(w&&(e[n]=w[0]));w?(w.after(t),w=r):(w=r,h.prepend(t))}))};x(g.children())}h&&h.length>0&&(u.select(h,!0),u.collapse(!1)),f.focus&&f.focus.remove(),f.anchor&&f.anchor.remove(),l.insert(e,u,o),t||s.apply(u)}else t||s.apply(u)}else t||s.apply(u)}}}},{key:"setBlocks",value:function(e,t){var n=this,r=this.editor;if(st(r)){var i=r.node,o=r.schema,a=r.mark,s=r.change,l=t||s.range.toTrusty(),c=rt(l.startContainer),A=null,u={};"string"===typeof e?(A=Ut(e,c),u=A.attributes(),u.style=A.css()):u=e;var d=this.getBlocks(l),h=l.startNode;if(h.isEditable()&&0===d.length){if(h.isCard()||h.isEditable())return;var p=A||Ut("

      ");if(!o.isAllowIn(p.name,h.name))return;i.setAttributes(p,u);var f=l.createSelection();h.children().each((function(e){p.append(e)}));var g=o.data.globals["block"]||{},m=h.attributes();Object.keys(m).forEach((function(e){e!==$&&"id"!==e&&g["name"]&&p.attributes(e,m[e])}));var v=g.style||{},b=h.css();return Object.keys(b).forEach((function(e){v[e]||delete b[e]})),p.css(b),h.append(p),f.move(),void(t||s.apply(l))}var y=A?this.findPlugin(A):void 0,w=l.createSelection();d.forEach((function(e){if(!e.attributes(fe)){if(A){var t=o.data.globals["block"]||{},r=e.attributes();Object.keys(r).forEach((function(e){var n;e!==$&&"id"!==e&&t["name"]&&(null===(n=A)||void 0===n||n.attributes(e,r[e]))}));var s=t.style||{},l=e.css();Object.keys(l).forEach((function(e){s[e]||delete l[e]})),A.css(l)}if(!A||n.findPlugin(e)===y&&e.name===A.name)return A&&(u=A.attributes()),void i.setAttributes(e,u);if("p"===A.name||!o.isAllowIn(e.name,A.name)){y&&e.allChildren().forEach((function(e){if(i.isMark(e)){var t=a.findPlugin(e);if(!t)return;y.disableMark&&y.disableMark.indexOf(t.constructor.pluginName)>-1&&i.unwrap(e)}}));var c=i.replace(e,A),d=c.parent();!d||d.isEditable()||o.isAllowIn(d.name,c.name)||i.unwrap(d)}}})),w.move(),t||s.apply(l)}}},{key:"merge",value:function(e){var t=this.editor;if(st(t)){var n=t.change,r=t.schema,i=e||n.range.toTrusty(),o=this.getBlocks(i);if(0!==o.length){var a=o[0].closest(X),s=r.getCanMergeTags();if(0!==s.length){var l=a.find(s.join(","));if(l.length>0){var c=i.createSelection(),A=l.next();while(A&&s.indexOf(A.name)>0){var u=A.prev(),d=A.attributes(),h=null===u||void 0===u?void 0:u.attributes();A.name===(null===u||void 0===u?void 0:u.name)&&d["class"]===(h?h["class"]:void 0)&&Object.keys(d).join(",")===Object.keys(h||{}).join(",")&&t.node.merge(u,A),A=A.next()}c.move()}e||n.apply(i)}}}}},{key:"findBlocks",value:function(e){var t,n=this.editor;if(e=e.cloneRange(),e.startNode.isRoot()&&e.shrinkToElementNode(),!e.startNode.inEditor()||(null===(t=n.card.find(e.startNode))||void 0===t?void 0:t.type)===nn.BLOCK)return[];var r=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,s=r,l=o;r.nodeType===Node.ELEMENT_NODE&&r.childNodes[i]&&(s=r.childNodes[i]||r),o.nodeType===Node.ELEMENT_NODE&&a>0&&o.childNodes[a-1]&&(l=o.childNodes[a-1]||r),e.collapsed&&(s=l);var c=function(e,t,n){e.some((function(e){return e[0]===t[0]}))||(n?e.unshift(t):e.push(t))},A=function(e){var t=[];while(e){if(e.isEditable())break;n.node.isBlock(e)&&t.push(e);var r=e.parent();if(!r)break;e=r}return t},u=this.getBlocks(e);A(Ut(s)).forEach((function(e){return c(u,e,!0)}));var d=e,h=d.commonAncestorNode,p=n.card.find(h,!0),f=null===p||void 0===p?void 0:p.isEditable,g=f&&(null===p||void 0===p?void 0:p.getSelectionNodes)?p.getSelectionNodes():[];return 0===g.length&&(f=!1),e.collapsed&&!f||(A(Ut(l)).forEach((function(e){return c(u,e)})),g.forEach((function(e){e.traverse((function(e){e.isElement()&&!e.isCard()&&n.node.isBlock(e)&&c(u,e)}),!0,"editable")}))),u}},{key:"isFirstOffset",value:function(e,t){var n=e,r=n.startNode,i=n.endNode,o=n.startOffset,a=n.endOffset,s="start"===t?r:i,l="start"===t?o:a;e=e.cloneRange();var c=this.closest(s);e.select(c,!0),e.setEnd(s[0],l);var A=this.editor;A.node.isBlock(s)||e.enlargeToElementNode();var u=e.cloneContents();if(!u.firstChild)return!0;var d=A.node;if(1===u.childNodes.length&&"br"===Ut(u.firstChild).name)return!0;var h=Ut("
      ");return h.append(u),d.isEmpty(h)}},{key:"isLastOffset",value:function(e,t){var n=e,r=n.startNode,i=n.endNode,o=n.startOffset,a=n.endOffset,s="start"===t?r:i,l="start"===t?o:a;e=e.cloneRange();var c=this.closest(s);e.select(c,!0),e.setStart(s,l);var A=this.editor.node;A.isBlock(s)||e.enlargeToElementNode();var u=e.cloneContents();if(!u.firstChild)return!0;var d=Ut("
      ");return d.append(u),0>=d.find("br").length&&A.isEmpty(d)}},{key:"getBlocks",value:function(e){e=e.cloneRange(),e.shrinkToElementNode(),e.shrinkToTextNode();var t=this.editor,n=t.node,r=this.closest(e.startNode);e.startNode.isRoot()&&(r=Ut(e.getStartOffsetNode()));var i=this.closest(e.endNode);e.endNode.isRoot()&&(i=Ut(e.getEndOffsetNode()));var o=this.closest(e.commonAncestorNode),a=[],s=!1,l=e,c=l.commonAncestorNode,A=t.card.find(c,!0),u=null===A||void 0===A?void 0:A.isEditable,d=u?(null===A||void 0===A?void 0:A.getSelectionNodes)?A.getSelectionNodes():[]:[o];return 0===d.length&&(u=!1,d.push(o)),d.forEach((function(e){e.traverse((function(e){var n=Ut(e);if(n.equal(r)&&(s=!0),(s||u)&&t.node.isBlock(n)&&!n.isCard()&&n.inEditor()&&a.push(n),n.equal(i))return s=!1,!1}),!0,"editable")})),a.length>1&&this.isFirstOffset(e,"end")&&!n.isEmpty(i)&&a.pop(),a}},{key:"getBlockByRange",value:function(e){var t=e.block,n=e.range,r=e.isLeft,i=e.clone,o=void 0!==i&&i,a=e.keepDataId,s=void 0!==a&&a;gt(t)&&(t=Ut(t));var l=this.editor,c=$t.create(l,t.document);r?(c.select(t,!0),c.setEnd(n.startContainer,n.startOffset)):(c.select(t,!0),c.setStart(n.endContainer,n.endOffset));var A=o?c.cloneContents():c.extractContents(),u=s?t.clone(!1):l.node.clone(t,!1,!1);return u.append(A),o&&u.find(xe).each((function(e){var t=Ut(e),n=t.attributes(fe);t.attributes(ge,n),t.removeAttributes(fe)})),u}},{key:"getLeftText",value:function(e,t){var n=this.editor;if(!st(n))return"";t=t||n.change.range.get();var r=this.getBlockByRange({block:e,range:t,isLeft:!0,clone:!0});return r.text().replace(/\u200B/g,"")}},{key:"removeLeftText",value:function(e,t){var n=this.editor;if(st(n)){t=t||n.change.range.get(),gt(e)&&(e=Ut(e)),t.createSelection();var r=e.find(he),i=!1;e.traverse((function(e){var t=Ut(e);if(t.equal(r))return r.remove(),void(i=!0);i&&t.isText()&&t.remove()}),!1)}}},{key:"flat",value:function(e,t){var n=this.editor;if(st(n)){var r=n.schema,i=n.node,o=r.getCanMergeTags(),a=e.parent(),s=t.fragment?t[0].parentNode:t.get();while(a&&s&&a.get()!==s&&a.inEditor()){if(e.isCard())a.before(e);else if(i.isList(a)&&"li"===e.name||o.indexOf(a.name)>-1&&i.isBlock(e)&&a.name!==e.name){var l=i.clone(a,!1,!1);l.append(e),e=l,a.before(e)}else e=i.replace(e,i.clone(this.findTop(a,e),!1,!1)),a.before(e);a.first()||a.remove(),a=e.parent()}}}},{key:"insertEmptyBlock",value:function(e,t){var n=this.editor;if(st(n)){var r=n.change,i=r.blocks,o=r.marks,a=n.node;if(this.insert(t),i[0]){var s=i[0].css();t.css(s)}var l=t.find("br");o.forEach((function(e){var t=n.mark.findPlugin(e);e=a.clone(e,!1,!1),!1!==(null===t||void 0===t?void 0:t.copyOnEnter)&&!1!==(null===t||void 0===t?void 0:t.followStyle)&&(e=a.clone(e,!1,!1),l.before(e),e.append(l),l=e)})),l=t.find("br");var c=l.parent();c&&a.isMark(c)&&(l=a.replace(l,Ut("​",null))),e.select(l).shrinkToTextNode(),e.collapse(!1),e.scrollIntoView(),r.range.select(e)}}},{key:"insertOrSplit",value:function(e,t){var n,r,i,o=e.cloneRange();if(o.enlargeFromTextNode(),this.isLastOffset(e,"end")||o.endNode.type===Node.ELEMENT_NODE&&((null===(n=t.get())||void 0===n?void 0:n.childNodes.length)||0)>0&&o.endContainer.childNodes[o.endOffset]===(null===(r=t.last())||void 0===r?void 0:r.get())&&"br"===(null===(i=t.first())||void 0===i?void 0:i.name)){var a=Ut("


      ");if("p"===t.name){var s=t.attributes();Object.keys(s).forEach((function(e){e!==$&&a.attributes(e,s[e])}))}this.insertEmptyBlock(e,a)}else this.split()}}]),e}(),Do=(0,E.Z)("_scrollNode"),Ho=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this.kind="editor",this.options={lang:"zh-CN",locale:{},plugins:[],cards:[],config:{},iconFonts:"url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.woff2?t=1638071536645') format('woff2'), url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.woff?t=1638071536645') format('woff'), url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.ttf?t=1638071536645') format('truetype')"},this.container=void 0,this.language=void 0,this.root=void 0,this.card=void 0,this.plugin=void 0,this.node=void 0,this.nodeId=void 0,this.list=void 0,this.mark=void 0,this.inline=void 0,this.block=void 0,this.event=void 0,this.schema=void 0,this.conversion=void 0,this.command=void 0,this.clipboard=void 0,this.request=void 0,Object.defineProperty(this,Do,{writable:!0,value:null}),this.options=(0,s.Z)((0,s.Z)({},this.options),n);var i=this.options.iconFonts,o=document.querySelector("#am-iconfont");if(!o&&!1!==i){o=document.createElement("style"),o.setAttribute("type","text/css"),o.setAttribute("id","am-iconfont");var a='@font-face { font-family: "data-icon";';Array.isArray(i)&&(i=i.map((function(e){return"url('".concat(e.url,"') format('").concat(e.format,"')")})).join(",")),a+="src: ".concat(i,";}"),o.innerHTML=a,document.head.appendChild(o)}this.container=Ut(t),this.container.attributes(G,Y),this.language=new ki(this.options.lang||"zh-CN",O()(_i,null===n||void 0===n?void 0:n.locale)),this.event=new ht,this.command=new Oi(this),this.schema=new Zi,this.schema.add(Qt),this.conversion=new qi(this),Lt.forEach((function(e){return r.conversion.add(e.from,e.to)})),this.card=new eo(this,this.options.lazyRender),this.clipboard=new io(this),this.request=new Co,this.plugin=new Hi(this),this.node=new Rt(this),this.nodeId=new no(this.schema),this.list=new Eo(this),this.mark=new Fo(this),this.inline=new No(this),this.block=new Qo(this),this.root=Ut(this.options.root||this.container.parent()||document.body);var c=this.root.css("position");c&&"static"!==c||this.root.css("position","relative")}return(0,c.Z)(e,[{key:"scrollNode",get:function(){if((0,_.Z)(this,Do)[Do])return(0,_.Z)(this,Do)[Do];var e=this.options.scrollNode,t=e?"function"===typeof e?e():e:null,n=["auto","scroll"],r=this.container.parent();while(!t&&r&&r.length>0&&"body"!==r.name){if(n.includes(r.css("overflow"))||n.includes(r.css("overflow-y"))){t=r.get();break}r=r.parent()}return null===t&&(t=document.documentElement),(0,_.Z)(this,Do)[Do]=t?Ut(t):null,(0,_.Z)(this,Do)[Do]}},{key:"init",value:function(){this.mark.init(),this.inline.init(),this.block.init(),this.list.init();var e=this.options,t=e.plugins,n=e.cards,r=e.config;this.card.init(null!==n&&void 0!==n?n:[]);var i="function"===typeof r?r(this):null!==r&&void 0!==r?r:{};this.plugin.init(null!==t&&void 0!==t?t:[],i),this.nodeId.init()}},{key:"setScrollNode",value:function(e){(0,_.Z)(this,Do)[Do]=e?Ut(e):null}},{key:"on",value:function(e,t,n){return this.event.on(e,t,n),this}},{key:"off",value:function(e,t){return this.event.off(e,t),this}},{key:"trigger",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2?r-2:0),o=2;o2?r-2:0),o=2;o2?r-2:0),o=2;o0&&!e.collapsed&&0===e.endOffset&&(e.endContainer.previousSibling&&e.setEndAfter(e.endContainer.previousSibling),!e.collapsed&&e.endOffset>0&&e.endContainer.childNodes[e.endOffset-1]===i[0])){var o=e.startNode.closest("[".concat(be,'="center"]'),(function(e){var t;return Ut(e).isEditable()?void 0:(null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode)||void 0}));o.length>0?e.setEnd(o[0],o[0].childNodes.length):e.setEnd(i[0],i[0].childNodes.length)}var a=e.commonAncestorNode;if(i=a.closest("[".concat(fe,"]"),(function(e){var t;return Ut(e).isEditable()?void 0:(null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode)||void 0})),i.length>0){var s=a.closest("[".concat(be,'="center"]'),(function(e){var t;return Ut(e).isEditable()?void 0:(null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode)||void 0}));0===s.length&&(e.select(i),a=e.commonAncestorNode)}if((a.inEditor()||a.isRoot())&&!e.collapsed){var l=function(e){if(0===e.length)return{};for(var t=e.length-1;t>0;t--){var n=e[t];n.appendChild(e[t-1])}return{inner:e[0],outter:e[e.length-1]}};if(i=a.closest("[".concat(fe,"]"),(function(e){var t;return(null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode)||void 0})),i.length>0){var c=this.card.find(i);if(c&&c.getSelectionNodes){var A=c.getSelectionNodes();if(A.length>0){var u=l(A.map((function(e){return e[0]}))),d=u.inner,h=u.outter,p=A.map((function(e){return e.html()})).join(""),f=new un("
      ".concat(p,"
      "),this);p=f.toHTML(d,h);var g=new un(p,this).toText(this.schema,!0);return{html:p,text:g}}}else if(!(null===c||void 0===c?void 0:c.isEditable))return}var m,v=this.node,b=this.list,y=e.startNode.closest("li");if(y&&v.isCustomize(y)){var w=e.endNode.closest("li");if(!y.equal(w)||b.isLast(e)&&b.isFirst(e))if(b.isFirst(e)){var x=y.parent(),k=y.getIndex();x&&e.setStart(x,k<0?0:k)}else{var C,B,_=y.parent(),E=e.createSelection(),S=E.getNode(y,"center",!0);if(null===(C=E.anchor)||void 0===C||C.remove(),null===(B=E.focus)||void 0===B||B.remove(),st(this)&&this.change.combinText(),S.length>0){var F=!1;S.each((function(e,t){var n=S.eq(t);F||"li"!==(null===n||void 0===n?void 0:n.name)?F&&(null===n||void 0===n||n.remove()):F=!0}));var T=y.first(),M=T?this.card.find(T):void 0;M&&(m=S,this.list.addCardToCustomize(m,M.name,M.getValue()),_&&v.wrap(m,null===_||void 0===_?void 0:_.clone()))}}}var I=e.enlargeToElementNode(!0).cloneContents(),N=[];if(a.isText()&&1===I.childNodes.length&&(null===(n=I.firstChild)||void 0===n?void 0:n.nodeType)===Node.TEXT_NODE){var U=a.parent();while(U&&(v.isMark(U)||v.isInline(U)))N.push(U.clone(!1).get()),U=U.parent()}I.querySelectorAll("li").forEach((function(e){var t,n,i=Ut(e),o=i.attributes($);if(o){var a=null===(t=r.container.get())||void 0===t?void 0:t.querySelector("[".concat($,"=").concat(o,"]"));v.isCustomize(i)&&!(null===(n=i.first())||void 0===n?void 0:n.isCard())&&(null===a||void 0===a?void 0:a.firstChild)&&i.prepend(v.clone(Ut(a.firstChild),!0,!1));var s=null===a||void 0===a?void 0:a.parentElement;s=s?Ut(s.cloneNode(!1)):null;var l=e.parentElement;!(a&&s&&v.isList(s))||l&&v.isList(l)||("ol"===s.name&&s.removeAttributes("start"),v.wrap(e,s))}}));var L=l(N),Q=L.inner,D=L.outter,H=[];I.childNodes.forEach((function(e){var t=Ut(e);(v.isList(t)||"li"===t.name)&&H.push(t)})),this.nodeId.generateAll(Ut(I),!0),this.list.merge(H);var O=new un(I,this),z=O.toHTML(Q,D),Z=new un(z,this).toText(this.schema,!0);return{html:z,text:Z}}}}},{key:"destroy",value:function(){this.container.removeAttributes(G),this.event.destroy(),this.plugin.destroy(),this.card.destroy(),this.container.empty()}}]),e}(),Oo=' .data-icon {\n font-family: "data-icon" !important;\n font-size: 16px;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n .data-icon-block-image:before {\n content: "\\ea20";\n }\n\n .data-icon-inline-image:before {\n content: "\\e601";\n }\n\n .data-icon-no-border:before {\n content: "\\e608";\n }\n\n .data-icon-line-height:before {\n content: "\\e697";\n }\n\n .data-icon-text:before {\n content: "\\e600";\n }\n\n .data-icon-comment:before {\n content: "\\e73e";\n }\n\n .data-icon-huanyuan:before {\n content: "\\e60a";\n }\n\n .data-icon-label:before {\n content: "\\e714";\n }\n\n .data-icon-video:before {\n content: "\\e741";\n }\n\n .data-icon-table:before {\n content: "\\e6a8";\n }\n\n .data-icon-h:before {\n content: "\\e7a0";\n }\n\n .data-icon-collapse-subtree:before {\n content: "\\e754";\n }\n\n .data-icon-expand-subtree:before {\n content: "\\e792";\n }\n\n .data-icon-sub-node:before {\n content: "\\e78e";\n }\n\n .data-icon-sister-node:before {\n content: "\\e784";\n }\n\n .data-icon-sup:before {\n content: "\\e790";\n }\n\n .data-icon-sub:before {\n content: "\\e75a";\n }\n\n .data-icon-maximize:before {\n content: "\\e752";\n }\n\n .data-icon-codeblock:before {\n content: "\\e709";\n }\n\n .data-icon-emoji:before {\n content: "\\e73a";\n }\n\n .data-icon-h4:before {\n content: "\\e759";\n }\n\n .data-icon-h1:before {\n content: "\\e75b";\n }\n\n .data-icon-h5:before {\n content: "\\e75c";\n }\n\n .data-icon-h2:before {\n content: "\\e75d";\n }\n\n .data-icon-h3:before {\n content: "\\e760";\n }\n\n .data-icon-h6:before {\n content: "\\e761";\n }\n\n .data-icon-liuchengtu:before {\n content: "\\e61c";\n }\n\n .data-icon-website:before {\n content: "\\e694";\n }\n\n .data-icon-preferences:before {\n content: "\\e788";\n }\n\n .data-icon-hr:before {\n content: "\\e76a";\n }\n\n .data-icon-task-list:before {\n content: "\\e79f";\n }\n\n .data-icon-unordered-list:before {\n content: "\\e777";\n }\n\n .data-icon-ordered-list:before {\n content: "\\e795";\n }\n\n .data-icon-arrow-left:before {\n content: "\\e748";\n }\n\n .data-icon-arrow-up:before {\n content: "\\e769";\n }\n\n .data-icon-arrow-right:before {\n content: "\\e779";\n }\n\n .data-icon-arrow-down:before {\n content: "\\e79a";\n }\n\n .data-icon-moremark:before {\n content: "\\e772";\n }\n\n .data-icon-clean:before {\n content: "\\e74d";\n }\n\n .data-icon-paintformat:before {\n content: "\\e756";\n }\n\n .data-icon-lock:before {\n content: "\\e768";\n }\n\n .data-icon-loading:before {\n content: "\\e76b";\n }\n\n .data-icon-unlock:before {\n content: "\\e796";\n }\n\n .data-icon-collapse:before {\n content: "\\e79e";\n }\n\n .data-icon-align-bottom:before {\n content: "\\e72b";\n }\n\n .data-icon-attachment:before {\n content: "\\e72c";\n }\n\n .data-icon-bold:before {\n content: "\\e72d";\n }\n\n .data-icon-border-color:before {\n content: "\\e72e";\n }\n\n .data-icon-border-all:before {\n content: "\\e72f";\n }\n\n .data-icon-border-inner:before {\n content: "\\e730";\n }\n\n .data-icon-border-left:before {\n content: "\\e731";\n }\n\n .data-icon-border-bottom:before {\n content: "\\e732";\n }\n\n .data-icon-border-none:before {\n content: "\\e733";\n }\n\n .data-icon-box:before {\n content: "\\e734";\n }\n\n .data-icon-border-outer:before {\n content: "\\e735";\n }\n\n .data-icon-border-right:before {\n content: "\\e736";\n }\n\n .data-icon-clear:before {\n content: "\\e737";\n }\n\n .data-icon-close:before {\n content: "\\e738";\n }\n\n .data-icon-code-example:before {\n content: "\\e739";\n }\n\n .data-icon-clip:before {\n content: "\\e73b";\n }\n\n .data-icon-border-up:before {\n content: "\\e73c";\n }\n\n .data-icon-code:before {\n content: "\\e73d";\n }\n\n .data-icon-command:before {\n content: "\\e73f";\n }\n\n .data-icon-compact-display:before {\n content: "\\e740";\n }\n\n .data-icon-copy:before {\n content: "\\e742";\n }\n\n .data-icon-download:before {\n content: "\\e743";\n }\n\n .data-icon-deletecolumn:before {\n content: "\\e744";\n }\n\n .data-icon-cut:before {\n content: "\\e745";\n }\n\n .data-icon-decreasedecimalplace:before {\n content: "\\e746";\n }\n\n .data-icon-drag:before {\n content: "\\e747";\n }\n\n .data-icon-delete:before {\n content: "\\e749";\n }\n\n .data-icon-drag-circle:before {\n content: "\\e74a";\n }\n\n .data-icon-deleterow:before {\n content: "\\e74b";\n }\n\n .data-icon-edit:before {\n content: "\\e74c";\n }\n\n .data-icon-filter:before {\n content: "\\e74e";\n }\n\n .data-icon-expand:before {\n content: "\\e74f";\n }\n\n .data-icon-error:before {\n content: "\\e750";\n }\n\n .data-icon-freezerowcoloum:before {\n content: "\\e751";\n }\n\n .data-icon-freezefirstrow:before {\n content: "\\e753";\n }\n\n .data-icon-freezzecolumn:before {\n content: "\\e755";\n }\n\n .data-icon-border-style:before {\n content: "\\e757";\n }\n\n .data-icon-gotolink:before {\n content: "\\e758";\n }\n\n .data-icon-increasedecimalplace:before {\n content: "\\e75e";\n }\n\n .data-icon-insertrowbelow:before {\n content: "\\e75f";\n }\n\n .data-icon-image:before {\n content: "\\e762";\n }\n\n .data-icon-italic:before {\n content: "\\e763";\n }\n\n .data-icon-indent:before {\n content: "\\e764";\n }\n\n .data-icon-insertrowabove:before {\n content: "\\e765";\n }\n\n .data-icon-insertrowright:before {\n content: "\\e766";\n }\n\n .data-icon-left-circle-fill:before {\n content: "\\e767";\n }\n\n .data-icon-link:before {\n content: "\\e76c";\n }\n\n .data-icon-keyboard:before {\n content: "\\e76d";\n }\n\n .data-icon-more:before {\n content: "\\e76e";\n }\n\n .data-icon-merge-cells:before {\n content: "\\e76f";\n }\n\n .data-icon-outdent:before {\n content: "\\e770";\n }\n\n .data-icon-mention:before {\n content: "\\e771";\n }\n\n .data-icon-plus:before {\n content: "\\e773";\n }\n\n .data-icon-minus-circle-o:before {\n content: "\\e774";\n }\n\n .data-icon-highlight:before {\n content: "\\e775";\n }\n\n .data-icon-paste:before {\n content: "\\e776";\n }\n\n .data-icon-insertrowleft:before {\n content: "\\e778";\n }\n\n .data-icon-quote:before {\n content: "\\e77a";\n }\n\n .data-icon-plus-circle-o:before {\n content: "\\e77b";\n }\n\n .data-icon-right-circle-fill:before {\n content: "\\e77c";\n }\n\n .data-icon-question-circle-o:before {\n content: "\\e77d";\n }\n\n .data-icon-preview:before {\n content: "\\e77e";\n }\n\n .data-icon-reload:before {\n content: "\\e77f";\n }\n\n .data-icon-rotate-left:before {\n content: "\\e780";\n }\n\n .data-icon-math:before {\n content: "\\e781";\n }\n\n .data-icon-overflow:before {\n content: "\\e782";\n }\n\n .data-icon-redo:before {\n content: "\\e783";\n }\n\n .data-icon-searchreplace:before {\n content: "\\e785";\n }\n\n .data-icon-save:before {\n content: "\\e786";\n }\n\n .data-icon-singleselect:before {\n content: "\\e787";\n }\n\n .data-icon-rotate-right:before {\n content: "\\e789";\n }\n\n .data-icon-sort-ascending:before {\n content: "\\e78a";\n }\n\n .data-icon-sort-descending:before {\n content: "\\e78b";\n }\n\n .data-icon-toc:before {\n content: "\\e78c";\n }\n\n .data-icon-solit-cells:before {\n content: "\\e78d";\n }\n\n .data-icon-translate:before {\n content: "\\e78f";\n }\n\n .data-icon-successful:before {\n content: "\\e791";\n }\n\n .data-icon-strikethrough:before {\n content: "\\e793";\n }\n\n .data-icon-undo:before {\n content: "\\e794";\n }\n\n .data-icon-underline:before {\n content: "\\e797";\n }\n\n .data-icon-unlink:before {\n content: "\\e798";\n }\n\n .data-icon-wrap:before {\n content: "\\e799";\n }\n\n .data-icon-upload:before {\n content: "\\e79b";\n }\n\n .data-icon-zoom-out:before {\n content: "\\e79c";\n }\n\n .data-icon-zoom-in:before {\n content: "\\e79d";\n }\n\n .data-icon-align-center:before {\n content: "\\e725";\n }\n\n .data-icon-align-justify:before {\n content: "\\e726";\n }\n\n .data-icon-align-left:before {\n content: "\\e727";\n }\n\n .data-icon-align-top:before {\n content: "\\e728";\n }\n\n .data-icon-align-right:before {\n content: "\\e729";\n }\n\n .data-icon-align-middle:before {\n content: "\\e72a";\n }\n\n.data-anticon {\n display: inline-block;\n font-style: normal;\n vertical-align: -0.125em;\n text-align: center;\n text-transform: none;\n line-height: 0;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n}\n\n.data-anticon svg {\n display: inline-block;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes loadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.data-anticon .data-anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n.data-anticon > * {\n line-height: 1;\n}\n\n.am-engine {\n position: relative;\n background-color: #FFFFFF;\n}\n\n.am-engine.am-engine-placeholder:before {\n content: attr(data-placeholder);\n pointer-events: none;\n position: absolute;\n color: #bbbfc4;\n height: 0;\n}\n\n.am-engine ::-moz-selection {\n background: rgba(180, 213, 254, 0.5) !important;\n color: inherit!important;\n}\n\n.am-engine ::selection {\n background: rgba(180, 213, 254, 0.5) !important;\n color: inherit!important;\n}\n\n.am-engine , .am-engine-view {\n font-family: \'Chinese Quote\', \'Segoe UI\', Roboto, \'PingFang SC\', \'Hiragino Sans GB\', \'Microsoft YaHei\', \'Helvetica Neue\', Helvetica, Arial, sans-serif, \'Apple Color Emoji\';\n\tword-wrap: break-word;\n\toutline-style: none;\n\twhite-space: pre-wrap;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n font-size: 14px;\n line-height: 1.74;\n color: #262626;\n letter-spacing: .05em;\n /* pt / px 换算表:https://websemantics.uk/articles/font-size-conversion/ */\n}\n\n.am-engine > *:first-child,.am-engine-view > *:first-child {\n\tmargin-top: 0 !important;\n}\n\n.am-engine p , .am-engine-view p {\n white-space: normal;\n margin: 0;\n line-height: 1.74;\n}\n\n.am-engine [contenteditable="true"],.am-engine-view [contenteditable="true"] {\n\toutline-style: none;\n}\n\n.am-engine .selection-transparent::-moz-selection,.am-engine-view .selection-transparent::-moz-selection {\n\tbackground: transparent;\n}\n\n.am-engine .selection-transparent::selection,.am-engine-view .selection-transparent::selection {\n\tbackground: transparent;\n}\n/*---------------------------卡片 begin-----------------------*/\n\n.am-engine [data-card-type], .am-engine-view [data-card-type] {\n white-space: normal;\n}\n.am-engine span[data-card-type="inline"],.am-engine-view span[data-card-type="inline"] {\n\tdisplay: inline-block;\n\ttext-indent: 0;\n\tvertical-align: baseline;\n\twhite-space: initial;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element],.am-engine-view span[data-card-type="inline"] span[data-card-element] {\n\tdisplay: inline-block;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="center"],.am-engine-view span[data-card-type="inline"] span[data-card-element="center"] {\n\tvertical-align: bottom;\n border-radius: 2px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine span[data-card-type="inline"] span[data-card-element="right"],.am-engine-view span[data-card-type="inline"] span[data-card-element="right"] {\n\ttext-align: left;\n\t-webkit-user-select: text;\n\t -moz-user-select: text;\n\t user-select: text;\n min-width: 1px;\n background: transparent;\n bottom: 0;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"] {\n left: -1px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="right"],.am-engine-view span[data-card-type="inline"] span[data-card-element="right"] {\n right: -1px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"]::-moz-selection,\n.am-engine span[data-card-type="inline"] span[data-card-element="right"]::-moz-selection,.am-engine-view span[data-card-type="inline"] span[data-card-element="right"]::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"]::selection,\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"]::selection,\n.am-engine span[data-card-type="inline"] span[data-card-element="right"]::selection,.am-engine-view span[data-card-type="inline"] span[data-card-element="right"]::selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"],.am-engine-view div[data-card-type="block"],.am-engine span[data-card-type="inline"].data-card-block,.am-engine-view span[data-card-type="inline"].data-card-block {\n\tdisplay: block;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"] {\n\tbottom: 0;\n\tposition: absolute;\n\twidth: 2px;\n\toverflow: hidden;\n\toutline: none;\n\ttext-align: left;\n\ttext-indent: 0;\n\t-webkit-box-flex: 0;\n\tflex: 0 0 auto;\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t user-select: text;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"] {\n\tleft: -2px;\n\ttext-align: left;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"] {\n\tright: -2px;\n\ttext-align: right;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection {\n\tbackground: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::selection {\n\tbackground: transparent !important;\n}\n\n.am-engine span[data-card-element="body"],.am-engine-view span[data-card-element="body"],.am-engine div[data-card-element="body"],.am-engine-view div[data-card-element="body"] {\n\tposition: relative;\n}\n\n.am-engine span[data-card-element="body"] [data-card-element="center"],.am-engine-view span[data-card-element="body"] [data-card-element="center"],.am-engine div[data-card-element="body"] [data-card-element="center"],.am-engine-view div[data-card-element="body"] [data-card-element="center"] {\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t user-select: text;\n}\n.am-engine span[data-card-element="body"] [data-element="editable"],.am-engine div[data-card-element="body"] [data-element="editable"]\n{\n cursor: text;\n}\n/*---------------------------卡片 end-----------------------*/\n';en(Oo);var zo=function(e){(0,h.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;(0,l.Z)(this,n),i=t.call(this,e,r),i._readonly=!1,i._container=void 0,i.kind="engine",i.typing=void 0,i.model=void 0,i.change=void 0,i.history=void 0,i.hotkey=void 0,i.options=(0,s.Z)((0,s.Z)({},i.options),r),i.history=new $r((0,A.Z)(i)),i._container=new xi(i.container,{engine:(0,A.Z)(i),lang:i.options.lang,className:i.options.className,tabIndex:i.options.tabIndex,placeholder:i.options.placeholder,autoPrepend:i.options.autoPrepend,autoAppend:i.options.autoAppend}),i.root=Ut(i.options.root||i.container.parent()||rt().body);var o=i.root.css("position");return o&&"static"!==o||i.root.css("position","relative"),i._container.init(),i.change=new yn((0,A.Z)(i),{onChange:function(e){return i.trigger("change",e)},onSelect:function(){return i.trigger("select")},onSelectStart:function(){return i.trigger("selectStart")},onSelectEnd:function(){return i.trigger("selectEnd")},onRealtimeChange:function(e){i.trigger("realtimeChange",e)},onSetValue:function(){return i.trigger("afterSetValue")}}),i.change.init(),i.typing=new bi((0,A.Z)(i)),i._readonly=void 0!==i.options.readonly&&i.options.readonly,i._container.setReadonly(i._readonly),i.hotkey=new Yr((0,A.Z)(i)),i.init(),i.isEmpty()&&i._container.showPlaceholder(),i.model=jr.from((0,A.Z)(i)),i.model.resetRoot(),i}return(0,c.Z)(n,[{key:"readonly",get:function(){return this._readonly},set:function(e){this.readonly!==e&&(e?(this.hotkey.disable(),this._container.setReadonly(!0),this.model.mutation.stop()):(this.hotkey.enable(),this._container.setReadonly(!1),this.model.mutation.start()),this._readonly=e,this.card.reRender(),this.trigger("readonly",e))}},{key:"isFocus",value:function(){return this._container.isFocus()}},{key:"isEmpty",value:function(){return this.change.isEmpty()}},{key:"focus",value:function(e){this.change.range.focus(e)}},{key:"blur",value:function(){this.change.range.blur()}},{key:"getValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.change.getValue({ignoreCursor:e});return e?Pt.removeTags(t):t}},{key:"getValueAsync",value:function(){var e=(0,a.Z)(g().mark((function e(){var t,n,r=this,i=arguments;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]&&i[0],n=i.length>1?i[1]:void 0,e.abrupt("return",new Promise(function(){var e=(0,a.Z)(g().mark((function e(i,a){var s,l,c;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:s=g().mark((function e(t){var i,s;return g().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=r.plugin.components[t],e.next=3,new Promise((function(e){i.waiting?i.waiting(n).then((function(){return e(!0)})).catch(e):e(!0)}));case 3:if(s=e.sent,"object"!==(0,o.Z)(s)){e.next=7;break}return a(s),e.abrupt("return",{v:void 0});case 7:case"end":return e.stop()}}),e)})),e.t0=g().keys(r.plugin.components);case 2:if((e.t1=e.t0()).done){e.next=10;break}return l=e.t1.value,e.delegateYield(s(l),"t2",5);case 5:if(c=e.t2,"object"!==(0,o.Z)(c)){e.next=8;break}return e.abrupt("return",c.v);case 8:e.next=2;break;case 10:i(r.getValue(t));case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getHtml",value:function(){var e=Ut(this.container[0].cloneNode(!0));return e.removeAttributes(Dt),e.removeAttributes("tabindex"),e.removeAttributes("autocorrect"),e.removeAttributes("autocomplete"),e.removeAttributes("spellcheck"),e.removeAttributes("data-gramm"),e.removeAttributes(yi),e.removeClass(wi),e.removeAttributes("role"),new un(e,this).toHTML()}},{key:"initDocOnReadonly",value:function(){this.readonly&&this.model.resetRoot()}},{key:"setValue",value:function(e,t){return e=this.trigger("beforeSetValue",e)||e,this.change.setValue(e,void 0,t),this.normalize(),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setHtml",value:function(e,t){var n=this;return this.change.setHtml(e,(function(e){n.normalize(),n.container.allChildren("editable").forEach((function(e){n.node.isInline(e)?n.inline.repairCursor(e):n.node.isMark(e)&&n.mark.repairCursor(e)})),t&&t(e)})),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setMarkdown",value:function(e,t){var n=this;return this.change.setMarkdown(e,(function(e){n.normalize(),n.container.allChildren("editable").forEach((function(e){n.node.isInline(e)?n.inline.repairCursor(e):n.node.isMark(e)&&n.mark.repairCursor(e)})),t&&t(e)})),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setJsonValue",value:function(e,t){var n=this.model.toValue(e);return this.change.setValue(n,void 0,t),this.normalize(),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"getJsonValue",value:function(){return v()(this.model.root)}},{key:"getText",value:function(e){return new un(this.container,this).toText(this.schema,e)}},{key:"normalize",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.container,n=Ut("

      "),r=t.children();r.each((function(t,i){var o=r.eq(i);o&&(e.node.isBlock(o)?(n.get().childNodes.length>0&&o.before(n),n=Ut("

      ")):o.isCursor()||n.append(o))})),n.get().childNodes.length>0&&t.append(n),r=t.children(),r.each((function(t,n){var i=r.eq(n);if(i&&(e.node.removeMinusStyle(i,"text-indent"),e.node.isRootBlock(i))){var o=i.get().childNodes.length;if(0===o)i.append(Ut("
      "));else{var a=i.first();1===o&&"span"===(null===a||void 0===a?void 0:a.name)&&[Ae,le,ce].indexOf(a.attributes(G))>=0&&i.prepend(Ut("
      "))}}}))}},{key:"showPlaceholder",value:function(){this._container.showPlaceholder()}},{key:"hidePlaceholder",value:function(){this._container.hidePlaceholder()}},{key:"destroy",value:function(){this._container.destroy(),this.change.destroy(),this.hotkey.destroy(),this.typing.destroy(),this.model.destroy(),this.history.reset(),(0,u.Z)((0,d.Z)(n.prototype),"destroy",this).call(this)}}]),n}(Ho),Zo='.card-maximize-header {\r\n position: fixed !important;\r\n top: 0;\r\n right: 0;\r\n left: 0;\r\n z-index: 9999;\r\n height: 56px;\r\n background: #fff;\r\n border-bottom: 1px solid #e8e8e8;\r\n width: 100%;\r\n}\r\n\r\n.card-maximize-header .header-crumb {\r\n float: left;\r\n line-height: 32px;\r\n display: flex;\r\n height: 100%;\r\n align-items: center;\r\n -webkit-box-align: center;\r\n -ms-flex-align: center;\r\n}\r\n\r\n.card-maximize-header .header-crumb a\r\n{\r\n color: #595959 !important;\r\n font-size: 14px;\r\n cursor: pointer;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split {\r\n display: inline-block;\r\n vertical-align: middle;\r\n padding: 0 15px;\r\n font-size: 20px;\r\n padding-right: 8px;\r\n font-weight: 200;\r\n margin: 0 8px;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split + a {\r\n display: inline-block;\r\n vertical-align: middle;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split + a:hover {\r\n\tcolor: #8C8C8C;\r\n}\r\n\r\n.data-card-block-max > [data-card-element="body"] > [data-card-element="center"], .data-card-block-max > [data-card-element="body"] > [data-card-element="center"].data-card-background-selected {\r\n top: 96px;\r\n background: #fafafa !important;\r\n position: fixed!important;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 124;\r\n overflow: auto;\r\n padding: 20px;\r\n}\r\n\r\n.am-engine-mobile .data-card-block-max > [data-card-element="body"] > [data-card-element="center"],.am-engine-view .data-card-block-max > [data-card-element="body"] > [data-card-element="center"] {\r\n top:56px;\r\n}';en(Zo);var Ro=function(){function e(t,n){(0,l.Z)(this,e),this.card=void 0,this.node=void 0,this.editor=void 0,this.editor=t,this.card=n}return(0,c.Z)(e,[{key:"restore",value:function(){this.card.root.removeClass("data-card-block-max"),this.node&&(this.node.remove(),this.node=void 0);var e=this.editor;st(e)&&(e.trigger("card:minimize",this.card),e.history.reset())}},{key:"maximize",value:function(){var e=this;if(!this.node){var t=this.editor,n=t.language,r=n.get("maximize","back").toString(),i=Ut('

      \n \n
      "));i.on("click",(function(e){e.stopPropagation()})),this.card.root.addClass("data-card-block-max");var o=i.find(".header-crumb");o.on("click",(function(){e.card.minimize()}));var a=this.card.findByKey("body");null===a||void 0===a||a.prepend(i),st(t)&&(t.trigger("card:maximize",this.card),t.history.reset()),this.node=i}}}]),e}(),Po=".data-card-resize {\r\n position: absolute;\r\n bottom: -3px;\r\n right: 0px;\r\n left: 0px;\r\n margin: 0 auto;\r\n z-index: 2;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.data-card-resize-btn{\r\n background: #d9dbdd;\r\n border-radius: 3px;\r\n height: 6px;\r\n padding: 0 50px;\r\n display: block;\r\n}\r\n\r\n.data-card-resize-btn svg {\r\n display: block;\r\n color: #999;\r\n}\r\n\r\n.data-card-resize-btn:hover {\r\n cursor: row-resize;\r\n}";en(Po);var qo=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this.editor=void 0,this.card=void 0,this.point=void 0,this.options={},this.component=void 0,this.start=!1,this.touchStart=function(e){e.preventDefault(),e.cancelBubble=!0,r.point={x:e.targetTouches[0].clientX,y:e.targetTouches[0].clientY};var t=r.options.dragStart;t&&t(r.point)},this.dragStart=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0,r.point={x:e.clientX,y:e.clientY};var t=r.options.dragStart;t&&t(r.point)},this.dragMove=function(e){if(r.point){var t=r.options.dragMove;t&&t(e.clientY-r.point.y)}},this.touchMove=function(e){if(e.preventDefault(),r.point){var t=r.options.dragMove;t&&t(e.targetTouches[0].clientY-r.point.y)}},this.dragEnd=function(e){r.point=void 0;var t=r.options.dragEnd;t&&t()},this.editor=t,this.card=n}return(0,c.Z)(e,[{key:"create",value:function(e){this.options=e;var t=Ut('
      '));Ue?(t.on("touchstart",this.touchStart),t.on("touchmove",this.touchMove),t.on("touchend",this.dragEnd),t.on("touchcancel",this.dragEnd)):(t.on("dragstart",this.dragStart),document.addEventListener("mousemove",this.dragMove),document.addEventListener("mouseup",this.dragEnd)),t.on("click",(function(e){e.stopPropagation()})),this.component=t}},{key:"render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.card.root,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80;this.start=!1;var r=0,i=0,o=this.card;this.create({dragStart:function(){r=t.height(),e.start=!0,o.onActivate(!1)},dragMove:function(o){e.start&&(i=r+o,i=i0&&void 0!==arguments[0])||arguments[0];if((0,_.Z)(n,Wo)[Wo]&&0!==(0,_.Z)(n,Wo)[Wo].length&&(0,_.Z)(n,jo)[jo]&&0!==(0,_.Z)(n,jo)[jo].length){var t=(0,D.ZP)((0,_.Z)(n,Wo)[Wo].get(),(0,_.Z)(n,jo)[jo].get(),(0,s.Z)((0,s.Z)({},Jn[(0,_.Z)(n,Vo)[Vo]]),{},{targetOffset:(0,_.Z)(n,Go)[Go]}));if((0,_.Z)(n,Yo)[Yo]&&e){var r=Object.keys(Jn).find((function(e){var n=Jn[e].points;return n[0]===t.points[0]&&n[1]===t.points[1]}));(0,_.Z)(n,Wo)[Wo].attributes("data-placement",r),(0,_.Z)(n,Yo)[Yo]((0,s.Z)((0,s.Z)({},t),{},{align:r}))}}},(0,_.Z)(this,Ko)[Ko]=t}return(0,c.Z)(e,[{key:"bind",value:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,_.Z)(this,Vo)[Vo],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,_.Z)(this,Go)[Go],a=arguments.length>4?arguments[4]:void 0;((0,_.Z)(this,Wo)[Wo]=e,(0,_.Z)(this,jo)[jo]=t,(0,_.Z)(this,Vo)[Vo]=i,(0,_.Z)(this,Go)[Go]=o,(0,_.Z)(this,$o)[$o]=Ut('
      '),(0,_.Z)(this,$o)[$o].append((0,_.Z)(this,Wo)[Wo]),(0,_.Z)(this,Ko)[Ko].root.append((0,_.Z)(this,$o)[$o]),(0,_.Z)(this,Yo)[Yo]=a,Ue||window.addEventListener("scroll",this.updateListener,{passive:!0}),window.addEventListener("resize",this.updateListener),st((0,_.Z)(this,Ko)[Ko])&&!Ue)&&(null===(n=(0,_.Z)(this,Ko)[Ko].scrollNode)||void 0===n||n.on("scroll",this.updateListener,{passive:!0}));if(t&&t.length>0){var s={width:t.width(),height:t.height()};"undefined"!==typeof ResizeObserver&&((0,_.Z)(this,Jo)[Jo]=new ResizeObserver((function(){var e=t.width(),n=t.height();e===s.width&&n===s.height||(s={width:e,height:n},r.updateListener())})),(0,_.Z)(this,Jo)[Jo].observe(t.get()))}this.update()}},{key:"setOffset",value:function(e){(0,_.Z)(this,Go)[Go]=e}},{key:"destroy",value:function(){var e,t,n;((0,_.Z)(this,Yo)[Yo]=void 0,Ue||window.removeEventListener("scroll",this.updateListener),window.removeEventListener("resize",this.updateListener),st((0,_.Z)(this,Ko)[Ko])&&!Ue)&&(null===(n=(0,_.Z)(this,Ko)[Ko].scrollNode)||void 0===n||n.off("scroll",this.updateListener));null===(e=(0,_.Z)(this,Jo)[Jo])||void 0===e||e.disconnect(),null===(t=(0,_.Z)(this,$o)[$o])||void 0===t||t.remove()}}]),e}(),ta=".data-card-dnd {\r\n position: absolute;\r\n top: 0;\r\n left: -21px;\r\n right: auto;\r\n bottom: auto;\r\n width: 18px;\r\n height: 24px;\r\n line-height: 24px;\r\n font-size: 14px;\r\n font-weight: normal;\r\n display: none;\r\n opacity: 0;\r\n z-index: 125;\r\n transition: all 0.3s ease-in-out;\r\n background: rgba(255, 255, 255, 0.9);\r\n}\r\n\r\n.data-card-dnd-active {\r\n display: block;\r\n opacity: 1;\r\n cursor: pointer;\r\n}\r\n\r\n.data-card-dnd:hover {\r\n\tbackground: #f4f4f4;\r\n\tcolor: #595959;\r\n}\r\n\r\n.data-card-dnd-trigger {\r\n width: 18px;\r\n height: 24px;\r\n text-align: center;\r\n color: #BFBFBF;\r\n font-size: 16px;\r\n border-radius: 2px 2px;\r\n cursor: move;\r\n cursor: grab;\r\n cursor: -moz-grab;\r\n cursor: -webkit-grab;\r\n}\r\n\r\n.am-engine-view .data-toolbar-active {\r\n\tmin-width: 200px;\r\n}\r\n\r\n.data-card-toolbar.data-toolbar-block {\r\n\ttop: -48px;\r\n\tbottom: auto;\r\n\tdisplay: none;\r\n}\r\n\r\n.data-card-toolbar.data-card-toolbar-active {\r\n\tdisplay: block;\r\n}\r\n\r\n.data-card-toolbar.data-toolbar-active {\r\n\tdisplay: block;\r\n}";en(ta);var na=function(e){return-1===["button","input","dropdown","node","switch"].indexOf(e.type)},ra=(0,E.Z)("hideTimeout"),ia=(0,E.Z)("showTimeout"),oa=(0,E.Z)("defaultAlign"),aa=(0,E.Z)("dndNode"),sa=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this.card=void 0,this.toolbar=void 0,this.editor=void 0,this.offset=void 0,this.position=void 0,this.dndPosition=void 0,Object.defineProperty(this,ra,{writable:!0,value:null}),Object.defineProperty(this,ia,{writable:!0,value:null}),Object.defineProperty(this,oa,{writable:!0,value:"topLeft"}),Object.defineProperty(this,aa,{writable:!0,value:null}),this.clearHide=function(){(0,_.Z)(r,ra)[ra]&&clearTimeout((0,_.Z)(r,ra)[ra]),(0,_.Z)(r,ra)[ra]=null},this.clearShow=function(){(0,_.Z)(r,ia)[ia]&&clearTimeout((0,_.Z)(r,ia)[ia]),(0,_.Z)(r,ia)[ia]=null},this.enterHide=function(){r.clearShow(),(0,_.Z)(r,ra)[ra]=setTimeout((function(){var e,t;r.hide(),(0,_.Z)(r,ra)[ra]=null;var n=r.toolbar;null===n||void 0===n||null===(e=n.root)||void 0===e||e.off("mouseenter",r.clearHide),null===n||void 0===n||null===(t=n.root)||void 0===t||t.off("mouseleave",r.enterHide)}),200)},this.enterShow=function(){r.clearHide(),(0,_.Z)(r,ia)[ia]=setTimeout((function(){var e,t;(0,_.Z)(r,ia)[ia]=null,r.show();var n=r.toolbar;null===n||void 0===n||null===(e=n.root)||void 0===e||e.on("mouseenter",r.clearHide),null===n||void 0===n||null===(t=n.root)||void 0===t||t.on("mouseleave",r.enterHide)}),200)},this.editor=t,this.card=n,this.position=new ea(t),this.dndPosition=new ea(t),this.unbindEnterShow(),st(t)&&!t.readonly||this.bindEnterShow()}return(0,c.Z)(e,[{key:"setDefaultAlign",value:function(e){(0,_.Z)(this,oa)[oa]=e}},{key:"bindEnterShow",value:function(){this.card.root.on("mouseenter",this.enterShow),this.card.root.on("mouseleave",this.enterHide)}},{key:"unbindEnterShow",value:function(){this.card.root.off("mouseenter",this.enterShow),this.card.root.off("mouseleave",this.enterHide)}},{key:"setOffset",value:function(e){this.offset=e}},{key:"getContainer",value:function(){var e;return null===(e=this.toolbar)||void 0===e?void 0:e.root}},{key:"getDefaultItem",value:function(e){var t=this,n=this.editor,r=n.language,i=n.clipboard,o=n.card;switch(e.type){case"separator":return{key:"separator",type:"node",node:e.node||Ut('')};case"copy":return{key:"copy",type:"button",content:e.content||'',title:e.title||r.get("copy","title"),onClick:function(o,a){if(e.onClick)e.onClick(o,a);else{var s=i.copy(t.card.root[0],!0);s?n.messageSuccess("copy",r.get("copy","success")):n.messageError("copy",r.get("copy","error"))}}};case"delete":return{key:"delete",type:"button",content:e.content||'',title:e.title||r.get("delete","title").toString(),onClick:function(n,r){e.onClick?e.onClick(n,r):o.remove(t.card.root)}};case"maximize":return{key:"maximize",type:"button",content:e.content||'',title:e.title||r.get("maximize","title").toString(),onClick:function(n,r){e.onClick?e.onClick(n,r):t.card.maximize()}};case"more":return{key:"more",type:"dropdown",content:e.content||'',title:e.title||r.get("more","title").toString(),items:e.items}}}},{key:"getItems",value:function(){var e=this;if(!this.card.toolbar)return[[],[]];var t=this.card.toolbar(),n=[];return t.forEach((function(t){if(na(t))switch(t.type){case"dnd":break;default:var r=e.getDefaultItem(t);r&&n.push(r)}else n.push(t)})),[n,t]}},{key:"create",value:function(){this.hide();var e=this.getItems(),t=(0,w.Z)(e,2),n=t[0],r=t[1];if(n.length>0){var i=r.find((function(e){return na(e)&&"dnd"===e.type}));if(i&&!Ue&&"dnd"===i.type){var o=this.editor,a=o.root,s=o.language,l=this.createDnd(i.content||'',i.title||s.get("dnd","title").toString());a.append(l),(0,_.Z)(this,aa)[aa]=l}var c=new mr({items:n});c.root.addClass("data-card-toolbar"),c.root.attributes(Ee,this.card.id),c.render(Ut(document.body)),c.hide(),this.toolbar=c}}},{key:"update",value:function(){var e,t=this.getItems(),n=(0,w.Z)(t,1),r=n[0];null===(e=this.toolbar)||void 0===e||e.update({items:r})}},{key:"hide",value:function(){var e;null===(e=(0,_.Z)(this,aa)[aa])||void 0===e||e.remove(),this.dndPosition.destroy(),this.hideCardToolbar()}},{key:"show",value:function(e){this.showCardToolbar(e)}},{key:"hideCardToolbar",value:function(){var e;null===(e=this.toolbar)||void 0===e||e.destroy(),this.position.destroy()}},{key:"showDnd",value:function(){var e=this;(0,_.Z)(this,aa)[aa]&&0!==(0,_.Z)(this,aa)[aa].length&&(this.card.isMaximize?(0,_.Z)(this,aa)[aa].removeClass("data-card-dnd-active"):(0,_.Z)(this,aa)[aa].length>0&&((0,_.Z)(this,aa)[aa].addClass("data-card-dnd-active"),setTimeout((function(){e.dndPosition.bind((0,_.Z)(e,aa)[aa],e.card.root,"leftTop",e.offset)}))))}},{key:"showCardToolbar",value:function(e){var t=this;this.create();var n=this.getContainer();if(n&&n.length>0){this.showDnd();var r=this.card;n.addClass("data-toolbar-active"),n.attributes("toolbar-trigger-key",r.constructor.cardName),this.toolbar&&this.toolbar.show();var i=(0,_.Z)(this,oa)[oa],o=this.position;setTimeout((function(){o.bind(n,r.isMaximize?r.getCenter().first():r.root,(0,_.Z)(t,oa)[oa],t.offset,(function(e){t.offset&&4===t.offset.length&&"bottomLeft"===e.align&&e.align!==i?(o.setOffset([t.offset[2],t.offset[3]]),i=e.align,o.update(!1)):t.offset&&e.align===(0,_.Z)(t,oa)[oa]&&e.align!==i&&(o.setOffset(t.offset),i=e.align,o.update(!1)),i=e.align}))}),10)}}},{key:"createDnd",value:function(e,t){var n=this,r=Ut("
      \n
      \n ').concat(e,"\n
      \n
      "));return r.on("mouseenter",(function(){nr.show(r,t)})),r.on("mouseleave",(function(){nr.hide()})),r.on("mousedown",(function(e){e.stopPropagation(),nr.hide(),n.hideCardToolbar()})),r.on("mouseup",(function(){n.showCardToolbar()})),r}},{key:"destroy",value:function(){this.unbindEnterShow(),this.dndPosition.destroy(),this.position.destroy()}}]),e}(),la=function(){function e(t){var n,r=t.editor,i=t.value,o=t.root;(0,l.Z)(this,e),this.editor=void 0,this.root=void 0,this.toolbarModel=void 0,this.resizeModel=void 0,this.activatedByOther=!1,this.selectedByOther=!1,this.contenteditable=[],this.defaultMaximize=void 0,this.isMaximize=!1,this._id=void 0,this.resize=void 0,this.editor=r;var a=(null===(n=i)||void 0===n?void 0:n.type)||this.constructor.cardType,s="inline"===a?"span":"div";this.root=o||Ut("<".concat(s," />")),"string"===typeof i&&(i=Ye(i)),i=i||{},i.id=this.getId(i.id),this._id=i.id,i.type=a,this.setValue(i),this.defaultMaximize=new Ro(r,this)}return(0,c.Z)(e,[{key:"isEditable",get:function(){return this.contenteditable.length>0}},{key:"activated",get:function(){return this.root.hasClass("card-activated")}},{key:"setActivated",value:function(e){e?this.root.addClass("card-activated"):this.root.removeClass("card-activated")}},{key:"selected",get:function(){return this.root.hasClass("card-selected")}},{key:"setSelected",value:function(e){e?this.root.addClass("card-selected"):this.root.removeClass("card-selected")}},{key:"id",get:function(){if(this._id)return this._id;var e=this.root.attributes(ve);if(!e)return{};var t=Ye(e);return"object"===(0,o.Z)(t)&&(null===t||void 0===t?void 0:t.id)||""}},{key:"name",get:function(){return this.root.attributes(fe)}},{key:"type",get:function(){var e=this.root.attributes(me);if(!e){var t=this.root.attributes(ve),n=Ye(t||"{}");e=(null===n||void 0===n?void 0:n.type)||this.constructor.cardType}return e},set:function(e){if(this.name&&e!==this.type){var t=this.editor.card,n=this.root.attributes(ve),r=Ye(n||"{}"),i=t.replace(this,this.name,(0,s.Z)((0,s.Z)({},r),{},{type:e}));t.render(i.root),i.activate(!1),t.activate(i.root)}}},{key:"loading",get:function(){return!!this.root.attributes(ye)}},{key:"init",value:function(){this.root.attributes(we,this.isEditable?"true":"false");var e=this.toolbarModel;null===e||void 0===e||e.hide(),null===e||void 0===e||e.destroy();var t=this.editor;this.toolbar&&(this.toolbarModel=new sa(t,this)),this.resize&&(this.resizeModel=new qo(t,this))}},{key:"getId",value:function(e){var t=[];if(this.editor.card.each((function(e){t.push(e.id)})),e&&t.indexOf(e)<0)return e;var n=Oe();while(t.indexOf(n)>=0)n=Oe();return n}},{key:"setValue",value:function(e){if(null!=e){var t=this.root.attributes(ve),n=Ye(t||"{}");(null===n||void 0===n?void 0:n.id)&&delete e["id"],e=(0,s.Z)((0,s.Z)({},n),e),e.type&&(null===n||void 0===n?void 0:n.type)!==e.type&&(this.type=e.type),this.root.attributes(ve,$e(e))}}},{key:"getValue",value:function(){var e=this.root.attributes(ve);return e?Ye(e):{}}},{key:"find",value:function(e){return this.root.find(e)}},{key:"findByKey",value:function(e){var t=this.root.first()||Ut([]);if("body"===e||0===t.length)return t;var n=t.children(),r=["left","center","right"].indexOf(e);if(r>-1)return n.toArray().find((function(t){return t.attributes(be)===e}));var i=this.type===nn.BLOCK?"div":"span",o=this.find("".concat(i,"[").concat(be,"=").concat(e,"]"));return o.name===i&&o.attributes(be)===e?o:void 0}},{key:"activate",value:function(e){e?this.activated||(this.setActivated(e),this.onActivate(e)):this.activated&&(this.setActivated(e),this.onActivate(!1))}},{key:"select",value:function(e){st(this.editor)&&!this.activatedByOther&&(e?this.selected||this.isMaximize||(this.setSelected(e),this.onSelect(e)):this.selected&&(this.setSelected(e),this.onSelect(!1)))}},{key:"getCenter",value:function(){var e=this.findByKey("center");return e||Ut([])}},{key:"isCenter",value:function(e){var t,n=e.closest(this.type===nn.BLOCK?"div[".concat(be,"=center]"):"span[".concat(be,"=center]"));return n.length>0&&!!(null===(t=this.findByKey("center"))||void 0===t?void 0:t.equal(n))}},{key:"isCursor",value:function(e){return this.isLeftCursor(e)||this.isRightCursor(e)}},{key:"isLeftCursor",value:function(e){var t;if(e.isElement()&&"left"!==e.attributes(be))return!1;var n=e.closest(Ce);return n.length>0&&!!(null===(t=this.findByKey("left"))||void 0===t?void 0:t.equal(n))}},{key:"isRightCursor",value:function(e){var t;if(e.isElement()&&"right"!==e.attributes(be))return!1;var n=e.closest(_e);return n.length>0&&!!(null===(t=this.findByKey("right"))||void 0===t?void 0:t.equal(n))}},{key:"focus",value:function(e,t){var n=this.findByKey("left"),r=this.findByKey("right");if(n&&0!==n.length&&r&&0!==r.length){var i=t?n:r;e.select(i,!0).shrinkToTextNode();var o=i.first();o&&(e.setStart(o,t?0:1),e.collapse(!0),st(this.editor)&&this.editor.change.range.select(e),this.onFocus&&this.onFocus())}}},{key:"maximize",value:function(){var e;this.isMaximize=!0,this.defaultMaximize.maximize(),null===(e=this.toolbarModel)||void 0===e||e.show()}},{key:"minimize",value:function(){var e;this.isMaximize=!1,this.defaultMaximize.restore(),null===(e=this.toolbarModel)||void 0===e||e.show()}},{key:"onSelect",value:function(e){var t=this.constructor.selectStyleType;if(t!==on.NONE){var n="data-card-".concat(t,"-selected"),r=this.getCenter();e?r.addClass(n):r.removeClass(n)}}},{key:"onSelectByOther",value:function(e,t){var n=this.getCenter(),r=this.constructor.selectStyleType;r===on.BACKGROUND?n.css("background-color",e?t.rgb:""):n.css("outline",e?"2px solid "+t.color:"");var i="card-selected-other";return e?this.root.addClass(i):this.root.removeClass(i),n}},{key:"onActivate",value:function(e){var t,n;this.resize&&(e?null===(t=this.resizeModel)||void 0===t||t.show():null===(n=this.resizeModel)||void 0===n||n.hide())}},{key:"onActivateByOther",value:function(e,t){return this.onSelectByOther(e,t)}},{key:"initToolbar",value:function(){var e,t;this.toolbar?(this.toolbarModel||(this.toolbarModel=new sa(this.editor,this)),this.activated&&this.toolbarModel.show()):(null===(e=this.toolbarModel)||void 0===e||e.hide(),null===(t=this.toolbarModel)||void 0===t||t.destroy(),this.toolbarModel=void 0)}},{key:"initResize",value:function(){if(this.resize){this.resizeModel||(this.resizeModel=new qo(this.editor,this));var e,t="function"===typeof this.resize?this.resize():this.findByKey("body");if(t&&t.length>0)null===(e=this.resizeModel)||void 0===e||e.render(t)}}},{key:"didUpdate",value:function(){this.initResize(),this.initToolbar()}},{key:"beforeRender",value:function(){var e=this.getCenter(),t=Ut("<".concat(this.type===nn.BLOCK?"div":"span",' class="').concat(ye,'" ').concat(G,'="').concat(J,'" />'));t.append(''),e.empty().append(t)}},{key:"didRender",value:function(){var e=this;this.loading&&(this.find(".".concat(ye)).remove(),setTimeout((function(){e.root.removeAttributes(ye)}),200)),this.initResize(),this.initToolbar(),this.isEditable&&this.editor.nodeId.generateAll(this.getCenter().get())}},{key:"destroy",value:function(){var e,t,n,r;null===(e=this.toolbarModel)||void 0===e||e.hide(),null===(t=this.toolbarModel)||void 0===t||t.destroy(),this.toolbarModel=void 0,null===(n=this.resizeModel)||void 0===n||n.hide(),null===(r=this.resizeModel)||void 0===r||r.destroy(),this.resizeModel=void 0}}]),e}();la.cardName=void 0,la.cardType=void 0,la.autoActivate=void 0,la.autoSelected=!0,la.singleSelectable=void 0,la.collab=!0,la.focus=void 0,la.selectStyleType=on.BORDER,la.lazyRender=!1;var ca=function(e){(0,h.Z)(n,e);var t=(0,p.Z)(n);function n(e,r){var i;return(0,l.Z)(this,n),i=t.call(this,e,r),i.kind="view",i.init(),i.container.hasClass(se)||i.container.addClass(se),i}return(0,c.Z)(n,[{key:"render",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new un(e,this),i=r.toValue(this.schema,this.conversion,!1,!0);this.container.html(i),this.card.render(this.container,(function(){n&&t.trigger("render",t.container)}))}}]),n}(Ho),Aa=".data-scrollable::-webkit-scrollbar {\r\n display: none;\r\n overflow: hidden;\r\n }\r\n .data-scrollable.scroll-x {\r\n padding-bottom: 10px;\r\n overflow-x: hidden;\r\n }\r\n \r\n .data-scrollable.scroll-y {\r\n padding-right: 10px;\r\n overflow-y: hidden;\r\n }\r\n\r\n .data-scrollable:hover .data-scrollbar {\r\n display: block;\r\n }\r\n .data-scrollable.scrolling {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n }\r\n .data-scrollable.scrolling .data-scrollbar {\r\n display: block;\r\n }\r\n .data-scrollable .data-scrollbar {\r\n display: none;\r\n position: absolute;\r\n cursor: default;\r\n transition: opacity 0.3s ease-in-out;\r\n }\r\n .data-scrollable .data-scrollbar .data-scrollbar-trigger {\r\n position: absolute;\r\n background: #c1c1c1;\r\n border-radius: 10px;\r\n cursor: pointer;\r\n }\r\n .data-scrollable .data-scrollbar .data-scrollbar-trigger:hover {\r\n background: #888;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-x {\r\n height: 8px;\r\n bottom: 0px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\r\n height: 8px;\r\n min-width: 60px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-y {\r\n top: 0;\r\n width: 8px;\r\n height: 100%;\r\n right: 0px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-y .data-scrollbar-trigger {\r\n width: 8px;\r\n min-height: 60px;\r\n }\r\n .data-scrollable .scrollbar-shadow-left {\r\n position: absolute;\r\n z-index: 10;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n opacity: 0.8;\r\n background: linear-gradient(270deg, rgba(99, 114, 130, 0) 0, rgba(99, 114, 130, 0.16));\r\n background: -webkit-linear-gradient(right, rgba(99, 114, 130, 0), rgba(99, 114, 130, 0.16));\r\n pointer-events: none;\r\n }\r\n .data-scrollable .scrollbar-shadow-right {\r\n position: absolute;\r\n z-index: 10;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n opacity: 0.8;\r\n background: linear-gradient(90deg, rgba(99, 114, 130, 0) 0, rgba(99, 114, 130, 0.16));\r\n background: -webkit-linear-gradient(left, rgba(99, 114, 130, 0), rgba(99, 114, 130, 0.16));\r\n pointer-events: none;\r\n }";en(Aa);var ua=(0,E.Z)("observer"),da=(0,E.Z)("reverse"),ha=(0,E.Z)("content"),pa=(0,E.Z)("enableScroll"),fa=(0,E.Z)("scroll"),ga=(0,E.Z)("isScrolling"),ma=function(e){(0,h.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4?arguments[4]:void 0;return(0,l.Z)(this,n),r=t.call(this),r.container=void 0,r.x=void 0,r.y=void 0,r.shadow=void 0,r.scrollBarX=void 0,r.slideX=void 0,r.slideXDragging=void 0,r.scrollBarY=void 0,r.slideY=void 0,r.slideYDragging=void 0,r.shadowLeft=void 0,r.shadowRight=void 0,r.oWidth=0,r.oHeight=0,r.sWidth=0,r.sHeight=0,r.xWidth=0,r.yHeight=0,Object.defineProperty((0,A.Z)(r),ua,{writable:!0,value:void 0}),Object.defineProperty((0,A.Z)(r),da,{writable:!0,value:void 0}),Object.defineProperty((0,A.Z)(r),ha,{writable:!0,value:void 0}),r.shadowTimer=void 0,Object.defineProperty((0,A.Z)(r),pa,{writable:!0,value:!0}),Object.defineProperty((0,A.Z)(r),fa,{writable:!0,value:void 0}),Object.defineProperty((0,A.Z)(r),ga,{writable:!0,value:!1}),r.refresh=function(){var e=r.container.get();if(e){var t,n,i=function(){setTimeout((function(){(0,_.Z)((0,A.Z)(r),ga)[ga]=!1}),0)},o=e.scrollTop,a=null===(t=(0,_.Z)((0,A.Z)(r),ha)[ha])||void 0===t?void 0:t.get(),s=Ge(r.container.css("padding-left")),l=Ge(r.container.css("padding-right")),c=Ge(r.container.css("padding-top")),u=Ge(r.container.css("padding-bottom")),d=a?(0,_.Z)((0,A.Z)(r),ha)[ha].width()+s+l:e.scrollWidth,h=a?(0,_.Z)((0,A.Z)(r),ha)[ha].height()+c+u:e.scrollHeight;if(r.oWidth=r.getWidth(),r.oHeight=r.container.height()-Ge(r.container.css("border-top-width"))-Ge(r.container.css("border-bottom-width")),r.sWidth=d,r.sHeight=h,r.xWidth=Math.floor(r.oWidth*r.oWidth/d),r.yHeight=Math.floor(r.oHeight*r.oHeight/h),r.x){var p,f,g,m;null===(p=r.slideX)||void 0===p||p.css("width",r.xWidth+"px");var v=Math.round(r.oWidth)-s-l===r.sWidth||a&&Math.round((0,_.Z)((0,A.Z)(r),ha)[ha].width())<=Math.round(r.oWidth-s-l)?"none":"block";null===(f=r.slideX)||void 0===f||f.css("display",v),r.emit("display",v),null===(g=r.shadowLeft)||void 0===g||g.css("display",v),null===(m=r.shadowRight)||void 0===m||m.css("display",v)}if(r.y){var b,y;null===(b=r.slideY)||void 0===b||b.css("height",r.yHeight+"px");var w=Math.round(r.oHeight)-c-u===r.sHeight||a&&Math.round((0,_.Z)((0,A.Z)(r),ha)[ha].height())<=Math.round(r.oHeight-c-u)?"none":"block";null===(y=r.slideY)||void 0===y||y.css("display",w),r.emit("display",w)}if(r.x&&a&&e.scrollWidth-s-l>(0,_.Z)((0,A.Z)(r),ha)[ha].width()){(0,_.Z)((0,A.Z)(r),ga)[ga]=!0;var x=e.scrollWidth-s-l-(0,_.Z)((0,A.Z)(r),ha)[ha].width();if((0,_.Z)((0,A.Z)(r),fa)[fa]){var k=(0,_.Z)((0,A.Z)(r),fa)[fa],C=k.onScrollX,B=k.getScrollLeft;if(x=B?B(-0)+e.scrollLeft-x:e.scrollLeft-x,x<0&&(x=0),C){var E=C(x);e.scrollLeft=E>0?E:0}r.scroll({left:x})}else e.scrollLeft-=x,i();return}if(r.y&&a&&e.scrollHeight-c-u!==(0,_.Z)((0,A.Z)(r),ha)[ha].height())return(0,_.Z)((0,A.Z)(r),ga)[ga]=!0,e.scrollTop-=e.scrollHeight-c-u-(0,_.Z)((0,A.Z)(r),ha)[ha].height(),void i();var S=(null===(n=(0,_.Z)((0,A.Z)(r),fa)[fa])||void 0===n?void 0:n.getScrollLeft)?(0,_.Z)((0,A.Z)(r),fa)[fa].getScrollLeft(e.scrollLeft):e.scrollLeft;if((0,_.Z)((0,A.Z)(r),fa)[fa]){var F=(0,_.Z)((0,A.Z)(r),fa)[fa].onScrollX;if(F){(0,_.Z)((0,A.Z)(r),ga)[ga]=!0;var T=F(S);e.scrollLeft=T>0?T:0,i()}r.scroll({left:S})}else r.reRenderX(S);r.reRenderY(o)}},r.scroll=function(e){var t=0,n=0;if(!(0,_.Z)((0,A.Z)(r),fa)[fa]&&e instanceof Event){var i=e.target,o=i.scrollTop,a=i.scrollLeft;t=o,n=a}else{if(e instanceof Event)return(0,_.Z)((0,A.Z)(r),ga)[ga]?void 0:void r.refresh();var s,l;void 0===e.top&&(e.top=(null===(s=r.container.get())||void 0===s?void 0:s.scrollTop)||0);void 0===e.left&&(e.left=(null===(l=r.container.get())||void 0===l?void 0:l.scrollLeft)||0);t=e.top,n=e.left}r.reRenderX(n),r.reRenderY(t)},r.wheelXScroll=j()((function(e){var t,n;e.preventDefault();var i=(De?e.wheelDeltaX:e.wheelDelta/120||-e.detail)>0?"up":"down",o=r.container.get();if(o){var a=r.container.width(),s=(null===(t=(0,_.Z)((0,A.Z)(r),fa)[fa])||void 0===t?void 0:t.getOffsetWidth)?(0,_.Z)((0,A.Z)(r),fa)[fa].getOffsetWidth(a):a,l=Math.max(s/(De?20-Math.abs(e.wheelDelta):8),20),c=((null===(n=(0,_.Z)((0,A.Z)(r),fa)[fa])||void 0===n?void 0:n.getScrollLeft)?(0,_.Z)((0,A.Z)(r),fa)[fa].getScrollLeft(o.scrollLeft):o.scrollLeft)+("up"===i?-l:l);if(c="up"===i?Math.max(0,c):Math.min(c,r.sWidth-r.oWidth),(0,_.Z)((0,A.Z)(r),fa)[fa]){var u=(0,_.Z)((0,A.Z)(r),fa)[fa].onScrollX;if(u){var d=u(c);o.scrollLeft=d>0?d:0}r.scroll({left:c})}else o.scrollLeft=c}}),De?50:0,{trailing:!0}),r.wheelYScroll=j()((function(e){e.preventDefault();var t=(De?e.wheelDeltaX:e.wheelDelta/120||-e.detail)>0?"up":"down",n=r.container.get();if(n){var i=r.container.height(),o=Math.max(i/(De?20-Math.abs(e.wheelDelta):8),20),a=n.scrollTop+("up"===t?-o:o);a="up"===t?Math.max(0,a):Math.min(a,r.sHeight-r.oHeight),n.scrollTop=a}}),De?100:0,{trailing:!0}),r.bindWheelScroll=function(e){if((0,_.Z)((0,A.Z)(r),pa)[pa]){var t=r.x&&e.wheelDeltaX!==e.wheelDeltaY&&Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY);t?r.slideX&&"none"!==r.slideX.css("display")&&r.wheelXScroll(e):r.y&&0!==e.wheelDeltaY&&r.slideY&&"none"!==r.slideY.css("display")&&r.wheelYScroll(e)}},r.bindContainerTouchX=function(e){e.target&&(0,_.Z)((0,A.Z)(r),pa)[pa]&&(Ut(e.target).hasClass("data-scrollbar-trigger")||((0,_.Z)((0,A.Z)(r),da)[da]=!0,r.scrollXStart(e)))},r.bindContainerTouchY=function(e){e.target&&(0,_.Z)((0,A.Z)(r),pa)[pa]&&(Ut(e.target).hasClass("data-scrollbar-trigger")||((0,_.Z)((0,A.Z)(r),da)[da]=!0,r.scrollYStart(e)))},r.getEventClientOffset=function(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.touches[0].clientX,y:e.touches[0].clientY}},r.scrollX=function(e){if(r.slideXDragging){var t,n=r.slideXDragging,i=n.point,o=n.position,a=r.getEventClientOffset(e),s=(0,_.Z)((0,A.Z)(r),da)[da]?o-(a.x-i):o+(a.x-i);s=Math.max(0,Math.min(s,r.oWidth-r.xWidth)),null===(t=r.slideX)||void 0===t||t.css("left",s+"px");var l=s/(r.oWidth-r.xWidth);l=Math.min(1,l);var c=r.container.get(),u=(r.sWidth-r.oWidth)*l;if((0,_.Z)((0,A.Z)(r),fa)[fa]){var d=(0,_.Z)((0,A.Z)(r),fa)[fa].onScrollX;if(d){var h=d(u);c.scrollLeft=h>0?h:0}r.scroll({left:u})}else c.scrollLeft=u}},r.scrollY=function(e){if(r.slideYDragging){var t,n=r.slideYDragging,i=n.point,o=n.position,a=r.getEventClientOffset(e),s=(0,_.Z)((0,A.Z)(r),da)[da]?o-(a.y-i):o+(a.y-i);s=Math.max(0,Math.min(s,r.oHeight-r.yHeight)),null===(t=r.slideY)||void 0===t||t.css("top",s+"px");var l=s/(r.oHeight-r.yHeight);l=Math.min(1,l),r.container.get().scrollTop=(r.sHeight-r.oHeight)*l}},r.scrollXEnd=function(){r.slideXDragging=void 0,(0,_.Z)((0,A.Z)(r),da)[da]=!1,document.body.removeEventListener(Ue?"touchmove":"mousemove",r.scrollX),document.body.removeEventListener(Ue?"touchend":"mouseup",r.scrollXEnd),r.container.removeClass("scrolling")},r.scrollYEnd=function(){r.slideYDragging=void 0,document.body.removeEventListener(Ue?"touchmove":"mousemove",r.scrollY),document.body.removeEventListener(Ue?"touchend":"mouseup",r.scrollYEnd),r.container.removeClass("scrolling")},r.scrollXStart=function(e){var t,n=r.getEventClientOffset(e);r.container.addClass("scrolling"),r.slideXDragging={point:n.x,position:parseInt((null===(t=r.slideX)||void 0===t?void 0:t.css("left"))||"0")},document.body.addEventListener(Ue?"touchmove":"mousemove",r.scrollX,{passive:!0}),document.body.addEventListener(Ue?"touchend":"mouseup",r.scrollXEnd,{passive:!0})},r.scrollYStart=function(e){var t,n=r.getEventClientOffset(e);r.container.addClass("scrolling"),r.slideYDragging={point:n.y,position:parseInt((null===(t=r.slideY)||void 0===t?void 0:t.css("top"))||"0")},document.body.addEventListener(Ue?"touchmove":"mousemove",r.scrollY,{passive:!0}),document.body.addEventListener(Ue?"touchend":"mouseup",r.scrollYEnd,{passive:!0})},r.bindXScrollEvent=function(){var e;r.x&&(null===(e=r.slideX)||void 0===e||e.on(Ue?"touchstart":"mousedown",r.scrollXStart,{passive:!0}))},r.bindYScrollEvent=function(){var e;r.y&&(null===(e=r.slideY)||void 0===e||e.on(Ue?"touchstart":"mousedown",r.scrollYStart,{passive:!0}))},r.reRenderShadow=function(e){if(r.shadow){var t,n,i=r.container.get();if(i)null===(n=r.shadowLeft)||void 0===n||n.css("left",((0,_.Z)((0,A.Z)(r),fa)[fa]?i.scrollLeft:e)+"px");null===(t=r.shadowRight)||void 0===t||t.css("left",e+r.oWidth-4+"px")}},r.reRenderX=function(e){if(r.x){var t,n,i;null===(t=r.scrollBarX)||void 0===t||t.css("left",e+"px");var o=r.sWidth-r.oWidth,a=o<=0?0:e/o;a=Math.min(1,a),null===(n=r.slideX)||void 0===n||n.css("left",(r.oWidth-r.xWidth)*a+"px"),r.emit("change",{x:e,y:Ge((null===(i=r.scrollBarY)||void 0===i?void 0:i.css("top"))||"0")}),r.oWidth=r.getWidth(),r.reRenderShadow(e)}},r.reRenderY=function(e){if(r.y){var t,n,i;null===(t=r.scrollBarY)||void 0===t||t.css("top",e+"px");var o=r.sHeight-r.oHeight,a=o<=0?0:e/o;a=Math.min(1,a),null===(n=r.slideY)||void 0===n||n.css("top",(r.oHeight-r.yHeight)*a+"px"),r.emit("change",{x:Ge((null===(i=r.scrollBarX)||void 0===i?void 0:i.css("left"))||"0"),y:e})}},r.container=gt(e)?Ut(e):e,r.x=i,r.y=o,r.shadow=a,(0,_.Z)((0,A.Z)(r),fa)[fa]=s,r.init(),r}return(0,c.Z)(n,[{key:"setContentNode",value:function(e){(0,_.Z)(this,ha)[ha]=e&>(e)?Ut(e):e}},{key:"init",value:function(){var e=this.container.children(),t=!1;e.each((function(e){!t&&Ut(e).hasClass("data-scrollbar")&&(t=!0)})),t||(this.container.css("position","relative"),this.container.addClass("data-scrollable"),this.x&&(this.scrollBarX=Ut("
      ')),this.slideX=this.scrollBarX.find(".data-scrollbar-trigger"),this.container.append(this.scrollBarX),this.container.addClass("scroll-x")),this.y&&(this.scrollBarY=Ut("
      ')),this.slideY=this.scrollBarY.find(".data-scrollbar-trigger"),this.container.append(this.scrollBarY),this.container.addClass("scroll-y")),this.shadow&&(this.shadowLeft=Ut("
      ')),this.shadowRight=Ut("
      ')),this.container.append(this.shadowLeft),this.container.append(this.shadowRight)),this.refresh(),this.bindEvents())}},{key:"getWidth",value:function(){var e,t=this.container.get();if(!t)return 0;var n=this.container.width(),r=(null===(e=(0,_.Z)(this,fa)[fa])||void 0===e?void 0:e.getOffsetWidth)?(0,_.Z)(this,fa)[fa].getOffsetWidth(n):n;return r}},{key:"enableScroll",value:function(){(0,_.Z)(this,pa)[pa]=!0}},{key:"disableScroll",value:function(){(0,_.Z)(this,pa)[pa]=!1}},{key:"bindEvents",value:function(){Ue?(this.x&&this.container.on("touchstart",this.bindContainerTouchX,{passive:!0}),this.y&&this.container.on("touchstart",this.bindContainerTouchY,{passive:!0})):this.container.on(Ie?"DOMMouseScroll":"mousewheel",this.bindWheelScroll),this.container.on("scroll",this.scroll,{passive:!0});var e=this.container.get();e&&(window.addEventListener("resize",this.refresh),this.bindXScrollEvent(),this.bindYScrollEvent())}},{key:"destroy",value:function(){var e,t,n,r,i,o,a;(null===(e=this.slideX)||void 0===e||e.off(Ue?"touchstart":"mousedown",this.scrollXStart),null===(t=this.slideY)||void 0===t||t.off(Ue?"touchstart":"mousedown",this.scrollYStart),Ue?(this.x&&this.container.off("touchstart",this.bindContainerTouchX),this.y&&this.container.off("touchstart",this.bindContainerTouchY)):this.container.off(Ie?"DOMMouseScroll":"mousewheel",this.bindWheelScroll),this.container.off("scroll",this.scroll),this.container.removeClass("data-scrollable"),this.x)&&(null===(r=this.scrollBarX)||void 0===r||r.remove(),this.container.removeClass("scroll-x"));this.y&&(null===(i=this.scrollBarY)||void 0===i||i.remove(),this.container.removeClass("scroll-y"));this.shadow&&(null===(o=this.shadowLeft)||void 0===o||o.remove(),null===(a=this.shadowRight)||void 0===a||a.remove());null===(n=(0,_.Z)(this,ua)[ua])||void 0===n||n.disconnect(),window.removeEventListener("resize",this.refresh),window.removeEventListener("scroll",this.refresh)}}]),n}(I.EventEmitter2),va=".data-resizer {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n top: 0;\r\n left: 0;\r\n bottom: 0px;\r\n right: 0;\r\n z-index: 1;\r\n outline: 2px solid #1890FF;\r\n max-width: initial !important;\r\n}\r\n.data-resizer img {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n bottom: 0;\r\n right: 0;\r\n cursor: pointer;\r\n width: 100%;\r\n height: 100%;\r\n opacity: 0.3;\r\n}\r\n.data-resizer-holder {\r\n position: absolute;\r\n width: 14px;\r\n height: 14px;\r\n border: 2px solid #fff;\r\n border-radius: 50%;\r\n background: #1890FF;\r\n display: inline-block;\r\n}\r\n.data-resizer-holder-right-top {\r\n top: -6px;\r\n right: -6px;\r\n cursor: nesw-resize;\r\n}\r\n.data-resizer-holder-right-bottom {\r\n bottom: -6px;\r\n right: -6px;\r\n cursor: nwse-resize;\r\n}\r\n.data-resizer-holder-left-bottom {\r\n bottom: -6px;\r\n left: -6px;\r\n cursor: nesw-resize;\r\n}\r\n.data-resizer-holder-left-top {\r\n left: -6px;\r\n top: -6px;\r\n cursor: nwse-resize;\r\n}\r\n\r\n.data-resizer-number {\r\n position: absolute;\r\n display: inline-block;\r\n line-height: 24px;\r\n padding: 0 4px;\r\n font-size: 12px;\r\n border-radius: 3px 3px;\r\n background: rgba(0, 0, 0, 0.86);\r\n color: rgba(255, 255, 255, 0.96);\r\n font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\r\n opacity: 0;\r\n visibility: hidden;\r\n transition: opacity 0.3s ease-in-out;\r\n transform: scale(0.8);\r\n}\r\n\r\n.data-resizer-number-right-top {\r\n top: 0px;\r\n right: -6px;\r\n transform: translateX(100%) scale(0.8);\r\n}\r\n\r\n.data-resizer-number-right-bottom {\r\n right: -6px;\r\n bottom: 0px;\r\n transform: translateX(100%) scale(0.8);\r\n}\r\n\r\n.data-resizer-number-left-bottom {\r\n left: -6px;\r\n bottom: 0px;\r\n transform: translateX(-100%) scale(0.8);\r\n}\r\n\r\n.data-resizer-number-left-top {\r\n left: -6px;\r\n top: 0px;\r\n transform: translateX(-100%) scale(0.8);\r\n}\r\n\r\n.data-resizer-number-active {\r\n opacity: 1;\r\n visibility: visible;\r\n}";en(va);var ba=function(){function e(t){var n,r=this;(0,l.Z)(this,e),this.options=void 0,this.root=void 0,this.image=void 0,this.resizerNumber=void 0,this.point={x:0,y:0},this.position=void 0,this.size=void 0,this.maxWidth=void 0,this.resizing=!1,this.onMouseMove=function(e){e.preventDefault(),e.stopPropagation();var t=window.TouchEvent&&e instanceof TouchEvent?e.touches[0]:e,n=t.clientX,i=t.clientY;if(n!==r.point.x||i!==r.point.y){var o=r.point.x-n,a=r.point.y-i;r.updateSize(o,a)}r.resizing=!0},this.onMouseUp=function(e){var t;e.preventDefault(),e.stopPropagation();var n=r.root.get();if(n){var i=n.clientWidth,o=n.clientHeight;r.size={width:i,height:o},r.resizerNumber.removeClass("data-resizer-number-".concat(r.position)),r.resizerNumber.removeClass("data-resizer-number-active"),r.position=void 0,r.resizing=!1,r.root.removeClass("data-resizing"),document.removeEventListener(Ue?"touchmove":"mousemove",r.onMouseMove),document.removeEventListener(Ue?"touchend":"mouseup",r.onMouseUp);var a=r.options.onChange;a&&a(r.size),null===(t=r.image)||void 0===t||t.hide()}},this.options=t,this.root=Ut(this.renderTemplate(t.imgUrl)),t.imgUrl&&(this.image=this.root.find("img")),null===(n=this.image)||void 0===n||n.hide(),this.resizerNumber=this.root.find(".data-resizer-number");var i=this.options,o=i.width,a=i.height;this.size={width:o,height:a},this.maxWidth=this.options.maxWidth}return(0,c.Z)(e,[{key:"renderTemplate",value:function(e){return'\n\t\t\t\n\t\t\t\t'.concat(e?''):"",'\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t')}},{key:"onMouseDown",value:function(e,t){var n;this.resizing||(e.preventDefault(),e.stopPropagation(),this.root.css("top",["right-top","left-top"].indexOf(t)>-1?"auto":0),this.root.css("left",["left-top","left-bottom"].indexOf(t)>-1?"auto":0),this.root.css("bottom",["right-bottom","left-bottom"].indexOf(t)>-1?"auto":0),this.root.css("right",["right-top","right-bottom"].indexOf(t)>-1?"auto":0),this.point={x:window.TouchEvent&&e instanceof TouchEvent?e.touches[0].clientX:e.clientX,y:window.TouchEvent&&e instanceof TouchEvent?e.touches[0].clientY:e.clientY},this.position=t,this.resizing=!0,this.root.addClass("data-resizing"),this.resizerNumber.addClass("data-resizer-number-".concat(this.position)),this.resizerNumber.addClass("data-resizer-number-active"),null===(n=this.image)||void 0===n||n.show(),document.addEventListener(Ue?"touchmove":"mousemove",this.onMouseMove),document.addEventListener(Ue?"touchend":"mouseup",this.onMouseUp))}},{key:"updateSize",value:function(e,t){e=["right-top","right-bottom"].indexOf(this.position||"")>-1?this.size.width-e:this.size.width+e,this.setSize(e,t)}},{key:"setSize",value:function(e,t){e<24&&(e=24);var n=this.options.rate;e>this.maxWidth&&(e=this.maxWidth),t=e*n,t<24&&(t=24,e=t/n),e=Math.round(e),t=Math.round(t),this.root.css({width:e+"px",height:t+"px"}),this.resizerNumber.html("".concat(e,"·").concat(t))}},{key:"on",value:function(e,t){this.root.on(e,t)}},{key:"off",value:function(e,t){this.root.off(e,t)}},{key:"render",value:function(){var e=this,t=this.options,n=t.width,r=t.height;return this.setSize(n,r),this.root.find(".data-resizer-holder-right-top").on(Ue?"touchstart":"mousedown",(function(t){return e.onMouseDown(t,"right-top")})),this.root.find(".data-resizer-holder-right-bottom").on(Ue?"touchstart":"mousedown",(function(t){return e.onMouseDown(t,"right-bottom")})),this.root.find(".data-resizer-holder-left-bottom").on(Ue?"touchstart":"mousedown",(function(t){return e.onMouseDown(t,"left-bottom")})),this.root.find(".data-resizer-holder-left-top").on(Ue?"touchstart":"mousedown",(function(t){return e.onMouseDown(t,"left-top")})),this.root}},{key:"destroy",value:function(){this.root.remove(),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)}}]),e}();t.ZP=zo},7279:function(e,t,n){"use strict";n.d(t,{b:function(){return A}});n(57658);var r=n(13087),i=n(62833),o=n(26334),a=n(62040),s=n(93806),l=n(24343),c=n(43629),A=function(){function e(){(0,r.Z)(this,e),this.headingTags={h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0}}return(0,i.Z)(e,[{key:"getHeadings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.headingTags;(0,c.kI)(e)||(e=(0,c.$)(e));var n=e.children();if(!n)return[];var r=[];return n.each((function(e){t[e.nodeName.toLowerCase()]&&r.push(e)})),r}},{key:"getText",value:function(e){var t=(0,c.kd)(e,(function(e){return!e.getAttribute(c.Jr)})),n="";return t.forEach((function(e){n+=e.textContent})),n}},{key:"normalize",value:function(e){var t=this;if(e=e||[],0===e.length)return[];var n=[];e.forEach((function(e){var r=(t.getText(e)||"").trim(),i=e["id"]||e[c.Mr];r&&i&&n.push({id:i,text:r,level:parseInt(e.tagName.substr(1)),depth:-1,node:e})}));var r=[];n.forEach((function(e){r.indexOf(e.level)<0&&r.push(e.level)})),r.sort();var i={};return r.forEach((function(e,t){i[e]=t+1})),n.forEach((function(e){e.depth=i[e.level]})),n}},{key:"getFromDom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.headingTags;try{var n=this.getHeadings(e,t),r=this.normalize(n);return r}catch(i){return[]}}}]),e}();function u(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var d=".data-anchor-button {\r\n\tposition: absolute;\r\n\twidth: 24px;\r\n\theight: 24px;\r\n\tline-height: 24px;\r\n\ttext-align: center;\r\n\tfont-size: 14px;\r\n\tdisplay: block;\r\n\tbackground: rgba(255, 255, 255, 0.9);\r\n\tcolor: #BFBFBF;\r\n\tborder-radius: 2px 2px;\r\n\tcursor: pointer;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\t-webkit-transition: opacity 0.3s ease-in-out;\r\n\ttransition: opacity 0.3s ease-in-out;\r\n}\r\n\r\n.data-anchor-button.data-anchor-button-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-anchor-button .data-icon {\r\n\twidth: 18px;\r\n}\r\n\r\n.data-anchor-button:hover {\r\n\tbackground: #f4f4f4;\r\n\tcolor: #595959;\r\n}\r\n\r\n.am-engine-view h1,.am-engine-view h2,.am-engine-view h3,.am-engine-view h4,.am-engine-view h5,.am-engine-view h6 {\r\n position: relative;\r\n}\r\n\r\n.am-engine-view h1 .data-anchor-button,.am-engine-view h2 .data-anchor-button,.am-engine-view h3 .data-anchor-button,.am-engine-view h4 .data-anchor-button,.am-engine-view h5 .data-anchor-button,.am-engine-view h6 .data-anchor-button{\r\n position: absolute;\r\n left: -24px;\r\n display: none;\r\n}\r\n\r\n.am-engine-view h1:hover .data-anchor-button,.am-engine-view h2:hover .data-anchor-button,.am-engine-view h3:hover .data-anchor-button,.am-engine-view h4:hover .data-anchor-button,.am-engine-view h5:hover .data-anchor-button,.am-engine-view h6:hover .data-anchor-button {\r\n display: inline-block;\r\n opacity: 1;\r\n visibility: visible;\r\n}\r\n\r\n.am-engine-view h1 , .am-engine h1,.am-engine-view h2 , .am-engine h2,.am-engine-view h3 , .am-engine h3,.am-engine-view h4 , .am-engine h4,.am-engine-view h5 , .am-engine h5,.am-engine-view h6 , .am-engine h6 {\r\n margin: 0;\r\n word-spacing: 1px;\r\n color: #262626;\r\n font-weight: bold;\r\n padding:0;\r\n}\r\n\r\n.am-engine-view h1 , .am-engine h1 {\r\n font-size: 28px;\r\n line-height: 36px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h2 , .am-engine h2 {\r\n font-size: 24px;\r\n line-height: 32px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h3 , .am-engine h3 {\r\n font-size: 20px;\r\n line-height: 28px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h4 , .am-engine h4 {\r\n font-size: 16px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h5 , .am-engine h5 {\r\n font-size: 14px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h6 , .am-engine h6 {\r\n font-size: 14px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n font-weight: normal;\r\n}";u(d);var h=function(e){(0,s.Z)(n,e);var t=(0,l.Z)(n);function n(){var e;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a-1})),e.allowIn=["blockquote","$root"],e.disableMark=e.options.disableMark||["fontsize","bold"],e.closureRef={current:{block:null}},e.onRender=function(t){var n=e.editor,r=n.language,i=(0,c.$)(t);0!==e.tagName.length&&i.find(e.tagName.join(",")).each((function(t){var i=(0,c.$)(t),o=i.attributes("id");if(o){i.find(".data-anchor-button").remove(),c.u.hide();var a=(0,c.$)(''));24!==i.height()&&a.css({top:(i.height()-24)/2+"px"}),a.on("mouseenter",(function(){c.u.show(a,r.get("copyAnchor","title").toString())})),a.on("mouseleave",(function(){c.u.hide()})),a.on("click",(function(t){t.preventDefault(),t.stopPropagation();var i=e.options.anchorCopy?e.options.anchorCopy(o):window.location.href+"/"+o;n.clipboard.copy(i)?n.messageSuccess("copy",r.get("copy","success").toString()):n.messageError("copy",r.get("copy","error").toString())})),i.prepend(a)}}))},e.updateId=function(){0!==e.tagName.length&&e.editor.container.find(e.tagName.join(",")).each((function(e){var t,n=(0,c.$)(e);if(null===(t=n.parent())||void 0===t?void 0:t.isEditable()){var r=n.attributes("id");(!r||(0,c.$)('[id="'.concat(r,'"]')).length>1)&&(r=n.attributes(c.Mr)||(0,c.TT)(n),n.attributes("id",r))}else n.removeAttributes("id")}))},e.realtimeChange=function(){e.updateId(),e.showAnchor()},e.updateAnchorPosition=function(){var t,n=e.editor;if((0,c.iC)(n)){var r=n.change,i=n.root,o=i.find(".data-anchor-button");if(0!==o.length){var a=r.range.get(),s=a.startNode.closest("h1,h2,h3,h4,h5,h6");if(0===s.length)return o.remove(),void c.u.hide();var l=(null===(t=i.get())||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0},A=s.get().getBoundingClientRect(),u=Math.round(A.left-l.left-o.get().clientWidth-1),d=Math.round(A.top-l.top+A.height/2-o.get().clientHeight/2);o.css({top:"".concat(d,"px"),left:"".concat(u,"px")})}}},e.showAnchor=function(){var t,n,r=e.editor;if((0,c.iC)(r)&&0!==e.tagName.length&&!1!==e.options.showAnchor){var i=r.change,o=r.root,a=r.clipboard,s=r.language,l=r.card,A=i.range.get(),u=o.find(".data-anchor-button"),d=A.startNode.closest(e.tagName.join(","));if(e.closureRef.current.block=d,(0===d.length||u.length>0&&0===u.find(".data-icon-".concat(d.name)).length||!r.isFocus())&&(u.remove(),c.u.hide()),0!==d.length&&!l.closest(d,!0)&&r.isFocus()&&(null===(t=d.parent())||void 0===t?void 0:t.isEditable()))if(u.find(".data-icon-".concat(d.name)).length>0)e.updateAnchorPosition();else{u=(0,c.$)('')),o.append(u);var h=(null===(n=o.get())||void 0===n?void 0:n.getBoundingClientRect())||{left:0,top:0},p=d.get().getBoundingClientRect(),f=Math.round(p.left-h.left-u.get().clientWidth-1),g=Math.round(p.top-h.top+p.height/2-u.get().clientHeight/2);u.css({top:"".concat(g,"px"),left:"".concat(f,"px")}),u.addClass("data-anchor-button-active"),u.on("mouseenter",(function(){c.u.show(u,s.get("copyAnchor","title").toString())})),u.on("mouseleave",(function(){c.u.hide()})),u.on("click",(function(t){if(t.preventDefault(),t.stopPropagation(),e.closureRef.current.block){var n=e.closureRef.current.block.attributes("id"),i=e.options.anchorCopy?e.options.anchorCopy(n):window.location.href+"/"+n;a.copy(i)?r.messageSuccess("copy",s.get("copy","success").toString()):r.messageError("copy",s.get("copy","error").toString())}}))}}},e.markdownIt=function(t){!1!==e.options.markdown&&t.enable("heading")},e.onBackspace=function(t){var n,r=e.editor;if((0,c.iC)(r)){var i=r.change,o=r.node,a=i.range.get();if(a.collapsed){var s=r.block;if(s.isFirstOffset(a,"start")){var l=s.closest(a.startNode);if(e.tagName.indexOf(l.name)>-1&&o.isEmptyWithTrim(l)&&(null===(n=l.parent())||void 0===n?void 0:n.isEditable()))return t.preventDefault(),s.setBlocks("

      "),!1;var A=l.parent();return!(e.tagName.indexOf(l.name)>-1)||A&&o.isBlock(A)?void 0:(t.preventDefault(),i.mergeAfterDelete(l),!1)}}}},e}return(0,i.Z)(n,[{key:"init",value:function(){(0,o.Z)((0,a.Z)(n.prototype),"init",this).call(this);var e=this.editor;if((0,c.iC)(e))e.on("keydown:backspace",this.onBackspace),e.on("markdown-it",this.markdownIt),e.on("setValue",this.updateId),e.on("realtimeChange",this.realtimeChange),e.on("select",this.showAnchor),e.on("blur",this.showAnchor),window.addEventListener("resize",this.updateAnchorPosition);else{if(!1===this.options.showAnchor)return;e.on("render",this.onRender)}}},{key:"execute",value:function(e){var t=this.editor;if((0,c.iC)(t)){e&&e!==this.queryState()||(e="p");var n=this.options.enableTypes;if(!("p"!==e&&n&&n.indexOf(e)<0)){var r=t.list,i=t.block;r.split(),i.setBlocks("<".concat(e," />"))}}}},{key:"queryState",value:function(){var e=this.editor;if((0,c.iC)(e)){var t=e.change,n=t.blocks;if(0===n.length)return"";var r=this.tagName.find((function(e){return n.some((function(t){return t.name===e}))}));return r||""}}},{key:"hotkey",value:function(){var e,t,n,r,i,o,a=(null===(e=this.options.hotkey)||void 0===e?void 0:e.h1)||"mod+opt+1",s=(null===(t=this.options.hotkey)||void 0===t?void 0:t.h2)||"mod+opt+2",l=(null===(n=this.options.hotkey)||void 0===n?void 0:n.h3)||"mod+opt+3",c=(null===(r=this.options.hotkey)||void 0===r?void 0:r.h4)||"mod+opt+4",A=(null===(i=this.options.hotkey)||void 0===i?void 0:i.h5)||"mod+opt+5",u=(null===(o=this.options.hotkey)||void 0===o?void 0:o.h6)||"mod+opt+6",d=this.options.enableTypes;return[{key:a,args:"h1"},{key:s,args:"h2"},{key:l,args:"h3"},{key:c,args:"h4"},{key:A,args:"h5"},{key:u,args:"h6"}].filter((function(e){return!d||d.indexOf(e.key)>-1}))}},{key:"destroy",value:function(){var e=this.editor;(0,c.iC)(e)?(e.off("keydown:backspace",this.onBackspace),e.off("markdown-it",this.markdownIt),e.off("setValue",this.updateId),e.off("realtimeChange",this.realtimeChange),e.off("select",this.showAnchor),e.off("blur",this.showAnchor),window.removeEventListener("resize",this.updateAnchorPosition)):e.off("render",this.onRender)}}],[{key:"pluginName",get:function(){return"heading"}}]),n}(c.AT);t.Z=h},46194:function(e,t,n){"use strict";n.d(t,{nV:function(){return Et},Mq:function(){return Ft},ZP:function(){return Tt},F7:function(){return st}});n(57658);var r=n(73396),i=n(44870),o=n(87139),a=n(49242),s=n(31823),l=n.n(s),c=n(69208),A=n.n(c),u=n(43629),d=n(95082),h=n(25431),p=n(30670),f=n(3336),g=(n(32515),n(66046)),m=n(62833),v=n(13087),b=n(93806),y=n(24343),w=n(88478),x=n(52417),k=n(26334),C=n(62040),B=n(39693),_=n(72036),E=n(29662),S=n.n(E),F={engine:Object,name:{type:String,required:!0},icon:String,content:[String,Function],title:String,placement:String,hotkey:[String,Object],command:Object,autoExecute:{type:[Boolean,void 0],default:void 0},className:String,active:{type:[Boolean,void 0],default:void 0},disabled:{type:[Boolean,void 0],default:void 0},onClick:Function,onMouseDown:Function,onMouseEnter:Function,onMouseLevel:Function},T={engine:Object,name:{type:String,required:!0},direction:String,items:{type:Array,required:!0},values:{type:[String,Array,Number],required:!0},className:String,onSelect:Function,hasDot:{type:[Boolean,void 0],default:void 0}},M={engine:Object,name:{type:String,required:!0},values:[String,Array,Number],items:{type:Array,default:[]},icon:String,placement:String,content:[String,Function],title:String,disabled:{type:[Boolean,void 0],default:void 0},single:{type:[Boolean,void 0],default:void 0},className:String,direction:String,onSelect:Function,hasArrow:{type:[Boolean,void 0],default:void 0},hasDot:{type:[Boolean,void 0],default:void 0}},I={engine:{type:Object,required:!0},color:{type:String,required:!0},active:Boolean,setStroke:{type:[Boolean,void 0],default:void 0},onSelect:Function},N={engine:I.engine,colors:{type:Array,required:!0},setStroke:I.setStroke,onSelect:I.onSelect},U={engine:N.engine,colors:Array,defaultColor:{type:String,required:!0},defaultActiveColor:{type:String,required:!0},setStroke:N.setStroke,onSelect:I.onSelect,placement:String},L=(0,d.Z)({engine:F.engine,name:F.name,content:{type:[String,Function],required:!0},buttonTitle:String,dropdownTitle:String,command:F.command,autoExecute:F.autoExecute,disabled:F.disabled},A()(U,"engine")),Q={name:F.name,engine:F.engine,icon:F.icon,title:F.title,search:String,description:F.content,disabled:F.disabled,prompt:[String,Function,Object],command:F.command,autoExecute:F.autoExecute,className:F.className,placement:F.placement,onClick:Function,onMouseDown:Function},D={engine:F.engine,title:String,items:{type:Array,required:!0},onSelect:Q.onClick},H={engine:D.engine,header:String,groups:{type:Array,required:!0},disabled:F.disabled,className:Q.className,icon:Q.icon,content:F.content,onSelect:D.onSelect},O={engine:{type:Object,required:!0},items:{type:Array,default:[]},popup:{type:[Boolean,void 0],default:void 0},icon:Q.icon,content:F.content},z={engine:{type:Object,required:!0},items:{type:Array,default:[]},className:String,popup:{type:[Boolean,void 0],default:void 0},onLoad:Function},Z=function(e,t,n){var r=null===e||void 0===e?void 0:e.plugin.components[t];if(r&&r.hotkey){var i=r.hotkey();if(i){if(Array.isArray(i))if(n){var o=i.findIndex((function(e){return"object"===(0,f.Z)(e)&&e.args===n}));i=i[o>-1?o:0]}else i=i[0];return"object"===(0,f.Z)(i)&&(i=i.key),i}}},R={},P=function(e){var t=document.body,n=document.createElement("span");n.innerHTML=Array(10).join("wi"),n.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;"),t.appendChild(n);var r=function(e){return n.style.fontFamily=e,n.clientWidth},i=r("monospace"),o=r("serif"),a=r("sans-serif"),s=e((function(e){if("string"!==typeof e)return console.log("Font name is not legal !"),!1;if(void 0!==R[e])return R[e];var t=i!==r(e+",monospace")||a!==r(e+",sans-serif")||o!==r(e+",serif");return R[e]=t,t}));return t.removeChild(n),s},q=(0,r.aZ)({name:"am-button",components:{ATooltip:p.Z},props:F,setup(e){const t=(0,i.iH)();let n=e.hotkey;!e.engine||!0!==n&&void 0!==n||(n=Z(e.engine,e.command&&!Array.isArray(e.command)?e.command.name:e.name)),"string"===typeof n&&""!==n&&(n=(0,u.Yh)(n));const r=(0,i.iH)(!1);return{iconIsHtml:/^<.*>/.test((e.icon||"").trim()),isMobile:u.tq,visible:r,hotkeyText:n,element:t}},data(){return{visible:!1}},methods:{triggerMouseDown(e){e.preventDefault(),this.disabled||(this.onMouseDown&&this.onMouseDown(e,this.engine),this.visible=!1)},triggerMouseEnter(e){this.onMouseEnter&&this.onMouseEnter(e,this.engine),this.visible=!0},triggerMouseLeave(e){this.onMouseLevel&&this.onMouseLevel(e,this.engine),this.visible=!1},triggerClick(e){const t=e.target.nodeName;if("INPUT"!==t&&"TEXTAREA"!==t&&e.preventDefault(),!this.disabled&&(!this.onClick||!1!==this.onClick(e,this.engine))&&!1!==this.autoExecute){let e=this.name,t=[];this.command&&(Array.isArray(this.command)?t=this.command:(e=this.command.name,t=this.command.args)),this.engine&&this.engine.command.execute(e,...t)}}}});const K={key:0,class:"toolbar-tooltip-title"},W=["innerHTML"],j=["innerHTML"];function V(e,t,n,i,a,s){const l=(0,r.up)("a-tooltip");return(0,r.wg)(),(0,r.j4)(l,{placement:e.placement||"bottom",visible:!(!e.title&&!e.hotkeyText||e.isMobile)&&e.visible},{title:(0,r.w5)((()=>[e.title?((0,r.wg)(),(0,r.iD)("div",K,(0,o.zw)(e.title),1)):(0,r.kq)("v-if",!0),e.hotkeyText?((0,r.wg)(),(0,r.iD)("div",{key:1,class:"toolbar-tooltip-hotkey",innerHTML:e.hotkeyText},null,8,W)):(0,r.kq)("v-if",!0)])),default:(0,r.w5)((()=>[(0,r._)("button",{class:(0,o.C_)(["toolbar-button",e.className,{"toolbar-button-active":e.active,"toolbar-button-disabled":e.disabled}]),ref:"element",onClick:t[0]||(t[0]=(...t)=>e.triggerClick&&e.triggerClick(...t)),onMousedown:t[1]||(t[1]=(...t)=>e.triggerMouseDown&&e.triggerMouseDown(...t)),onMouseenter:t[2]||(t[2]=(...t)=>e.triggerMouseEnter&&e.triggerMouseEnter(...t)),onMouseleave:t[3]||(t[3]=(...t)=>e.triggerMouseLeave&&e.triggerMouseLeave(...t))},[(0,r.WI)(e.$slots,"icon",{},(()=>[e.iconIsHtml?((0,r.wg)(),(0,r.iD)("span",{key:0,innerHTML:e.icon},null,8,j)):(0,r.kq)("v-if",!0),!e.iconIsHtml&&e.icon?((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,o.C_)(`data-icon data-icon-${e.icon}`)},null,2)):(0,r.kq)("v-if",!0)])),(0,r.WI)(e.$slots,"default",{},(()=>[(0,r.Uk)((0,o.zw)("function"===typeof e.content?e.content(e.engine):e.content),1)]))],34)])),_:3},8,["placement","visible"])}function G(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var $="\n.editor-toolbar .toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: auto;\n min-width: 26px;\n margin: 0;\n text-align: center;\n padding: 0 7px;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 3px 3px;\n font-size: 16px;\n cursor: pointer;\n color: #595959;\n outline: none;\n}\n.editor-toolbar.editor-toolbar-popup .toolbar-button {\n min-width: 24px;\n line-height: 24px;\n border-radius: 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button {\n padding: 0 4px;\n margin: 0 1px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:hover {\n border: 1px solid transparent;\n background-color: #f5f5f5;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:active,.editor-toolbar .toolbar-button-active,.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-active:hover {\n background-color: #e8e8e8;\n border: 1px solid transparent;\n}\n.editor-toolbar .toolbar-button-disabled,.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n";G($),q.render=V,q.__file="src/components/button.vue";var Y=function(e){var t=(0,i.iH)(!1);return(0,r.bv)((function(){if(e.value&&u.tq){var n=e.value.getBoundingClientRect();t.value=!window.visualViewport||n.left>window.visualViewport.width/2}})),t},X=(0,r.aZ)({name:"am-dropdown-list",components:{ATooltip:p.Z},props:T,setup(e){const t=(0,i.iH)(""),n=(0,i.iH)(null),o=t=>{const{command:n,key:r}=t;let{hotkey:i}=t;return!e.engine||!0!==i&&void 0!==i||(i=Z(e.engine,n&&!Array.isArray(n)?n.name:e.name,r)),"string"===typeof i&&""!==i&&(i=(0,u.Yh)(i)),i},a={};return e.items.forEach((e=>{a[e.key]=o(e)})),(0,r.bv)((()=>{if(n.value&&e.engine&&e.engine.scrollNode){const r=n.value,i=e.engine.scrollNode.get();if(!i)return;const o=r.getBoundingClientRect(),a=i.getBoundingClientRect();o.topa.bottom&&(t.value="top")}})),{element:n,isMobile:u.tq,hotkeys:a,placement:t}},methods:{triggerSelect(e,t){e.preventDefault(),e.stopPropagation();const n=this.items.find((e=>e.key===t));if(!n||n.disabled)return;const{autoExecute:r,command:i}=n;if((!this.onSelect||!1!==this.onSelect(e,t,this.engine))&&!1!==r){let e=this.name,n=[t];i&&(Array.isArray(i)?n=n.concat(i):(e=i.name,n=n.concat(i.args))),this.engine&&this.engine.command.execute(e,...n)}}}});const J={key:0,class:"toolbar-tooltip-title"},ee=["innerHTML"],te=["onClick"],ne={key:0,class:"data-icon data-icon-dot"},re=["innerHTML"];function ie(e,t,n,i,a,s){const l=(0,r.up)("a-tooltip");return(0,r.wg)(),(0,r.iD)("div",{ref:"element",class:(0,o.C_)(["toolbar-dropdown-list",`toolbar-dropdown-${e.direction||"vertical"}`,{[`toolbar-dropdown-placement-${e.placement}`]:!!e.placement},{"toolbar-dropdown-dot":!1!==e.hasDot},e.className])},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.items,(({key:t,placement:n,title:i,content:a,className:s,icon:c,disabled:A})=>((0,r.wg)(),(0,r.j4)(l,{key:t,placement:n||"right"},(0,r.Nv)({default:(0,r.w5)((()=>[(0,r._)("a",{class:(0,o.C_)(["toolbar-dropdown-list-item",s,{"toolbar-dropdown-list-item-disabled":A}]),onClick:n=>e.triggerSelect(n,t)},[("string"===typeof e.values&&e.values===t||Array.isArray(e.values)&&e.values.indexOf(t)>-1)&&"horizontal"!==e.direction&&!1!==e.hasDot?((0,r.wg)(),(0,r.iD)("span",ne)):(0,r.kq)("v-if",!0),(0,r.WI)(e.$slots,"icon",{},(()=>[c?((0,r.wg)(),(0,r.iD)("span",{key:0,class:(0,o.C_)(["data-icon",`data-icon-${c}`])},null,2)):(0,r.kq)("v-if",!0)])),(0,r._)("div",{innerHTML:"function"===typeof a?a(e.engine):a},null,8,re)],10,te)])),_:2},[!i&&!e.hotkeys[t]||e.isMobile?void 0:{name:"title",fn:(0,r.w5)((()=>[i?((0,r.wg)(),(0,r.iD)("div",J,(0,o.zw)(i),1)):(0,r.kq)("v-if",!0),e.hotkeys[t]?((0,r.wg)(),(0,r.iD)("div",{key:1,class:"toolbar-tooltip-hotkey",innerHTML:e.hotkeys[t]},null,8,ee)):(0,r.kq)("v-if",!0)]))}]),1032,["placement"])))),128))],2)}X.render=ie,X.__file="src/components/dropdown-list.vue";var oe=(0,r.aZ)({name:"am-dropdown",components:{AmButton:q,AmDropdownList:X},props:M,setup(e,t){const n=(0,i.iH)("");let o=(0,i.iH)(void 0);const a=(0,i.iH)(!1),s=(0,i.iH)(void 0),l=(0,i.iH)(null),c=Y(l),A=r=>{!1!==e.single&&(r=Array.isArray(r)&&r.length>0?r[0]:r);const i=e.items.find((e=>"string"===typeof r&&e.key===r||Array.isArray(r)&&r.indexOf(e.key)>-1)),a=e.items.length>0?e.items.find((e=>!0===e.isDefault))||e.items[0]:null;i?t.slots.default?o.value=i:"function"===typeof e.content?o.value={icon:e.icon,content:e.content(e.engine)}:Array.isArray(r)&&r.length>1?o.value={icon:e.icon,content:e.content}:o.value={icon:i.icon,content:"function"===typeof i.content?i.content(e.engine):i.content}:e.icon||e.content?(!Array.isArray(r)||r.length<1)&&(o.value={icon:e.icon,content:"function"===typeof e.content?e.content(e.engine):e.content}):a&&(o.value={icon:a.icon,content:"function"===typeof a.content?a.content(e.engine):a.content}),n.value=r||(e.icon||e.content?"":a?a.key:"")},u=e=>{e.preventDefault()},d=t=>{t.preventDefault(),e.disabled||(a.value?p():h())},h=()=>{a.value=!0},p=e=>{e&&s.value&&s.value.element&&s.value.element.contains(e.target)||(a.value=!1)},f=(t,n)=>{p(),e.onSelect&&e.onSelect(t,n,e.engine)};return A(e.values),(0,r.YP)((()=>({...e})),(e=>A(e.values))),(0,r.YP)((()=>a.value),((e,t)=>{e?document.addEventListener("click",p):document.removeEventListener("click",p)})),{buttonRef:l,isRight:c,buttonContent:o,valuesVar:n,triggerMouseDown:u,triggerClick:d,show:h,hide:p,triggerSelect:f,visible:a,targetRef:s}}});const ae=["innerHTML"],se={key:0,class:"data-icon data-icon-arrow"};function le(e,t,n,i,a,s){const l=(0,r.up)("am-button"),c=(0,r.up)("am-dropdown-list");return(0,r.wg)(),(0,r.iD)("div",{class:(0,o.C_)(["toolbar-dropdown",{"toolbar-dropdown-right":e.isRight},e.className]),ref:"buttonRef",onClick:t[0]||(t[0]=(...t)=>e.triggerClick&&e.triggerClick(...t)),onMousedown:t[1]||(t[1]=(...t)=>e.triggerMouseDown&&e.triggerMouseDown(...t))},[(0,r._)("div",{class:(0,o.C_)(["toolbar-dropdown-trigger",{"toolbar-dropdown-trigger-active":e.visible,"toolbar-dropdown-trigger-arrow":!1!==e.hasArrow}])},[(0,r.Wm)(l,{name:e.name,title:e.title,active:e.visible,disabled:e.disabled,placement:e.placement,ref:"targetRef"},{default:(0,r.w5)((()=>[(0,r.WI)(e.$slots,"default",{item:e.content},(()=>[e.buttonContent&&e.buttonContent.icon?((0,r.wg)(),(0,r.iD)("span",{key:0,class:(0,o.C_)(["data-icon",`data-icon-${e.buttonContent.icon}`])},null,2)):(0,r.kq)("v-if",!0),e.buttonContent&&!e.buttonContent.icon&&e.buttonContent.content?((0,r.wg)(),(0,r.iD)("span",{key:1,class:"toolbar-dropdown-button-text",innerHTML:e.buttonContent.content},null,8,ae)):(0,r.kq)("v-if",!0)])),!1!==e.hasArrow?((0,r.wg)(),(0,r.iD)("span",se)):(0,r.kq)("v-if",!0)])),_:3},8,["name","title","active","disabled","placement"])],2),e.visible?((0,r.wg)(),(0,r.j4)(c,{key:0,hasDot:e.hasDot,engine:e.engine,direction:e.direction,name:e.name,items:e.items,values:e.valuesVar,"on-select":e.triggerSelect},null,8,["hasDot","engine","direction","name","items","values","on-select"])):(0,r.kq)("v-if",!0)],34)}var ce="\n.toolbar-dropdown {\n position: relative;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger {\n display: flex;\n align-items: stretch;\n height: 100%;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-button {\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {\n font-size: 12px;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .toolbar-button{\n padding-right: 20px;\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .data-icon-arrow {\n position: absolute;\n right: 6px;\n top: calc(100% / 2 - 2px);\n width: 8px;\n height: 8px;\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\n background-repeat: no-repeat;\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n}\n.toolbar-dropdown .toolbar-dropdown-list {\n position: absolute;\n top: 32px;\n font-size: 12px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);\n padding: 5px 0;\n height: auto;\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n max-height: calc(80vh);\n overflow: auto;\n}\n.toolbar-dropdown.toolbar-dropdown-right:not(.toolbar-dropdown-right) .toolbar-dropdown-list{\n left: 0px;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list, .editor-toolbar-popup .toolbar-dropdown .toolbar-dropdown-list:not(.toolbar-dropdown-placement-bottom) {\n bottom: 32px;\n top: auto;\n overflow: auto;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list {\n max-height: calc(30vh);\n}\n.editor-toolbar-mobile .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list,.editor-toolbar-popup .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list{\n right: 0px;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item {\n padding: 2px 10px 2px 16px;\n line-height: 30px;\n color: #595959;\n text-align: left;\n position: relative;\n display: flex;\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item-disabled {\n color: rgba(17, 31, 44, 0.24);\n cursor: not-allowed;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item:not(.toolbar-dropdown-list-item-disabled):hover {\n color: #262626;\n background-color: #f5f5f5;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon {\n margin-right: 8px;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-horizontal .toolbar-dropdown-list-item {\n display: inline-block;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-dot .toolbar-dropdown-list-item {\n padding-left: 30px;\n padding-right: 16px;\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon-dot\n{\n position: absolute;\n top: 50%;\n left: 8px;\n margin-top: -7px;\n width: 14px;\n height: 14px;\n display: block;\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjQgKDY3Mzc4KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5VbnRpdGxlZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPgogICAgICAgIDxnIGlkPSJjaGVjayIgZmlsbD0iIzAwMDAwMCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIG9wYWNpdHk9IjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTIuNDY4NzUsMi41OTc2NTYyNSBMMTEuNTEzMDg1OSwyLjU5NzY1NjI1IEMxMS4zNzkxMDE2LDIuNTk3NjU2MjUgMTEuMjUxOTUzMSwyLjY1OTE3OTY5IDExLjE2OTkyMTksMi43NjQ0NTMxMiBMNS41MzMwMDc4MSw5LjkwNTI3MzQ0IEwyLjgzMDA3ODEyLDYuNDgwNDY4NzUgQzIuNzQ2Njc5NjksNi4zNzUxOTUzMSAyLjYyMDg5ODQ0LDYuMzEzNjcxODcgMi40ODY5MTQwNiw2LjMxMzY3MTg3IEwxLjUzMTI1LDYuMzEzNjcxODcgQzEuNDM5NjQ4NDQsNi4zMTM2NzE4NyAxLjM4OTA2MjUsNi40MTg5NDUzMSAxLjQ0NTExNzE5LDYuNDkwMDM5MDYgTDUuMTg5ODQzNzUsMTEuMjM0MTc5NyBDNS4zNjQ4NDM3NSwxMS40NTU2NjQxIDUuNzAxMTcxODcsMTEuNDU1NjY0MSA1Ljg3NzUzOTA2LDExLjIzNDE3OTcgTDEyLjU1NDg4MjgsMi43NzI2NTYyNSBDMTIuNjEwOTM3NSwyLjcwMjkyOTY5IDEyLjU2MDM1MTYsMi41OTc2NTYyNSAxMi40Njg3NSwyLjU5NzY1NjI1IFoiIGlkPSJQYXRoIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);\n background-repeat: no-repeat;\n}\n";G(ce),oe.render=le,oe.__file="src/components/dropdown.vue";var Ae=(0,m.Z)((function e(){(0,v.Z)(this,e)}));Ae.colors=void 0,Ae._map=void 0,Ae.getStroke=void 0,Ae.getColors=void 0,Ae.colors=[["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF"],["#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96"],["#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB"],["#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2"],["#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB"],["#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F"],["#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"]],Ae._map=function(){for(var e={},t=Ae.colors,n=0,r=t.length;n2&&t.x<5)?this.colors[4][t.x]:e},Ae.getColors=function(){return this.colors};var ue=(0,r.aZ)({name:"am-color-plicker-item",props:I,setup(e){const t=t=>{t.preventDefault(),t.stopPropagation(),e.onSelect&&e.onSelect(e.color,t)},n="transparent"===e.color,r=e.engine.language.get("toolbar","colorPicker",e.color.toUpperCase());return{title:r,special:n,triggerSelect:t}},data(){const e=this.toState(this.color||"#FFFFFF"),t=["#ffffff","#fafafa","transparent"].indexOf(e.hex)>=0;return{state:e,needBorder:t,styles:this.getStyles(e)}},computed:{refreshStyles(){return this.getStyles()}},methods:{getContrastingColor(e){if("transparent"===e.hex)return"rgba(0,0,0,0.4)";const t=(299*e.rgb.r+587*e.rgb.g+114*e.rgb.b)/1e3;return t>=210?"#8C8C8C":"#FFFFFF"},toState(e,t){let n=e.hex??e;"transparent"===n&&(n="rgba(0,0,0,0)");const r=(0,g.Vi)(n),i=r.toHsl(),o=r.toHsv(),a=r.toRgb(),s=r.toHex();0===i.s&&(i.h=t||0,o.h=t||0);const l="000000"===s&&0===a.a;return{hsl:i,hex:l?"transparent":"#".concat(s),rgb:a,hsv:o,oldHue:e["h"]||t||i.h,source:e["source"]}},getStyles(e){return{check:{fill:this.getContrastingColor(e||this.state),display:this.active?"block":"none"},block:{backgroundColor:this.color,border:this.setStroke?"1px solid ".concat(Ae.getStroke(this.color)):void 0}}}}});const de=["title"],he=(0,r._)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},null,-1),pe=[he];function fe(e,t,n,i,a,s){return(0,r.wg)(),(0,r.iD)("span",{class:(0,o.C_)(["colorpicker-group-item",{"colorpicker-group-item-border":e.needBorder,"colorpicker-group-item-active":e.active,"colorpicker-group-item-special":e.special}]),onClick:t[0]||(t[0]=(...t)=>e.triggerSelect&&e.triggerSelect(...t)),title:e.title},[(0,r._)("span",{style:(0,o.j5)(e.refreshStyles.block)},[((0,r.wg)(),(0,r.iD)("svg",{style:(0,o.j5)(e.refreshStyles.check),viewBox:"0 0 18 18"},pe,4))],4)],10,de)}ue.render=fe,ue.__file="src/components/color/picker/item.vue";var ge=(0,r.aZ)({name:"am-color-plicker-group",components:{AmColorPickerItem:ue},props:N});const me={class:"colorpicker-group"};function ve(e,t,n,i,o,a){const s=(0,r.up)("am-color-picker-item");return(0,r.wg)(),(0,r.iD)("span",me,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.colors,(t=>((0,r.wg)(),(0,r.j4)(s,{engine:e.engine,color:t.value,active:t.active,key:t.value,"on-select":e.onSelect,"set-stroke":e.setStroke},null,8,["engine","color","active","on-select","set-stroke"])))),128))])}ge.render=ve,ge.__file="src/components/color/picker/group.vue";var be=(0,r.aZ)({name:"am-color-picker",components:{AmColorPickerItem:ue,AmColorPickerGroup:ge},props:U,setup(e,t){const n=(e,t)=>e.map((e=>e.map((e=>{const n="string"===typeof e?e:e.value;return{value:n,active:t===n}})))),r=(0,i.iH)(n(e.colors||Ae.getColors(),e.defaultActiveColor)),o=(t,i)=>{r.value=n(r.value,t),e.onSelect&&e.onSelect(t,i)},a=e.engine.language.get("toolbar","colorPicker","transparent"===e.defaultColor?"nonFillText":"defaultText");return{colors:r,triggerSelect:o,text:a}},methods:{triggerMouseDown(e){"INPUT"!==e.target.tagName&&e.preventDefault()}}});const ye={class:"colorpicker-default-text"};function we(e,t,n,i,a,s){const l=(0,r.up)("am-color-picker-item"),c=(0,r.up)("am-color-picker-group");return(0,r.wg)(),(0,r.iD)("div",{class:"colorpicker-board",onMousedown:t[1]||(t[1]=(...t)=>e.triggerMouseDown&&e.triggerMouseDown(...t))},[(0,r._)("div",{class:"colorpicker-default",onClick:t[0]||(t[0]=t=>e.triggerSelect(e.defaultColor,t))},[(0,r.Wm)(l,{engine:e.engine,color:e.defaultColor,"active-colors":[],"on-select":e.triggerSelect},null,8,["engine","color","on-select"]),(0,r._)("span",ye,(0,o.zw)(e.text),1)]),((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.colors,((t,n)=>((0,r.wg)(),(0,r.j4)(c,{engine:e.engine,colors:t,key:n,"on-select":e.triggerSelect,"set-stroke":e.setStroke},null,8,["engine","colors","on-select","set-stroke"])))),128))],32)}var xe='\n.colorpicker-default {\r\n display: flex;\r\n align-items: center;\r\n padding: 4px 8px;\r\n margin: 4px 0 8px;\r\n border-radius: 2px;\r\n cursor: pointer;\n}\n.colorpicker-default:hover {\r\n background-color: #f5f5f5;\n}\n.colorpicker-default-text {\r\n margin-left: 8px;\n}\n.colorpicker-group {\r\n display: flex;\r\n width: 100%;\r\n height: auto;\r\n position: relative;\r\n padding: 0 8px;\n}\n.colorpicker-group:nth-child(2){\r\n margin-bottom: 6px;\n}\n.colorpicker-group:last-child {\r\n margin-bottom: 0px;\n}\n.colorpicker-group-item {\r\n width: 24px;\r\n height: 24px;\r\n padding: 2px 2px;\r\n display: inline-block;\r\n border-radius: 3px 3px;\r\n border: 1px solid transparent;\r\n flex: 0 0 auto;\r\n cursor: pointer;\r\n background-color: #fff;\n}\n.colorpicker-group-item > span {\r\n position: relative;\r\n width: 18px;\r\n height: 18px;\r\n display: block;\r\n border-radius: 2px 2px;\r\n border: 1px solid transparent;\n}\n.colorpicker-group-item > span svg {\r\n position: absolute;\r\n top: -1px;\r\n left: 1px;\r\n width: 12px;\r\n height: 12px;\n}\n.colorpicker-group-item-border > span {\r\n border: 1px solid #e8e8e8;\n}\n.colorpicker-group-item-special {\r\n position: relative;\n}\n.colorpicker-group-item-special:after {\r\n content: "";\r\n display: block;\r\n position: absolute;\r\n top: 10px;\r\n left: 0px;\r\n width: 22px;\r\n height: 0;\r\n border-bottom: 2px solid #ff5151;\r\n transform: rotate(45deg);\n}\n.colorpicker-group-item:hover {\r\n border: 1px solid #d9d9d9;\r\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n}\r\n';G(xe),be.render=we,be.__file="src/components/color/picker/picker.vue";var ke=(0,r.aZ)({name:"am-color",components:{AmButton:q,AmColorPicker:be},props:L,setup(e){const t=(0,i.iH)(!1),n=(0,i.iH)(null),o=Y(n),a=(0,i.iH)(void 0),s=(0,i.iH)(e.defaultActiveColor),l=()=>"string"===typeof e.content?e.content:e.content(s.value,Ae.getStroke(s.value),e.disabled),c=(0,i.iH)(l()),A=e=>{e.preventDefault(),t.value?d():u()},u=()=>{t.value=!0},d=e=>{e&&a.value&&a.value.element&&a.value.element.contains(e.target)||(t.value=!1)};(0,r.YP)((()=>t.value),((e,t)=>{e?document.addEventListener("click",d):document.removeEventListener("click",d)}));const h=e=>{p(s.value,e)},p=(t,n)=>{if(d(),s.value=t,c.value="string"===typeof e.content?e.content:e.content(t,Ae.getStroke(t),e.disabled),!1!==e.autoExecute){let n=e.name,r=[t,e.defaultColor];e.command&&(Array.isArray(e.command)?r=e.command:(n=e.command.name,r=e.command.args)),e.engine&&e.engine.command.execute(n,...r)}e.onSelect&&e.onSelect(t,n)};return(0,r.Ah)((()=>document.removeEventListener("click",d))),(0,r.YP)((()=>({...e})),(()=>c.value=l())),{buttonRef:n,isRight:o,visible:t,buttonContent:c,currentColor:s,triggerSelect:p,triggerClick:h,toggleDropdown:A,targetRef:a}}});const Ce=["innerHTML"],Be=(0,r._)("span",{class:"colorpicker-button-dropdown-empty"},null,-1),_e=(0,r._)("span",{class:"data-icon data-icon-arrow"},null,-1),Ee={key:0,class:"toolbar-dropdown-list","data-element":"ui"};function Se(e,t,n,i,a,s){const l=(0,r.up)("am-button"),c=(0,r.up)("am-color-picker");return(0,r.wg)(),(0,r.iD)("div",{class:(0,o.C_)(["toolbar-dropdown","colorpicker-button",{"toolbar-dropdown-right":e.isRight}]),ref:"buttonRef"},[(0,r._)("div",{class:(0,o.C_)(["toolbar-dropdown-trigger colorpicker-button-group",{"colorpicker-button-group-active":e.visible}])},[(0,r.Wm)(l,{class:"colorpicker-button-text",name:e.name,title:e.buttonTitle,"on-click":e.triggerClick,disabled:e.disabled,placement:e.placement},{default:(0,r.w5)((()=>[(0,r._)("span",{innerHTML:e.buttonContent},null,8,Ce)])),_:1},8,["name","title","on-click","disabled","placement"]),(0,r.Wm)(l,{class:"colorpicker-button-dropdown toolbar-dropdown-trigger-arrow",name:e.name,title:e.dropdownTitle,"on-click":e.toggleDropdown,disabled:e.disabled,placement:e.placement,ref:"targetRef"},{icon:(0,r.w5)((()=>[Be])),default:(0,r.w5)((()=>[_e])),_:1},8,["name","title","on-click","disabled","placement"])],2),e.visible?((0,r.wg)(),(0,r.iD)("div",Ee,[(0,r.Wm)(c,{engine:e.engine,colors:e.colors,"default-active-color":e.currentColor,"default-color":e.defaultColor,"on-select":e.triggerSelect,"set-stroke":e.setStroke},null,8,["engine","colors","default-active-color","default-color","on-select","set-stroke"])])):(0,r.kq)("v-if",!0)],2)}var Fe="\n.editor-toolbar .colorpicker-button .colorpicker-button-group {\n padding: 0 2px;\n}\n.colorpicker-button-group .toolbar-button {\n padding: 0;\n}\n.colorpicker-button-group .colorpicker-button-text {\n margin-right: 0;\n min-width: 26px;\n border-radius: 3px 0 0 3px;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-text {\n margin: 0;\n border-radius: 3px 0 0 3px;\n}\n.colorpicker-button-group .colorpicker-button-text:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group .colorpicker-button-dropdown {\n margin-left: -1px;\n min-width: 17px;\n text-align: center;\n padding: 0 0;\n border-radius: 0 3px 3px 0;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup .colorpicker-button-group .colorpicker-button-dropdown {\n line-height: 24px;\n min-width: 17px;\n padding: 0 4px;\n margin: 0;\n margin-left: -1px;\n border-radius: 0 3px 3px 0;\n}\n.colorpicker-button-group .colorpicker-button-dropdown:hover,\n.colorpicker-button-group .colorpicker-button-dropdown:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group .colorpicker-button-dropdown .colorpicker-button-dropdown-empty {\n display: inline-block;\n}\n.colorpicker-button-group:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-button-group-active .toolbar-button,\n.colorpicker-button-group-active:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n";G(Fe),ke.render=Se,ke.__file="src/components/color/color.vue";var Te=(0,r.aZ)({name:"am-collapse-item",components:{APopover:h.Z},props:Q,setup(e){const t=(0,i.iH)(!1),n=t=>{t.preventDefault(),e.onMouseDown&&e.onMouseDown(t,e.engine)},r=t=>{if(e.disabled)return;const n=t.target.nodeName;if("INPUT"!==n&&"TEXTAREA"!==n&&t.preventDefault(),(!e.onClick||!1!==e.onClick(t,e.name,e.engine))&&!1!==e.autoExecute){let t=e.name,n=[];e.command&&(Array.isArray(e.command)?n=e.command:(t=e.command.name,n=e.command.args)),e.engine&&e.engine.command.execute(t,...n)}},o=()=>{t.value=!e.disabled},a=()=>{t.value=!1};return{iconIsHtml:/^<.*>/.test((e.icon||"").trim()),active:t,disabled:e.disabled,handleClick:r,handleMouseDown:n,triggerMouseEnter:o,triggerMouseLeave:a}}});const Me=["innerHTML"],Ie={key:0,class:"toolbar-collapse-item-text"},Ne={class:"toolbar-collapse-item-title"},Ue={key:0,class:"toolbar-collapse-item-description"};function Le(e,t,n,i,a,s){const l=(0,r.up)("a-popover");return(0,r.wg)(),(0,r.j4)(l,{placement:e.placement||"right",content:"function"===typeof e.prompt?e.prompt():e.prompt,overlayClassName:e.prompt?"":"prompt-popover-hide"},{default:(0,r.w5)((()=>[(0,r._)("div",{class:(0,o.C_)(["toolbar-collapse-item",{"toolbar-collapse-item-active":e.active},{"toolbar-collapse-item-disabled":e.disabled},e.className]),onMouseenter:t[0]||(t[0]=(...t)=>e.triggerMouseEnter&&e.triggerMouseEnter(...t)),onMouseleave:t[1]||(t[1]=(...t)=>e.triggerMouseLeave&&e.triggerMouseLeave(...t)),onClick:t[2]||(t[2]=(...t)=>e.handleClick&&e.handleClick(...t)),onMousedown:t[3]||(t[3]=(...t)=>e.handleMouseDown&&e.handleMouseDown(...t))},[(0,r.WI)(e.$slots,"icon",{},(()=>[e.iconIsHtml?((0,r.wg)(),(0,r.iD)("span",{key:0,innerHTML:e.icon},null,8,Me)):(0,r.kq)("v-if",!0),!e.iconIsHtml&&e.icon?((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,o.C_)(`data-icon data-icon-${e.icon}`)},null,2)):(0,r.kq)("v-if",!0)])),e.title?((0,r.wg)(),(0,r.iD)("div",Ie,[(0,r._)("div",Ne,(0,o.zw)(e.title),1),e.description?((0,r.wg)(),(0,r.iD)("div",Ue,(0,o.zw)("function"===typeof e.description?e.description():e.description),1)):(0,r.kq)("v-if",!0)])):(0,r.kq)("v-if",!0)],34)])),_:3},8,["placement","content","overlayClassName"])}var Qe="\n.prompt-popover-hide {\n display: none;\n}\n";G(Qe),Te.render=Le,Te.__file="src/components/collapse/item.vue";var De=(0,r.aZ)({name:"am-collapse-group",components:{AmCollapseItem:Te},props:D,setup(e){const t=(t,n,r)=>{let i;const o=e.items.find((e=>e.name===n));return o&&o.onClick&&(i=o.onClick(t,n,r)),e.onSelect&&e.onSelect(t,n,r),i};return{omit:A(),onClick:t}}});const He={class:"toolbar-collapse-group"},Oe={key:0,class:"toolbar-collapse-group-title"};function ze(e,t,n,i,a,s){const l=(0,r.up)("am-collapse-item");return(0,r.wg)(),(0,r.iD)("div",He,[e.title?((0,r.wg)(),(0,r.iD)("div",Oe,(0,o.zw)(e.title),1)):(0,r.kq)("v-if",!0),((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.items,(t=>((0,r.wg)(),(0,r.j4)(l,(0,r.dG)({key:t.name,engine:e.engine},{...e.omit(t,"onClick","onDisabled")},{"on-click":e.onClick}),null,16,["engine","on-click"])))),128))])}De.render=ze,De.__file="src/components/collapse/group.vue";var Ze=(0,r.aZ)({name:"am-collapse",components:{AmButton:q,AmCollapseGroup:De},props:H,setup(e){const t=!(e.icon||e.content),n=(0,i.iH)(t),o=(0,i.iH)(null),a=Y(o);(0,r.Ah)((()=>{t&&document.removeEventListener("click",l)}));const s=()=>{n.value=!0,setTimeout((()=>{document.addEventListener("click",l)}),10)},l=e=>{document.removeEventListener("click",l),n.value=!1},c=()=>{n.value?l():s()},A=(t,n)=>{l(),e.onSelect&&e.onSelect(t,n)};return{isCustomize:t,visible:n,collapse:o,isRight:a,triggerClick:c,triggerSelect:A}}});const Re={key:1,class:"toolbar-dropdown-list","data-element":"ui"},Pe=["innerHTML"],qe={class:"toolbar-collapse-content"};function Ke(e,t,n,i,a,s){const l=(0,r.up)("am-button"),c=(0,r.up)("am-collapse-group");return(0,r.wg)(),(0,r.iD)("div",{class:(0,o.C_)(["toolbar-dropdown toolbar-collapse",{"toolbar-dropdown-right":e.isRight},e.className]),ref:"collapse"},[e.isCustomize?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.j4)(l,{key:0,name:"collapse",icon:e.icon,content:e.content,"on-click":e.triggerClick,active:e.visible,disabled:e.disabled},null,8,["icon","content","on-click","active","disabled"])),e.visible?((0,r.wg)(),(0,r.iD)("div",Re,[(0,r.WI)(e.$slots,"header",{},(()=>[e.header?((0,r.wg)(),(0,r.iD)("div",{key:0,class:"toolbar-collapse-header",innerHTML:e.header},null,8,Pe)):(0,r.kq)("v-if",!0)])),(0,r._)("div",qe,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.groups,((t,n)=>((0,r.wg)(),(0,r.j4)(c,(0,r.dG)({key:n,engine:e.engine},t,{"on-select":e.triggerSelect}),null,16,["engine","on-select"])))),128))])])):(0,r.kq)("v-if",!0)],2)}var We="\n.toolbar-collapse-header {\r\n color: #8c8c8c;\r\n margin: 4px 16px 0;\r\n font-size: 12px;\r\n line-height: 20px;\r\n text-align: left;\r\n padding-bottom: 8px;\r\n margin-bottom: 6px;\r\n border-bottom: 1px solid #e8e8e8;\n}\n.toolbar-collapse-header code{\r\n background-color: #f5f5f5;\r\n border-radius: 4px;\r\n padding: 2px;\r\n border: 1px solid #d9d9d9;\n}\n.toolbar-collapse-content {\r\n min-width: 200px\n}\n.toolbar-collapse-group-title {\r\n padding: 2px 16px;\r\n text-align: left;\r\n color: #8c8c8c;\r\n font-weight: 700;\r\n font-size: 12px;\r\n line-height: 24px;\n}\n.toolbar-collapse-item {\r\n display: flex;\r\n cursor: pointer;\r\n padding: 4px 16px 0;\n}\n.toolbar-collapse-item-active {\r\n background-color: #f4f4f4;\n}\n.editor-toolbar .toolbar-collapse-item-disabled, .data-toolbar-component-list .toolbar-collapse-item-disabled, .editor-toolbar:not(.editor-toolbar-mobile) .toolbar-collapse-item-disabled:hover, .data-toolbar-component-list .toolbar-collapse-item-disabled:hover {\r\n background-color: transparent;\r\n border: 1px solid transparent;\r\n box-shadow: none;\r\n color: #000000;\r\n opacity: 0.25;\r\n cursor: not-allowed;\n}\n.toolbar-collapse-item .toolbar-collapse-item-text\r\n{\r\n display: block;\r\n text-align: left;\r\n margin-left: 8px;\n}\n.toolbar-collapse-item .toolbar-collapse-item-title{\r\n display: block;\r\n color: #595959;\r\n line-height: 24px;\r\n font-size: 14px;\r\n font-weight: normal;\n}\n.toolbar-collapse-item .toolbar-collapse-item-description\r\n{\r\n display: block;\r\n font-size: 12px;\r\n color: rgba(0,0,0,.45);\n}\r\n";G(We),Ze.render=Ke,Ze.__file="src/components/collapse/collapse.vue";var je=(0,r.aZ)({name:"am-group",components:{AmButton:q,AmDropdown:oe,AmColor:ke,AmCollapse:Ze,AmPopover:h.Z},props:O,setup(){return{isMobile:u.tq}},methods:{getPopupContainer:()=>document.querySelector(".data-toolbar-popup-wrapper")||document.querySelector(".editor-toolbar")||document.body}});const Ve={key:0,class:"editor-toolbar-group"},Ge={key:1,class:"editor-toolbar-group"};function $e(e,t,n,i,a,s){const l=(0,r.up)("am-button"),c=(0,r.up)("am-dropdown"),A=(0,r.up)("am-color"),u=(0,r.up)("am-collapse"),d=(0,r.up)("am-popover");return(0,r.wg)(),(0,r.iD)(r.HY,null,[e.icon||e.content?((0,r.wg)(),(0,r.iD)("div",Ve,[(0,r.Wm)(d,{"get-popup-container":e.getPopupContainer,"overlay-class-name":"editor-toolbar-popover","arrow-point-at-center":!0,placement:e.isMobile?"topRight":void 0},{content:(0,r.w5)((()=>[(0,r._)("div",{class:(0,o.C_)(["editor-toolbar",{"editor-toolbar-mobile":e.isMobile&&!e.popup,"editor-toolbar-popup":e.popup}]),"data-element":"ui"},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.items,((t,n)=>((0,r.wg)(),(0,r.iD)(r.HY,{key:n},["button"===t.type?((0,r.wg)(),(0,r.j4)(l,(0,r.dG)({key:0,key:n},t,{placement:"top",engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"dropdown"===t.type?((0,r.wg)(),(0,r.j4)(c,(0,r.dG)({key:1,key:n},t,{placement:"top",engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"color"===t.type?((0,r.wg)(),(0,r.j4)(A,(0,r.dG)({key:2,key:n},t,{placement:"top",engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"collapse"===t.type?((0,r.wg)(),(0,r.j4)(u,(0,r.dG)({key:3,key:n},t,{engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0)],64)))),128))],2)])),default:(0,r.w5)((()=>[(0,r.Wm)(l,{name:"group-popover",icon:e.icon,content:e.content},null,8,["icon","content"])])),_:1},8,["get-popup-container","placement"])])):(0,r.kq)("v-if",!0),e.icon||e.content?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("div",Ge,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.items,((t,n)=>((0,r.wg)(),(0,r.iD)(r.HY,{key:n},["button"===t.type?((0,r.wg)(),(0,r.j4)(l,(0,r.dG)({key:0,key:n},t,{engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"dropdown"===t.type?((0,r.wg)(),(0,r.j4)(c,(0,r.dG)({key:1,key:n},t,{engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"color"===t.type?((0,r.wg)(),(0,r.j4)(A,(0,r.dG)({key:2,key:n},t,{engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0),"collapse"===t.type?((0,r.wg)(),(0,r.j4)(u,(0,r.dG)({key:3,key:n},t,{engine:e.engine}),null,16,["engine"])):(0,r.kq)("v-if",!0)],64)))),128))]))],64)}var Ye="\n.editor-toolbar-group {\n padding: 4px;\n width: auto;\n border-left: 1px solid #e8e8e8;\n display: flex;\n align-items: stretch;\n}\n.editor-toolbar .editor-toolbar-group:nth-child(1) {\n border-left: none;\n}\n";G(Ye),je.render=$e,je.__file="src/components/group.vue";var Xe={toolbar:{collapse:{title:"Type ".concat(u.MX?"⌘":"Ctrl"," + / to quickly insert a card")},undo:{title:"Undo"},redo:{title:"Redo"},paintformat:{title:"Format brush"},removeformat:{title:"Clear format"},heading:{title:"Text and title",p:"Text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},fontfamily:{title:"Font family",notInstalled:"The font may not be installed",items:{default:"Default",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"FangSong",stFangsong:"STFangsong",stSong:"STSong",stKaiti:"STKaiti",simSun:"SimSum",microsoftYaHei:"Microsoft YaHei",kaiTi:"KaiTi",kaitiSC:"KaiTi SC",simHei:"SimHei",heitiSC:"Heiti SC",fzHei:"FZHeiTi",fzKai:"FZKaiTi",fzFangSong:"FZFangSong"}},fontsize:{title:"Font size"},fontcolor:{title:"Font color",more:"More colors"},backcolor:{title:"Background color",more:"More colors"},bold:{title:"Bold"},italic:{title:"Italic"},strikethrough:{title:"Strikethrough"},underline:{title:"Underline"},moremark:{title:"More text styles",sup:"Sup",sub:"Sub",code:"Inline code"},alignment:{title:"Alignment",left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},unorderedlist:{title:"Unordered list"},orderedlist:{title:"Ordered list"},tasklist:{title:"Task list"},indent:{title:"Ident",in:"Increase indent",out:"Reduce indent"},"line-height":{title:"Line height",default:"Default"},link:{title:"Insert Link"},quote:{title:"Insert reference"},hr:{title:"Insert dividing line"},colorPicker:{defaultText:"Default Color",nonFillText:"No fill color","#000000":"Black","#262626":"Dark Gray 3","#595959":"Dark Gray 2","#8C8C8C":"Dark Gray 1","#BFBFBF":"Gray","#D9D9D9":"Light Gray 4","#E9E9E9":"Light Gray 3","#F5F5F5":"Light Gray 2","#FAFAFA":"Light Gray 1","#FFFFFF":"White","#F5222D":"Red","#FA541C":"Chinese Red","#FA8C16":"Orange","#FADB14":"Yellow","#52C41A":"Green","#13C2C2":"Cyan","#1890FF":"Light Blue","#2F54EB":"Blue","#722ED1":"Purple","#EB2F96":"Magenta","#FFE8E6":"Red 1","#FFECE0":"Chinese Red 1","#FFEFD1":"Orange 1","#FCFCCA":"Yellow 1","#E4F7D2":"Green 1","#D3F5F0":"Cyan 1","#D4EEFC":"Light Blue 1","#DEE8FC":"Blue 1","#EFE1FA":"Purple 1","#FAE1EB":"Magenta 1","#FFA39E":"Red 2","#FFBB96":"Chinese Red 2","#FFD591":"Orange 2","#FFFB8F":"Yellow 2","#B7EB8F":"Green 2","#87E8DE":"Cyan 2","#91D5FF":"Light Blue 2","#ADC6FF":"Blue 2","#D3ADF7":"Purple 2","#FFADD2":"Magenta 2","#FF4D4F":"Red 3","#FF7A45":"Chinese Red 3","#FFA940":"Orange 3","#FFEC3D":"Yellow 3","#73D13D":"Green 3","#36CFC9":"Cyan 3","#40A9FF":"Light Blue 3","#597EF7":"Blue 3","#9254DE":"Purple 3","#F759AB":"Magenta 3","#CF1322":"Red 4","#D4380D":"Chinese Red 4","#D46B08":"Orange 4","#D4B106":"Yellow 4","#389E0D":"Green 4","#08979C":"Cyan 4","#096DD9":"Light Blue 4","#1D39C4":"Blue 4","#531DAB":"Purple 4","#C41D7F":"Magenta 4","#820014":"Red 5","#871400":"Chinese Red 5","#873800":"Orange 5","#614700":"Yellow 5","#135200":"Green 5","#00474F":"Cyan 5","#003A8C":"Light Blue 5","#061178":"Blue 5","#22075E":"Purple 5","#780650":"Magenta 5"},component:{placeholder:"Card name"},image:{title:"Image"},codeblock:{title:"Codeblock"},table:{title:"Table"},file:{title:"File"},video:{title:"Video"},math:{title:"Formula"},status:{title:"Status"},mind:{title:"Mind Map"},commonlyUsed:{title:"Commonly used"},searchEmtpy:{title:"No matching card"}}},Je={toolbar:{collapse:{title:"输入 ".concat(u.MX?"⌘":"Ctrl"," + / 快速插入卡片")},undo:{title:"撤销"},redo:{title:"重做"},paintformat:{title:"格式刷"},removeformat:{title:"清除格式"},heading:{title:"正文与标题",p:"正文",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{title:"字体",notInstalled:"可能未安装该字体",items:{default:"默认",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"仿宋",stFangsong:"华文仿宋",stSong:"华文宋体",stKaiti:"华文楷体",simSun:"宋体",microsoftYaHei:"微软雅黑",kaiTi:"楷体",kaitiSC:"楷体-简",simHei:"黑体",heitiSC:"黑体-简",fzHei:"方正黑体",fzKai:"方正楷体",fzFangSong:"方正仿宋"}},fontsize:{title:"字号"},fontcolor:{title:"字体颜色",more:"更多颜色"},backcolor:{title:"背景颜色",more:"更多颜色"},bold:{title:"粗体"},italic:{title:"斜体"},strikethrough:{title:"删除线"},underline:{title:"下划线"},moremark:{title:"更多文本样式",sup:"上标",sub:"下标",code:"行内代码"},alignment:{title:"对齐方式",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},unorderedlist:{title:"无序列表"},orderedlist:{title:"有序列表"},tasklist:{title:"任务列表"},indent:{title:"缩进",in:"增加缩进",out:"减少缩进"},"line-height":{title:"行高",default:"默认"},link:{title:"链接"},quote:{title:"插入引用"},hr:{title:"插入分割线"},colorPicker:{defaultText:"默认",nonFillText:"无填充色","#000000":"黑色","#262626":"深灰 3","#595959":"深灰 2","#8C8C8C":"深灰 1","#BFBFBF":"灰色","#D9D9D9":"浅灰 4","#E9E9E9":"浅灰 3","#F5F5F5":"浅灰 2","#FAFAFA":"浅灰 1","#FFFFFF":"白色","#F5222D":"红色","#FA541C":"朱红","#FA8C16":"橙色","#FADB14":"黄色","#52C41A":"绿色","#13C2C2":"青色","#1890FF":"浅蓝","#2F54EB":"蓝色","#722ED1":"紫色","#EB2F96":"玫红","#FFE8E6":"红色 1","#FFECE0":"朱红 1","#FFEFD1":"橙色 1","#FCFCCA":"黄色 1","#E4F7D2":"绿色 1","#D3F5F0":"青色 1","#D4EEFC":"浅蓝 1","#DEE8FC":"蓝色 1","#EFE1FA":"紫色 1","#FAE1EB":"玫红 1","#FFA39E":"红色 2","#FFBB96":"朱红 2","#FFD591":"橙色 2","#FFFB8F":"黄色 2","#B7EB8F":"绿色 2","#87E8DE":"青色 2","#91D5FF":"浅蓝 2","#ADC6FF":"蓝色 2","#D3ADF7":"紫色 2","#FFADD2":"玫红 2","#FF4D4F":"红色 3","#FF7A45":"朱红 3","#FFA940":"橙色 3","#FFEC3D":"黄色 3","#73D13D":"绿色 3","#36CFC9":"青色 3","#40A9FF":"浅蓝 3","#597EF7":"蓝色 3","#9254DE":"紫色 3","#F759AB":"玫红 3","#CF1322":"红色 4","#D4380D":"朱红 4","#D46B08":"橙色 4","#D4B106":"黄色 4","#389E0D":"绿色 4","#08979C":"青色 4","#096DD9":"浅蓝 4","#1D39C4":"蓝色 4","#531DAB":"紫色 4","#C41D7F":"玫红 4","#820014":"红色 5","#871400":"朱红 5","#873800":"橙色 5","#614700":"黄色 5","#135200":"绿色 5","#00474F":"青色 5","#003A8C":"浅蓝 5","#061178":"蓝色 5","#22075E":"紫色 5","#780650":"玫红 5"},component:{placeholder:"卡片名称"},image:{title:"图片"},codeblock:{title:"代码块"},table:{title:"表格"},file:{title:"附件"},video:{title:"视频"},math:{title:"公式"},status:{title:"状态"},mind:{title:"脑图"},commonlyUsed:{title:"常用"},searchEmtpy:{title:"无匹配卡片"}}},et={"en-US":Xe,"zh-CN":Je},tt=(0,r.aZ)({name:"am-table",props:{maxRows:Number,maxCols:Number,minRows:Number,minCols:Number,onSelect:Function},setup(e){const t=(0,i.iH)(e.maxRows||10),n=(0,i.iH)(e.maxCols||10),r=(0,i.iH)(e.minRows||4),o=(0,i.iH)(e.minCols||4),a=(0,i.iH)(4),s=(0,i.iH)(4),l=(0,i.iH)(0),c=(0,i.iH)(0);return{maxRows:t,maxCols:n,minRows:r,minCols:o,currentRows:a,currentCols:s,selectedRows:l,selectedCols:c}},methods:{triggerMouseDown(e){e.preventDefault()},triggerSelect(e,t,n){this.onSelect&&this.onSelect(e,t+1,n+1)},triggerHover(e,t){const n=Math.max(this.minRows,Math.min(this.maxRows,e+2)),r=Math.max(this.minCols,Math.min(this.maxCols,t+2));this.currentRows=n,this.currentCols=r,this.selectedRows=e+1,this.selectedCols=t+1}}});const nt={"data-element":"ui",class:"data-toolbar-table-selector"},rt=["onClick","onMouseover"],it={class:"data-toolbar-table-selector-info"};function ot(e,t,n,i,a,s){return(0,r.wg)(),(0,r.iD)("div",nt,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.currentRows,(n=>((0,r.wg)(),(0,r.iD)("div",{class:"data-toolbar-table-selector-tr",key:n},[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.currentCols,(i=>((0,r.wg)(),(0,r.iD)("div",{class:(0,o.C_)([{"data-toolbar-table-selector-td":!0},{actived:n-1e.triggerSelect(t,n-1,i-1),onMousedown:t[0]||(t[0]=t=>e.triggerMouseDown(t)),onMouseover:t=>e.triggerHover(n-1,i-1)},null,42,rt)))),128))])))),128)),(0,r._)("div",it,(0,o.zw)(void 0===e.selectedRows?0:e.selectedRows)+"x"+(0,o.zw)(void 0===e.selectedCols?0:e.selectedCols),1)])}var at="\n.data-toolbar-table-selector .data-toolbar-table-selector-tr {\r\n display: flex;\r\n flex-wrap: nowrap;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-tr .data-toolbar-table-selector-td {\r\n width: 20px;\r\n height: 16px;\r\n border: 1px solid #d9d9d9;\r\n margin-right: -1px;\r\n margin-bottom: -1px;\r\n cursor: pointer;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-tr .data-toolbar-table-selector-td.actived {\r\n background: #ddefff;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-info {\r\n text-align: center;\n}\r\n";G(at),tt.render=ot,tt.__file="src/components/table.vue";var st=[{key:"default",value:""},{key:"arial",value:"Arial"},{key:"comicSansMS",value:'"Comic Sans MS"'},{key:"courierNew",value:'"Courier New"'},{key:"georgia",value:"Georgia"},{key:"helvetica",value:"Helvetica"},{key:"impact",value:"Impact"},{key:"timesNewRoman",value:'"Times New Roman"'},{key:"trebuchetMS",value:'"Trebuchet MS"'},{key:"verdana",value:"Verdana"},{key:"fangSong",value:"FangSong, 仿宋, FZFangSong-Z02S, STFangsong, fangsong"},{key:"stFangsong",value:"STFangsong, 华文仿宋, FangSong, FZFangSong-Z02S, fangsong"},{key:"stSong",value:'STSong, 华文宋体, SimSun, "Songti SC", NSimSun, serif'},{key:"stKaiti",value:'STKaiti, 华文楷体, KaiTi, "Kaiti SC", cursive'},{key:"simSun",value:'SimSun, 宋体, "Songti SC", NSimSun, STSong, serif'},{key:"microsoftYaHei",value:'"Microsoft YaHei", 微软雅黑, "PingFang SC", SimHei, STHeiti, sans-serif'},{key:"kaiTi",value:'KaiTi, 楷体, STKaiti, "Kaiti SC", cursive'},{key:"kaitiSC",value:'"Kaiti SC"'},{key:"simHei",value:'SimHei, 黑体, "Microsoft YaHei", "PingFang SC", STHeiti, sans-serif'},{key:"heitiSC",value:'"Heiti SC"'},{key:"fzHei",value:"FZHei-B01S"},{key:"fzKai",value:"FZKai-Z03S"},{key:"fzFangSong",value:"FZFangSong-Z02S"}],lt=function(e,t){return P((function(n){return e.map((function(e){var r=e.key,i=e.value,o="default"!==r&&!i.split(",").some((function(e){return n(e.trim())}));return{key:i,faimlyName:t?t[r]:r,content:'').concat(t?t[r]:r,""),hotkey:!1,disabled:o,title:o?t&&t["notInstalled"]||"The font may not be installed":void 0}}))}))},ct=".editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .toolbar-button {\r\n font-weight: bold;\r\n min-width: 73px;\r\n}\r\n\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h1,\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h2,\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h3,\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h4,\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h5,\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\r\n line-height: 1.6;\r\n font-weight: bold;\r\n color: #262626;\r\n}\r\n\r\n.heading-item-h1 {\r\n font-size: 28px;\r\n}\r\n\r\n.heading-item-h2 {\r\n font-size: 24px;\r\n}\r\n\r\n.heading-item-h3 {\r\n font-size: 20px;\r\n}\r\n\r\n.heading-item-h4 {\r\n font-size: 16px;\r\n}\r\n\r\n.heading-item-h5 {\r\n font-size: 14px;\r\n}\r\n\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\r\n font-size: 14px;\r\n font-weight: normal;\r\n}\r\n\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontsize .toolbar-button {\r\n font-weight: bold;\r\n min-width: 58px;\r\n}\r\n\r\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontfamily .toolbar-button {\r\n font-size: 12px;\r\n}";G(ct);var At=function(e){var t=e.language.get("toolbar"),n=e.container.css("font-size");return[{type:"collapse",header:t["collapse"]["title"],icon:"collapse",groups:[{items:[{name:"image-uploader",icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["image"]["title"],search:"图片,tupian,image,img"},{name:"codeblock",icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["codeblock"]["title"],search:"代码块,daimakuai,code"},{name:"table",command:{name:"table",args:[3,3]},placement:"rightTop",onDisabled:function(){return!!e.card.active||!e.command.queryEnabled("table")},prompt:e.card.active||!e.command.queryEnabled("table")?void 0:(0,r.h)(tt,{onSelect:function(t,n,r){e.command.execute("table",n,r)}}),icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["table"]["title"],search:"biaoge,table"},{name:"file-uploader",icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["file"]["title"],search:"附件,文件,fujian,wenjian,file"},{name:"video-uploader",icon:'\n\t\t\t\t\t\t\t\t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\t\t\t\t\t',title:t["video"]["title"],search:"视频,MP4,shipin,video"},{name:"math",icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["math"]["title"],search:"公式,数学公式,gongshi,formula,math,latex"},{name:"status",icon:'\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',title:t["status"]["title"],search:"status,label,状态"}]}]},{type:"button",name:"undo",icon:"undo",title:t["undo"]["title"],onDisabled:function(){return!e.command.queryState("undo")||!e.command.queryEnabled("undo")},onActive:function(){return!1}},{type:"button",name:"redo",icon:"redo",title:t["redo"]["title"],onDisabled:function(){return!e.command.queryState("redo")||!e.command.queryEnabled("redo")},onActive:function(){return!1}},{type:"button",name:"paintformat",icon:"paintformat",title:t["paintformat"]["title"]},{type:"button",name:"removeformat",icon:"clean",title:t["removeformat"]["title"]},{type:"dropdown",name:"heading",className:"toolbar-dropdown-heading",title:t["heading"]["title"],items:[{key:"p",className:"heading-item-p",content:t["heading"]["p"]},{key:"h1",className:"heading-item-h1",content:t["heading"]["h1"]},{key:"h2",className:"heading-item-h2",content:t["heading"]["h2"]},{key:"h3",className:"heading-item-h3",content:t["heading"]["h3"]},{key:"h4",className:"heading-item-h4",content:t["heading"]["h4"]},{key:"h5",className:"heading-item-h5",content:t["heading"]["h5"]},{key:"h6",className:"heading-item-h6",content:t["heading"]["h6"]}]},{type:"dropdown",name:"fontsize",className:"toolbar-dropdown-fontsize",title:t["fontsize"]["title"],items:[{key:"12px",content:"12px",hotkey:!1},{key:"13px",content:"13px",hotkey:!1},{key:"14px",content:"14px",hotkey:!1},{key:"15px",content:"15px",hotkey:!1},{key:"16px",content:"16px",hotkey:!1},{key:"19px",content:"19px",hotkey:!1},{key:"22px",content:"22px",hotkey:!1},{key:"24px",content:"24px",hotkey:!1},{key:"29px",content:"29px",hotkey:!1},{key:"32px",content:"32px",hotkey:!1},{key:"40px",content:"40px",hotkey:!1},{key:"48px",content:"48px",hotkey:!1}].map((function(e){return e.key===n?(0,d.Z)((0,d.Z)({},e),{},{isDefault:!0}):e})),onDisabled:function(){var t=e.command.queryState("heading")||"p";return/^h\d$/.test(t)||!e.command.queryEnabled("fontsize")}},{type:"dropdown",name:"fontfamily",className:"toolbar-dropdown-fontfamily",title:t["fontfamily"]["title"],items:lt(st,(0,d.Z)((0,d.Z)({},t["fontfamily"]["items"]),{},{notInstalled:t["fontfamily"]["notInstalled"]})),onActive:function(t){var n,r=e.command.queryState("fontfamily");if(!r||!Array.isArray(r)||0===r.length)return"";var i=r[0].split(",").map((function(e){return e.replace(/"/g,"").trim().toLowerCase()}));return(null===(n=t.find((function(e){return i.indexOf(e["faimlyName"].trim().toLowerCase())>-1})))||void 0===n?void 0:n.key)||""}},{type:"button",name:"bold",icon:"bold",title:t["bold"]["title"],onDisabled:function(){var t=e.command.queryState("heading")||"p";return/^h\d$/.test(t)||!e.command.queryEnabled("bold")}},{type:"button",name:"italic",icon:"italic",title:t["italic"]["title"]},{type:"button",name:"strikethrough",icon:"strikethrough",title:t["strikethrough"]["title"]},{type:"button",name:"underline",icon:"underline",title:t["underline"]["title"]},{type:"dropdown",name:"moremark",icon:"moremark",single:!1,title:t["moremark"]["title"],items:[{key:"sup",icon:"sup",content:t["moremark"]["sup"],disabled:!e.command.queryEnabled("sup"),command:{name:"sup",args:[]}},{key:"sub",icon:"sub",disabled:!e.command.queryEnabled("sub"),content:t["moremark"]["sub"],command:{name:"sub",args:[]}},{key:"code",icon:"code",disabled:!e.command.queryEnabled("code"),content:t["moremark"]["code"],command:{name:"code",args:[]}}],onDisabled:function(){var t=[];return!0===e.command.queryEnabled("sup")&&t.push("sup"),!0===e.command.queryEnabled("sub")&&t.push("sub"),!0===e.command.queryEnabled("code")&&t.push("code"),0===t.length},onActive:function(){var t=[];return!0===e.command.queryState("sup")&&t.push("sup"),!0===e.command.queryState("sub")&&t.push("sub"),!0===e.command.queryState("code")&&t.push("code"),t}},{type:"color",name:"fontcolor",defaultColor:"#262626",defaultActiveColor:"#F5222D",buttonTitle:t["fontcolor"]["title"],dropdownTitle:t["fontcolor"]["more"],content:function(e,t,n){return!0===n&&(e="#BFBFBF",t="#BFBFBF"),'\n\t\t\t\t\t\tcolor-font\n\t\t\t\t\t\tCreated with Sketch.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t')}},{type:"color",name:"backcolor",defaultColor:"transparent",defaultActiveColor:"#FADB14",buttonTitle:t["backcolor"]["title"],dropdownTitle:t["backcolor"]["more"],content:function(e,t,n){return!0===n&&(e="#BFBFBF",t="#BFBFBF"),'\n \n \n \n\t\t\t\t\t')}},{type:"dropdown",name:"alignment",title:t["alignment"]["title"],items:[{key:"left",icon:"align-left",content:t["alignment"]["left"]},{key:"center",icon:"align-center",content:t["alignment"]["center"]},{key:"right",icon:"align-right",content:t["alignment"]["right"]},{key:"justify",icon:"align-justify",content:t["alignment"]["justify"]}]},{type:"button",name:"unorderedlist",icon:"unordered-list",title:t["unorderedlist"]["title"]},{type:"button",name:"orderedlist",icon:"ordered-list",title:t["orderedlist"]["title"]},{type:"button",name:"tasklist",icon:"task-list",title:t["tasklist"]["title"]},{type:"dropdown",name:"indent",icon:"indent",hasDot:!1,title:t["indent"]["title"],items:[{key:"in",icon:"indent",content:t["indent"]["in"]},{key:"out",icon:"outdent",content:t["indent"]["out"]}]},{type:"dropdown",name:"line-height",content:function(){return''},title:t["line-height"]["title"],items:[{key:"default",content:t["line-height"]["default"]},{key:"1",content:"1"},{key:"1.15",content:"1.15"},{key:"1.5",content:"1.5"},{key:"2",content:"2"},{key:"2.5",content:"2.5"},{key:"3",content:"3"}]},{type:"button",name:"link",icon:"link",command:{name:"link",args:["_blank"]},title:t["link"]["title"],onDisabled:function(){var t=e.card,n=(0,u.iC)(e)?e.change.range.get():u.e6.from(e);if(!n)return!e.command.queryEnabled("link");var r=t.find(n.startNode);return!!r&&!r.isCursor(n.startNode)||n.containsCard()||!e.command.queryEnabled("link")}},{type:"button",name:"quote",icon:"quote",title:t["quote"]["title"]},{type:"button",name:"hr",icon:"hr",title:t["hr"]["title"]}]},ut=(0,r.aZ)({name:"am-toolbar",components:{AmGroup:je},props:z,setup(e){let t=(0,i.iH)([]);const n=()=>{e.engine.isFocus()&&!e.engine.readonly&&(s.value&&clearTimeout(s.value),s.value=setTimeout((()=>{const e=a.value,t=e.getBoundingClientRect(),n=(0,u.ZQ)(getComputedStyle(e).borderTopWidth),r=(0,u.ZQ)(getComputedStyle(e).borderBottomWidth),i=t.height||0;c.top=Math.max(document.body.scrollTop,document.documentElement.scrollTop)+(window.visualViewport.height||0)-i+n+r}),10))},o=()=>{u.tq&&n();const r=[],i=At(e.engine);e.items.forEach((t=>{const n={items:[]};Array.isArray(t)||(n.icon=t.icon,n.content=t.content,t=t.items),t.forEach((t=>{let r;if("string"===typeof t){const e=i.find((e=>"collapse"===t?e.type===t:"collapse"!==e.type&&e.name===t));e&&(r=e)}else{const e=i.find((e=>"collapse"===t.type?e.type===t.type:"collapse"!==e.type&&e.name===t.name));if("collapse"===t.type){const n={...l()(A()({...e},"groups"),A()({...t},"groups")),groups:[]};t.groups.forEach((t=>{const r=[];t.items.forEach((t=>{let n;e.groups.some((e=>e.items.some((e=>{const r=e.name===("string"===typeof t?t:t.name);return r&&(n={...e,..."string"===typeof t?{}:t}),r})))),n?r.push(n):"object"===typeof t&&r.push(t)})),r.length>0&&n.groups.push({...A()(t,"itmes"),items:r})})),r=n.groups.length>0?n:void 0}else"dropdown"===t.type?(r=e?l()(e,A()({...t},"type","items")):{...t},r.items=t.items):r=e?l()(e,A()({...t},"type")):{...t}}r&&("button"===r.type?r.onActive?r.active=r.onActive():e.engine.command.queryEnabled(r.name)&&(r.active=e.engine.command.queryState(r.name)):"dropdown"===r.type&&(r.onActive?r.values=r.onActive(r.items):r.values=e.engine.command.queryState(r.name)),"collapse"!==r.type?r.disabled=r.onDisabled?r.onDisabled():!e.engine.command.queryEnabled(r.name):(r.groups.forEach((t=>t.items.forEach((t=>{t.disabled=t.onDisabled?t.onDisabled():!e.engine.command.queryEnabled(t.name)})))),r.disabled=!r.groups.some((e=>e.items.some((e=>!e.disabled))))),n.items.push(r))})),n.items.length>0&&r.push(n)})),t.value=r},a=(0,i.iH)(null),s=(0,i.iH)(null),c=(0,i.qj)({top:0});let d;const h=()=>{c.top=-120,clearTimeout(d),d=setTimeout((()=>{n()}),200)},p=()=>{e.engine.readonly?h():n()};let f;const g=()=>{clearTimeout(f),f=setTimeout((()=>{o()}),100)};return(0,r.bv)((()=>{e.engine.language.add(et),e.engine.on("select",g),e.engine.on("change",g),e.engine.on("blur",g),e.engine.on("focus",g),e.engine.on("historyChange",g),u.tq?(e.engine.on("readonly",p),e.engine.on("blur",h),e.engine.isFocus()||h(),document.addEventListener("scroll",n),visualViewport.addEventListener("resize",n),visualViewport.addEventListener("scroll",n)):e.engine.on("readonly",g),g()})),(0,r.Ah)((()=>{e.engine.off("select",g),e.engine.off("change",g),e.engine.off("readonly",g),e.engine.off("blur",g),e.engine.off("focus",g),e.engine.off("historyChange",g),u.tq?(e.engine.off("readonly",p),e.engine.off("blur",h),document.removeEventListener("scroll",n),visualViewport.removeEventListener("resize",n),visualViewport.removeEventListener("scroll",n)):e.engine.off("readonly",g)})),{toolbarRef:a,mobileView:c,isMobile:u.tq,groups:t}},methods:{preventDefault(e){e.preventDefault()},triggerMouseDown(){},triggerMouseOver(e){this.preventDefault(e)},triggerMouseMove(e){this.preventDefault(e)},triggerContextMenu(e){this.preventDefault(e)}}});const dt={class:"editor-toolbar-content"};function ht(e,t,n,i,a,s){const l=(0,r.up)("am-group");return(0,r.wg)(),(0,r.iD)("div",{ref:"toolbarRef",class:(0,o.C_)(["editor-toolbar",e.className,{"editor-toolbar-mobile":e.isMobile&&!e.popup,"editor-toolbar-popup":e.popup}]),style:(0,o.j5)(e.isMobile?{top:`${e.mobileView.top}px`}:{}),"data-element":"ui",onMousedown:t[0]||(t[0]=(...t)=>e.triggerMouseDown&&e.triggerMouseDown(...t)),onMouseover:t[1]||(t[1]=(...t)=>e.triggerMouseOver&&e.triggerMouseOver(...t)),onMousemove:t[2]||(t[2]=(...t)=>e.triggerMouseMove&&e.triggerMouseMove(...t)),onContextmenu:t[3]||(t[3]=(...t)=>e.triggerContextMenu&&e.triggerContextMenu(...t))},[(0,r._)("div",dt,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.groups,((t,n)=>((0,r.wg)(),(0,r.j4)(l,(0,r.dG)({key:n,engine:e.engine,popup:e.popup},t),null,16,["engine","popup"])))),128))])],38)}var pt="\n.ant-tooltip .toolbar-tooltip-title {\n font-size: 12px;\n text-align: center;\n}\n.ant-tooltip .toolbar-tooltip-hotkey {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.85);\n text-align: center;\n}\n.editor-toolbar {\n position: relative;\n width: 100%;\n padding:0;\n z-index: 200;\n border-top:1px solid rgba(0,0,0,.05);\n border-bottom: 1px solid rgba(0,0,0,.05);\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n.editor-toolbar .editor-toolbar-content {\n position: relative;\n flex-direction: row;\n background: transparent;\n text-align: center;\n width: 100%;\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n}\n.editor-toolbar.editor-toolbar-mobile,.editor-toolbar.editor-toolbar-popover {\n position: absolute;\n left: 0;\n box-shadow: none;\n}\n.editor-toolbar.editor-toolbar-popup {\n position: initial;\n box-shadow: none;\n top: 0;\n left: 0;\n border: 0 none;\n}\n.editor-toolbar-mobile .editor-toolbar-content {\n text-align: left;\n padding: 0 12px;\n}\n.editor-toolbar-mobile .editor-toolbar-group,.editor-toolbar-popup .editor-toolbar-group {\n border: 0 none;\n padding: 0;\n}\n.editor-toolbar-popup .editor-toolbar-content {\n text-align: center;\n padding: 0;\n}\n.editor-toolbar-popover .editor-toolbar {\n position: relative;\n box-shadow: none;\n border: 0 none;\n left: 0;\n top: 0;\n display: flex;\n}\n.editor-toolbar-popover {\n border-radius: 3px;\n background: transparent;\n}\n.editor-toolbar-popover .ant-popover-inner {\n border-radius: 3px;\n}\n.editor-toolbar-popover .ant-popover-inner-content {\n padding: 2px;\n}\n.am-engine-mobile {\n margin-bottom: 40px;\n}\n";G(pt),ut.render=ht,ut.__file="src/components/toolbar.vue";var ft=(0,_.Z)("position"),gt=function(){function e(t,n){var r=this;(0,v.Z)(this,e),this.engine=void 0,this.root=void 0,this.otpions=void 0,this.vm=void 0,Object.defineProperty(this,ft,{writable:!0,value:void 0}),this.SCOPE_NAME="data-toolbar-component",this.handlePreventDefault=function(e){var t;if(0!==(null===(t=r.root)||void 0===t?void 0:t.closest("body").length))return e.preventDefault(),!1},this.otpions=n,this.engine=t,(0,B.Z)(this,ft)[ft]=new u.Ly(t)}return(0,m.Z)(e,[{key:"select",value:function(e){var t,n,r;null===(t=this.root)||void 0===t||t.find(".toolbar-collapse-item-active").removeClass("toolbar-collapse-item-active"),null===(n=this.root)||void 0===n||null===(r=n.find(".toolbar-collapse-item").eq(e))||void 0===r||r.addClass("toolbar-collapse-item-active")}},{key:"scroll",value:function(e){if(this.root){var t=this.root.find(".toolbar-collapse-item").toArray(),n=this.root.find(".toolbar-collapse-item-active"),r=t.findIndex((function(e){return e.equal(n)})),i="up"===e?r-1:r+1;i<0&&(i=t.length-1),i>=t.length&&(i=0),n=t[i],this.select(i);var o=0;this.root.find(".toolbar-collapse-group-title,.toolbar-collapse-item").each((function(e){if(n.equal(e))return!1;o+=e.clientHeight}));var a=this.root.get();a.scrollTop=o-a.clientHeight/2}}},{key:"unbindEvents",value:function(){(0,E.deleteScope)(this.SCOPE_NAME),(0,E.unbind)("enter",this.SCOPE_NAME),(0,E.unbind)("up",this.SCOPE_NAME),(0,E.unbind)("down",this.SCOPE_NAME),(0,E.unbind)("esc",this.SCOPE_NAME),this.engine.off("keydown:enter",this.handlePreventDefault)}},{key:"bindEvents",value:function(){var e=this;this.unbindEvents(),(0,E.setScope)(this.SCOPE_NAME),S()("enter",this.SCOPE_NAME,(function(t){var n,r,i;if(0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)){t.preventDefault();var o=null===(r=e.root)||void 0===r?void 0:r.find(".toolbar-collapse-item-active");null===o||void 0===o||null===(i=o.get())||void 0===i||i.click()}})),S()("up",this.SCOPE_NAME,(function(t){var n;0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)&&(t.preventDefault(),e.scroll("up"))})),S()("down",this.SCOPE_NAME,(function(t){var n;0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)&&(t.preventDefault(),e.scroll("down"))})),S()("esc",this.SCOPE_NAME,(function(t){t.preventDefault(),e.unbindEvents();var n=e.otpions.onCancel;n&&n()})),this.engine.on("keydown:enter",this.handlePreventDefault)}},{key:"remove",value:function(){var e;this.root&&0!==this.root.length&&(null===(e=(0,B.Z)(this,ft)[ft])||void 0===e||e.destroy(),this.vm&&this.vm.unmount(),this.root.remove(),this.root=void 0)}},{key:"render",value:function(e,t,n){var r;this.unbindEvents(),this.remove(),this.root=(0,u.$)('

      '),e.append(this.root);var i=this.root.get(),o=this.otpions.onSelect;n.length>0?(this.vm=(0,a.ri)(Ze,{engine:this.engine,groups:n,onSelect:o}),this.vm.mount(i)):this.root.append('
      '.concat(this.engine.language.get("toolbar","searchEmtpy","title"),"
      ")),this.select(0),this.bindEvents(),null===(r=(0,B.Z)(this,ft)[ft])||void 0===r||r.bind(this.root,t)}}]),e}(),mt=(0,_.Z)("editor"),vt=(0,_.Z)("root"),bt=(0,_.Z)("point"),yt=(0,_.Z)("align"),wt=(0,_.Z)("options"),xt=(0,_.Z)("vm"),kt=function(){function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,v.Z)(this,e),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:{left:0,top:-9999}}),Object.defineProperty(this,yt,{writable:!0,value:"bottom"}),Object.defineProperty(this,wt,{writable:!0,value:{}}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),this.onSelect=function(){var e,t=null===(e=u.e6.from((0,B.Z)(i,mt)[mt]))||void 0===e?void 0:e.cloneRange().shrinkToTextNode(),n=window.getSelection();if(t&&n&&n.focusNode&&!t.collapsed&&!(0,B.Z)(i,mt)[mt].card.getSingleSelectedCard(t)&&(t.commonAncestorNode.inEditor((0,B.Z)(i,mt)[mt].container)||t.commonAncestorNode.isRoot((0,B.Z)(i,mt)[mt].container))){var r=t.startNode.next();if((null===r||void 0===r?void 0:r.isElement())&&1===Math.abs(t.endOffset-t.startOffset)){var o=(0,B.Z)(i,mt)[mt].card.closest(r);if(o)return void i.hide()}var a=t.startNode.prev();if((null===a||void 0===a?void 0:a.isElement())&&1===Math.abs(t.startOffset-t.endOffset)){var s=(0,B.Z)(i,mt)[mt].card.closest(a);if(s)return void i.hide()}var l=t.getSubRanges();if(0===l.length||(0,B.Z)(i,mt)[mt].card.active&&!(0,B.Z)(i,mt)[mt].card.active.isEditable)i.hide();else{var c=l[0],A=l[l.length-1],d=c.cloneRange().collapse(!0).getBoundingClientRect(),h=A.cloneRange().collapse(!1).getBoundingClientRect(),p=void 0;i.showContent((function(){var e,t,r;if(p=null===(e=(0,B.Z)(i,vt)[vt].get())||void 0===e?void 0:e.getBoundingClientRect(),p){(0,B.Z)(i,yt)[yt]=A.startNode.equal(n.focusNode)&&(!c.startNode.equal(n.focusNode)||n.focusOffset>n.anchorOffset)?"bottom":"top";var o=12,a="bottom"===(0,B.Z)(i,yt)[yt]?h:d;"top"===(0,B.Z)(i,yt)[yt]&&a.top-p.height-owindow.innerHeight&&((0,B.Z)(i,yt)[yt]="top"),a="bottom"===(0,B.Z)(i,yt)[yt]?h:d;var s=null===(r=(0,B.Z)(i,mt)[mt].scrollNode)||void 0===r?void 0:r.get(),l=null===s||void 0===s?void 0:s.getBoundingClientRect(),u="top"===(0,B.Z)(i,yt)[yt]?a.top-p.height-o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0):a.bottom+o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0),f=a.left-((null===l||void 0===l?void 0:l.left)||0)+((null===s||void 0===s?void 0:s.scrollLeft)||0)+a.width-p.width/2;f<0&&(f=16),(0,B.Z)(i,bt)[bt]={left:f,top:u},(0,B.Z)(i,vt)[vt].css({left:"".concat((0,B.Z)(i,bt)[bt].left,"px"),top:"".concat((0,B.Z)(i,bt)[bt].top,"px")})}else i.hide()}))}}else i.hide()},this.hide=function(e){if(null===e||void 0===e?void 0:e.target){var t=(0,u.$)(e.target);if(t.closest(".data-toolbar-popup-wrapper").length>0||t.closest(u.m6).length>0)return}(0,B.Z)(i,vt)[vt].css({left:"0px",top:"-9999px"})},(0,B.Z)(this,wt)[wt]=o,(0,B.Z)(this,mt)[mt]=t,(0,B.Z)(this,vt)[vt]=(0,u.$)('
      '),((null===(n=(0,B.Z)(this,mt)[mt].scrollNode)||void 0===n?void 0:n.get())||document.body).appendChild((0,B.Z)(this,vt)[vt][0]),(0,u.iC)(t)?(0,B.Z)(this,mt)[mt].on("selectEnd",this.onSelect):document.addEventListener("selectionchange",this.onSelect),u.tq||window.addEventListener("scroll",this.onSelect,{passive:!0}),window.addEventListener("resize",this.onSelect),null===(r=(0,B.Z)(this,mt)[mt].scrollNode)||void 0===r||r.on("scroll",this.onSelect,{passive:!0}),document.addEventListener("mousedown",this.hide)}return(0,m.Z)(e,[{key:"showContent",value:function(e){var t,n=(0,B.Z)(this,mt)[mt].trigger("toolbar-render",(0,B.Z)(this,wt)[wt]);if(!n&&0===((0,B.Z)(this,wt)[wt].items||[]).length)return null===(t=(0,B.Z)(this,xt)[xt])||void 0===t||t.unmount(),(0,B.Z)(this,xt)[xt]=void 0,void this.hide();var r,i=ut;"object"===(0,f.Z)(n)&&(null===(r=(0,B.Z)(this,xt)[xt])||void 0===r||r.unmount(),(0,B.Z)(this,xt)[xt]=void 0,i=n);(0,B.Z)(this,xt)[xt]||((0,B.Z)(this,xt)[xt]=(0,a.ri)(i,(0,d.Z)((0,d.Z)({},(0,B.Z)(this,wt)[wt]),{},{engine:(0,B.Z)(this,mt)[mt],popup:!0})),(0,B.Z)(this,xt)[xt].mount((0,B.Z)(this,vt)[vt].get())),setTimeout((function(){e&&e()}),200)}},{key:"destroy",value:function(){var e;(0,B.Z)(this,vt)[vt].remove(),(0,u.iC)((0,B.Z)(this,mt)[mt])?(0,B.Z)(this,mt)[mt].off("select",this.onSelect):document.removeEventListener("selectionchange",this.onSelect),u.tq||window.removeEventListener("scroll",this.onSelect),window.removeEventListener("resize",this.onSelect),null===(e=(0,B.Z)(this,mt)[mt].scrollNode)||void 0===e||e.off("scroll",this.onSelect),document.removeEventListener("mousedown",this.hide),(0,B.Z)(this,xt)[xt]&&((0,B.Z)(this,xt)[xt].unmount(),(0,B.Z)(this,xt)[xt]=void 0)}}]),e}(),Ct=".data-toolbar-component-list {\n position: absolute;\n min-height: 0px;\n top: 10px;\n left: 0;\n}\n\n.data-toolbar-component-list .toolbar-dropdown-list {\n top:0px;\n position: relative;\n}\n\n.data-toolbar-component-placeholder {\n color: rgba(0,0,0,0.25);\n pointer-events: none;\n width: 76px;\n}\n\n.data-toolbar-component-list-empty {\n position: relative;\n font-size: 14px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n padding: 5px 16px;\n line-height: 32px;\n min-width: 200px;\n height: auto;\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n max-height: calc(80vh);\n overflow: auto;\n}\n/** ------------------- popup ---------------------- **/\n.data-toolbar-popup-wrapper {\n position: absolute;\n z-index: 9999;\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n box-shadow: 0 4px 8px 0 rgba(31, 35, 41, 0.1);\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover {\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-inner-content {\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-arrow {\n display: none;\n}\n";G(Ct);var Bt=(0,_.Z)("collapseData"),_t=(0,_.Z)("data"),Et=function(e){(0,b.Z)(n,e);var t=(0,y.Z)(n);function n(){var e;(0,v.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o=0&&(t.find((function(e){var t=e.name;return t===n.name}))||t.push((0,d.Z)({},n)))}))}));var n=[];return t.length>0&&n.push({title:"",items:t}),n}},{key:"remove",value:function(){var e,t=this.editor;(0,u.iC)(t)&&(null===(e=this.component)||void 0===e||e.remove(),t.card.remove(this.id))}},{key:"changeToText",value:function(){var e,t,n=this.editor;if(this.root.inEditor()&&(0,u.iC)(n)){var r=(null===(e=this.keyword)||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText)||"";this.remove(),n.node.insertText(r)}}},{key:"destroy",value:function(){var e=this.component;null===e||void 0===e||e.unbindEvents(),null===e||void 0===e||e.remove()}},{key:"activate",value:function(e){var t;((0,k.Z)((0,C.Z)(n.prototype),"activate",this).call(this,e),e)||(null===(t=this.component)||void 0===t||t.unbindEvents(),this.changeToText())}},{key:"handleInput",value:function(){var e,t,n=this.editor;if((0,u.iC)(n)){var r=n.change,i=n.card;if(!r.isComposing()){var o=(null===(e=this.keyword)||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText.replace(/[\r\n]/g,""))||"",a=this.component;if(""===o)return null===a||void 0===a||a.remove(),void i.remove(this.id);var s=o.substr(1);if(""!==s){var l=this.search(s);null===a||void 0===a||a.render(n.root,this.root,l)}else null===a||void 0===a||a.render(n.root,this.root,(0,B.Z)(this,Bt)[Bt]||[])}}}},{key:"resetPlaceHolder",value:function(){var e,t,n,r;"/"===(null===(e=this.keyword)||void 0===e||null===(t=e.get())||void 0===t?void 0:t.innerText)?null===(n=this.placeholder)||void 0===n||n.css("visibility","visible"):null===(r=this.placeholder)||void 0===r||r.css("visibility","hidden")}},{key:"render",value:function(e){var t,n,r,i=this;this.setData(e);var o=this.editor;if((0,u.iC)(o)&&!u.sk){var a=o.language.get("toolbar","component");this.root.attributes("data-transient","true"),this.root.attributes(u.xT,"false");var s=(0,u.$)('/').concat(a["placeholder"],"")),l=this.getCenter();l.empty().append(s),this.keyword=l.find(".data-toolbar-component-keyword"),this.placeholder=l.find(".data-toolbar-component-placeholder"),null===(t=this.keyword)||void 0===t||t.on("keydown",(function(e){(0,u.P6)("enter",e)&&e.preventDefault()}));var c=Date.now();null===(n=this.keyword)||void 0===n||n.on("input",(function(){if(i.resetPlaceHolder(),Date.now()-c<200){var e,t,n=null===(e=i.keyword)||void 0===e?void 0:e.first();if(n&&n.isText()&&"/、"===n[0].nodeValue||"//"===(null===n||void 0===n||null===(t=n.get())||void 0===t?void 0:t.nodeValue)){var r,o=null===(r=n.get())||void 0===r?void 0:r.splitText(1);null===o||void 0===o||o.remove()}}setTimeout((function(){i.handleInput()}),10)})),(0,B.Z)(this,Bt)[Bt]||((0,B.Z)(this,Bt)[Bt]=this.getData()),null===(r=this.component)||void 0===r||r.render(o.root,this.root,(0,B.Z)(this,Bt)[Bt])}}}],[{key:"cardName",get:function(){return"toolbar"}},{key:"cardType",get:function(){return u.eT.INLINE}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}}]),n}(u.Zb),St=function(e){return[{title:e.language.get("toolbar","commonlyUsed","title"),items:["image-uploader","codeblock","table","file-uploader","video-uploader","math","status"]}]},Ft=function(e){(0,b.Z)(n,e);var t=(0,y.Z)(n);function n(){var e;(0,v.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;oa?(i=n,_.value="x"):(i=r,_.value="y"),t(-i,-i)&&e.preventDefault()}var S=(0,c.iH)({onTouchStart:x,onTouchMove:C,onTouchEnd:B,onWheel:E});function F(e){S.value.onTouchStart(e)}function U(e){S.value.onTouchMove(e)}function L(e){S.value.onTouchEnd(e)}function Q(e){S.value.onWheel(e)}(0,s.bv)((function(){var t,n;document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",L,{passive:!1}),null===(t=e.value)||void 0===t||t.addEventListener("touchstart",F,{passive:!1}),null===(n=e.value)||void 0===n||n.addEventListener("wheel",Q,{passive:!1})})),(0,s.Jd)((function(){document.removeEventListener("touchmove",U),document.removeEventListener("touchend",L)}))}function L(e,t){var n=(0,c.iH)(e);function r(e){var r="function"===typeof e?e(n.value):e;r!==n.value&&t(r,n.value),n.value=r}return[n,r]}var Q=n(44585),D=n(88704),H=n(58388),O=n(34507),z=n(37788),Z=n(37526),R=n(39016),P=n(6049),q=n(83430);function K(e,t,n,r){if(!(0,P.Z)(e))return e;t=(0,Z.Z)(t,e);var i=-1,o=t.length,a=o-1,s=e;while(null!=s&&++in?"left":"right"})})),I=(0,o.Z)(M,2),N=I[0],O=I[1],z=L(0,(function(t,n){!T.value&&e.onTabScroll&&e.onTabScroll({direction:t>n?"top":"bottom"})})),Z=(0,o.Z)(z,2),R=Z[0],P=Z[1],q=(0,k.Z)(0),K=(0,o.Z)(q,2),W=K[0],j=K[1],V=(0,k.Z)(0),G=(0,o.Z)(V,2),$=G[0],Y=G[1],X=(0,k.Z)(null),J=(0,o.Z)(X,2),ne=J[0],re=J[1],ie=(0,k.Z)(null),oe=(0,o.Z)(ie,2),ae=oe[0],se=oe[1],le=(0,k.Z)(0),ce=(0,o.Z)(le,2),Ae=ce[0],ue=ce[1],de=(0,k.Z)(0),he=(0,o.Z)(de,2),pe=he[0],fe=he[1],ge=d(new Map),me=(0,o.Z)(ge,2),ve=me[0],be=me[1],ye=m(h,ve),we=(0,s.Fl)((function(){return"".concat(g.value,"-nav-operations-hidden")})),xe=(0,c.iH)(0),ke=(0,c.iH)(0);(0,s.m0)((function(){T.value?e.rtl?(xe.value=0,ke.value=Math.max(0,W.value-ne.value)):(xe.value=Math.min(0,ne.value-W.value),ke.value=0):(xe.value=Math.min(0,ae.value-$.value),ke.value=0)}));var Ce=function(e){return eke.value?ke.value:e},Be=(0,c.iH)(),_e=(0,k.Z)(),Ee=(0,o.Z)(_e,2),Se=Ee[0],Fe=Ee[1],Te=function(){Fe(Date.now())},Me=function(){clearTimeout(Be.value)},Ie=function(e,t){e((function(e){var n=Ce(e+t);return n}))};U(v,(function(e,t){if(T.value){if(ne.value>=W.value)return!1;Ie(O,e)}else{if(ae.value>=$.value)return!1;Ie(P,t)}return Me(),Te(),!0})),(0,s.YP)(Se,(function(){Me(),Se.value&&(Be.value=setTimeout((function(){Fe(0)}),100))}));var Ne=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.activeKey,n=ye.value.get(t)||{width:0,height:0,left:0,right:0,top:0};if(T.value){var r=N.value;e.rtl?n.rightN.value+ne.value&&(r=n.right+n.width-ne.value):n.left<-N.value?r=-n.left:n.left+n.width>-N.value+ne.value&&(r=-(n.left+n.width-ne.value)),P(0),O(Ce(r))}else{var i=R.value;n.top<-R.value?i=-n.top:n.top+n.height>-R.value+ae.value&&(i=-(n.top+n.height-ae.value)),O(0),P(Ce(i))}},Ue=(0,c.iH)(0),Le=(0,c.iH)(0);(0,s.m0)((function(){var t,n,r,i,o,a,s,l=ye.value;["top","bottom"].includes(e.tabPosition)?(n="width",o=ne.value,a=W.value,s=Ae.value,r=e.rtl?"right":"left",i=Math.abs(N.value)):(n="height",o=ae.value,a=W.value,s=pe.value,r="top",i=-R.value);var c=o;a+s>o&&ai+c){p=f-1;break}}for(var m=0,v=d-1;v>=0;v-=1){var b=l.get(u[v].key)||te;if(b[r]0,o=N.value+ne.value2&&A.token&&"string"!=typeof A.token){for(var h=2;h-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var c=0;cr.right?1:0:t.clientYr.bottom?1:0,i.moveTo(i.pos+n*i.screen)})),e.on(this.node,"mousewheel",o),e.on(this.node,"DOMMouseScroll",o)}t.prototype.setPos=function(e,t){return e<0&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos)&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",!0)},t.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};var n=10;function r(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.update=function(e,t,r){var i=this.screen!=t||this.total!=e||this.size!=r;i&&(this.screen=t,this.total=e,this.size=r);var o=this.screen*(this.size/this.total);oe.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},r.prototype.setScrollTop=function(e){this.vert.setPos(e)},r.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}))},69767:function(e,t,n){n(57658),function(t,n){e.exports=n()}(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),A=!o&&/Chrome\/(\d+)/.exec(e),u=A&&+A[1],d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var k=b&&(c||d&&(null==x||x<12.11)),C=n||a&&s>=9;function B(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,E=function(e,t){var n=e.className,r=B(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function F(e,t){return S(e).appendChild(t)}function T(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?Q=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(Q=function(e){try{e.select()}catch(t){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=O(this.onTimeout,this)};function P(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var $=[""];function Y(e){while($.length<=e)$.push(X($)+" ");return $[e]}function X(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function oe(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ie(e))||t.test(e):ie(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var se=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function le(e){return e.charCodeAt(0)>=768&&se.test(e)}function ce(e,t,n){while((n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ue(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var de=null;function he(e,t,n){var r;de=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:de=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:de=i)}return null!=r?r:de}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var A=e.length,u=[],d=0;d-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ye(e,t){var n=ve(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ce(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){be(this,e,t)}}function Be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){Be(e),_e(e)}function Fe(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Me,Ie,Ne=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ue(e){if(null==Me){var t=T("span","​");F(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Me=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Me?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Le(e){if(null!=Ie)return Ie;var t=F(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return S(e),!(!n||n.left==n.right)&&(Ie=r.right-n.right<3)}var Qe=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},He=function(){var e=T("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Oe=null;function ze(e){if(null!=Oe)return Oe;var t=F(e,T("span","x")),n=t.getBoundingClientRect(),r=_(t,0,1).getBoundingClientRect();return Oe=Math.abs(n.left-r.left)>1}var Ze={},Re={};function Pe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ze[e]=t}function qe(e,t){Re[e]=t}function Ke(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),e=ne(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function We(e,t){t=Ke(t);var n=Ze[t.name];if(!n)return We(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var i=je[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var je={};function Ve(e,t){var n=je.hasOwnProperty(e)?je[e]:je[e]={};z(t,n)}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $e(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Ye(e,t,n){return!e.startState||e.startState(t,n)}var Xe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Je(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?st(n,Je(e,n).text.length):ft(t,Je(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?st(e.line,t):n<0?st(e.line,0):e}function gt(e,t){for(var n=[],r=0;r=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.post},Xe.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},vt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function bt(e,t,n,r){var i=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,St(e,t.text,s.mode,n,(function(e,t){var n=l;while(ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=bt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=Ft(e,t,n),a=o>r.first&&Je(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Ye(r.mode),o);return r.iter(o,t,(function(n){xt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=e)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,Ge(e.mode,t.state),n,t.lookAhead):new vt(e,Ge(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function _t(e,t,n,r){var i,o=e.doc,a=o.mode;t=pt(o,t);var s,l=Je(o,t.line),c=wt(e,t.line,n),A=new Xe(l.text,e.options.tabSize,c);r&&(s=[]);while((r||A.pose.options.maxHighlightLength?(s=!1,a&&xt(e,t,r,u.pos),u.pos=t.length,l=null):l=Et(Ct(n,u,r.state,d),o),d){var h=d[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||A!=l){while(ca;--s){if(s<=o.first)return o.first;var l=Je(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof mt?c.lookAhead:0)<=o.modeFrontier))return s;var A=Z(l.text,null,e.options.tabSize);(null==i||r>A)&&(i=s-1,r=A)}return i}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Je(e,r).stateAfter;if(i&&(!(i instanceof mt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Lt(a,o.from,l?null:o.to))}}return r}function zt(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var y=0;y0)){var A=[l,1],u=lt(c.from,s.from),d=lt(c.to,s.to);(u<0||!a.inclusiveLeft&&!u)&&A.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&A.push({from:s.to,to:c.to}),i.splice.apply(i,A),l+=A.length-3}}return i}function qt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Vt(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,r,i){var o=Je(e,t),a=It&&o.markedSpans;if(a)for(var s=0;s=0&&u<=0||A<=0&&u>=0)&&(A<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?lt(c.to,n)>=0:lt(c.to,n)>0)||A>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?lt(c.from,r)<=0:lt(c.from,r)<0)))return!0}}}function en(e){var t;while(t=$t(e))e=t.find(-1,!0).line;return e}function tn(e){var t;while(t=Yt(e))e=t.find(1,!0).line;return e}function nn(e){var t,n;while(t=Yt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function rn(e,t){var n=Je(e,t),r=en(n);return n==r?t:rt(r)}function on(e,t){if(t>e.lastLine())return t;var n,r=Je(e,t);if(!an(e,r))return t;while(n=Yt(r))r=n.find(1,!0).line;return rt(r)+1}function an(e,t){var n=It&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Kt(this,t),this.height=n?n(this):1};function dn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),qt(e),Kt(e,n);var i=r?r(e):1;i!=e.height&&nt(e,i)}function hn(e){e.parent=null,qt(e)}un.prototype.lineNo=function(){return rt(this)},Ce(un);var pn={},fn={};function gn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:pn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=M("span",null,null,l?"padding-right: .1px":null),r={pre:M("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=bn,Le(e.display.measure)&&(a=fe(o,e.doc.direction))&&(r.addToken=wn(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&rt(o);kn(o,r,yt(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=L(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=L(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ue(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function vn(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function bn(e,t,n,r,i,o,l){if(t){var c,A=e.splitSpaces?yn(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1;if(u.test(t)){c=document.createDocumentFragment();var h=0;while(1){u.lastIndex=h;var p=u.exec(t),f=p?p.index-h:t.length-h;if(f){var g=document.createTextNode(A.slice(h,h+f));a&&s<9?c.appendChild(T("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+f,g),e.col+=f,e.pos+=f}if(!p)break;h+=f+1;var m=void 0;if("\t"==p[0]){var v=e.cm.options.tabSize,b=v-e.col%v;m=c.appendChild(T("span",Y(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(m=c.appendChild(T("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",p[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(p[0]),m.setAttribute("cm-text",p[0]),a&&s<9?c.appendChild(T("span",[m])):c.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,c=document.createTextNode(A),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==A.charCodeAt(t.length-1),n||r||i||d||o||l){var y=n||"";r&&(y+=r),i&&(y+=i);var w=T("span",[c],y,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return e.content.appendChild(w)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&u.from<=c)break;if(u.to>=A)return e(n,r,i,o,a,s,l);e(n,r.slice(0,u.to-c),i,o,null,s,l),o=null,r=r.slice(u.to-c),c=u.to}}}function xn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function kn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,A,u,d,h=i.length,p=0,f=1,g="",m=0;;){if(m==p){l=c=A=s="",d=null,u=null,m=1/0;for(var v=[],b=void 0,y=0;yp||x.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&m>w.to&&(m=w.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&w.from==p&&(A+=" "+x.startStyle),x.endStyle&&w.to==m&&(b||(b=[])).push(x.endStyle,w.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var k in x.attributes)(d||(d={}))[k]=x.attributes[k];x.collapsed&&(!u||Vt(u.marker,x)<0)&&(u=w)}else w.from>p&&m>w.from&&(m=w.from)}if(b)for(var C=0;C=h)break;var _=Math.min(h,m);while(1){if(g){var E=p+g.length;if(!u){var S=E>_?g.slice(0,_-p):g;t.addToken(t,S,a?a+l:l,A,p+S.length==m?c:"",s,d)}if(E>=_){g=g.slice(_-p),p=_;break}p=E,A=""}g=i.slice(o,o=n[f++]),a=gn(n[f++],t.cm.options)}}else for(var F=1;F2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function er(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function tr(e,t){t=en(t);var n=rt(t),r=e.display.externalMeasured=new Cn(e.doc,t,n);r.lineN=n;var i=r.built=mn(e,r);return r.text=i.pre,F(e.display.lineMeasure,i.pre),r}function nr(e,t,n,r){return or(e,ir(e,t),n,r)}function rr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=l-s,i=o-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)while(c&&e[c-2]==e[c-3]&&e[c-1].insertLeft)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)while(c=0;i--)if((n=e[i]).left!=n.right)break;return n}function Ar(e,t,n,r){var i,o=lr(t.map,n,r),l=o.node,c=o.start,A=o.end,u=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){while(c&&le(t.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+A0&&(u=r="right"),i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Ir(e.display),top:p.top,bottom:p.bottom}:sr}for(var f=i.top-t.rect.top,g=i.bottom-t.rect.top,m=(f+g)/2,v=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function A(e,t,n){var r=s[t],i=1==r.level;return a(n?e-1:e,i!=n)}var u=he(s,l,c),d=de,h=A(l,u,"before"==c);return null!=d&&(h.other=A(l,d,"before"!=c)),h}function xr(e,t){var n=0;t=pt(e.doc,t),e.options.lineWrapping||(n=Ir(e.display)*t.ch);var r=Je(e.doc,t.line),i=ln(r)+jn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function kr(e,t,n,r,i){var o=st(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Cr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return kr(r.first,0,null,-1,-1);var i=it(r,n),o=r.first+r.size-1;if(i>o)return kr(r.first+r.size-1,Je(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Je(r,i);;){var s=Sr(e,a,i,t,n),l=Xt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Je(r,i=c.line)}}function Br(e,t,n,r){r-=mr(t);var i=t.text.length,o=Ae((function(t){return or(e,n,t-1).bottom<=r}),i,0);return i=Ae((function(t){return or(e,n,t).top>r}),o,i),{begin:o,end:i}}function _r(e,t,n,r){n||(n=ir(e,t));var i=vr(e,t,or(e,n,r),"line").top;return Br(e,t,n,i)}function Er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Sr(e,t,n,r,i){i-=ln(t);var o=ir(e,t),a=mr(t),s=0,l=t.text.length,c=!0,A=fe(t,e.doc.direction);if(A){var u=(e.options.lineWrapping?Tr:Fr)(e,t,n,o,A,r,i);c=1!=u.level,s=c?u.from:u.to-1,l=c?u.to:u.from-1}var d,h,p=null,f=null,g=Ae((function(t){var n=or(e,o,t);return n.top+=a,n.bottom+=a,!!Er(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,f=n),!0)}),s,l),m=!1;if(f){var v=r-f.left=y.bottom?1:0}return g=ce(t.text,g,1),kr(n,g,h,m,r-d)}function Fr(e,t,n,r,i,o,a){var s=Ae((function(s){var l=i[s],c=1!=l.level;return Er(wr(e,st(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,A=wr(e,st(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Er(A,o,a,!0)&&A.top>a&&(l=i[s-1])}return l}function Tr(e,t,n,r,i,o,a){var s=Br(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var A=null,u=null,d=0;d=c||h.to<=l)){var p=1!=h.level,f=or(e,r,p?Math.min(c,h.to)-1:Math.max(l,h.from)).right,g=fg)&&(A=h,u=g)}}return A||(A=i[i.length-1]),A.fromc&&(A={from:A.from,to:c,level:A.level}),A}function Mr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ar){ar=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ar.appendChild(document.createTextNode("x")),ar.appendChild(T("br"));ar.appendChild(document.createTextNode("x"))}F(e.measure,ar);var n=ar.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),S(e.measure),n||1}function Ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");F(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Nr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Ur(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ur(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Lr(e){var t=Mr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ir(e.display)-3);return function(i){if(an(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Je(e.doc,c.line).text).length==c.ch){var A=Z(l,l.length,e.options.tabSize)-l.length;c=st(c.line,Math.max(0,Math.round((o-Gn(e.display).left)/Ir(e.display))-A))}return c}function Hr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)It&&rn(e.doc,t)i.viewFrom?Zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Zr(e);else if(t<=i.viewFrom){var o=Rr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Zr(e)}else if(n>=i.viewTo){var a=Rr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Zr(e)}else{var s=Rr(e,t,t,-1),l=Rr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Bn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Zr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Hr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==P(a,n)&&a.push(n)}}}function Zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Rr(e,t,n,r){var i,o=Hr(e,t),a=e.display.view;if(!It||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}while(rn(e.doc,n)!=n){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Pr(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Bn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Bn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Hr(e,n)))),r.viewTo=n}function qr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||l.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Gr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Gn(e.display),s=a.left,l=Math.max(r.sizerWidth,Yn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function A(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function u(t,n,r){var o,a,u=Je(i,t),d=u.text.length;function h(n,r){return yr(e,st(t,n),"div",u,r)}function p(t,n,r){var i=_r(e,u,null,t),o="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(u.text.charAt(i.end-1))?2:1);return h(a,o)[o]}var f=fe(u,i.direction);return ue(f,n||0,null==r?d:r,(function(e,t,i,u){var g="ltr"==i,m=h(e,g?"left":"right"),v=h(t-1,g?"right":"left"),b=null==n&&0==e,y=null==r&&t==d,w=0==u,x=!f||u==f.length-1;if(v.top-m.top<=3){var k=(c?b:y)&&w,C=(c?y:b)&&x,B=k?s:(g?m:v).left,_=C?l:(g?v:m).right;A(B,m.top,_-B,m.bottom)}else{var E,S,F,T;g?(E=c&&b&&w?s:m.left,S=c?l:p(e,i,"before"),F=c?s:p(t,i,"after"),T=c&&y&&x?l:v.right):(E=c?p(e,i,"before"):s,S=!c&&b&&w?l:m.right,F=!c&&y&&x?s:v.left,T=c?p(t,i,"after"):l),A(E,m.top,S-E,m.bottom),m.bottom0?t.blinker=setInterval((function(){e.hasFocus()||ei(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Yr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Jr(e))}function Xr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ei(e))}),100)}function Jr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),$r(e))}function ei(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ti(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||f<-.005)&&(ie.display.sizerWidth){var m=Math.ceil(d/Ir(e.display));m>e.display.maxLineLength&&(e.display.maxLineLength=m,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ni(e){if(e.widgets)for(var t=0;t=a&&(o=it(t,ln(Je(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ii(e,t){if(!we(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!f){var a=T("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jn(e.display))+"px;\n height: "+(t.bottom-t.top+$n(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function oi(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?st(t.line,t.ch+1,"before"):t,t=t.ch?st(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=wr(e,t),l=n&&n!=t?wr(e,n):s;i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var c=si(e,i),A=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=c.scrollTop&&(pi(e,c.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(a=!0)),null!=c.scrollLeft&&(gi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}function ai(e,t){var n=si(e,t);null!=n.scrollTop&&pi(e,n.scrollTop),null!=n.scrollLeft&&gi(e,n.scrollLeft)}function si(e,t){var n=e.display,r=Mr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Xn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Vn(n),l=t.tops-r;if(t.topi+o){var A=Math.min(t.top,(c?s:t.bottom)-o);A!=i&&(a.scrollTop=A)}var u=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-u,h=Yn(e)-n.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.lefth+d-3&&(a.scrollLeft=t.right+(p?0:10)-h),a}function li(e,t){null!=t&&(di(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ci(e){di(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ai(e,t,n){null==t&&null==n||di(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){di(e),e.curOp.scrollToPos=t}function di(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=xr(e,t.from),r=xr(e,t.to);hi(e,n,r,t.margin)}}function hi(e,t,n,r){var i=si(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Ai(e,i.scrollLeft,i.scrollTop)}function pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Ki(e,{top:t}),fi(e,t,!0),n&&Ki(e),Di(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function gi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Vn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+$n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vi=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),me(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new R,this.disableVert=new R},vi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}e.style.visibility="",t.set(1e3,r)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bi=function(){};function yi(e,t){t||(t=mi(e));var n=e.display.barWidth,r=e.display.barHeight;wi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ti(e),wi(e,mi(e)),n=e.display.barWidth,r=e.display.barHeight}function wi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}bi.prototype.update=function(){return{bottom:0,right:0}},bi.prototype.setScrollLeft=function(){},bi.prototype.setScrollTop=function(){},bi.prototype.clear=function(){};var xi={native:vi,null:bi};function ki(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?gi(e,t):pi(e,t)}),e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Ci=0;function Bi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ci,markArrays:null},En(e.curOp)}function _i(e){var t=e.curOp;t&&Fn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Fi(e){e.updatedDisplay=e.mustUpdate&&Pi(e.cm,e.update)}function Ti(e){var t=e.cm,n=t.display;e.updatedDisplay&&ti(t),e.barMeasure=mi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=nr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+$n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Mi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=wt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,l=bt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,A=l.classes;A?o.styleClasses=A:c&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||c!=A&&(!c||!A||c.bgClass!=A.bgClass||c.textClass!=A.textClass),d=0;!u&&dn)return Di(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ni(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qr(e))return!1;$i(e)&&(Zr(e),t.dims=Nr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),It&&(o=rn(e.doc,o),a=on(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Pr(e,o,a),n.viewOffset=ln(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=qr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Zi(e);return l>4&&(n.lineDiv.style.display="none"),Wi(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ri(c),S(n.cursorDiv),S(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Di(e,400)),n.updateLineNumbers=null,!0}function qi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Yn(e))r&&(t.visible=ri(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Vn(e.display)-Xn(e),n.top)}),t.visible=ri(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Pi(e,t))break;ti(e);var i=mi(e);Kr(e),yi(e,i),Vi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n=new Oi(e,t);if(Pi(e,n)){ti(e),qi(e,n);var r=mi(e);Kr(e),yi(e,r),Vi(e,r),n.finish()}}function Wi(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,A=r.viewFrom,u=0;u-1&&(h=!1),Nn(e,d,A,n)),h&&(S(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(at(e.options,A)))),a=d.node.nextSibling}else{var p=Zn(e,d,A,n);o.insertBefore(p,a)}A+=d.size}while(a)a=s(a)}function ji(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Mn(e,"gutterChanged",e)}function Vi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+$n(e)+"px"}function Gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Ur(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yi(i.gutters,i.lineNumbers),Xi(o),r.init(o)}Oi.prototype.signal=function(e,t){ke(e,t)&&this.events.push(arguments)},Oi.prototype.finish=function(){for(var e=0;ec.clientWidth,p=c.scrollHeight>c.clientHeight;if(i&&h||o&&p){if(o&&b&&l)e:for(var f=t.target,g=s.view;f!=c;f=f.parentNode)for(var m=0;m=0&<(e,r.to())<=0)return n}return-1};var so=function(e,t){this.anchor=e,this.head=t};function lo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return lt(e.from(),t.from())})),n=P(t,i);for(var o=1;o0:l>=0){var c=dt(s.from(),a.from()),A=ut(s.to(),a.to()),u=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new so(u?A:c,u?c:A))}}return new ao(t,n)}function co(e,t){return new ao([new so(e,t||e)],0)}function Ao(e){return e.text?st(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return Ao(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ao(t).ch-t.to.ch),st(n,r)}function ho(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,m)}Mn(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function So(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Eo(i,i.lastOp==r)))a=X(o.changes),0==lt(t.from,t.to)&&0==lt(t.from,a.to)?a.to=Ao(t):o.changes.push(Bo(e,t));else{var l=X(i.done);l&&l.ranges||Mo(e.sel,i.done),o={changes:[Bo(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ye(e,"historyAdded")}function Fo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function To(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Fo(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Mo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&_o(i.undone)}function Mo(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Io(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function No(e){if(!e)return null;for(var t,n=0;n-1&&(X(s)[u]=c[u],delete c[u])}}}return r}function Do(e,t,n,r){if(r){var i=e.anchor;if(n){var o=lt(t,i)<0;o!=lt(n,i)<0?(i=t,t=n):o!=lt(t,n)<0&&(t=n)}return new so(i,t)}return new so(n||t,t)}function Ho(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),qo(e,new ao([Do(e.sel.primary(),t,n,i)],0),r)}function Oo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ye(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var u=l.find(r<0?1:-1),d=void 0;if((r<0?A:c)&&(u=Yo(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(d=lt(u,n))&&(r<0?d<0:d>0))return Go(e,u,t,r,i)}var h=l.find(r<0?-1:1);return(r<0?c:A)&&(h=Yo(e,h,r,h.line==t.line?o:null)),h?Go(e,h,t,r,i):null}}return t}function $o(e,t,n,r,i){var o=r||1,a=Go(e,t,n,o,i)||!i&&Go(e,t,n,o,!0)||Go(e,t,n,-o,i)||!i&&Go(e,t,n,-o,!0);return a||(e.cantEdit=!0,st(e.first,0))}function Yo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?pt(e,st(t.line-1)):null:n>0&&t.ch==(r||Je(e,t.line)).text.length?t.line=0;--i)ta(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ta(e,t)}}function ta(e,t){if(1!=t.text.length||""!=t.text[0]||0!=lt(t.from,t.to)){var n=ho(e,t);So(e,t,n,e.cm?e.cm.curOp.id:NaN),ia(e,t,n,Zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=P(r,e.history)||(ca(e.history,t),r.push(e.history)),ia(e,t,null,Zt(e,t))}))}}function na(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--h){var p=d(h);if(p)return p.v}}}}function ra(e,t){if(0!=t&&(e.first+=t,e.sel=new ao(J(e.sel.ranges,(function(e){return new so(st(e.anchor.line+t,e.anchor.ch),st(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Or(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:st(o,Je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=et(e,t.from,t.to),n||(n=ho(e,t)),e.cm?oa(e.cm,t,r):bo(e,t,r),Ko(e,n,W),e.cantEdit&&$o(e,st(e.firstLine(),0))&&(e.cantEdit=!1)}}function oa(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=rt(en(Je(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&xe(e),bo(r,t,n,Lr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=cn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Tt(r,o.line),Di(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Or(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Or(e,o.line,a.line+1,c):zr(e,o.line,"text");var A=ke(e,"changes"),u=ke(e,"change");if(u||A){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};u&&Mn(e,"change",e,d),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function aa(e,t,n,r,i){var o;r||(r=n),lt(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ea(e,{from:n,to:r,text:t,origin:i})}function sa(e,t,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=M("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Jt(e,t.line,t,n,o)||t.line!=n.line&&Jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ut()}o.addToHistory&&So(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&en(r)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&nt(r,0),Ht(r,new Lt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){an(e,t)&&nt(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Or(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var A=t.line;A<=n.line;A++)zr(c,A,"text");o.atomic&&jo(c.doc),Mn(c,"markerAdded",c,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Bi(e),ke(this,"clear")){var n=this.find();n&&Mn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Or(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jo(e.doc)),e&&Mn(e,"markerCleared",e,this,r,i),t&&_i(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)ea(this,r[l]);s?Po(this,s):this.cm&&ci(this.cm)})),undo:Qi((function(){na(this,"undo")})),redo:Qi((function(){na(this,"redo")})),undoSelection:Qi((function(){na(this,"undo",!0)})),redoSelection:Qi((function(){na(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=pt(this,e),t=pt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),pt(this,st(n,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Ko(t.doc,co(n,n)),d)for(var h=0;h=0;t--)aa(e.doc,"",r[t].from,r[t].to,"+delete");ci(e)}))}function Ga(e,t,n){var r=ce(e.text,t+n,n);return r<0||r>e.text.length?null:r}function $a(e,t,n){var r=Ga(e,t.ch,n);return null==r?null:new st(t.line,r,n<0?"after":"before")}function Ya(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var A=ir(t,n);a=i<0?n.text.length-1:0;var u=or(t,A,a).top;a=Ae((function(e){return or(t,A,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new st(r,a,c)}}return new st(r,i<0?n.text.length:0,i<0?"before":"after")}function Xa(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return $a(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=he(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&d>=A.begin)){var h=u?"before":"after";return new st(n.line,d,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new st(n.line,l(e,1),"before"):new st(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?A.end:l(A.begin,-1);return null==g||r>0&&g==t.text.length||(f=p(r>0?0:i.length-1,r,c(g)),!f)?null:f}za.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},za.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},za.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},za.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},za["default"]=b?za.macDefault:za.pcDefault;var Ja={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return Va(e,(function(t){if(t.empty()){var n=Je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new st(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),st(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Je(e.doc,i.line-1).text;a&&(i=new st(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),st(i.line-1,a.length-1),i,"+transpose"))}n.push(new so(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ni(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(lt((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(lt(i.to(),t)>0||t.xRel<0)?Cs(e,r,t,o):_s(e,r,t,o)}function Cs(e,t,n,r){var i=e.display,o=!1,c=Ui(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Xr(e)),be(i.wrapper.ownerDocument,"mouseup",c),be(i.wrapper.ownerDocument,"mousemove",A),be(i.scroller,"dragstart",u),be(i.scroller,"drop",c),o||(Be(t),r.addNew||Ho(e.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),A=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},u=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,me(i.wrapper.ownerDocument,"mouseup",c),me(i.wrapper.ownerDocument,"mousemove",A),me(i.scroller,"dragstart",u),me(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Bs(e,t,n){if("char"==n)return new so(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new so(st(t.line,0),pt(e.doc,st(t.line+1,0)));var r=n(e,t);return new so(r.from,r.to)}function _s(e,t,n,r){a&&Xr(e);var i=e.display,o=e.doc;Be(t);var s,l,c=o.sel,A=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?A[l]:new so(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new so(n,n)),n=Dr(e,t,!0,!0),l=-1;else{var u=Bs(e,n,r.unit);s=r.extend?Do(s,u.anchor,u.head,r.extend):u}r.addNew?-1==l?(l=A.length,qo(o,lo(e,A.concat([s]),l),{scroll:!1,origin:"*mouse"})):A.length>1&&A[l].empty()&&"char"==r.unit&&!r.extend?(qo(o,lo(e,A.slice(0,l).concat(A.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):zo(o,l,s,j):(l=0,qo(o,new ao([s],0),j),c=o.sel);var d=n;function h(t){if(0!=lt(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,A=Z(Je(o,n.line).text,n.ch,a),u=Z(Je(o,t.line).text,t.ch,a),h=Math.min(A,u),p=Math.max(A,u),f=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));f<=g;f++){var m=Je(o,f).text,v=G(m,h,a);h==p?i.push(new so(st(f,v),st(f,v))):m.length>v&&i.push(new so(st(f,v),st(f,G(m,p,a))))}i.length||i.push(new so(n,n)),qo(o,lo(e,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,y=s,w=Bs(e,t,r.unit),x=y.anchor;lt(w.anchor,x)>0?(b=w.head,x=dt(y.from(),w.anchor)):(b=w.anchor,x=ut(y.to(),w.head));var k=c.ranges.slice(0);k[l]=Es(e,new so(pt(o,x),b)),qo(o,lo(e,k,l),j)}}var p=i.wrapper.getBoundingClientRect(),f=0;function g(t){var n=++f,a=Dr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=lt(a,d)){e.curOp.focus=N(D(e)),h(a);var s=ri(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Ui(e,(function(){f==n&&(i.scroller.scrollTop+=l,g(t))})),50)}}function m(t){e.state.selectingText=!1,f=1/0,t&&(Be(t),i.input.focus()),be(i.wrapper.ownerDocument,"mousemove",v),be(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var v=Ui(e,(function(e){0!==e.buttons&&Te(e)?g(e):m(e)})),b=Ui(e,m);e.state.selectingText=b,me(i.wrapper.ownerDocument,"mousemove",v),me(i.wrapper.ownerDocument,"mouseup",b)}function Es(e,t){var n=t.anchor,r=t.head,i=Je(e.doc,n.line);if(0==lt(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var a=he(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var A=he(o,r.ch,r.sticky),u=A-a||(r.ch-n.ch)*(1==s.level?-1:1);l=A==c-1||A==c?u<0:u>0}var d=o[c+(l?-1:0)],h=l==(1==d.level),p=h?d.from:d.to,f=h?"after":"before";return n.ch==p&&n.sticky==f?t:new so(new st(n.line,p,f),r)}function Ss(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(d){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ke(e,n))return Ee(t);o-=s.top-a.viewOffset;for(var l=0;l=i){var A=it(e.doc,o),u=e.display.gutterSpecs[l];return ye(e,n,e,A,u.className,t),Ee(t)}}}function Fs(e,t){return Ss(e,t,"gutterClick",!0)}function Ts(e,t){Wn(e.display,t)||Ms(e,t)||we(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function Ms(e,t){return!!ke(e,"gutterContextMenu")&&Ss(e,t,"gutterContextMenu",!1)}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}vs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==lt(t,this.pos)&&n==this.button};var Ns={toString:function(){return"CodeMirror.Init"}},Us={},Ls={};function Qs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ns&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ns,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,go(e)}),!0),n("indentUnit",2,go,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),pr(e),Or(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(st(r,o))}r++}));for(var i=n.length-1;i>=0;i--)aa(e.doc,t,n[i],st(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ns&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Is(e),Ji(e)}),!0),n("keyMap","default",(function(e,t,n){var r=ja(t),i=n!=Ns&&ja(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Hs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Yi(t,e.options.lineNumbers),Ji(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ur(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){ki(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Yi(e.options.gutters,t),Ji(e)}),!0),n("firstLineNumber",1,Ji,!0),n("lineNumberFormatter",(function(e){return e}),Ji,!0),n("showCursorWhenSelecting",!1,Kr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(ei(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ds),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Kr,!0),n("singleCursorHeightPerLine",!0,Kr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ds(e,t,n){var r=n&&n!=Ns;if(!t!=!r){var i=e.display.dragFunctions,o=t?me:be;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Hs(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),An(e)),Qr(e),Or(e),pr(e),setTimeout((function(){return yi(e)}),100)}function Os(e,t){var n=this;if(!(this instanceof Os))return new Os(e,t);this.options=t=t?z(t):{},z(Us,t,!1);var r=t.value;"string"==typeof r?r=new Ba(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Os.inputStyles[t.inputStyle](this),o=this.display=new eo(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ki(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),zs(this),Na(),Bi(this),this.curOp.forceUpdate=!0,wo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Jr(n)}),20):ei(this),Ls)Ls.hasOwnProperty(c)&&Ls[c](this,t[c],Ns);$i(this),t.finishInit&&t.finishInit(this);for(var A=0;A400}me(t.scroller,"touchstart",(function(i){if(!we(e,i)&&!o(i)&&!Fs(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Wn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new so(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new so(st(a.line,0),pt(e.doc,st(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Be(n)}i()})),me(t.scroller,"touchcancel",i),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(pi(e,t.scroller.scrollTop),gi(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return oo(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return oo(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){we(e,t)||Se(t)},over:function(t){we(e,t)||(Fa(e,t),Se(t))},start:function(t){return Sa(e,t)},drop:Ui(e,Ea),leave:function(t){we(e,t)||Ta(e)}};var c=t.input.getField();me(c,"keyup",(function(t){return hs.call(e,t)})),me(c,"keydown",Ui(e,us)),me(c,"keypress",Ui(e,ps)),me(c,"focus",(function(t){return Jr(e,t)})),me(c,"blur",(function(t){return ei(e,t)}))}Os.defaults=Us,Os.optionHandlers=Ls;var Zs=[];function Rs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=wt(e,t).state:n="prev");var a=e.options.tabSize,s=Je(o,t),l=Z(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,A=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(A.length),s.text),c==K||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Z(Je(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var u="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)d+=a,u+="\t";if(da,l=Qe(t),c=null;if(s&&r.ranges.length>1)if(Ps&&Ps.text.join("\n")==t){if(r.ranges.length%Ps.text.length==0){c=[];for(var A=0;A=0;d--){var h=r.ranges[d],p=h.from(),f=h.to();h.empty()&&(n&&n>0?p=st(p.line,p.ch-n):e.state.overwrite&&!s?f=st(f.line,Math.min(Je(o,f.line).text.length,f.ch+X(l).length)):s&&Ps&&Ps.lineWise&&Ps.text.join("\n")==l.join("\n")&&(p=f=st(p.line,0)));var g={from:p,to:f,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ea(e.doc,g),Mn(e,"inputRead",e,g)}t&&!s&&js(e,t),ci(e),e.curOp.updateInput<2&&(e.curOp.updateInput=u),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ws(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Ni(t,(function(){return Ks(t,n,0,null,"paste")})),!0}function js(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Rs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Je(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Rs(e,i.head.line,"smart"));a&&Mn(e,"electricInput",e,i.head.line)}}}function Vs(e){for(var t=[],n=[],r=0;rn&&(Rs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ci(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&zo(this.doc,r,new so(o,c[r].to()),W)}}})),getTokenAt:function(e,t){return _t(this,e,t)},getLineTokens:function(e,t){return _t(this,st(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,n=yt(this,Je(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Je(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-ln(r):0)},defaultTextHeight:function(){return Mr(this.display)},defaultCharWidth:function(){return Ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=wr(this,pt(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ai(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Li(us),triggerOnKeyPress:Li(ps),triggerOnKeyUp:hs,triggerOnMouseDown:Li(ys),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Li((function(e){js(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=pt(this.doc,e),a=0;a0&&s(n.charAt(r-1)))--r;while(i.5||this.options.lineWrapping)&&Qr(this),ye(this,"refresh",this)})),swapDoc:Li((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),wo(this,e),pr(this),this.display.input.reset(),Ai(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Mn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Xs(e,t,n,r,i){var o=t,a=n,s=Je(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new st(n,t.ch,t.sticky),s=Je(e,n))}function A(o){var a;if("codepoint"==r){var A=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(A))a=null;else{var u=n>0?A>=55296&&A<56320:A>=56320&&A<57343;a=new st(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u?2:1))),-n)}}else a=i?Xa(e.cm,s,t,n):$a(s,t,n);if(null==a){if(o||!c())return!1;t=Ya(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)A();else if("column"==r)A(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;;p=!1){if(n<0&&!A(!p))break;var f=s.text.charAt(t.ch)||"\n",g=oe(f,h)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||p||g||(g="s"),u&&u!=g){n<0&&(n=1,A(),t.sticky="after");break}if(g&&(u=g),n>0&&!A(!p))break}var m=$o(e,t,o,a,!0);return ct(o,m)&&(m.hitSide=!0),m}function Js(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,H(e).innerHeight||a(e).documentElement.clientHeight),c=Math.max(l-.5*Mr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){if(o=Cr(e,s,i),!o.outside)break;if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var el=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function tl(e,t){var n=rr(e,t.line);if(!n||n.hidden)return null;var r=Je(e.doc,t.line),i=er(n,r,t.line),o=fe(r,e.doc.direction),a="left";if(o){var s=he(o,t.ch);a=s%2?"right":"left"}var l=lr(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function nl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rl(e,t){return t&&(e.bad=!0),e}function il(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function A(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(A(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(st(r,0),st(i+1,0),c(+h));return void(p.length&&(o=p[0].find(0))&&u(et(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&A();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&tl(t,i)||{node:l[0].measure.map[2],offset:0},A=o.liner.firstLine()&&(a=st(a.line-1,Je(r.doc,a.line-1).length)),s.ch==Je(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Hr(r,a.line))?(t=rt(i.view[0].line),n=i.view[0].node):(t=rt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,A=Hr(r,s.line);if(A==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=rt(i.view[A+1].line)-1,c=i.view[A+1].node.previousSibling),!n)return!1;var u=r.doc.splitLines(il(r,n,c,t,l)),d=et(r.doc,st(t,0),st(l,Je(r.doc,l).text.length));while(u.length>1&&d.length>1)if(X(u)==X(d))u.pop(),d.pop(),l--;else{if(u[0]!=d[0])break;u.shift(),d.shift(),t++}var h=0,p=0,f=u[0],g=d[0],m=Math.min(f.length,g.length);while(ha.ch&&v.charCodeAt(v.length-p-1)==b.charCodeAt(b.length-p-1))h--,p++;u[u.length-1]=v.slice(0,v.length-p).replace(/^\u200b+/,""),u[0]=u[0].slice(h).replace(/\u200b+$/,"");var w=st(t,h),x=st(l,d.length?X(d).length-p:0);return u.length>1||u[0]||lt(w,x)?(aa(r.doc,u,w,x,"+input"),!0):void 0},el.prototype.ensurePolled=function(){this.forceCompositionEnd()},el.prototype.reset=function(){this.forceCompositionEnd()},el.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},el.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},el.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ni(this.cm,(function(){return Or(e.cm)}))},el.prototype.setUneditable=function(e){e.contentEditable="false"},el.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ui(this.cm,Ks)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},el.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},el.prototype.onContextMenu=function(){},el.prototype.resetPosition=function(){},el.prototype.needsContentAttribute=!0;var sl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null,this.resetting=!1};function ll(e,t){if(t=t?z(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=N(e.ownerDocument);t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(be(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Os((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function cl(e){e.off=be,e.on=me,e.wheelEventPixels=io,e.Doc=Ba,e.splitLines=Qe,e.countColumn=Z,e.findColumn=G,e.isWordChar=ie,e.Pass=K,e.signal=ye,e.Line=un,e.changeEnd=Ao,e.scrollbarModel=xi,e.Pos=st,e.cmpPos=lt,e.modes=Ze,e.mimeModes=Re,e.resolveMode=Ke,e.getMode=We,e.modeExtensions=je,e.extendMode=Ve,e.copyState=Ge,e.startState=Ye,e.innerMode=$e,e.commands=Ja,e.keyMap=za,e.keyName=Wa,e.isModifierKey=qa,e.lookupKey=Pa,e.normalizeKeyMap=Ra,e.StringStream=Xe,e.SharedTextMarker=ba,e.TextMarker=ma,e.LineWidget=ha,e.e_preventDefault=Be,e.e_stopPropagation=_e,e.e_stop=Se,e.addClass=U,e.contains=I,e.rmClass=E,e.keyNames=Qa}sl.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!we(r,e)){if(r.somethingSelected())qs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Vs(r);qs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,W):(n.prevInput="",i.value=t.text.join("\n"),Q(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),me(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),me(i,"paste",(function(e){we(r,e)||Ws(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),me(i,"cut",o),me(i,"copy",o),me(e.scroller,"paste",(function(t){if(!Wn(e,t)&&!we(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),me(e.lineSpace,"selectstart",(function(t){Wn(e,t)||Be(t)})),me(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),me(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},sl.prototype.createField=function(e){this.wrapper=$s(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Gs(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},sl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},sl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Wr(e);if(e.options.moveInputWithCursor){var i=wr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},sl.prototype.showSelection=function(e){var t=this.cm,n=t.display;F(n.cursorDiv,e.cursors),F(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},sl.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Q(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.resetting=!1}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||N(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},sl.prototype.blur=function(){this.textarea.blur()},sl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},sl.prototype.receivedFocus=function(){this.slowPoll()},sl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},sl.prototype.fastPoll=function(){var e=!1,t=this;function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},sl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(r.length,i.length);while(l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},sl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},sl.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Dr(n,e),c=r.scroller.scrollTop;if(o&&!d){var A=n.options.resetSelectionOnContextMenu;A&&-1==n.doc.sel.contains(o)&&Ui(n,qo)(n.doc,co(o),W);var u,h=i.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=i.ownerDocument.defaultView.scrollY),r.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),C){Se(e);var g=function(){be(window,"mouseup",g),setTimeout(v,20)};me(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Ui(n,Xo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},sl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,Qs(Os),Ys(Os);var Al="iter insert remove copy getEditor constructor".split(" ");for(var ul in Ba.prototype)Ba.prototype.hasOwnProperty(ul)&&P(Al,ul)<0&&(Os.prototype[ul]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ba.prototype[ul]));return Ce(Ba),Os.inputStyles={textarea:sl,contenteditable:el},Os.defineMode=function(e){Os.defaults.mode||"null"==e||(Os.defaults.mode=e),Pe.apply(this,arguments)},Os.defineMIME=qe,Os.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Os.defineMIME("text/plain","null"),Os.defineExtension=function(e,t){Os.prototype[e]=t},Os.defineDocExtension=function(e,t){Ba.prototype[e]=t},Os.fromTextArea=ll,cl(Os),Os.version="5.65.14",Os}))},8365:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/,F=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,T=l.isReservedIdentifier||!1;function M(e,t){var n=e.next();if(y[n]){var r=y[n](e,t);if(!1!==r)return r}if('"'==n||"'"==n)return t.tokenize=I(n),t.tokenize(e,t);if(_.test(n)){if(e.backUp(1),e.match(E))return"number";e.next()}if(B.test(n))return c=n,null;if("/"==n){if(e.eat("*"))return t.tokenize=N,N(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(S.test(n)){while(!e.match(/^\/[\/*]/,!1)&&e.eat(S));return"operator"}if(e.eatWhile(F),C)while(e.match(C))e.eatWhile(F);var i=e.current();return s(p,i)?(s(m,i)&&(c="newstatement"),s(v,i)&&(A=!0),"keyword"):s(f,i)?"type":s(g,i)||T&&T(i)?(s(m,i)&&(c="newstatement"),"builtin"):s(b,i)?"atom":"variable"}function I(e){return function(t,n){var r,i=!1,o=!1;while(null!=(r=t.next())){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!w)&&(n.tokenize=null),"string"}}function N(e,t){var n,r=!1;while(n=e.next()){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function U(e,t){l.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-u,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return U(e,t),null;c=A=null;var s=(t.tokenize||M)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))while("statement"==t.context.type)r(t);else if("{"==c)n(t,e.column(),"}");else if("["==c)n(t,e.column(),"]");else if("("==c)n(t,e.column(),")");else if("}"==c){while("statement"==a.type)a=r(t);"}"==a.type&&(a=r(t));while("statement"==a.type)a=r(t)}else c==a.type?r(t):x&&(("}"==a.type||"top"==a.type)&&";"!=c||"statement"==a.type&&"newstatement"==c)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),y.token){var u=y.token(e,t,s);void 0!==u&&(s=u)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=A?"def":s||c,U(e,t),s},indent:function(t,n){if(t.tokenize!=M&&null!=t.tokenize||t.typeAtEndOfLine&&o(t.context))return e.Pass;var r=t.context,i=n&&n.charAt(0),a=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)while("statement"==r.type&&l.dontIndentStatements.test(r.info))r=r.prev;if(y.indent){var s=y.indent(t,r,n,u);if("number"==typeof s)return s}var c=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){while("top"!=r.type&&"}"!=r.type)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:d):!r.align||h&&")"==r.type?")"!=r.type||a?r.indented+(a?0:u)+(a||!c||/^(?:case|default)\b/.test(n)?0:u):r.indented+d:r.column+(a?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",c="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",A="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",u="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",d=a("int long char short double float unsigned signed void bool"),h=a("SEL instancetype id Class Protocol BOOL");function p(e){return s(d,e)||/.+_t$/.test(e)}function f(e){return p(e)||s(h,e)}var g="case do else for if switch while struct enum union",m="struct enum union";function v(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=v;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function b(e,t){return"type"==t.prevToken&&"type"}function y(e){return!(!e||e.length<2)&&("_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase()))}function w(e){return e.eatWhile(/[\w\.']/),"number"}function x(e,t){if(e.backUp(1),e.match(/^(?:R|u8R|uR|UR|LR)/)){var n=e.match(/^"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=B,B(e,t))}return e.match(/^(?:u8|u|U|L)/)?!!e.match(/^["']/,!1)&&"string":(e.next(),!1)}function k(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function C(e,t){var n;while(null!=(n=e.next()))if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function B(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function _(t,n){"string"==typeof t&&(t=[t]);var r=[];function i(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var o=0;o!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=E,t.tokenize(e,t))},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=S(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),_("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){return t.tokenize=F(e.match('""')),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=S(1),t.tokenize(e,t))},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),_(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":v},modeProps:{fold:["brace","include"]}}),_("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:p,blockKeywords:a(g),atoms:a("null true false"),hooks:{"#":v},modeProps:{fold:["brace","include"]}}),_("text/x-objectivec",{name:"clike",keywords:a(l+" "+A),types:f,builtin:a(u),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a(m+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:y,hooks:{"#":v,"*":b},modeProps:{fold:["brace","include"]}}),_("text/x-objectivec++",{name:"clike",keywords:a(l+" "+A+" "+c),types:f,builtin:a(u),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a(m+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:y,hooks:{"#":v,"*":b,u:x,U:x,L:x,R:x,0:w,1:w,2:w,3:w,4:w,5:w,6:w,7:w,8:w,9:w,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&k(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),_("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:p,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":v},modeProps:{fold:["brace","include"]}});var T=null;function M(e){return function(t,n){var r,i=!1,o=!1;while(!t.eol()){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){T=M(e),o=!0;break}r=t.next(),i="single"==e&&!i&&"\\"==r}return o&&(n.tokenize=null),"string"}}_("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=M(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!T||!e.match("`"))&&(t.tokenize=T,T=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}))},70189:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("cmake",(function(){var e=/({)?[a-zA-Z0-9_]+(})?/;function t(e,t){var n,r,i=!1;while(!e.eol()&&(n=e.next())!=t.pending){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),n==t.pending?t.continueString=!1:t.continueString=!0,"string"}function n(n,r){var i=n.next();return"$"===i?n.match(e)?"variable-2":"variable":r.continueString?(n.backUp(1),t(n,r)):n.match(/(\s+)?\w+\(/)||n.match(/(\s+)?\w+\ \(/)?(n.backUp(1),"def"):"#"==i?(n.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,t(n,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(n.eatWhile(/[\w-]/),null)}return{startState:function(){var e={inDefinition:!1,inInclude:!1,continueString:!1,pending:!1};return e},token:function(e,t){return e.eatSpace()?null:n(e,t)}}})),e.defineMIME("text/x-cmake","cmake")}))},16880:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?x(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=B),x("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function C(e){return function(t,n){var r,i=!1;while(null!=(r=t.next())){if(r==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==r}return(r==e||!i&&")"!=e)&&(n.tokenize=null),x("string","string")}}function B(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),x(null,"(")}function _(e,t,n){this.type=e,this.indent=t,this.prev=n}function E(e,t,n,r){return e.context=new _(n,t.indentation()+(!1===r?0:a),e.context),n}function S(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function F(e,t,n){return I[n.context.type](e,t,n)}function T(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return F(e,t,n)}function M(e){var t=e.current().toLowerCase();o=m.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var I={top:function(e,t,n){if("{"==e)return E(n,t,"block");if("}"==e&&n.context.prev)return S(n);if(y&&/@component/i.test(e))return E(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return E(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return E(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return E(n,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return E(n,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return E(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return d.hasOwnProperty(r)?(o="property","maybeprop"):h.hasOwnProperty(r)?(o=w?"string-2":"property","maybeprop"):v?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?I.top(e,t,n):(o="error","block")},maybeprop:function(e,t,n){return":"==e?E(n,t,"prop"):F(e,t,n)},prop:function(e,t,n){if(";"==e)return S(n);if("{"==e&&v)return E(n,t,"propBlock");if("}"==e||"{"==e)return T(e,t,n);if("("==e)return E(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)M(t);else if("interpolation"==e)return E(n,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?S(n):"word"==e?(o="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?T(e,t,n):")"==e?S(n):"("==e?E(n,t,"parens"):"interpolation"==e?E(n,t,"interpolation"):("word"==e&&M(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(o="variable-3",n.context.type):F(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(o="tag",n.context.type):I.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return E(n,t,"atBlock_parens");if("}"==e||";"==e)return T(e,t,n);if("{"==e)return S(n)&&E(n,t,v?"block":"top");if("interpolation"==e)return E(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":A.hasOwnProperty(r)?"property":u.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":h.hasOwnProperty(r)?w?"string-2":"property":m.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?T(e,t,n):"{"==e?S(n)&&E(n,t,v?"block":"top",!1):("word"==e&&(o="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?S(n):"{"==e||"}"==e?T(e,t,n,2):I.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?E(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):F(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,S(n)):"word"==e?(o="@font-face"==n.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(o="variable","keyframes"):"{"==e?E(n,t,"top"):F(e,t,n)},at:function(e,t,n){return";"==e?S(n):"{"==e||"}"==e?T(e,t,n):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?S(n):"{"==e||";"==e?T(e,t,n):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new _(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||k)(e,t);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(t.state=I[t.state](i,e,t)),o},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(l),A=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(A),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=t(d),p=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],f=t(p),g=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],m=t(g),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],b=t(v),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(y),x=n.concat(i).concat(a).concat(l).concat(A).concat(d).concat(v).concat(y);function k(e,t){var n,r=!1;while(null!=(n=e.next())){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:m,colorKeywords:b,valueKeywords:w,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:b,valueKeywords:w,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:b,valueKeywords:w,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:m,colorKeywords:b,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}))},30029:function(e,t,n){n(57658),function(e){e(n(69767),n(8365))}((function(e){"use strict";var t="this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline".split(" "),n="try catch finally do else for if switch while".split(" "),r="true false null".split(" "),i="void bool num int double dynamic var String Null Never".split(" ");function o(e){for(var t={},n=0;n0&&(t.tokenize=s(t),null)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=d(1),t.tokenize(e,t))},token:function(e,t,n){if("variable"==n){var r=RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g");if(r.test(e.current()))return"variable-2"}}}}),e.registerHelper("hintWords","application/dart",t.concat(r).concat(i)),e.defineMode("dart",(function(t){return e.getMode(t,"application/dart")}),"clike")}))},44258:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("diff",(function(){var e={"+":"positive","-":"negative","@":"meta"};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||0===n)return t.skipToEnd(),("error "+(e[t.string.charAt(0)]||"")).replace(/ $/,"");var r=e[t.peek()]||t.skipToEnd();return-1===n?t.skipToEnd():t.pos=n,r}}})),e.defineMIME("text/x-diff","diff")}))},48314:function(e,t,n){(function(e){e(n(69767),n(24559))})((function(e){"use strict";var t="from",n=new RegExp("^(\\s*)\\b("+t+")\\b","i"),r=["run","cmd","entrypoint","shell"],i=new RegExp("^(\\s*)("+r.join("|")+")(\\s+\\[)","i"),o="expose",a=new RegExp("^(\\s*)("+o+")(\\s+)","i"),s=["arg","from","maintainer","label","env","add","copy","volume","user","workdir","onbuild","stopsignal","healthcheck","shell"],l=[t,o].concat(r).concat(s),c="("+l.join("|")+")",A=new RegExp("^(\\s*)"+c+"(\\s*)(#.*)?$","i"),u=new RegExp("^(\\s*)"+c+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:n,token:[null,"keyword"],sol:!0,next:"from"},{regex:A,token:[null,"keyword",null,"error"],sol:!0},{regex:i,token:[null,"keyword",null],sol:!0,next:"array"},{regex:a,token:[null,"keyword",null],sol:!0,next:"expose"},{regex:u,token:[null,"keyword",null],sol:!0,next:"arguments"},{regex:/./,token:null}],from:[{regex:/\s*$/,token:null,next:"start"},{regex:/(\s*)(#.*)$/,token:[null,"error"],next:"start"},{regex:/(\s*\S+\s+)(as)/i,token:[null,"keyword"],next:"start"},{token:null,next:"start"}],single:[{regex:/(?:[^\\']|\\.)/,token:"string"},{regex:/'/,token:"string",pop:!0}],double:[{regex:/(?:[^\\"]|\\.)/,token:"string"},{regex:/"/,token:"string",pop:!0}],array:[{regex:/\]/,token:null,next:"start"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"}],expose:[{regex:/\d+$/,token:"number",next:"start"},{regex:/[^\d]+$/,token:null,next:"start"},{regex:/\d+/,token:"number"},{regex:/[^\d]+/,token:null},{token:null,next:"start"}],arguments:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:/"(?:[^\\"]|\\.)*"?$/,token:"string",next:"start"},{regex:/"/,token:"string",push:"double"},{regex:/'(?:[^\\']|\\.)*'?$/,token:"string",next:"start"},{regex:/'/,token:"string",push:"single"},{regex:/[^#"']+[\\`]$/,token:null},{regex:/[^#"']+$/,token:null,next:"start"},{regex:/[^#"']+/,token:null},{token:null,next:"start"}],meta:{lineComment:"#"}}),e.defineMIME("text/x-dockerfile","dockerfile")}))},69150:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",(function(t){var n=["-type","-spec","-export_type","-opaque"],r=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],i=/[\->,;]/,o=["->",";",","],a=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],s=/[\+\-\*\/<>=\|:!]/,l=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],c=/[<\(\[\{]/,A=["<<","(","[","{"],u=/[>\)\]\}]/,d=["}","]",")",">>"],h=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],p=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],f=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,g=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function m(e,t){if(t.in_string)return t.in_string=!y(e),B(t,e,"string");if(t.in_atom)return t.in_atom=!w(e),B(t,e,"atom");if(e.eatSpace())return B(t,e,"whitespace");if(!F(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return C(e.current(),n)?B(t,e,"type"):B(t,e,"attribute");var m=e.next();if("%"==m)return e.skipToEnd(),B(t,e,"comment");if(":"==m)return B(t,e,"colon");if("?"==m)return e.eatSpace(),e.eatWhile(f),B(t,e,"macro");if("#"==m)return e.eatSpace(),e.eatWhile(f),B(t,e,"record");if("$"==m)return"\\"!=e.next()||e.match(g)?B(t,e,"number"):B(t,e,"error");if("."==m)return B(t,e,"dot");if("'"==m){if(!(t.in_atom=!w(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),B(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return B(t,e,"function")}return B(t,e,"atom")}if('"'==m)return t.in_string=!y(e),B(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(m))return e.eatWhile(f),B(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(m)){if(e.eatWhile(f),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),B(t,e,"fun");var x=e.current();return C(x,r)?B(t,e,"keyword"):C(x,a)?B(t,e,"operator"):e.match(/\s*\(/,!1)?!C(x,p)||":"==F(t).token&&"erlang"!=F(t,2).token?C(x,h)?B(t,e,"guard"):B(t,e,"function"):B(t,e,"builtin"):":"==k(e)?B(t,e,"erlang"==x?"builtin":"function"):C(x,["true","false"])?B(t,e,"boolean"):B(t,e,"atom")}var _=/[0-9]/,E=/[0-9a-zA-Z]/;return _.test(m)?(e.eatWhile(_),e.eat("#")?e.eatWhile(E)||e.backUp(1):e.eat(".")&&(e.eatWhile(_)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(_)||e.backUp(2):e.eatWhile(_)||e.backUp(1)):e.backUp(1)),B(t,e,"number")):v(e,c,A)?B(t,e,"open_paren"):v(e,u,d)?B(t,e,"close_paren"):b(e,i,o)?B(t,e,"separator"):b(e,s,l)?B(t,e,"operator"):B(t,e,null)}function v(e,t,n){if(1==e.current().length&&t.test(e.current())){e.backUp(1);while(t.test(e.peek()))if(e.next(),C(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function b(e,t,n){if(1==e.current().length&&t.test(e.current())){while(t.test(e.peek()))e.next();while(01&&"fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[t].token){case"}":return N(e,{g:["{"]});case"]":return N(e,{i:["["]});case")":return N(e,{i:["("]});case">>":return N(e,{i:["<<"]});case"end":return N(e,{i:["begin","case","fun","if","receive","try"]});case",":return N(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return N(e,{r:["when"],m:["try","if","case","receive"]});case";":return N(e,{E:["case","fun","if","receive","try","when"]});case"catch":return N(e,{e:["try"]});case"of":return N(e,{e:["case"]});case"after":return N(e,{e:["receive","try"]});default:return e}}function N(e,t){for(var n in t)for(var r=e.length-1,i=t[n],o=r-1;-1"==s.token?C(l.token,["receive","case","if","try"])?l.column+o+o:l.column+o:C(s.token,A)?s.column+s.token.length:(i=D(n),z(i)?i.column+o:0):0}function L(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(t)&&0===t.index?t[0]:""}function Q(e){var t=e.tokenStack.slice(0,-1),n=O(t,"type",["open_paren"]);return!!z(t[n])&&t[n]}function D(e){var t=e.tokenStack,n=O(t,"type",["open_paren","separator","keyword"]),r=O(t,"type",["operator"]);return z(n)&&z(r)&&n!|\/]/;function s(e,t){var r=e.next();if('"'==r||"'"==r||"`"==r)return t.tokenize=l(r),t.tokenize(e,t);if(/[\d\.]/.test(r))return"."==r?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==r?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(r))return n=r,null;if("/"==r){if(e.eat("*"))return t.tokenize=c,c(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(a.test(r))return e.eatWhile(a),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var s=e.current();return i.propertyIsEnumerable(s)?("case"!=s&&"default"!=s||(n="case"),"keyword"):o.propertyIsEnumerable(s)?"atom":"variable"}function l(e){return function(t,n){var r,i=!1,o=!1;while(null!=(r=t.next())){if(r==e&&!i){o=!0;break}i=!i&&"`"!=e&&"\\"==r}return(o||!i&&"`"!=e)&&(n.tokenize=s),"string"}}function c(e,t){var n,r=!1;while(n=e.next()){if("/"==n&&r){t.tokenize=s;break}r="*"==n}return"comment"}function A(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function u(e,t,n){return e.context=new A(e.indented,t,n,null,e.context)}function d(e){if(e.context.prev){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}}return{startState:function(e){return{tokenize:null,context:new A((e||0)-r,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;n=null;var i=(t.tokenize||s)(e,t);return"comment"==i||(null==r.align&&(r.align=!0),"{"==n?u(t,e.column(),"}"):"["==n?u(t,e.column(),"]"):"("==n?u(t,e.column(),")"):"case"==n?r.type="case":("}"==n&&"}"==r.type||n==r.type)&&d(t),t.startOfLine=!1),i},indent:function(t,n){if(t.tokenize!=s&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);if("case"==i.type&&/^(?:case|default)\b/.test(n))return t.context.type="}",i.indented;var a=o==i.type;return i.align?i.column+(a?0:1):i.indented+(a?0:r)},electricChars:"{}):",closeBrackets:"()[]{}''\"\"``",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}})),e.defineMIME("text/x-go","go")}))},18511:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";e.defineMode("groovy",(function(t){function n(e){for(var t={},n=e.split(" "),r=0;r"))return r="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),"@"==n)return e.eatWhile(/[\w\$_\.]/),"meta";if("."==t.lastToken)return"property";if(e.eat(":"))return r="proplabel","property";var l=e.current();return s.propertyIsEnumerable(l)?"atom":i.propertyIsEnumerable(l)?(o.propertyIsEnumerable(l)?r="newstatement":a.propertyIsEnumerable(l)&&(r="standalone"),"keyword"):"variable"}function c(e,t,n){var r=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";r=!0}function i(t,n){var i,o=!1,a=!r;while(null!=(i=t.next())){if(i==e&&!o){if(!r)break;if(t.match(e+e)){a=!0;break}}if('"'==e&&"$"==i&&!o){if(t.eat("{"))return n.tokenize.push(A()),"string";if(t.match(/^\w/,!1))return n.tokenize.push(u),"string"}o=!o&&"\\"==i}return a&&n.tokenize.pop(),"string"}return n.tokenize.push(i),i(t,n)}function A(){var e=1;function t(t,n){if("}"==t.peek()){if(e--,0==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else"{"==t.peek()&&e++;return l(t,n)}return t.isBase=!0,t}function u(e,t){var n=e.match(/^(\.|[\w\$_]+)/);return n?"."==n[0]?null:"variable":(t.tokenize.pop(),t.tokenize[t.tokenize.length-1](e,t))}function d(e,t){var n,r=!1;while(n=e.next()){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function h(e,t){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e||"standalone"==e&&!t}function p(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function f(e,t,n){return e.context=new p(e.indented,t,n,null,e.context)}function g(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return l.isBase=!0,{startState:function(e){return{tokenize:[l],context:new p((e||0)-t.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||h(t.lastToken,!0)||(g(t),n=t.context)),e.eatSpace())return null;r=null;var i=t.tokenize[t.tokenize.length-1](e,t);if("comment"==i)return i;if(null==n.align&&(n.align=!0),";"!=r&&":"!=r||"statement"!=n.type)if("->"==r&&"statement"==n.type&&"}"==n.prev.type)g(t),t.context.align=!1;else if("{"==r)f(t,e.column(),"}");else if("["==r)f(t,e.column(),"]");else if("("==r)f(t,e.column(),")");else if("}"==r){while("statement"==n.type)n=g(t);"}"==n.type&&(n=g(t));while("statement"==n.type)n=g(t)}else r==n.type?g(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==r)&&f(t,e.column(),"statement");else g(t);return t.startOfLine=!1,t.lastToken=r||i,i},indent:function(n,r){if(!n.tokenize[n.tokenize.length-1].isBase)return e.Pass;var i=r&&r.charAt(0),o=n.context;"statement"!=o.type||h(n.lastToken,!0)||(o=o.prev);var a=i==o.type;return"statement"==o.type?o.indented+("{"==i?0:t.indentUnit):o.align?o.column+(a?0:1):o.indented+(a?0:t.indentUnit)},electricChars:"{}",closeBrackets:{triples:"'\""},fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}})),e.defineMIME("text/x-groovy","groovy")}))},42797:function(e,t,n){(function(e){e(n(69767),n(61804),n(16107),n(16880))})((function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var r={};function i(e){var t=r[e];return t||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(e,t){var n=e.match(i(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(e,t){return new RegExp((t?"^":"")+"","i")}function s(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function l(e,t){for(var n=0;n=0;d--)c.script.unshift(["type",u[d].matches,u[d].mode]);function h(t,i){var s,A=o.token(t,i.htmlState),u=/\btag\b/.test(A);if(u&&!/[<>\s\/]/.test(t.current())&&(s=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))i.inTag=s+" ";else if(i.inTag&&u&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var p=">"==t.current()&&l(c[d[1]],d[2]),f=e.getMode(r,p),g=a(d[1],!0),m=a(d[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=h,t.localState=t.localMode=null,null):n(e,m,t.localMode.token(e,t.localState))},i.localMode=f,i.localState=e.startState(f,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=" "));return A}return{startState:function(){var t=e.startState(o);return{token:h,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(o,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?o.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||o}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}))},62470:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("http",(function(){function e(e,t){return e.skipToEnd(),t.cur=a,"error"}function t(t,r){return t.match(/^HTTP\/\d\.\d/)?(r.cur=n,"keyword"):t.match(/^[A-Z]+/)&&/[ \t]/.test(t.peek())?(r.cur=i,"keyword"):e(t,r)}function n(t,n){var i=t.match(/^\d+/);if(!i)return e(t,n);n.cur=r;var o=Number(i[0]);return o>=100&&o<200?"positive informational":o>=200&&o<300?"positive success":o>=300&&o<400?"positive redirect":o>=400&&o<500?"negative client-error":o>=500&&o<600?"negative server-error":"error"}function r(e,t){return e.skipToEnd(),t.cur=a,null}function i(e,t){return e.eatWhile(/\S/),t.cur=o,"string-2"}function o(t,n){return t.match(/^HTTP\/\d\.\d$/)?(n.cur=a,"keyword"):e(t,n)}function a(e){return e.sol()&&!e.eat(/[ \t]/)?e.match(/^.*?:/)?"atom":(e.skipToEnd(),"error"):(e.skipToEnd(),"string")}function s(e){return e.skipToEnd(),null}return{token:function(e,t){var n=t.cur;return n!=a&&n!=s&&e.eatSpace()?null:n(e,t)},blankLine:function(e){e.cur=s},startState:function(){return{cur:t}}}})),e.defineMIME("message/http","http")}))},16107:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,A=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),h=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function f(e){var t,n=!1,r=!1;while(null!=(t=e.next())){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function g(e,t,n){return r=e,i=n,t}function m(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=v(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==n&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if("="==n&&e.eat(">"))return g("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==n)return e.eat("*")?(t.tokenize=b,b(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):it(e,t,1)?(f(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==n)return t.tokenize=y,y(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==n&&e.eatWhile(u))return g("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(h.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?g("."):g("operator","operator",e.current());if(u.test(n)){e.eatWhile(u);var r=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(r)){var i=d[r];return g(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",r)}return g("variable","variable",r)}}function v(e){return function(t,n){var r,i=!1;if(s&&"@"==t.peek()&&t.match(p))return n.tokenize=m,g("jsonld-keyword","meta");while(null!=(r=t.next())){if(r==e&&!i)break;i=!i&&"\\"==r}return i||(n.tokenize=m),g("string","string")}}function b(e,t){var n,r=!1;while(n=e.next()){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return g("comment","comment")}function y(e,t){var n,r=!1;while(null!=(n=e.next())){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return g("quasi","string-2",e.current())}var w="([{}])";function x(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(A){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=w.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(u.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;var c=e.string.charAt(a-1);if(c==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function C(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function B(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function _(e,t,n,r,i){var o=e.cc;E.state=e,E.stream=i,E.marked=null,E.cc=o,E.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);while(1){var a=o.length?o.pop():l?K:P;if(a(n,r)){while(o.length&&o[o.length-1].lex)o.pop()();return E.marked?E.marked:"variable"==n&&B(e,r)?"variable-2":t}}}var E={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;e>=0;e--)E.cc.push(arguments[e])}function F(){return S.apply(null,arguments),!0}function T(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function M(e){var t=E.state;if(E.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=I(e,t.context);if(null!=r)return void(t.context=r)}else if(!T(e,t.localVars))return void(t.localVars=new L(e,t.localVars));n.globalVars&&!T(e,t.globalVars)&&(t.globalVars=new L(e,t.globalVars))}}function I(e,t){if(t){if(t.block){var n=I(e,t.prev);return n?n==t.prev?t:new U(n,t.vars,!0):null}return T(e,t.vars)?t:new U(t.prev,new L(e,t.vars),!1)}return null}function N(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function U(e,t,n){this.prev=e,this.vars=t,this.block=n}function L(e,t){this.name=e,this.next=t}var Q=new L("this",new L("arguments",null));function D(){E.state.context=new U(E.state.context,E.state.localVars,!1),E.state.localVars=Q}function H(){E.state.context=new U(E.state.context,E.state.localVars,!0),E.state.localVars=null}function O(){E.state.localVars=E.state.context.vars,E.state.context=E.state.context.prev}function z(e,t){var n=function(){var n=E.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new C(r,E.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function Z(){var e=E.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function R(e){function t(n){return n==e?F():";"==e||"}"==n||")"==n||"]"==n?S():F(t)}return t}function P(e,t){return"var"==e?F(z("vardef",t),Se,R(";"),Z):"keyword a"==e?F(z("form"),j,P,Z):"keyword b"==e?F(z("form"),P,Z):"keyword d"==e?E.stream.match(/^\s*$/,!1)?F():F(z("stat"),G,R(";"),Z):"debugger"==e?F(R(";")):"{"==e?F(z("}"),H,de,Z,O):";"==e?F():"if"==e?("else"==E.state.lexical.info&&E.state.cc[E.state.cc.length-1]==Z&&E.state.cc.pop()(),F(z("form"),j,P,Z,Ue)):"function"==e?F(He):"for"==e?F(z("form"),H,Le,P,O,Z):"class"==e||A&&"interface"==t?(E.marked="keyword",F(z("form","class"==e?e:t),Pe,Z)):"variable"==e?A&&"declare"==t?(E.marked="keyword",F(P)):A&&("module"==t||"enum"==t||"type"==t)&&E.stream.match(/^\s*\w/,!1)?(E.marked="keyword","enum"==t?F(tt):"type"==t?F(ze,R("operator"),me,R(";")):F(z("form"),Fe,R("{"),z("}"),de,Z,Z)):A&&"namespace"==t?(E.marked="keyword",F(z("form"),K,P,Z)):A&&"abstract"==t?(E.marked="keyword",F(P)):F(z("stat"),oe):"switch"==e?F(z("form"),j,R("{"),z("}","switch"),H,de,Z,Z,O):"case"==e?F(K,R(":")):"default"==e?F(R(":")):"catch"==e?F(z("form"),D,q,P,Z,O):"export"==e?F(z("stat"),je,Z):"import"==e?F(z("stat"),Ge,Z):"async"==e?F(P):"@"==t?F(K,P):S(z("stat"),K,R(";"),Z)}function q(e){if("("==e)return F(Ze,R(")"))}function K(e,t){return V(e,t,!1)}function W(e,t){return V(e,t,!0)}function j(e){return"("!=e?S():F(z(")"),G,R(")"),Z)}function V(e,t,n){if(E.state.fatArrowAt==E.stream.start){var r=n?te:ee;if("("==e)return F(D,z(")"),Ae(Ze,")"),Z,R("=>"),r,O);if("variable"==e)return S(D,Fe,R("=>"),r,O)}var i=n?Y:$;return k.hasOwnProperty(e)?F(i):"function"==e?F(He,i):"class"==e||A&&"interface"==t?(E.marked="keyword",F(z("form"),Re,Z)):"keyword c"==e||"async"==e?F(n?W:K):"("==e?F(z(")"),G,R(")"),Z,i):"operator"==e||"spread"==e?F(n?W:K):"["==e?F(z("]"),et,Z,i):"{"==e?ue(se,"}",null,i):"quasi"==e?S(X,i):"new"==e?F(ne(n)):F()}function G(e){return e.match(/[;\}\)\],]/)?S():S(K)}function $(e,t){return","==e?F(G):Y(e,t,!1)}function Y(e,t,n){var r=0==n?$:Y,i=0==n?K:W;return"=>"==e?F(D,n?te:ee,O):"operator"==e?/\+\+|--/.test(t)||A&&"!"==t?F(r):A&&"<"==t&&E.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?F(z(">"),Ae(me,">"),Z,r):"?"==t?F(K,R(":"),i):F(i):"quasi"==e?S(X,r):";"!=e?"("==e?ue(W,")","call",r):"."==e?F(ae,r):"["==e?F(z("]"),G,R("]"),Z,r):A&&"as"==t?(E.marked="keyword",F(me,r)):"regexp"==e?(E.state.lastType=E.marked="operator",E.stream.backUp(E.stream.pos-E.stream.start-1),F(i)):void 0:void 0}function X(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?F(X):F(G,J)}function J(e){if("}"==e)return E.marked="string-2",E.state.tokenize=y,F(X)}function ee(e){return x(E.stream,E.state),S("{"==e?P:K)}function te(e){return x(E.stream,E.state),S("{"==e?P:W)}function ne(e){return function(t){return"."==t?F(e?ie:re):"variable"==t&&A?F(Be,e?Y:$):S(e?W:K)}}function re(e,t){if("target"==t)return E.marked="keyword",F($)}function ie(e,t){if("target"==t)return E.marked="keyword",F(Y)}function oe(e){return":"==e?F(Z,P):S($,R(";"),Z)}function ae(e){if("variable"==e)return E.marked="property",F()}function se(e,t){return"async"==e?(E.marked="property",F(se)):"variable"==e||"keyword"==E.style?(E.marked="property","get"==t||"set"==t?F(le):(A&&E.state.fatArrowAt==E.stream.start&&(n=E.stream.match(/^\s*:\s*/,!1))&&(E.state.fatArrowAt=E.stream.pos+n[0].length),F(ce))):"number"==e||"string"==e?(E.marked=s?"property":E.style+" property",F(ce)):"jsonld-keyword"==e?F(ce):A&&N(t)?(E.marked="keyword",F(se)):"["==e?F(K,he,R("]"),ce):"spread"==e?F(W,ce):"*"==t?(E.marked="keyword",F(se)):":"==e?S(ce):void 0;var n}function le(e){return"variable"!=e?S(ce):(E.marked="property",F(He))}function ce(e){return":"==e?F(W):"("==e?S(He):void 0}function Ae(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=E.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),F((function(n,r){return n==t||r==t?S():S(e)}),r)}return i==t||o==t?F():n&&n.indexOf(";")>-1?S(e):F(R(t))}return function(n,i){return n==t||i==t?F():S(e,r)}}function ue(e,t,n){for(var r=3;r"),me):"quasi"==e?S(we,Ce):void 0}function ve(e){if("=>"==e)return F(me)}function be(e){return e.match(/[\}\)\]]/)?F():","==e||";"==e?F(be):S(ye,be)}function ye(e,t){return"variable"==e||"keyword"==E.style?(E.marked="property",F(ye)):"?"==t||"number"==e||"string"==e?F(ye):":"==e?F(me):"["==e?F(R("variable"),pe,R("]"),ye):"("==e?S(Oe,ye):e.match(/[;\}\)\],]/)?void 0:F()}function we(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?F(we):F(me,xe)}function xe(e){if("}"==e)return E.marked="string-2",E.state.tokenize=y,F(we)}function ke(e,t){return"variable"==e&&E.stream.match(/^\s*[?:]/,!1)||"?"==t?F(ke):":"==e?F(me):"spread"==e?F(ke):S(me)}function Ce(e,t){return"<"==t?F(z(">"),Ae(me,">"),Z,Ce):"|"==t||"."==e||"&"==t?F(me):"["==e?F(me,R("]"),Ce):"extends"==t||"implements"==t?(E.marked="keyword",F(me)):"?"==t?F(me,R(":"),me):void 0}function Be(e,t){if("<"==t)return F(z(">"),Ae(me,">"),Z,Ce)}function _e(){return S(me,Ee)}function Ee(e,t){if("="==t)return F(me)}function Se(e,t){return"enum"==t?(E.marked="keyword",F(tt)):S(Fe,he,Ie,Ne)}function Fe(e,t){return A&&N(t)?(E.marked="keyword",F(Fe)):"variable"==e?(M(t),F()):"spread"==e?F(Fe):"["==e?ue(Me,"]"):"{"==e?ue(Te,"}"):void 0}function Te(e,t){return"variable"!=e||E.stream.match(/^\s*:/,!1)?("variable"==e&&(E.marked="property"),"spread"==e?F(Fe):"}"==e?S():"["==e?F(K,R("]"),R(":"),Te):F(R(":"),Fe,Ie)):(M(t),F(Ie))}function Me(){return S(Fe,Ie)}function Ie(e,t){if("="==t)return F(W)}function Ne(e){if(","==e)return F(Se)}function Ue(e,t){if("keyword b"==e&&"else"==t)return F(z("form","else"),P,Z)}function Le(e,t){return"await"==t?F(Le):"("==e?F(z(")"),Qe,Z):void 0}function Qe(e){return"var"==e?F(Se,De):"variable"==e?F(De):S(De)}function De(e,t){return")"==e?F():";"==e?F(De):"in"==t||"of"==t?(E.marked="keyword",F(K,De)):S(K,De)}function He(e,t){return"*"==t?(E.marked="keyword",F(He)):"variable"==e?(M(t),F(He)):"("==e?F(D,z(")"),Ae(Ze,")"),Z,fe,P,O):A&&"<"==t?F(z(">"),Ae(_e,">"),Z,He):void 0}function Oe(e,t){return"*"==t?(E.marked="keyword",F(Oe)):"variable"==e?(M(t),F(Oe)):"("==e?F(D,z(")"),Ae(Ze,")"),Z,fe,O):A&&"<"==t?F(z(">"),Ae(_e,">"),Z,Oe):void 0}function ze(e,t){return"keyword"==e||"variable"==e?(E.marked="type",F(ze)):"<"==t?F(z(">"),Ae(_e,">"),Z):void 0}function Ze(e,t){return"@"==t&&F(K,Ze),"spread"==e?F(Ze):A&&N(t)?(E.marked="keyword",F(Ze)):A&&"this"==e?F(he,Ie):S(Fe,he,Ie)}function Re(e,t){return"variable"==e?Pe(e,t):qe(e,t)}function Pe(e,t){if("variable"==e)return M(t),F(qe)}function qe(e,t){return"<"==t?F(z(">"),Ae(_e,">"),Z,qe):"extends"==t||"implements"==t||A&&","==e?("implements"==t&&(E.marked="keyword"),F(A?me:K,qe)):"{"==e?F(z("}"),Ke,Z):void 0}function Ke(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||A&&N(t))&&E.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(E.marked="keyword",F(Ke)):"variable"==e||"keyword"==E.style?(E.marked="property",F(We,Ke)):"number"==e||"string"==e?F(We,Ke):"["==e?F(K,he,R("]"),We,Ke):"*"==t?(E.marked="keyword",F(Ke)):A&&"("==e?S(Oe,Ke):";"==e||","==e?F(Ke):"}"==e?F():"@"==t?F(K,Ke):void 0}function We(e,t){if("!"==t)return F(We);if("?"==t)return F(We);if(":"==e)return F(me,Ie);if("="==t)return F(W);var n=E.state.lexical.prev,r=n&&"interface"==n.info;return S(r?Oe:He)}function je(e,t){return"*"==t?(E.marked="keyword",F(Je,R(";"))):"default"==t?(E.marked="keyword",F(K,R(";"))):"{"==e?F(Ae(Ve,"}"),Je,R(";")):S(P)}function Ve(e,t){return"as"==t?(E.marked="keyword",F(R("variable"))):"variable"==e?S(W,Ve):void 0}function Ge(e){return"string"==e?F():"("==e?S(K):"."==e?S($):S($e,Ye,Je)}function $e(e,t){return"{"==e?ue($e,"}"):("variable"==e&&M(t),"*"==t&&(E.marked="keyword"),F(Xe))}function Ye(e){if(","==e)return F($e,Ye)}function Xe(e,t){if("as"==t)return E.marked="keyword",F($e)}function Je(e,t){if("from"==t)return E.marked="keyword",F(K)}function et(e){return"]"==e?F():S(Ae(W,"]"))}function tt(){return S(z("form"),Fe,R("{"),z("}"),Ae(nt,"}"),Z,Z)}function nt(){return S(Fe,Ie)}function rt(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function it(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return D.lex=H.lex=!0,O.lex=!0,Z.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new C((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new U(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),x(e,t)),t.tokenize!=b&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",_(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==b||t.tokenize==y)return e.Pass;if(t.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var A=t.cc[c];if(A==Z)l=l.prev;else if(A!=Ue&&A!=O)break}while(("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==$||i==Y)&&!/^[,\.=+\-*:?[\(]/.test(r)))l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var u=l.type,d=s==u;return"vardef"==u?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==u&&"{"==s?l.indented:"form"==u?l.indented+o:"stat"==u?l.indented+(rt(t,r)?a||o:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:it,skipExpression:function(t){_(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))},59228:function(e,t,n){(function(e){e(n(69767),n(61804),n(16107))})((function(e){"use strict";function t(e,t,n,r){this.state=e,this.mode=t,this.depth=n,this.prev=r}function n(r){return new t(e.copyState(r.mode,r.state),r.mode,r.depth,r.prev&&n(r.prev))}e.defineMode("jsx",(function(r,i){var o=e.getMode(r,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),a=e.getMode(r,i&&i.base||"javascript");function s(e){var t=e.tagName;e.tagName=null;var n=o.indent(e,"","");return e.tagName=t,n}function l(e,t){return t.context.mode==o?c(e,t,t.context):A(e,t,t.context)}function c(n,i,c){if(2==c.depth)return n.match(/^.*?\*\//)?c.depth=1:n.skipToEnd(),"comment";if("{"==n.peek()){o.skipAttribute(c.state);var A=s(c.state),u=c.state.context;if(u&&n.match(/^[^>]*>\s*$/,!1)){while(u.prev&&!u.startOfLine)u=u.prev;u.startOfLine?A-=r.indentUnit:c.prev.state.lexical&&(A=c.prev.state.lexical.indented)}else 1==c.depth&&(A+=r.indentUnit);return i.context=new t(e.startState(a,A),a,0,i.context),null}if(1==c.depth){if("<"==n.peek())return o.skipAttribute(c.state),i.context=new t(e.startState(o,s(c.state)),o,0,i.context),null;if(n.match("//"))return n.skipToEnd(),"comment";if(n.match("/*"))return c.depth=2,l(n,i)}var d,h=o.token(n,c.state),p=n.current();return/\btag\b/.test(h)?/>$/.test(p)?c.state.context?c.depth=0:i.context=i.context.prev:/^-1&&n.backUp(p.length-d),h}function A(n,r,i){if("<"==n.peek()&&a.expressionAllowed(n,i.state))return r.context=new t(e.startState(o,a.indent(i.state,"","")),o,0,r.context),a.skipExpression(i.state),null;var s=a.token(n,i.state);if(!s&&null!=i.depth){var l=n.current();"{"==l?i.depth++:"}"==l&&0==--i.depth&&(r.context=r.context.prev)}return s}return{startState:function(){return{context:new t(e.startState(a),a)}},copyState:function(e){return{context:n(e.context)}},token:l,indent:function(e,t,n){return e.context.mode.indent(e.context.state,t,n)},innerMode:function(e){return e.context}}}),"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})}))},36608:function(e,t,n){n(57658),function(e){e(n(69767),n(61804),n(98310))}((function(e){"use strict";e.defineMode("markdown",(function(t,n){var r=e.getMode(t,"text/html"),i="null"==r.name;function o(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in a)a.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(a[s]=n.tokenTypeOverrides[s]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,A=/^\[(x| )\](?=\s)/i,u=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,m=" ";function v(e,t,n){return t.f=t.inline=n,n(e,t)}function b(e,t,n){return t.f=t.block=n,n(e,t)}function y(e){return!e||!/\S/.test(e.string)}function w(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==k){var n=i;if(!n){var o=e.innerMode(r,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=E,t.block=x,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function x(t,r){var i=t.column()===r.indentation,s=y(r.prevLine.stream),h=r.indentedCode,g=r.prevLine.hr,m=!1!==r.list,b=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var w=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,m)){r.list=null;while(w=4&&(h||r.prevLine.fencedCodeEnd||r.prevLine.header||s))return t.skipToEnd(),r.indentedCode=!0,a.code;if(t.eatSpace())return null;if(i&&r.indentation<=b&&(_=t.match(u))&&_[1].length<=6)return r.quote=0,r.header=_[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,B(r);if(r.indentation<=b&&t.eat(">"))return r.quote=i?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),t.eatSpace(),B(r);if(!k&&!r.setext&&i&&r.indentation<=b&&(_=t.match(c))){var E=_[1]?"ol":"ul";return r.indentation=w+t.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&t.match(A,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+E]),B(r)}return i&&r.indentation<=b&&(_=t.match(p,!0))?(r.quote=0,r.fencedEndRE=new RegExp(_[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&o(_[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=C,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,B(r)):r.setext||!(x&&m||r.quote||!1!==r.list||r.code||k||f.test(t.string))&&(_=t.lookAhead(1))&&(_=_.match(d))?(r.setext?(r.header=r.setext,r.setext=0,t.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==_[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,B(r)):k?(t.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,a.hr):"["===t.peek()?v(t,r,I):v(t,r,r.inline)}function k(t,n){var o=r.token(t,n.htmlState);if(!i){var a=e.innerMode(r,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=E,n.block=x,n.htmlState=null)}return o}function C(e,t){var r,i=t.listStack[t.listStack.length-1]||0,o=t.indentation=e.quote?t.push(a.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function _(e,t){if(e.match(h,!0))return B(t)}function E(t,i){var o=i.text(t,i);if("undefined"!==typeof o)return o;if(i.list)return i.list=null,B(i);if(i.taskList){var s=" "===t.match(A,!0)[1];return s?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,B(i)}if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),B(i);var l=t.next();if(i.linkTitle){i.linkTitle=!1;var c=l;"("===l&&(c=")"),c=(c+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var u="^\\s*(?:[^"+c+"\\\\]+|\\\\\\\\|\\\\.)"+c;if(t.match(new RegExp(u),!0))return a.linkHref}if("`"===l){var d=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0!=i.code||i.quote&&1!=h){if(h==i.code){var p=B(i);return i.code=0,p}return i.formatting=d,B(i)}return i.code=h,B(i)}if(i.code)return B(i);if("\\"===l&&(t.next(),n.highlightFormatting)){var f=B(i),m=a.formatting+"-escape";return f?f+" "+m:m}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),B(i);if("["===l&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),B(i);if("]"===l&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");f=B(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=F,f}if("["===l&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,n.highlightFormatting&&(i.formatting="link")),B(i);if("]"===l&&i.linkText){n.highlightFormatting&&(i.formatting="link");f=B(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?F:E,f}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=S,n.highlightFormatting&&(i.formatting="link");f=B(i);return f?f+=" ":f="",f+a.linkInline}if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=S,n.highlightFormatting&&(i.formatting="link");f=B(i);return f?f+=" ":f="",f+a.linkEmail}if(n.xml&&"<"===l&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=t.string.indexOf(">",t.pos);if(-1!=v){var y=t.string.substring(t.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),b(t,i,k)}if(n.xml&&"<"===l&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===l||"_"===l){var w=1,x=1==t.pos?" ":t.string.charAt(t.pos-2);while(w<3&&t.eat(l))w++;var C=t.peek()||" ",_=!/\s/.test(C)&&(!g.test(C)||/\s/.test(x)||g.test(x)),T=!/\s/.test(x)&&(!g.test(x)||/\s/.test(C)||g.test(C)),M=null,I=null;if(w%2&&(i.em||!_||"*"!==l&&T&&!g.test(x)?i.em!=l||!T||"*"!==l&&_&&!g.test(C)||(M=!1):M=!0),w>1&&(i.strong||!_||"*"!==l&&T&&!g.test(x)?i.strong!=l||!T||"*"!==l&&_&&!g.test(C)||(I=!1):I=!0),null!=I||null!=M){n.highlightFormatting&&(i.formatting=null==M?"strong":null==I?"em":"strong em"),!0===M&&(i.em=l),!0===I&&(i.strong=l);p=B(i);return!1===M&&(i.em=!1),!1===I&&(i.strong=!1),p}}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return B(i);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(i.strikethrough){n.highlightFormatting&&(i.formatting="strikethrough");p=B(i);return i.strikethrough=!1,p}if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),B(i)}else if(" "===l&&t.match("~~",!0)){if(" "===t.peek())return B(i);t.backUp(2)}if(n.emoji&&":"===l&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting="emoji");var N=B(i);return i.emoji=!1,N}return" "===l&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),B(i)}function S(e,t){var r=e.next();if(">"===r){t.f=t.inline=E,n.highlightFormatting&&(t.formatting="link");var i=B(t);return i?i+=" ":i="",i+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function F(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=M("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,B(t)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function M(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link-string");var o=B(r);return r.linkHref=!1,o}return t.match(T[e]),r.linkHref=!0,B(r)}}function I(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=N,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,B(t)):v(e,t,E)}function N(e,t){if(e.match("]:",!0)){t.f=t.inline=U,n.highlightFormatting&&(t.formatting="link");var r=B(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function U(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=E,a.linkHref+" url")}var L={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:E,text:_,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.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 w(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!=k)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,m).length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==k?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:L}},indent:function(t,n,i){return t.block==k&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:w,getType:B,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return L}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}))},98310:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var t=0;t-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n*\/]/.test(a)?s(null,"select-op"):/[;{}:\[\]]/.test(a)?s(null,a):(e.eatWhile(/[\w\\\-]/),s("variable","variable")):s(null,"compare"):void s(null,"compare")}function c(e,t){var n,r=!1;while(null!=(n=e.next())){if(r&&"/"==n){t.tokenize=l;break}r="*"==n}return s("comment","comment")}function A(e,t){var n,r=0;while(null!=(n=e.next())){if(r>=2&&">"==n){t.tokenize=l;break}r="-"==n?r+1:0}return s("comment","comment")}function u(e){return function(t,n){var r,i=!1;while(null!=(r=t.next())){if(r==e&&!i)break;i=!i&&"\\"==r}return i||(n.tokenize=l),s("string","string")}}return{startState:function(e){return{tokenize:l,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;n=null;var r=t.tokenize(e,t),i=t.stack[t.stack.length-1];return"hash"==n&&"rule"==i?r="atom":"variable"==r&&("rule"==i?r="number":i&&"@media{"!=i||(r="tag")),"rule"==i&&/^[\{\};]$/.test(n)&&t.stack.pop(),"{"==n?"@media"==i?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==n?t.stack.pop():"@media"==n?t.stack.push("@media"):"{"==i&&"comment"!=n&&t.stack.push("rule"),r},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*a},electricChars:"}"}})),e.defineMIME("text/x-nginx-conf","nginx")}))},86788:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("octave",(function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var t=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),n=new RegExp("^[\\(\\[\\{\\},:=;\\.]"),r=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),i=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),o=new RegExp("^((>>=)|(<<=))"),a=new RegExp("^[\\]\\)]"),s=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),l=e(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),c=e(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function A(e,t){return e.sol()||"'"!==e.peek()?(t.tokenize=d,d(e,t)):(e.next(),t.tokenize=d,"operator")}function u(e,t){return e.match(/^.*%}/)?(t.tokenize=d,"comment"):(e.skipToEnd(),"comment")}function d(h,p){if(h.eatSpace())return null;if(h.match("%{"))return p.tokenize=u,h.skipToEnd(),"comment";if(h.match(/^[%#]/))return h.skipToEnd(),"comment";if(h.match(/^[0-9\.+-]/,!1)){if(h.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return h.tokenize=d,"number";if(h.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(h.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}if(h.match(e(["nan","NaN","inf","Inf"])))return"number";var f=h.match(/^"(?:[^"]|"")*("|$)/)||h.match(/^'(?:[^']|'')*('|$)/);return f?f[1]?"string":"string error":h.match(c)?"keyword":h.match(l)?"builtin":h.match(s)?"variable":h.match(t)||h.match(r)?"operator":h.match(n)||h.match(i)||h.match(o)?null:h.match(a)?(p.tokenize=A,null):(h.next(),"error")}return{startState:function(){return{tokenize:d}},token:function(e,t){var n=t.tokenize(e,t);return"number"!==n&&"variable"!==n||(t.tokenize=A),n},lineComment:"%",fold:"indent"}})),e.defineMIME("text/x-octave","octave")}))},14240:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("pascal",(function(){function e(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/;function i(e,i){var l=e.next();if("#"==l&&i.startOfLine)return e.skipToEnd(),"meta";if('"'==l||"'"==l)return i.tokenize=o(l),i.tokenize(e,i);if("("==l&&e.eat("*"))return i.tokenize=a,a(e,i);if("{"==l)return i.tokenize=s,s(e,i);if(/[\[\]\(\),;\:\.]/.test(l))return null;if(/\d/.test(l))return e.eatWhile(/[\w\.]/),"number";if("/"==l&&e.eat("/"))return e.skipToEnd(),"comment";if(r.test(l))return e.eatWhile(r),"operator";e.eatWhile(/[\w\$_]/);var c=e.current();return t.propertyIsEnumerable(c)?"keyword":n.propertyIsEnumerable(c)?"atom":"variable"}function o(e){return function(t,n){var r,i=!1,o=!1;while(null!=(r=t.next())){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return!o&&i||(n.tokenize=null),"string"}}function a(e,t){var n,r=!1;while(n=e.next()){if(")"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function s(e,t){var n;while(n=e.next())if("}"==n){t.tokenize=null;break}return"comment"}return{startState:function(){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n},electricChars:"{}"}})),e.defineMIME("text/x-pascal","pascal")}))},91909:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&t=(n=e.string.length-1)?e.pos=n:e.pos=r}e.defineMode("perl",(function(){var e={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},o="string-2",a=/[goseximacplud]/;function s(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){var o,a=!1,s=0;while(o=e.next()){if(o===n[s]&&!a)return void 0!==n[++s]?(t.chain=n[s],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=c,r;a=!a&&"\\"==o}return r},t.tokenize(e,t)}function l(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=c),e.skipToEnd(),"string"},t.tokenize(e,t)}function c(c,A){if(c.eatSpace())return null;if(A.chain)return s(c,A,A.chain,A.style,A.tail);if(c.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(c.match(/^<<(?=[_a-zA-Z])/))return c.eatWhile(/\w/),l(c,A,c.current().substr(2));if(c.sol()&&c.match(/^\=item(?!\w)/))return l(c,A,"=cut");var u=c.next();if('"'==u||"'"==u){if(n(c,3)=="<<"+u){var d=c.pos;c.eatWhile(/\w/);var h=c.current().substr(1);if(h&&c.eat(u))return l(c,A,h);c.pos=d}return s(c,A,[u],"string")}if("q"==u){var p=t(c,-2);if(!p||!/\w/.test(p))if(p=t(c,0),"x"==p){if(p=t(c,1),"("==p)return i(c,2),s(c,A,[")"],o,a);if("["==p)return i(c,2),s(c,A,["]"],o,a);if("{"==p)return i(c,2),s(c,A,["}"],o,a);if("<"==p)return i(c,2),s(c,A,[">"],o,a);if(/[\^'"!~\/]/.test(p))return i(c,1),s(c,A,[c.eat(p)],o,a)}else if("q"==p){if(p=t(c,1),"("==p)return i(c,2),s(c,A,[")"],"string");if("["==p)return i(c,2),s(c,A,["]"],"string");if("{"==p)return i(c,2),s(c,A,["}"],"string");if("<"==p)return i(c,2),s(c,A,[">"],"string");if(/[\^'"!~\/]/.test(p))return i(c,1),s(c,A,[c.eat(p)],"string")}else if("w"==p){if(p=t(c,1),"("==p)return i(c,2),s(c,A,[")"],"bracket");if("["==p)return i(c,2),s(c,A,["]"],"bracket");if("{"==p)return i(c,2),s(c,A,["}"],"bracket");if("<"==p)return i(c,2),s(c,A,[">"],"bracket");if(/[\^'"!~\/]/.test(p))return i(c,1),s(c,A,[c.eat(p)],"bracket")}else if("r"==p){if(p=t(c,1),"("==p)return i(c,2),s(c,A,[")"],o,a);if("["==p)return i(c,2),s(c,A,["]"],o,a);if("{"==p)return i(c,2),s(c,A,["}"],o,a);if("<"==p)return i(c,2),s(c,A,[">"],o,a);if(/[\^'"!~\/]/.test(p))return i(c,1),s(c,A,[c.eat(p)],o,a)}else if(/[\^'"!~\/(\[{<]/.test(p)){if("("==p)return i(c,1),s(c,A,[")"],"string");if("["==p)return i(c,1),s(c,A,["]"],"string");if("{"==p)return i(c,1),s(c,A,["}"],"string");if("<"==p)return i(c,1),s(c,A,[">"],"string");if(/[\^'"!~\/]/.test(p))return s(c,A,[c.eat(p)],"string")}}if("m"==u){p=t(c,-2);if((!p||!/\w/.test(p))&&(p=c.eat(/[(\[{<\^'"!~\/]/),p)){if(/[\^'"!~\/]/.test(p))return s(c,A,[p],o,a);if("("==p)return s(c,A,[")"],o,a);if("["==p)return s(c,A,["]"],o,a);if("{"==p)return s(c,A,["}"],o,a);if("<"==p)return s(c,A,[">"],o,a)}}if("s"==u){p=/[\/>\]})\w]/.test(t(c,-2));if(!p&&(p=c.eat(/[(\[{<\^'"!~\/]/),p))return s(c,A,"["==p?["]","]"]:"{"==p?["}","}"]:"<"==p?[">",">"]:"("==p?[")",")"]:[p,p],o,a)}if("y"==u){p=/[\/>\]})\w]/.test(t(c,-2));if(!p&&(p=c.eat(/[(\[{<\^'"!~\/]/),p))return s(c,A,"["==p?["]","]"]:"{"==p?["}","}"]:"<"==p?[">",">"]:"("==p?[")",")"]:[p,p],o,a)}if("t"==u){p=/[\/>\]})\w]/.test(t(c,-2));if(!p&&(p=c.eat("r"),p&&(p=c.eat(/[(\[{<\^'"!~\/]/),p)))return s(c,A,"["==p?["]","]"]:"{"==p?["}","}"]:"<"==p?[">",">"]:"("==p?[")",")"]:[p,p],o,a)}if("`"==u)return s(c,A,[u],"variable-2");if("/"==u)return/~\s*$/.test(n(c))?s(c,A,[u],o,a):"operator";if("$"==u){d=c.pos;if(c.eatWhile(/\d/)||c.eat("{")&&c.eatWhile(/\d/)&&c.eat("}"))return"variable-2";c.pos=d}if(/[$@%]/.test(u)){d=c.pos;if(c.eat("^")&&c.eat(/[A-Z]/)||!/[@$%&]/.test(t(c,-2))&&c.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){p=c.current();if(e[p])return"variable-2"}c.pos=d}if(/[$@%&]/.test(u)&&(c.eatWhile(/[\w$]/)||c.eat("{")&&c.eatWhile(/[\w$]/)&&c.eat("}"))){p=c.current();return e[p]?"variable-2":"variable"}if("#"==u&&"$"!=t(c,-2))return c.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(u)){d=c.pos;if(c.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),e[c.current()])return"operator";c.pos=d}if("_"==u&&1==c.pos){if("_END__"==r(c,6))return s(c,A,["\0"],"comment");if("_DATA__"==r(c,7))return s(c,A,["\0"],"variable-2");if("_C__"==r(c,7))return s(c,A,["\0"],"string")}if(/\w/.test(u)){d=c.pos;if("{"==t(c,-2)&&("}"==t(c,0)||c.eatWhile(/\w/)&&"}"==t(c,0)))return"string";c.pos=d}if(/[A-Z]/.test(u)){var f=t(c,-2);d=c.pos;if(c.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(c,0))){p=e[c.current()];return p?(p[1]&&(p=p[0]),":"!=f?1==p?"keyword":2==p?"def":3==p?"atom":4==p?"operator":5==p?"variable-2":"meta":"meta"):"meta"}c.pos=d}if(/[a-zA-Z_]/.test(u)){f=t(c,-2);c.eatWhile(/\w/);p=e[c.current()];return p?(p[1]&&(p=p[0]),":"!=f?1==p?"keyword":2==p?"def":3==p?"atom":4==p?"operator":5==p?"variable-2":"meta":"meta"):"meta"}return null}return{startState:function(){return{tokenize:c,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||c)(e,t)},lineComment:"#"}})),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}))},89099:function(e,t,n){n(57658),function(e){e(n(69767),n(42797),n(8365))}((function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";var o=!1;while(!e.eol()&&(o||!1===i||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1))){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally readonly match",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class enum function interface namespace trait"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var n;if(n=e.match(/^<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(n[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=r(o,"'"!=i),"string"}return!1},"#":function(e){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"},"/":function(e){if(e.eat("/")){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&! --t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",(function(t,n){var r=e.getMode(t,n&&n.htmlMode||"text/html"),i=e.getMode(t,l);function o(t,n){var o=n.curMode==i;if(t.sol()&&n.pending&&'"'!=n.pending&&"'"!=n.pending&&(n.pending=null),o)return o&&null==n.php.tokenize&&t.match("?>")?(n.curMode=r,n.curState=n.html,n.php.context.prev||(n.php=null),"meta"):i.token(t,n.curState);if(t.match(/^<\?\w*/))return n.curMode=i,n.php||(n.php=e.startState(i,r.indent(n.html,"",""))),n.curState=n.php,"meta";if('"'==n.pending||"'"==n.pending){while(!t.eol()&&t.next()!=n.pending);var a="string"}else if(n.pending&&t.pos/.test(l)?n.pending=s[0]:n.pending={end:t.pos,style:a},t.backUp(l.length-c)),a}return{startState:function(){var t=e.startState(r),o=n.startOpen?e.startState(i):null;return{html:t,php:o,curMode:n.startOpen?i:r,curState:n.startOpen?o:t,pending:null}},copyState:function(t){var n,o=t.html,a=e.copyState(r,o),s=t.php,l=s&&e.copyState(i,s);return n=t.curMode==r?a:l,{html:a,php:l,curMode:t.curMode,curState:n,pending:t.pending}},token:o,indent:function(e,t,n){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?r.indent(e.html,t,n):e.curMode.indent(e.curState,t,n)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}}),"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}))},38722:function(e,t,n){n(57658),function(e){"use strict";e(n(69767))}((function(e){"use strict";e.defineMode("powershell",(function(){function e(e,t){t=t||{};for(var n=void 0!==t.prefix?t.prefix:"^",r=void 0!==t.suffix?t.suffix:"\\b",i=0;i/,s=e([o,a],{suffix:""}),l=/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,c=/^[A-Za-z\_][A-Za-z\-\_\d]*\b/,A=/[A-Z]:|%|\?/i,u=e([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp("Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)"),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp("New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)"),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp("Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)"),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),d=e([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""}),h=e([A,u,d],{suffix:t}),p={keyword:r,number:l,operator:s,builtin:h,punctuation:i,identifier:c};function f(e,t){var r=t.returnStack[t.returnStack.length-1];if(r&&r.shouldReturnFrom(t))return t.tokenize=r.tokenize,t.returnStack.pop(),t.tokenize(e,t);if(e.eatSpace())return null;if(e.eat("("))return t.bracketNesting+=1,"punctuation";if(e.eat(")"))return t.bracketNesting-=1,"punctuation";for(var i in p)if(e.match(p[i]))return i;var o=e.next();if("'"===o)return g(e,t);if("$"===o)return k(e,t);if('"'===o)return m(e,t);if("<"===o&&e.eat("#"))return t.tokenize=x,x(e,t);if("#"===o)return e.skipToEnd(),"comment";if("@"===o){var a=e.eat(/["']/);if(a&&e.eol())return t.tokenize=B,t.startQuote=a[0],B(e,t);if(e.eol())return"error";if(e.peek().match(/[({]/))return"punctuation";if(e.peek().match(n))return k(e,t)}return"error"}function g(e,t){var n;while(null!=(n=e.peek()))if(e.next(),"'"===n&&!e.eat("'"))return t.tokenize=f,"string";return"error"}function m(e,t){var n;while(null!=(n=e.peek())){if("$"===n)return t.tokenize=v,"string";if(e.next(),"`"!==n){if('"'===n&&!e.eat('"'))return t.tokenize=f,"string"}else e.next()}return"error"}function v(e,t){return w(e,t,m)}function b(e,t){return t.tokenize=B,t.startQuote='"',B(e,t)}function y(e,t){return w(e,t,b)}function w(e,t,n){if(e.match("$(")){var r=t.bracketNesting;return t.returnStack.push({shouldReturnFrom:function(e){return e.bracketNesting===r},tokenize:n}),t.tokenize=f,t.bracketNesting+=1,"punctuation"}return e.next(),t.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:n}),t.tokenize=k,t.tokenize(e,t)}function x(e,t){var n,r=!1;while(null!=(n=e.next())){if(r&&">"==n){t.tokenize=f;break}r="#"===n}return"comment"}function k(e,t){var r=e.peek();return e.eat("{")?(t.tokenize=C,C(e,t)):void 0!=r&&r.match(n)?(e.eatWhile(n),t.tokenize=f,"variable-2"):(t.tokenize=f,"error")}function C(e,t){var n;while(null!=(n=e.next()))if("}"===n){t.tokenize=f;break}return"variable-2"}function B(e,t){var n=t.startQuote;if(e.sol()&&e.match(new RegExp(n+"@")))t.tokenize=f;else if('"'===n)while(!e.eol()){var r=e.peek();if("$"===r)return t.tokenize=y,"string";e.next(),"`"===r&&e.next()}else e.skipToEnd();return"string"}var _={startState:function(){return{returnStack:[],bracketNesting:0,tokenize:f}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:"<#",blockCommentEnd:"#>",lineComment:"#",fold:"brace"};return _})),e.defineMIME("application/x-powershell","powershell")}))},4668:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var n=["package","message","import","syntax","required","optional","repeated","reserved","default","extensions","packed","bool","bytes","double","enum","float","string","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","option","service","rpc","returns"],r=t(n);e.registerHelper("hintWords","protobuf",n);var i=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");function o(e){if(e.eatSpace())return null;if(e.match("//"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)||e.match(/^'([^']|(''))*'/)?"string":e.match(r)?"keyword":e.match(i)?"variable":(e.next(),null)}e.defineMode("protobuf",(function(){return{token:o,fold:"brace"}})),e.defineMIME("text/x-protobuf","protobuf")}))},72989:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i).concat(["exec","print"])),e.defineMode("python",(function(a,s){for(var l="error",c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,A=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],u=0;ur?C(t):i0&&_(e,t)&&(a+=" "+l),a}return w(e,t)}function w(e,t,r){if(e.eatSpace())return null;if(!r&&e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^[\d_]+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(o=!0),e.match(/^0b[01_]+/i)&&(o=!0),e.match(/^0o[0-7_]+/i)&&(o=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}if(e.match(m)){var a=-1!==e.current().toLowerCase().indexOf("f");return a?(t.tokenize=x(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=k(e.current(),t.tokenize),t.tokenize(e,t))}for(var s=0;s=0)e=e.substr(1);var n=1==e.length,r="string";function i(e){return function(t,n){var r=w(t,n,!0);return"punctuation"==r&&("{"==t.current()?n.tokenize=i(e+1):"}"==t.current()&&(n.tokenize=e>1?i(e-1):o)),r}}function o(o,a){while(!o.eol())if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}function k(e,t){while("rubf".indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){while(!i.eol())if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=t}return r}return i.isString=!0,i}function C(e){while("py"!=o(e).type)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function B(e,t,n){var r=e.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+d,type:n,align:r})}function _(e,t){var n=e.indentation();while(t.scopes.length>1&&o(t).offset>n){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function E(e,t){e.sol()&&(t.beginningOfLine=!0,t.dedent=!1);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":f?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent=!0),"lambda"==r&&(t.lambda=!0),":"==r&&!t.lambda&&"py"==o(t).type&&e.match(/^\s*(?:#|$)/,!1)&&C(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&B(e,t,"])}".slice(i,i+1)),i="])}".indexOf(r),-1!=i){if(o(t).type!=r)return l;t.indent=t.scopes.pop().offset-d}}return t.dedent&&e.eol()&&"py"==o(t).type&&t.scopes.length>1&&t.scopes.pop(),n}var S={startState:function(e){return{tokenize:y,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=E(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=y)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0)||"py"==r.type&&!t.dedent&&/^(else:|elif |except |finally:)/.test(n);return null!=r.align?r.align-(i?1:0):r.offset-(i?d:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return S})),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}))},33991:function(e,t,n){n(92087),function(e){e(n(69767))}((function(e){"use strict";e.registerHelper("wordChars","r",/[\w.]/),e.defineMode("r",(function(t){function n(e){for(var t={},n=0;n=!&|~$:]/;function h(e,t){s=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=p(n),"string";if("`"==n)return e.match(/[^`]+`/),"variable-3";if("."==n&&e.match(/.(?:[.]|\d+)/))return"keyword";if(/[a-zA-Z\.]/.test(n)){e.eatWhile(/[\w\.]/);var r=e.current();return l.propertyIsEnumerable(r)?"atom":A.propertyIsEnumerable(r)?(u.propertyIsEnumerable(r)&&!e.match(/\s*if(\s+|$)/,!1)&&(s="block"),"keyword"):c.propertyIsEnumerable(r)?"builtin":"variable"}return"%"==n?(e.skipTo("%")&&e.next(),"operator variable-2"):"<"==n&&e.eat("-")||"<"==n&&e.match("<-")||"-"==n&&e.match(/>>?/)?"operator arrow":"="==n&&t.ctx.argList?"arg-is":d.test(n)?"$"==n?"operator dollar":(e.eatWhile(d),"operator"):/[\(\){}\[\];]/.test(n)?(s=n,";"==n?"semi":null):null}function p(e){return function(t,n){if(t.eat("\\")){var r=t.next();return"x"==r?t.match(/^[a-f0-9]{2}/i):("u"==r||"U"==r)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==r?t.match(/^[a-f0-9]{4}/i):"U"==r?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&t.match(/^[0-7]{1,2}/),"string-2"}var i;while(null!=(i=t.next())){if(i==e){n.tokenize=h;break}if("\\"==i){t.backUp(1);break}}return"string"}}var f=1,g=2,m=4;function v(e,t,n){e.ctx={type:t,indent:e.indent,flags:0,column:n.column(),prev:e.ctx}}function b(e,t){var n=e.ctx;e.ctx={type:n.type,indent:n.indent,flags:n.flags|t,column:n.column,prev:n.prev}}function y(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}return{startState:function(){return{tokenize:h,ctx:{type:"top",indent:-t.indentUnit,flags:g},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(0==(3&t.ctx.flags)&&(t.ctx.flags|=g),t.ctx.flags&m&&y(t),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"!=n&&0==(t.ctx.flags&g)&&b(t,f),";"!=s&&"{"!=s&&"}"!=s||"block"!=t.ctx.type||y(t),"{"==s?v(t,"}",e):"("==s?(v(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==s?v(t,"]",e):"block"==s?v(t,"block",e):s==t.ctx.type?y(t):"block"==t.ctx.type&&"comment"!=n&&b(t,m),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(e,n){if(e.tokenize!=h)return 0;var r=n&&n.charAt(0),i=e.ctx,o=r==i.type;return i.flags&m&&(i=i.prev),"block"==i.type?i.indent+("{"==r?0:t.indentUnit):i.flags&f?i.column+(o?0:1):i.indent+(o?0:t.indentUnit)},lineComment:"#"}})),e.defineMIME("text/x-rsrc","r")}))},14040:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";function t(e){for(var t={},n=0,r=e.length;n]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return n=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var u=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||u||(n="."),"operator"}return null}return n="|",null}function A(e){var t,n=e.pos,r=0,i=!1,o=!1;while(null!=(t=e.next()))if(o)o=!1;else{if("[{(".indexOf(t)>-1)r++;else if("]})".indexOf(t)>-1){if(r--,r<0)break}else if("/"==t&&0==r){i=!0;break}o="\\"==t}return e.backUp(e.pos-n),i}function u(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=u(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=u(e+1));return c(t,n)}}function d(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,c(t,n))}}function h(e,t,n,r){return function(i,o){var a,s=!1;"read-quoted-paused"===o.context.type&&(o.context=o.context.prev,i.eat("}"));while(null!=(a=i.next())){if(a==e&&(r||!s)){o.tokenize.pop();break}if(n&&"#"==a&&!s){if(i.eat("{")){"}"==e&&(o.context={prev:o.context,type:"read-quoted-paused"}),o.tokenize.push(u());break}if(/[@\$]/.test(i.peek())){o.tokenize.push(d());break}}s=!s&&"\\"==a}return t}}function p(e,t){return function(n,r){return t&&n.eatSpace(),n.match(e)?r.tokenize.pop():n.skipToEnd(),"string"}}function f(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[c],indented:0,context:{type:"top",indented:-t.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){n=null,e.sol()&&(t.indented=e.indentation());var a,s=t.tokenize[t.tokenize.length-1](e,t),l=n;if("ident"==s){var c=e.current();s="."==t.lastTok?"property":r.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(c)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==s&&(l=c,i.propertyIsEnumerable(c)?a="indent":o.propertyIsEnumerable(c)?a="dedent":"if"!=c&&"unless"!=c||e.column()!=e.indentation()?"do"==c&&t.context.indented!]+/,token:"operator"},{regex:/[a-zA-Z_]\w*!/,token:"variable-3"},{regex:/[a-zA-Z_]\w*/,token:"variable"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}],string:[{regex:/"/,token:"string",next:"start"},{regex:/(?:[^\\"]|\\(?:.|$))*/,token:"string"}],string_raw:[{regex:/"/,token:"string",next:"start"},{regex:/[^"]*/,token:"string"}],string_raw_hash:[{regex:/"#+/,token:"string",next:"start"},{regex:/(?:[^"]|"(?!#))*/,token:"string"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],meta:{dontIndentStates:["comment"],electricInput:/^\s*\}$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),e.defineMIME("text/x-rustsrc","rust"),e.defineMIME("text/rust","rust")}))},67462:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("shell",(function(){var t={};function n(e,n){for(var r=0;r1&&e.eat("$");var n=e.next();return/['"({]/.test(n)?(t.tokens[0]=s(n,"("==n?"quote":"{"==n?"def":"string"),u(e,t)):(/\d/.test(n)||e.eatWhile(/\w/),t.tokens.shift(),"def")};function A(e){return function(t,n){return t.sol()&&t.string==e&&n.tokens.shift(),t.skipToEnd(),"string-2"}}function u(e,t){return(t.tokens[0]||a)(e,t)}return{startState:function(){return{tokens:[]}},token:function(e,t){return u(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}})),e.defineMIME("text/x-sh","shell"),e.defineMIME("application/x-sh","shell")}))},12492:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";function t(e){var t;while(null!=(t=e.next()))if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){var t;while(null!=(t=e.next()))if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){return e.eat("@")&&(e.match("session."),e.match("local."),e.match("global.")),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function i(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",(function(t,n){var r=n.client||{},i=n.atoms||{false:!0,true:!0,null:!0},l=n.builtin||a(s),c=n.keywords||a(o),A=n.operatorChars||/^[*+\-%<>!=&|~^\/]/,u=n.support||{},d=n.hooks||{},h=n.dateSQL||{date:!0,time:!0,timestamp:!0},p=!1!==n.backslashStringEscapes,f=n.brackets||/^[\{}\(\)\[\]]/,g=n.punctuation||/^[;.,:]/;function m(e,t){var n=e.next();if(d[n]){var o=d[n](e,t);if(!1!==o)return o}if(u.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]*'/)))return"number";if(u.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]*'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),u.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&u.doubleQuote)return t.tokenize=v(n),t.tokenize(e,t);if((u.nCharCast&&("n"==n||"N"==n)||u.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(u.escapeConstant&&("e"==n||"E"==n)&&("'"==e.peek()||'"'==e.peek()&&u.doubleQuote))return t.tokenize=function(e,t){return(t.tokenize=v(e.next(),!0))(e,t)},"keyword";if(u.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(u.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!u.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=b(1),t.tokenize(e,t);if("."!=n){if(A.test(n))return e.eatWhile(A),"operator";if(f.test(n))return"bracket";if(g.test(n))return e.eatWhile(g),"punctuation";if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return h.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":i.hasOwnProperty(a)?"atom":l.hasOwnProperty(a)?"type":c.hasOwnProperty(a)?"keyword":r.hasOwnProperty(a)?"builtin":null}return u.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:e.match(/^[\w\d_$#]+/)?"variable-2":void 0}function v(e,t){return function(n,r){var i,o=!1;while(null!=(i=n.next())){if(i==e&&!o){r.tokenize=m;break}o=(p||t)&&!o&&"\\"==i}return"string"}}function b(e){return function(t,n){var r=t.match(/^.*?(\/\*|\*\/)/);return r?"/*"==r[1]?n.tokenize=b(e+1):n.tokenize=e>1?b(e-1):m:t.skipToEnd(),"comment"}}function y(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function w(e){e.indent=e.context.indent,e.context=e.context.prev}return{startState:function(){return{tokenize:m,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==m&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?y(e,t,")"):"["==r?y(e,t,"]"):t.context&&t.context.type==r&&w(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:u.commentSlashSlash?"//":u.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``",config:n}}));var o="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function a(e){for(var t={},n=e.split(" "),r=0;r!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:a("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:a("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:a(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:a("date time timestamp"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":i}}),e.defineMIME("text/x-mariadb",{name:"sql",client:a("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:a(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group group_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:a("date time timestamp"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":i}}),e.defineMIME("text/x-sqlite",{name:"sql",client:a("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:a(o+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:a("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:a("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:a("date time timestamp datetime"),support:a("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":r,":":r,"?":r,$:r,'"':n,"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:a("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:a("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:a("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:a("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:a("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:a("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:a("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:a("date time timestamp"),support:a("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:a("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:a("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:a("date timestamp"),support:a("doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:a("source"),keywords:a(o+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:a("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time zone timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:a("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:a("date time timestamp"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),e.defineMIME("text/x-gql",{name:"sql",keywords:a("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:a("false true"),builtin:a("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:a("source"),keywords:a("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:a("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:a("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:a("date time timestamp"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:a("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:a("abs acos acosh add_months aggregate and any approx_count_distinct approx_percentile array array_contains array_distinct array_except array_intersect array_join array_max array_min array_position array_remove array_repeat array_sort array_union arrays_overlap arrays_zip ascii asin asinh assert_true atan atan2 atanh avg base64 between bigint bin binary bit_and bit_count bit_get bit_length bit_or bit_xor bool_and bool_or boolean bround btrim cardinality case cast cbrt ceil ceiling char char_length character_length chr coalesce collect_list collect_set concat concat_ws conv corr cos cosh cot count count_if count_min_sketch covar_pop covar_samp crc32 cume_dist current_catalog current_database current_date current_timestamp current_timezone current_user date date_add date_format date_from_unix_date date_part date_sub date_trunc datediff day dayofmonth dayofweek dayofyear decimal decode degrees delimited dense_rank div double e element_at elt encode every exists exp explode explode_outer expm1 extract factorial filter find_in_set first first_value flatten float floor forall format_number format_string from_csv from_json from_unixtime from_utc_timestamp get_json_object getbit greatest grouping grouping_id hash hex hour hypot if ifnull in initcap inline inline_outer input_file_block_length input_file_block_start input_file_name inputformat instr int isnan isnotnull isnull java_method json_array_length json_object_keys json_tuple kurtosis lag last last_day last_value lcase lead least left length levenshtein like ln locate log log10 log1p log2 lower lpad ltrim make_date make_dt_interval make_interval make_timestamp make_ym_interval map map_concat map_entries map_filter map_from_arrays map_from_entries map_keys map_values map_zip_with max max_by md5 mean min min_by minute mod monotonically_increasing_id month months_between named_struct nanvl negative next_day not now nth_value ntile nullif nvl nvl2 octet_length or outputformat overlay parse_url percent_rank percentile percentile_approx pi pmod posexplode posexplode_outer position positive pow power printf quarter radians raise_error rand randn random rank rcfile reflect regexp regexp_extract regexp_extract_all regexp_like regexp_replace repeat replace reverse right rint rlike round row_number rpad rtrim schema_of_csv schema_of_json second sentences sequence sequencefile serde session_window sha sha1 sha2 shiftleft shiftright shiftrightunsigned shuffle sign signum sin sinh size skewness slice smallint some sort_array soundex space spark_partition_id split sqrt stack std stddev stddev_pop stddev_samp str_to_map string struct substr substring substring_index sum tan tanh textfile timestamp timestamp_micros timestamp_millis timestamp_seconds tinyint to_csv to_date to_json to_timestamp to_unix_timestamp to_utc_timestamp transform transform_keys transform_values translate trim trunc try_add try_divide typeof ucase unbase64 unhex uniontype unix_date unix_micros unix_millis unix_seconds unix_timestamp upper uuid var_pop var_samp variance version weekday weekofyear when width_bucket window xpath xpath_boolean xpath_double xpath_float xpath_int xpath_long xpath_number xpath_short xpath_string xxhash64 year zip_with"),atoms:a("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:a("date time timestamp"),support:a("doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:a("source"),keywords:a("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:a("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:a("time"),support:a("decimallessFloat zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-trino",{name:"sql",keywords:a("abs absent acos add admin after all all_match alter analyze and any any_match approx_distinct approx_most_frequent approx_percentile approx_set arbitrary array_agg array_distinct array_except array_intersect array_join array_max array_min array_position array_remove array_sort array_union arrays_overlap as asc asin at at_timezone atan atan2 authorization avg bar bernoulli beta_cdf between bing_tile bing_tile_at bing_tile_coordinates bing_tile_polygon bing_tile_quadkey bing_tile_zoom_level bing_tiles_around bit_count bitwise_and bitwise_and_agg bitwise_left_shift bitwise_not bitwise_or bitwise_or_agg bitwise_right_shift bitwise_right_shift_arithmetic bitwise_xor bool_and bool_or both by call cardinality cascade case cast catalogs cbrt ceil ceiling char2hexint checksum chr classify coalesce codepoint column columns combinations comment commit committed concat concat_ws conditional constraint contains contains_sequence convex_hull_agg copartition corr cos cosh cosine_similarity count count_if covar_pop covar_samp crc32 create cross cube cume_dist current current_catalog current_date current_groups current_path current_role current_schema current_time current_timestamp current_timezone current_user data date_add date_diff date_format date_parse date_trunc day day_of_month day_of_week day_of_year deallocate default define definer degrees delete dense_rank deny desc describe descriptor distinct distributed dow doy drop e element_at else empty empty_approx_set encoding end error escape evaluate_classifier_predictions every except excluding execute exists exp explain extract false features fetch filter final first first_value flatten floor following for format format_datetime format_number from from_base from_base32 from_base64 from_base64url from_big_endian_32 from_big_endian_64 from_encoded_polyline from_geojson_geometry from_hex from_ieee754_32 from_ieee754_64 from_iso8601_date from_iso8601_timestamp from_iso8601_timestamp_nanos from_unixtime from_unixtime_nanos from_utf8 full functions geometric_mean geometry_from_hadoop_shape geometry_invalid_reason geometry_nearest_points geometry_to_bing_tiles geometry_union geometry_union_agg grant granted grants graphviz great_circle_distance greatest group grouping groups hamming_distance hash_counts having histogram hmac_md5 hmac_sha1 hmac_sha256 hmac_sha512 hour human_readable_seconds if ignore in including index infinity initial inner input insert intersect intersection_cardinality into inverse_beta_cdf inverse_normal_cdf invoker io is is_finite is_infinite is_json_scalar is_nan isolation jaccard_index join json_array json_array_contains json_array_get json_array_length json_exists json_extract json_extract_scalar json_format json_object json_parse json_query json_size json_value keep key keys kurtosis lag last last_day_of_month last_value lateral lead leading learn_classifier learn_libsvm_classifier learn_libsvm_regressor learn_regressor least left length level levenshtein_distance like limit line_interpolate_point line_interpolate_points line_locate_point listagg ln local localtime localtimestamp log log10 log2 logical lower lpad ltrim luhn_check make_set_digest map_agg map_concat map_entries map_filter map_from_entries map_keys map_union map_values map_zip_with match match_recognize matched matches materialized max max_by md5 measures merge merge_set_digest millisecond min min_by minute mod month multimap_agg multimap_from_entries murmur3 nan natural next nfc nfd nfkc nfkd ngrams no none none_match normal_cdf normalize not now nth_value ntile null nullif nulls numeric_histogram object objectid_timestamp of offset omit on one only option or order ordinality outer output over overflow parse_data_size parse_datetime parse_duration partition partitions passing past path pattern per percent_rank permute pi position pow power preceding prepare privileges properties prune qdigest_agg quarter quotes radians rand random range rank read recursive reduce reduce_agg refresh regexp_count regexp_extract regexp_extract_all regexp_like regexp_position regexp_replace regexp_split regr_intercept regr_slope regress rename render repeat repeatable replace reset respect restrict returning reverse revoke rgb right role roles rollback rollup round row_number rows rpad rtrim running scalar schema schemas second security seek select sequence serializable session set sets sha1 sha256 sha512 show shuffle sign simplify_geometry sin skewness skip slice some soundex spatial_partitioning spatial_partitions split split_part split_to_map split_to_multimap spooky_hash_v2_32 spooky_hash_v2_64 sqrt st_area st_asbinary st_astext st_boundary st_buffer st_centroid st_contains st_convexhull st_coorddim st_crosses st_difference st_dimension st_disjoint st_distance st_endpoint st_envelope st_envelopeaspts st_equals st_exteriorring st_geometries st_geometryfromtext st_geometryn st_geometrytype st_geomfrombinary st_interiorringn st_interiorrings st_intersection st_intersects st_isclosed st_isempty st_isring st_issimple st_isvalid st_length st_linefromtext st_linestring st_multipoint st_numgeometries st_numinteriorring st_numpoints st_overlaps st_point st_pointn st_points st_polygon st_relate st_startpoint st_symdifference st_touches st_union st_within st_x st_xmax st_xmin st_y st_ymax st_ymin start starts_with stats stddev stddev_pop stddev_samp string strpos subset substr substring sum system table tables tablesample tan tanh tdigest_agg text then ties timestamp_objectid timezone_hour timezone_minute to to_base to_base32 to_base64 to_base64url to_big_endian_32 to_big_endian_64 to_char to_date to_encoded_polyline to_geojson_geometry to_geometry to_hex to_ieee754_32 to_ieee754_64 to_iso8601 to_milliseconds to_spherical_geography to_timestamp to_unixtime to_utf8 trailing transaction transform transform_keys transform_values translate trim trim_array true truncate try try_cast type typeof uescape unbounded uncommitted unconditional union unique unknown unmatched unnest update upper url_decode url_encode url_extract_fragment url_extract_host url_extract_parameter url_extract_path url_extract_port url_extract_protocol url_extract_query use user using utf16 utf32 utf8 validate value value_at_quantile values values_at_quantiles var_pop var_samp variance verbose version view week week_of_year when where width_bucket wilson_interval_lower wilson_interval_upper window with with_timezone within without word_stem work wrapper write xxhash64 year year_of_week yow zip zip_with"),builtin:a("array bigint bingtile boolean char codepoints color date decimal double function geometry hyperloglog int integer interval ipaddress joniregexp json json2016 jsonpath kdbtree likepattern map model objectid p4hyperloglog precision qdigest re2jregexp real regressor row setdigest smallint sphericalgeography tdigest time timestamp tinyint uuid varbinary varchar zone"),atoms:a("false true null unknown"),operatorChars:/^[[\]|<>=!\-+*/%]/,dateSQL:a("date time timestamp zone"),support:a("decimallessFloat zerolessFloat hexNumber")})}))},70284:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";function t(e){for(var t={},n=0;n~^?!",s=":;,.(){}[]",l=/^\-?0b[01][01_]*/,c=/^\-?0o[0-7][0-7_]*/,A=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,u=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,d=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,h=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,p=/^\#[A-Za-z]+/,f=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function g(e,t,g){if(e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;var m,y=e.peek();if("/"==y){if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return t.tokenize.push(b),b(e,t)}if(e.match(p))return"builtin";if(e.match(f))return"attribute";if(e.match(l))return"number";if(e.match(c))return"number";if(e.match(A))return"number";if(e.match(u))return"number";if(e.match(h))return"property";if(a.indexOf(y)>-1)return e.next(),"operator";if(s.indexOf(y)>-1)return e.next(),e.match(".."),"punctuation";if(m=e.match(/("""|"|')/)){var w=v.bind(null,m[0]);return t.tokenize.push(w),w(e,t)}if(e.match(d)){var x=e.current();return o.hasOwnProperty(x)?"variable-2":i.hasOwnProperty(x)?"atom":n.hasOwnProperty(x)?(r.hasOwnProperty(x)&&(t.prev="define"),"keyword"):"define"==g?"def":"variable"}return e.next(),null}function m(){var e=0;return function(t,n,r){var i=g(t,n,r);if("punctuation"==i)if("("==t.current())++e;else if(")"==t.current()){if(0==e)return t.backUp(1),n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);--e}return i}}function v(e,t,n){var r,i=1==e.length,o=!1;while(r=t.peek())if(o){if(t.next(),"("==r)return n.tokenize.push(m()),"string";o=!1}else{if(t.match(e))return n.tokenize.pop(),"string";t.next(),o="\\"==r}return i&&n.tokenize.pop(),"string"}function b(e,t){var n;while(n=e.next())if("/"===n&&e.eat("*"))t.tokenize.push(b);else if("*"===n&&e.eat("/")){t.tokenize.pop();break}return"comment"}function y(e,t,n){this.prev=e,this.align=t,this.indented=n}function w(e,t){var n=t.match(/^\s*($|\/[\/\*])/,!1)?null:t.column()+1;e.context=new y(e.context,n,e.indented)}function x(e){e.context&&(e.indented=e.context.indented,e.context=e.context.prev)}e.defineMode("swift",(function(e){return{startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,t){var n=t.prev;t.prev=null;var r=t.tokenize[t.tokenize.length-1]||g,i=r(e,t,n);if(i&&"comment"!=i?t.prev||(t.prev=i):t.prev=n,"punctuation"==i){var o=/[\(\[\{]|([\]\)\}])/.exec(e.current());o&&(o[1]?x:w)(t,e)}return i},indent:function(t,n){var r=t.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);return null!=r.align?r.align-(i?1:0):r.indented+(i?0:e.indentUnit)},electricInput:/^\s*[\)\}\]]$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace",closeBrackets:"()[]{}''\"\"``"}})),e.defineMIME("text/x-swift","swift")}))},53810:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("vb",(function(t,n){var r="error";function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var o=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),a=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),s=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),l=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),c=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),A=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),u=["class","module","sub","enum","select","while","if","function","get","set","property","try","structure","synclock","using","with"],d=["else","elseif","case","catch","finally"],h=["next","loop"],p=["and","andalso","or","orelse","xor","in","not","is","isnot","like"],f=i(p),g=["#const","#else","#elseif","#end","#if","#region","addhandler","addressof","alias","as","byref","byval","cbool","cbyte","cchar","cdate","cdbl","cdec","cint","clng","cobj","compare","const","continue","csbyte","cshort","csng","cstr","cuint","culng","cushort","declare","default","delegate","dim","directcast","each","erase","error","event","exit","explicit","false","for","friend","gettype","goto","handles","implements","imports","infer","inherits","interface","isfalse","istrue","lib","me","mod","mustinherit","mustoverride","my","mybase","myclass","namespace","narrowing","new","nothing","notinheritable","notoverridable","of","off","on","operator","option","optional","out","overloads","overridable","overrides","paramarray","partial","private","protected","public","raiseevent","readonly","redim","removehandler","resume","return","shadows","shared","static","step","stop","strict","then","throw","to","true","trycast","typeof","until","until","when","widening","withevents","writeonly"],m=["object","boolean","char","string","byte","sbyte","short","ushort","int16","uint16","integer","uinteger","int32","uint32","long","ulong","int64","uint64","decimal","single","double","float","date","datetime","intptr","uintptr"],v=i(g),b=i(m),y='"',w=i(u),x=i(d),k=i(h),C=i(["end"]),B=i(["do"]),_=null;function E(e,t){t.currentIndent++}function S(e,t){t.currentIndent--}function F(e,t){if(e.eatSpace())return null;var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var i=!1;if((e.match(/^\d*\.\d+F?/i)||e.match(/^\d+\.\d*F?/)||e.match(/^\.\d+F?/))&&(i=!0),i)return e.eat(/J/i),"number";var u=!1;if(e.match(/^&H[0-9a-f]+/i)||e.match(/^&O[0-7]+/i)?u=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),u=!0):e.match(/^0(?![\dx])/i)&&(u=!0),u)return e.eat(/L/i),"number"}return e.match(y)?(t.tokenize=T(e.current()),t.tokenize(e,t)):e.match(c)||e.match(l)?null:e.match(s)||e.match(o)||e.match(f)?"operator":e.match(a)?null:e.match(B)?(E(e,t),t.doInCurrentLine=!0,"keyword"):e.match(w)?(t.doInCurrentLine?t.doInCurrentLine=!1:E(e,t),"keyword"):e.match(x)?"keyword":e.match(C)?(S(e,t),S(e,t),"keyword"):e.match(k)?(S(e,t),"keyword"):e.match(b)||e.match(v)?"keyword":e.match(A)?"variable":(e.next(),r)}function T(e){var t=1==e.length,i="string";return function(o,a){while(!o.eol()){if(o.eatWhile(/[^'"]/),o.match(e))return a.tokenize=F,i;o.eat(/['"]/)}if(t){if(n.singleLineStringErrors)return r;a.tokenize=F}return i}}function M(e,t){var n=t.tokenize(e,t),i=e.current();if("."===i)return n=t.tokenize(e,t),"variable"===n?"variable":r;var o="[({".indexOf(i);return-1!==o&&E(e,t),"dedent"===_&&S(e,t)?r:(o="])}".indexOf(i),-1!==o&&S(e,t)?r:n)}e.registerHelper("hintWords","vb",u.concat(d).concat(h).concat(p).concat(g).concat(m));var I={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:F,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=M(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(k)||r.match(C)||r.match(x)?t.indentUnit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*t.indentUnit},lineComment:"'"};return I})),e.defineMIME("text/x-vb","vb")}))},43004:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("velocity",(function(){function e(e){for(var t={},n=e.split(" "),r=0;r!?:\/|]/;function o(e,t,n){return t.tokenize=n,n(e,t)}function a(e,a){var A=a.beforeParams;a.beforeParams=!1;var u=e.next();if("'"==u&&!a.inString&&a.inParams)return a.lastTokenWasBuiltin=!1,o(e,a,s(u));if('"'!=u){if(/[\[\]{}\(\),;\.]/.test(u))return"("==u&&A?a.inParams=!0:")"==u&&(a.inParams=!1,a.lastTokenWasBuiltin=!0),null;if(/\d/.test(u))return a.lastTokenWasBuiltin=!1,e.eatWhile(/[\w\.]/),"number";if("#"==u&&e.eat("*"))return a.lastTokenWasBuiltin=!1,o(e,a,l);if("#"==u&&e.match(/ *\[ *\[/))return a.lastTokenWasBuiltin=!1,o(e,a,c);if("#"==u&&e.eat("#"))return a.lastTokenWasBuiltin=!1,e.skipToEnd(),"comment";if("$"==u)return e.eat("!"),e.eatWhile(/[\w\d\$_\.{}-]/),r&&r.propertyIsEnumerable(e.current())?"keyword":(a.lastTokenWasBuiltin=!0,a.beforeParams=!0,"builtin");if(i.test(u))return a.lastTokenWasBuiltin=!1,e.eatWhile(i),"operator";e.eatWhile(/[\w\$_{}@]/);var d=e.current();return t&&t.propertyIsEnumerable(d)?"keyword":n&&n.propertyIsEnumerable(d)||e.current().match(/^#@?[a-z0-9_]+ *$/i)&&"("==e.peek()&&(!n||!n.propertyIsEnumerable(d.toLowerCase()))?(a.beforeParams=!0,a.lastTokenWasBuiltin=!1,"keyword"):a.inString?(a.lastTokenWasBuiltin=!1,"string"):e.pos>d.length&&"."==e.string.charAt(e.pos-d.length-1)&&a.lastTokenWasBuiltin?"builtin":(a.lastTokenWasBuiltin=!1,null)}return a.lastTokenWasBuiltin=!1,a.inString?(a.inString=!1,"string"):a.inParams?o(e,a,s(u)):void 0}function s(e){return function(t,n){var r,i=!1,o=!1;while(null!=(r=t.next())){if(r==e&&!i){o=!0;break}if('"'==e&&"$"==t.peek()&&!i){n.inString=!0,o=!0;break}i=!i&&"\\"==r}return o&&(n.tokenize=a),"string"}}function l(e,t){var n,r=!1;while(n=e.next()){if("#"==n&&r){t.tokenize=a;break}r="*"==n}return"comment"}function c(e,t){var n,r=0;while(n=e.next()){if("#"==n&&2==r){t.tokenize=a;break}"]"==n?r++:" "!=n&&(r=0)}return"meta"}return{startState:function(){return{tokenize:a,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}})),e.defineMIME("text/velocity","velocity")}))},61804:function(e,t,n){n(57658),function(e){e(n(69767))}((function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var A in c)l[A]=c[A];for(var A in i)l[A]=i[A];function u(e,t){function n(n){return t.tokenize=n,n(e,t)}var r,i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(f(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"):(e.eatWhile(/[^&<]/),null)}function d(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=u,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=u,t.state=y,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=h(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e){var t=function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=d;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=u;break}n.next()}return e}}function f(e){return function(t,n){var r;while(null!=(r=t.next())){if("<"==r)return n.tokenize=f(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=u;break}return n.tokenize=f(e-1),n.tokenize(t,n)}}return"meta"}}function g(e){return e&&e.toLowerCase()}function m(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&(e.context=e.context.prev)}function b(e,t){var n;while(1){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(g(n))||!l.contextGrabbers[g(n)].hasOwnProperty(g(t)))return;v(e)}}function y(e,t,n){return"openTag"==e?(n.tagStart=t.column(),w):"closeTag"==e?x:y}function w(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",B):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",B(e,t,n)):(a="error",w)}function x(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",k):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",k(e,t,n)):(a="error",C)}function k(e,t,n){return"endTag"!=e?(a="error",k):(v(n),y)}function C(e,t,n){return a="error",k(e,t,n)}function B(e,t,n){if("word"==e)return a="attribute",_;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(g(r))?b(n,r):(b(n,r),n.context=new m(n,r,i==n.indented)),y}return a="error",B}function _(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),B(e,t,n))}function E(e,t,n){return"string"==e?S:"word"==e&&l.allowUnquoted?(a="string",B):(a="error",B(e,t,n))}function S(e,t,n){return"string"==e?S:B(e,t,n)}return u.isInText=!0,{startState:function(e){var t={tokenize:u,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=u)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=B)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}))},37406:function(e,t,n){(function(e){e(n(69767))})((function(e){"use strict";e.defineMode("yaml",(function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match("---"))return"def";if(e.match("..."))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-yaml","yaml"),e.defineMIME("text/yaml","yaml")}))},51945:function(e,t,n){"use strict";var r=n(83545),i={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function a(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function s(e,t){var n,s,l,c,A,u,d=!1;t||(t={}),n=t.debug||!1;try{l=r(),c=document.createRange(),A=document.getSelection(),u=document.createElement("span"),u.textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i["default"];window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),A.addRange(c);var h=document.execCommand("copy");if(!h)throw new Error("copy command was unsuccessful");d=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(p){n&&console.error("unable to copy using clipboardData: ",p),n&&console.error("falling back to prompt"),s=a("message"in t?t.message:o),window.prompt(s,e)}}finally{A&&("function"==typeof A.removeRange?A.removeRange(c):A.removeAllRanges()),u&&document.body.removeChild(u),l()}return d}e.exports=s},40255:function(e,t,n){n(57658),n(82801),n(1439),n(87585),n(55315), /*! * Cropper.js v1.6.0 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2023-08-26T08:14:27.943Z */ function(t,n){e.exports=n()}(0,(function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n
      ',pe=Number.isNaN||g.isNaN;function fe(e){return"number"===typeof e&&!pe(e)}var ge=function(e){return e>0&&e<1/0};function me(e){return"undefined"===typeof e}function ve(e){return"object"===n(e)&&null!==e}var be=Object.prototype.hasOwnProperty;function ye(e){if(!ve(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&be.call(n,"isPrototypeOf")}catch(r){return!1}}function we(e){return"function"===typeof e}var xe=Array.prototype.slice;function ke(e){return Array.from?Array.from(e):xe.call(e)}function Ce(e,t){return e&&we(t)&&(Array.isArray(e)||fe(e.length)?ke(e).forEach((function(n,r){t.call(e,n,r,e)})):ve(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var Be=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&n.forEach((function(t){ve(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},_e=/\.\d*(?:0|9){12}\d*$/;function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return _e.test(e)?Math.round(e*t)/t:e}var Se=/^width|height|left|top|marginLeft|marginTop$/;function Fe(e,t){var n=e.style;Ce(t,(function(e,t){Se.test(t)&&fe(e)&&(e="".concat(e,"px")),n[t]=e}))}function Te(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function Me(e,t){if(t)if(fe(e.length))Ce(e,(function(e){Me(e,t)}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Ie(e,t){t&&(fe(e.length)?Ce(e,(function(e){Ie(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function Ne(e,t,n){t&&(fe(e.length)?Ce(e,(function(e){Ne(e,t,n)})):n?Me(e,t):Ie(e,t))}var Ue=/([a-z\d])([A-Z])/g;function Le(e){return e.replace(Ue,"$1-$2").toLowerCase()}function Qe(e,t){return ve(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Le(t)))}function De(e,t,n){ve(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Le(t)),n)}function He(e,t){if(ve(e[t]))try{delete e[t]}catch(n){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(n){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Le(t)))}var Oe=/\s\s*/,ze=function(){var e=!1;if(f){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});g.addEventListener("test",n,r),g.removeEventListener("test",n,r)}return e}();function Ze(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(Oe).forEach((function(t){if(!ze){var o=e.listeners;o&&o[t]&&o[t][n]&&(i=o[t][n],delete o[t][n],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners)}e.removeEventListener(t,i,r)}))}function Re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;t.trim().split(Oe).forEach((function(t){if(r.once&&!ze){var o=e.listeners,a=void 0===o?{}:o;i=function(){delete a[t][n],e.removeEventListener(t,i,r);for(var o=arguments.length,s=new Array(o),l=0;lMath.abs(r)&&(r=c)}))})),r}function Ye(e,n){var r=e.pageX,i=e.pageY,o={endX:r,endY:i};return n?o:t({startX:r,startY:i},o)}function Xe(e){var t=0,n=0,r=0;return Ce(e,(function(e){var i=e.startX,o=e.startY;t+=i,n+=o,r+=1})),t/=r,n/=r,{pageX:t,pageY:n}}function Je(e){var t=e.aspectRatio,n=e.height,r=e.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=ge(r),a=ge(n);if(o&&a){var s=n*t;"contain"===i&&s>r||"cover"===i&&s90?{width:l,height:s}:{width:s,height:l}}function tt(e,t,n,r){var i=t.aspectRatio,o=t.naturalWidth,a=t.naturalHeight,l=t.rotate,c=void 0===l?0:l,A=t.scaleX,u=void 0===A?1:A,d=t.scaleY,h=void 0===d?1:d,p=n.aspectRatio,f=n.naturalWidth,g=n.naturalHeight,m=r.fillColor,v=void 0===m?"transparent":m,b=r.imageSmoothingEnabled,y=void 0===b||b,w=r.imageSmoothingQuality,x=void 0===w?"low":w,k=r.maxWidth,C=void 0===k?1/0:k,B=r.maxHeight,_=void 0===B?1/0:B,E=r.minWidth,S=void 0===E?0:E,F=r.minHeight,T=void 0===F?0:F,M=document.createElement("canvas"),I=M.getContext("2d"),N=Je({aspectRatio:p,width:C,height:_}),U=Je({aspectRatio:p,width:S,height:T},"cover"),L=Math.min(N.width,Math.max(U.width,f)),Q=Math.min(N.height,Math.max(U.height,g)),D=Je({aspectRatio:i,width:C,height:_}),H=Je({aspectRatio:i,width:S,height:T},"cover"),O=Math.min(D.width,Math.max(H.width,o)),z=Math.min(D.height,Math.max(H.height,a)),Z=[-O/2,-z/2,O,z];return M.width=Ee(L),M.height=Ee(Q),I.fillStyle=v,I.fillRect(0,0,L,Q),I.save(),I.translate(L/2,Q/2),I.rotate(c*Math.PI/180),I.scale(u,h),I.imageSmoothingEnabled=y,I.imageSmoothingQuality=x,I.drawImage.apply(I,[e].concat(s(Z.map((function(e){return Math.floor(Ee(e))}))))),I.restore(),M}var nt=String.fromCharCode;function rt(e,t,n){var r="";n+=t;for(var i=t;i0)n.push(nt.apply(null,ke(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(t,";base64,").concat(btoa(n.join("")))}function st(e){var t,n=new DataView(e);try{var r,i,o;if(255===n.getUint8(0)&&216===n.getUint8(1)){var a=n.byteLength,s=2;while(s+1=8&&(o=c+u)}}}if(o){var d,h,p=n.getUint16(o,r);for(h=0;h=0?i:Ae),height:Math.max(n.offsetHeight,o>=0?o:ue)};this.containerData=a,Fe(r,{width:a.width,height:a.height}),Me(e,U),Ie(r,U)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,r=Math.abs(t.rotate)%180===90,i=r?t.naturalHeight:t.naturalWidth,o=r?t.naturalWidth:t.naturalHeight,a=i/o,s=e.width,l=e.height;e.height*a>e.width?3===n?s=e.height*a:l=e.width/a:3===n?l=e.width/a:s=e.height*a;var c={aspectRatio:a,naturalWidth:i,naturalHeight:o,width:s,height:l};this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(e.width-c.width)/2,c.top=(e.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=Be({},c)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,o=this.cropBoxData,a=n.viewMode,s=i.aspectRatio,l=this.cropped&&o;if(e){var c=Number(n.minCanvasWidth)||0,A=Number(n.minCanvasHeight)||0;a>1?(c=Math.max(c,r.width),A=Math.max(A,r.height),3===a&&(A*s>c?c=A*s:A=c/s)):a>0&&(c?c=Math.max(c,l?o.width:0):A?A=Math.max(A,l?o.height:0):l&&(c=o.width,A=o.height,A*s>c?c=A*s:A=c/s));var u=Je({aspectRatio:s,width:c,height:A});c=u.width,A=u.height,i.minWidth=c,i.minHeight=A,i.maxWidth=1/0,i.maxHeight=1/0}if(t)if(a>(l?0:1)){var d=r.width-i.width,h=r.height-i.height;i.minLeft=Math.min(0,d),i.minTop=Math.min(0,h),i.maxLeft=Math.max(0,d),i.maxTop=Math.max(0,h),l&&this.limited&&(i.minLeft=Math.min(o.left,o.left+(o.width-i.width)),i.minTop=Math.min(o.top,o.top+(o.height-i.height)),i.maxLeft=o.left,i.maxTop=o.top,2===a&&(i.width>=r.width&&(i.minLeft=Math.min(0,d),i.maxLeft=Math.max(0,d)),i.height>=r.height&&(i.minTop=Math.min(0,h),i.maxTop=Math.max(0,h))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=r.width,i.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var i=et({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),o=i.width,a=i.height,s=n.width*(o/n.naturalWidth),l=n.height*(a/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(l-n.height)/2,n.width=s,n.height=l,n.aspectRatio=o/a,n.naturalWidth=o,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightt.width?i.height=i.width/n:i.width=i.height*n),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*r),i.height=Math.max(i.minHeight,i.height*r),i.left=t.left+(t.width-i.width)/2,i.top=t.top+(t.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=Be({},i)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,o=this.cropBoxData,a=this.limited,s=n.aspectRatio;if(e){var l=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,A=a?Math.min(r.width,i.width,i.width+i.left,r.width-i.left):r.width,u=a?Math.min(r.height,i.height,i.height+i.top,r.height-i.top):r.height;l=Math.min(l,r.width),c=Math.min(c,r.height),s&&(l&&c?c*s>l?c=l/s:l=c*s:l?c=l/s:c&&(l=c*s),u*s>A?u=A/s:A=u*s),o.minWidth=Math.min(l,A),o.minHeight=Math.min(c,u),o.maxWidth=A,o.maxHeight=u}t&&(a?(o.minLeft=Math.max(0,i.left),o.minTop=Math.max(0,i.top),o.maxLeft=Math.min(r.width,i.left+i.width)-o.width,o.maxTop=Math.min(r.height,i.top+i.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=r.width-o.width,o.maxTop=r.height-o.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=t.width&&n.height>=t.height?x:y),Fe(this.cropBox,Be({width:n.width,height:n.height},Ge({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Pe(this.element,q,this.getData())}},At={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,i=e.alt||"The image to preview",o=document.createElement("img");if(t&&(o.crossOrigin=t),o.src=r,o.alt=i,this.viewBox.appendChild(o),this.viewBoxImage=o,n){var a=n;"string"===typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,Ce(a,(function(e){var n=document.createElement("img");De(e,z,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=i,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n)}))}},resetPreview:function(){Ce(this.previews,(function(e){var t=Qe(e,z);Fe(e,{width:t.width,height:t.height}),e.innerHTML=t.html,He(e,z)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,i=n.height,o=e.width,a=e.height,s=n.left-t.left-e.left,l=n.top-t.top-e.top;this.cropped&&!this.disabled&&(Fe(this.viewBoxImage,Be({width:o,height:a},Ge(Be({translateX:-s,translateY:-l},e)))),Ce(this.previews,(function(t){var n=Qe(t,z),c=n.width,A=n.height,u=c,d=A,h=1;r&&(h=c/r,d=i*h),i&&d>A&&(h=A/i,u=r*h,d=A),Fe(t,{width:u,height:d}),Fe(t.getElementsByTagName("img")[0],Be({width:o*h,height:a*h},Ge(Be({translateX:-s*h,translateY:-l*h},e))))})))}},ut={bind:function(){var e=this.element,t=this.options,n=this.cropper;we(t.cropstart)&&Re(e,j,t.cropstart),we(t.cropmove)&&Re(e,W,t.cropmove),we(t.cropend)&&Re(e,K,t.cropend),we(t.crop)&&Re(e,q,t.crop),we(t.zoom)&&Re(e,ie,t.zoom),Re(n,X,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Re(n,re,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Re(n,V,this.onDblclick=this.dblclick.bind(this)),Re(e.ownerDocument,J,this.onCropMove=this.cropMove.bind(this)),Re(e.ownerDocument,ee,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Re(window,ne,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;we(t.cropstart)&&Ze(e,j,t.cropstart),we(t.cropmove)&&Ze(e,W,t.cropmove),we(t.cropend)&&Ze(e,K,t.cropend),we(t.crop)&&Ze(e,q,t.crop),we(t.zoom)&&Ze(e,ie,t.zoom),Ze(n,X,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Ze(n,re,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ze(n,V,this.onDblclick),Ze(e.ownerDocument,J,this.onCropMove),Ze(e.ownerDocument,ee,this.onCropEnd),t.responsive&&Ze(window,ne,this.onResize)}},dt={resize:function(){if(!this.disabled){var e,t,n=this.options,r=this.container,i=this.containerData,o=r.offsetWidth/i.width,a=r.offsetHeight/i.height,s=Math.abs(o-1)>Math.abs(a-1)?o:a;if(1!==s)n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(Ce(e,(function(t,n){e[n]=t*s}))),this.setCropBoxData(Ce(t,(function(e,n){t[n]=e*s}))))}},dblclick:function(){this.disabled||this.options.dragMode===P||this.setDragMode(Te(this.dragBox,I)?R:Z)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(fe(t)&&1!==t||fe(n)&&0!==n||e.ctrlKey))){var r,i=this.options,o=this.pointers;e.changedTouches?Ce(e.changedTouches,(function(e){o[e.identifier]=Ye(e)})):o[e.pointerId||0]=Ye(e),r=Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?k:Qe(e.target,O),ae.test(r)&&!1!==Pe(this.element,j,{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,r===w&&(this.cropping=!0,Me(this.dragBox,D)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==Pe(this.element,W,{originalEvent:e,action:t})&&(e.changedTouches?Ce(e.changedTouches,(function(e){Be(n[e.identifier]||{},Ye(e,!0))})):Be(n[e.pointerId||0]||{},Ye(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?Ce(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Ne(this.dragBox,D,this.cropped&&this.options.modal)),Pe(this.element,K,{originalEvent:e,action:t}))}}},ht={change:function(e){var t,n=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,l=n.aspectRatio,c=o.left,A=o.top,u=o.width,d=o.height,h=c+u,p=A+d,f=0,g=0,m=i.width,v=i.height,b=!0;!l&&e.shiftKey&&(l=u&&d?u/d:1),this.limited&&(f=o.minLeft,g=o.minTop,m=f+Math.min(i.width,r.width,r.left+r.width),v=g+Math.min(i.height,r.height,r.top+r.height));var I=a[Object.keys(a)[0]],N={x:I.endX-I.startX,y:I.endY-I.startY},L=function(e){switch(e){case C:h+N.x>m&&(N.x=m-h);break;case B:c+N.xv&&(N.y=v-p);break}};switch(s){case y:c+=N.x,A+=N.y;break;case C:if(N.x>=0&&(h>=m||l&&(A<=g||p>=v))){b=!1;break}L(C),u+=N.x,u<0&&(s=B,u=-u,c-=u),l&&(d=u/l,A+=(o.height-d)/2);break;case E:if(N.y<=0&&(A<=g||l&&(c<=f||h>=m))){b=!1;break}L(E),d-=N.y,A+=N.y,d<0&&(s=_,d=-d,A-=d),l&&(u=d*l,c+=(o.width-u)/2);break;case B:if(N.x<=0&&(c<=f||l&&(A<=g||p>=v))){b=!1;break}L(B),u-=N.x,c+=N.x,u<0&&(s=C,u=-u,c-=u),l&&(d=u/l,A+=(o.height-d)/2);break;case _:if(N.y>=0&&(p>=v||l&&(c<=f||h>=m))){b=!1;break}L(_),d+=N.y,d<0&&(s=E,d=-d,A-=d),l&&(u=d*l,c+=(o.width-u)/2);break;case S:if(l){if(N.y<=0&&(A<=g||h>=m)){b=!1;break}L(E),d-=N.y,A+=N.y,u=d*l}else L(E),L(C),N.x>=0?hg&&(d-=N.y,A+=N.y):(d-=N.y,A+=N.y);u<0&&d<0?(s=M,d=-d,u=-u,A-=d,c-=u):u<0?(s=F,u=-u,c-=u):d<0&&(s=T,d=-d,A-=d);break;case F:if(l){if(N.y<=0&&(A<=g||c<=f)){b=!1;break}L(E),d-=N.y,A+=N.y,u=d*l,c+=o.width-u}else L(E),L(B),N.x<=0?c>f?(u-=N.x,c+=N.x):N.y<=0&&A<=g&&(b=!1):(u-=N.x,c+=N.x),N.y<=0?A>g&&(d-=N.y,A+=N.y):(d-=N.y,A+=N.y);u<0&&d<0?(s=T,d=-d,u=-u,A-=d,c-=u):u<0?(s=S,u=-u,c-=u):d<0&&(s=M,d=-d,A-=d);break;case M:if(l){if(N.x<=0&&(c<=f||p>=v)){b=!1;break}L(B),u-=N.x,c+=N.x,d=u/l}else L(_),L(B),N.x<=0?c>f?(u-=N.x,c+=N.x):N.y>=0&&p>=v&&(b=!1):(u-=N.x,c+=N.x),N.y>=0?p=0&&(h>=m||p>=v)){b=!1;break}L(C),u+=N.x,d=u/l}else L(_),L(C),N.x>=0?h=0&&p>=v&&(b=!1):u+=N.x,N.y>=0?p0?s=N.y>0?T:S:N.x<0&&(c-=u,s=N.y>0?M:F),N.y<0&&(A-=d),this.cropped||(Ie(this.cropBox,U),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}b&&(o.width=u,o.height=d,o.left=c,o.top=A,this.action=s,this.renderCropBox()),Ce(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},pt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Me(this.dragBox,D),Ie(this.cropBox,U),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Be({},this.initialImageData),this.canvasData=Be({},this.initialCanvasData),this.cropBoxData=Be({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Be(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ie(this.dragBox,D),Me(this.cropBox,U)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ce(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ie(this.cropper,N)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Me(this.cropper,N)),this},destroy:function(){var e=this.element;return e[b]?(e[b]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=n.left,i=n.top;return this.moveTo(me(e)?e:r+Number(e),me(t)?t:i+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(fe(e)&&(n.left=e,r=!0),fe(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=Number(e),e=e<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,i=this.canvasData,o=i.width,a=i.height,s=i.naturalWidth,l=i.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var c=s*e,A=l*e;if(!1===Pe(this.element,ie,{ratio:e,oldRatio:o/s,originalEvent:n}))return this;if(n){var u=this.pointers,d=qe(this.cropper),h=u&&Object.keys(u).length?Xe(u):{pageX:n.pageX,pageY:n.pageY};i.left-=(c-o)*((h.pageX-d.left-i.left)/o),i.top-=(A-a)*((h.pageY-d.top-i.top)/a)}else ye(t)&&fe(t.x)&&fe(t.y)?(i.left-=(c-o)*((t.x-i.left)/o),i.top-=(A-a)*((t.y-i.top)/a)):(i.left-=(c-o)/2,i.top-=(A-a)/2);i.width=c,i.height=A,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),fe(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,fe(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(fe(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(fe(e)&&(n.scaleX=e,r=!0),fe(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){e={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var a=r.width/r.naturalWidth;if(Ce(e,(function(t,n){e[n]=t/a})),t){var s=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=s-e.y}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=r.rotate||0),n.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,i={};if(this.ready&&!this.disabled&&ye(e)){var o=!1;t.rotatable&&fe(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,o=!0),t.scalable&&(fe(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,o=!0),fe(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;fe(e.x)&&(i.left=e.x*a+r.left),fe(e.y)&&(i.top=e.y*a+r.top),fe(e.width)&&(i.width=e.width*a),fe(e.height)&&(i.height=e.height*a),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?Be({},this.containerData):{}},getImageData:function(){return this.sized?Be({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Ce(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&ye(e)&&(fe(e.left)&&(t.left=e.left),fe(e.top)&&(t.top=e.top),fe(e.width)?(t.width=e.width,t.height=e.width/n):fe(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,r=this.cropBoxData,i=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ye(e)&&(fe(e.left)&&(r.left=e.left),fe(e.top)&&(r.top=e.top),fe(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),fe(e.height)&&e.height!==r.height&&(n=!0,r.height=e.height),i&&(t?r.height=r.width/i:n&&(r.width=r.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=tt(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(e.rounded),i=r.x,o=r.y,a=r.width,l=r.height,c=n.width/Math.floor(t.naturalWidth);1!==c&&(i*=c,o*=c,a*=c,l*=c);var A=a/l,u=Je({aspectRatio:A,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=Je({aspectRatio:A,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=Je({aspectRatio:A,width:e.width||(1!==c?n.width:a),height:e.height||(1!==c?n.height:l)}),p=h.width,f=h.height;p=Math.min(u.width,Math.max(d.width,p)),f=Math.min(u.height,Math.max(d.height,f));var g=document.createElement("canvas"),m=g.getContext("2d");g.width=Ee(p),g.height=Ee(f),m.fillStyle=e.fillColor||"transparent",m.fillRect(0,0,p,f);var v=e.imageSmoothingEnabled,b=void 0===v||v,y=e.imageSmoothingQuality;m.imageSmoothingEnabled=b,y&&(m.imageSmoothingQuality=y);var w,x,k,C,B,_,E=n.width,S=n.height,F=i,T=o;F<=-a||F>E?(F=0,w=0,k=0,B=0):F<=0?(k=-F,F=0,w=Math.min(E,a+F),B=w):F<=E&&(k=0,w=Math.min(a,E-F),B=w),w<=0||T<=-l||T>S?(T=0,x=0,C=0,_=0):T<=0?(C=-T,T=0,x=Math.min(S,l+T),_=x):T<=S&&(C=0,x=Math.min(l,S-T),_=x);var M=[F,T,w,x];if(B>0&&_>0){var I=p/a;M.push(k*I,C*I,B*I,_*I)}return m.drawImage.apply(m,[n].concat(s(M.map((function(e){return Math.floor(Ee(e))}))))),g},setAspectRatio:function(e){var t=this.options;return this.disabled||me(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var i=e===Z,o=t.movable&&e===R;e=i||o?e:P,t.dragMode=e,De(n,O,e),Ne(n,I,i),Ne(n,H,o),t.cropBoxMovable||(De(r,O,e),Ne(r,I,i),Ne(r,H,o))}return this}},ft=g.Cropper,gt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,e),!t||!ce.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=Be({},de,ye(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return o(e,[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t[b]){if(t[b]=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(se.test(e))le.test(e)?this.read(ot(e)):this.clone();else{var i=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=o,i.onerror=o,i.ontimeout=o,i.onprogress=function(){i.getResponseHeader("content-type")!==oe&&i.abort()},i.onload=function(){t.read(i.response)},i.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&je(e)&&n.crossOrigin&&(e=Ve(e)),i.open("GET",e,!0),i.responseType="arraybuffer",i.withCredentials="use-credentials"===n.crossOrigin,i.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,r=st(e),i=0,o=1,a=1;if(r>1){this.url=at(e,oe);var s=lt(r);i=s.rotate,o=s.scaleX,a=s.scaleY}t.rotatable&&(n.rotate=i),t.scalable&&(n.scaleX=o,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&je(t)&&(n||(n="anonymous"),r=Ve(t)),this.crossOrigin=n,this.crossOriginUrl=r;var i=document.createElement("img");n&&(i.crossOrigin=n),i.src=r||t,i.alt=e.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),Me(i,L),e.parentNode.insertBefore(i,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=g.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(g.navigator.userAgent),r=function(t,n){Be(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.initialImageData=Be({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||n){var i=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){r(i.width,i.height),n||o.removeChild(i)},i.src=t.src,n||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(i))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,r=e.parentNode,i=document.createElement("div");i.innerHTML=he;var o=i.querySelector(".".concat(b,"-container")),a=o.querySelector(".".concat(b,"-canvas")),s=o.querySelector(".".concat(b,"-drag-box")),l=o.querySelector(".".concat(b,"-crop-box")),c=l.querySelector(".".concat(b,"-face"));this.container=r,this.cropper=o,this.canvas=a,this.dragBox=s,this.cropBox=l,this.viewBox=o.querySelector(".".concat(b,"-view-box")),this.face=c,a.appendChild(n),Me(e,U),r.insertBefore(o,e.nextSibling),Ie(n,L),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Me(l,U),t.guides||Me(l.getElementsByClassName("".concat(b,"-dashed")),U),t.center||Me(l.getElementsByClassName("".concat(b,"-center")),U),t.background&&Me(o,"".concat(b,"-bg")),t.highlight||Me(c,Q),t.cropBoxMovable&&(Me(c,H),De(c,O,y)),t.cropBoxResizable||(Me(l.getElementsByClassName("".concat(b,"-line")),U),Me(l.getElementsByClassName("".concat(b,"-point")),U)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),we(t.ready)&&Re(e,te,t.ready,{once:!0}),Pe(e,te)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),Ie(this.element,U)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ft,e}},{key:"setDefaults",value:function(e){Be(de,ye(e)&&e)}}]),e}();return Be(gt.prototype,ct,At,ut,dt,ht,pt),gt}))},76540:function(e,t,n){n(57658);var r=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},i=-1,o=1,a=0;r.Diff=function(e,t){return[e,t]},r.prototype.diff_main=function(e,t,n,i){"undefined"==typeof i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var o=i;if(null==e||null==t)throw new Error("Null input. (diff_main)");if(e==t)return e?[new r.Diff(a,e)]:[];"undefined"==typeof n&&(n=!0);var s=n,l=this.diff_commonPrefix(e,t),c=e.substring(0,l);e=e.substring(l),t=t.substring(l),l=this.diff_commonSuffix(e,t);var A=e.substring(e.length-l);e=e.substring(0,e.length-l),t=t.substring(0,t.length-l);var u=this.diff_compute_(e,t,s,o);return c&&u.unshift(new r.Diff(a,c)),A&&u.push(new r.Diff(a,A)),this.diff_cleanupMerge(u),u},r.prototype.diff_compute_=function(e,t,n,s){var l;if(!e)return[new r.Diff(o,t)];if(!t)return[new r.Diff(i,e)];var c=e.length>t.length?e:t,A=e.length>t.length?t:e,u=c.indexOf(A);if(-1!=u)return l=[new r.Diff(o,c.substring(0,u)),new r.Diff(a,A),new r.Diff(o,c.substring(u+A.length))],e.length>t.length&&(l[0][0]=l[2][0]=i),l;if(1==A.length)return[new r.Diff(i,e),new r.Diff(o,t)];var d=this.diff_halfMatch_(e,t);if(d){var h=d[0],p=d[1],f=d[2],g=d[3],m=d[4],v=this.diff_main(h,f,n,s),b=this.diff_main(p,g,n,s);return v.concat([new r.Diff(a,m)],b)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},r.prototype.diff_lineMode_=function(e,t,n){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var l=s.lineArray,c=this.diff_main(e,t,!1,n);this.diff_charsToLines_(c,l),this.diff_cleanupSemantic(c),c.push(new r.Diff(a,""));var A=0,u=0,d=0,h="",p="";while(A=1&&d>=1){c.splice(A-u-d,u+d),A=A-u-d;for(var f=this.diff_main(h,p,!1,n),g=f.length-1;g>=0;g--)c.splice(A,0,f[g]);A+=f.length}d=0,u=0,h="",p="";break}A++}return c.pop(),c},r.prototype.diff_bisect_=function(e,t,n){for(var a=e.length,s=t.length,l=Math.ceil((a+s)/2),c=l,A=2*l,u=new Array(A),d=new Array(A),h=0;hn)break;for(var w=-y+g;w<=y-m;w+=2){var x=c+w;S=w==-y||w!=y&&u[x-1]a)m+=2;else if(k>s)g+=2;else if(f){var C=c+p-w;if(C>=0&&C=B)return this.diff_bisectSplit_(e,t,S,k,n)}}}for(var _=-y+v;_<=y-b;_+=2){C=c+_;B=_==-y||_!=y&&d[C-1]a)b+=2;else if(E>s)v+=2;else if(!f){x=c+p-_;if(x>=0&&x=B)return this.diff_bisectSplit_(e,t,S,k,n)}}}}return[new r.Diff(i,e),new r.Diff(o,t)]},r.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),a=t.substring(0,r),s=e.substring(n),l=t.substring(r),c=this.diff_main(o,a,!1,i),A=this.diff_main(s,l,!1,i);return c.concat(A)},r.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){var t="",i=0,a=-1,s=n.length;while(ar?e=e.substring(n-r):nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,o,a,s,A]:null}var a,s,l,c,A,u=o(n,r,Math.ceil(n.length/4)),d=o(n,r,Math.ceil(n.length/2));if(!u&&!d)return null;a=d?u&&u[4].length>d[4].length?u:d:u,e.length>t.length?(s=a[0],l=a[1],c=a[2],A=a[3]):(c=a[0],A=a[1],s=a[2],l=a[3]);var h=a[4];return[s,l,c,A,h]},r.prototype.diff_cleanupSemantic=function(e){var t=!1,n=[],s=0,l=null,c=0,A=0,u=0,d=0,h=0;while(c0?n[s-1]:-1,A=0,u=0,d=0,h=0,l=null,t=!0)),c++;t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),c=1;while(c=m?(g>=p.length/2||g>=f.length/2)&&(e.splice(c,0,new r.Diff(a,f.substring(0,g))),e[c-1][1]=p.substring(0,p.length-g),e[c+1][1]=f.substring(g),c++):(m>=p.length/2||m>=f.length/2)&&(e.splice(c,0,new r.Diff(a,p.substring(0,m))),e[c-1][0]=o,e[c-1][1]=f.substring(0,f.length-m),e[c+1][0]=i,e[c+1][1]=p.substring(m),c++),c++}c++}},r.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),i=t.charAt(0),o=n.match(r.nonAlphaNumericRegex_),a=i.match(r.nonAlphaNumericRegex_),s=o&&n.match(r.whitespaceRegex_),l=a&&i.match(r.whitespaceRegex_),c=s&&n.match(r.linebreakRegex_),A=l&&i.match(r.linebreakRegex_),u=c&&e.match(r.blanklineEndRegex_),d=A&&t.match(r.blanklineStartRegex_);return u||d?5:c||A?4:o&&!s&&l?3:s||l?2:o||a?1:0}var n=1;while(n=h&&(h=p,A=i,u=o,d=s)}e[n-1][1]!=A&&(A?e[n-1][1]=A:(e.splice(n-1,1),n--),e[n][1]=u,d?e[n+1][1]=d:(e.splice(n+1,1),n--))}n++}},r.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,r.whitespaceRegex_=/\s/,r.linebreakRegex_=/[\r\n]/,r.blanklineEndRegex_=/\n\r?\n$/,r.blanklineStartRegex_=/^\r?\n\r?\n/,r.prototype.diff_cleanupEfficiency=function(e){var t=!1,n=[],s=0,l=null,c=0,A=!1,u=!1,d=!1,h=!1;while(c0?n[s-1]:-1,d=h=!1),t=!0)),c++;t&&this.diff_cleanupMerge(e)},r.prototype.diff_cleanupMerge=function(e){e.push(new r.Diff(a,""));var t,n=0,s=0,l=0,c="",A="";while(n1?(0!==s&&0!==l&&(t=this.diff_commonPrefix(A,c),0!==t&&(n-s-l>0&&e[n-s-l-1][0]==a?e[n-s-l-1][1]+=A.substring(0,t):(e.splice(0,0,new r.Diff(a,A.substring(0,t))),n++),A=A.substring(t),c=c.substring(t)),t=this.diff_commonSuffix(A,c),0!==t&&(e[n][1]=A.substring(A.length-t)+e[n][1],A=A.substring(0,A.length-t),c=c.substring(0,c.length-t))),n-=s+l,e.splice(n,s+l),c.length&&(e.splice(n,0,new r.Diff(i,c)),n++),A.length&&(e.splice(n,0,new r.Diff(o,A)),n++),n++):0!==n&&e[n-1][0]==a?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,l=0,s=0,c="",A="";break}""===e[e.length-1][1]&&e.pop();var u=!1;n=1;while(nt)break;s=r,l=a}return e.length!=n&&e[n][0]===i?l:l+(t-s)},r.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=//g,l=/\n/g,c=0;c");switch(A){case o:t[c]=''+d+"";break;case i:t[c]=''+d+"";break;case a:t[c]=""+d+"";break}}return t.join("")},r.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(e,r){var o=e/t.length,a=Math.abs(n-r);return i.Match_Distance?o+a/i.Match_Distance:a?1:o}var a=this.Match_Threshold,s=e.indexOf(t,n);-1!=s&&(a=Math.min(o(0,s),a),s=e.lastIndexOf(t,n+t.length),-1!=s&&(a=Math.min(o(0,s),a)));var l,c,A=1<=p;m--){var v=r[e.charAt(m-1)];if(g[m]=0===h?(g[m+1]<<1|1)&v:(g[m+1]<<1|1)&v|(u[m+1]|u[m])<<1|1|u[m+1],g[m]&A){var b=o(h,m-1);if(b<=a){if(a=b,s=m-1,!(s>n))break;p=Math.max(1,2*n-s)}}}if(o(h+1,n)>a)break;u=g}return s},r.prototype.match_alphabet_=function(e){for(var t={},n=0;n2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(e&&"object"==typeof e&&"undefined"==typeof t&&"undefined"==typeof n)l=e,s=this.diff_text1(l);else if("string"==typeof e&&t&&"object"==typeof t&&"undefined"==typeof n)s=e,l=t;else{if("string"!=typeof e||"string"!=typeof t||!n||"object"!=typeof n)throw new Error("Unknown call format to patch_make.");s=e,l=n}if(0===l.length)return[];for(var c=[],A=new r.patch_obj,u=0,d=0,h=0,p=s,f=s,g=0;g=2*this.Patch_Margin&&u&&(this.patch_addContext_(A,p),c.push(A),A=new r.patch_obj,u=0,p=f,d=h);break}m!==o&&(d+=v.length),m!==i&&(h+=v.length)}return u&&(this.patch_addContext_(A,p),c.push(A)),c},r.prototype.patch_deepCopy=function(e){for(var t=[],n=0;nthis.Match_MaxBits?(c=this.match_main(t,d.substring(0,this.Match_MaxBits),u),-1!=c&&(h=this.match_main(t,d.substring(d.length-this.Match_MaxBits),u+d.length-this.Match_MaxBits),(-1==h||c>=h)&&(c=-1))):c=this.match_main(t,d,u),-1==c)s[l]=!1,r-=e[l].length2-e[l].length1;else if(s[l]=!0,r=c-u,A=-1==h?t.substring(c,c+d.length):t.substring(c,h+this.Match_MaxBits),d==A)t=t.substring(0,c)+this.diff_text2(e[l].diffs)+t.substring(c+d.length);else{var p=this.diff_main(d,A,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(p)/d.length>this.Patch_DeleteThreshold)s[l]=!1;else{this.diff_cleanupSemanticLossless(p);for(var f,g=0,m=0;ms[0][1].length){var l=t-s[0][1].length;s[0][1]=n.substring(s[0][1].length)+s[0][1],o.start1-=l,o.start2-=l,o.length1+=l,o.length2+=l}if(o=e[e.length-1],s=o.diffs,0==s.length||s[s.length-1][0]!=a)s.push(new r.Diff(a,n)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){l=t-s[s.length-1][1].length;s[s.length-1][1]+=n.substring(0,l),o.length1+=l,o.length2+=l}return n},r.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n2*t?(u.length1+=p.length,l+=p.length,d=!1,u.diffs.push(new r.Diff(h,p)),s.diffs.shift()):(p=p.substring(0,t-u.length1-this.Patch_Margin),u.length1+=p.length,l+=p.length,h===a?(u.length2+=p.length,c+=p.length):d=!1,u.diffs.push(new r.Diff(h,p)),p==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(p.length))}A=this.diff_text2(u.diffs),A=A.substring(A.length-this.Patch_Margin);var f=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);""!==f&&(u.length1+=f.length,u.length2+=f.length,0!==u.diffs.length&&u.diffs[u.diffs.length-1][0]===a?u.diffs[u.diffs.length-1][1]+=f:u.diffs.push(new r.Diff(a,f))),d||e.splice(++n,0,u)}}},r.prototype.patch_toText=function(e){for(var t=[],n=0;n0)if(o===e[a])return r;i(t)}}Object.assign(b.prototype,{subscribe:function(e,t,n){var r=this,i=this._target,o=this._emitter,a=this._listeners,s=function(){var r=m.apply(null,arguments),a={data:r,name:t,original:e};if(n){var s=n.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(r))}else o.emit.apply(o,[t].concat(r))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===t&&null===a[e]&&(a[e]=s,r._on.call(i,e,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!o.hasListeners(n)&&a[e]&&(a[e]=null,r._off.call(i,e,s))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=s,r._on.call(i,e,s))},unsubscribe:function(e){var t,n,r,i=this,o=this._listeners,a=this._emitter,s=this._off,l=this._target;if(e&&"string"!==typeof e)throw TypeError("event must be a string");function c(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=_.call(a,i);a._observers.splice(e,1)}if(e){if(t=o[e],!t)return;s.call(l,e,t),delete o[e],--this._listenersCount||c()}else{n=h(o),r=n.length;while(r-- >0)e=n[r],s.call(l,e,o[e]);this._listeners={},this._listenersCount=0,c()}}});var k=x(["function"]),C=x(["object","function"]);function B(e,t,n){var r,i,o,a=0,s=new e((function(l,c,A){function u(){i&&(i=null),a&&(clearTimeout(a),a=0)}n=y(n,{timeout:0,overload:!1},{timeout:function(e,t){return e*=1,("number"!==typeof e||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),r=!n.overload&&"function"===typeof e.prototype.cancel&&"function"===typeof A;var d=function(e){u(),l(e)},h=function(e){u(),c(e)};r?t(d,h,A):(i=[function(e){h(e||Error("canceled"))}],t(d,h,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!==typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),o=!0),n.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),c(e)}),n.timeout))}));return r||(s.cancel=function(e){if(i){for(var t=i.length,n=1;n0)d=v[s],"_listeners"!==d&&(b=E(e,t,n[d],r+1,i),b&&(y?y.push.apply(y,b):y=b));return y}if("**"===w){m=r+1===i||r+2===i&&"*"===x,m&&n._listeners&&(y=E(e,t,n,i,i)),v=h(n),s=v.length;while(s-- >0)d=v[s],"_listeners"!==d&&("*"===d||"**"===d?(n[d]._listeners&&!m&&(b=E(e,t,n[d],i,i),b&&(y?y.push.apply(y,b):y=b)),b=E(e,t,n[d],r,i)):b=E(e,t,n[d],d===x?r+2:r,i),b&&(y?y.push.apply(y,b):y=b));return y}n[w]&&(y=E(e,t,n[w],r+1,i))}if(p=n["*"],p&&E(e,t,p,r+1,i),f=n["**"],f)if(r0)d=v[s],"_listeners"!==d&&(d===x?E(e,t,f[d],r+2,i):d===w?E(e,t,f[d],r+1,i):(g={},g[d]=f[d],E(e,t,{"**":g},r+1,i)))}else f._listeners?E(e,t,f,i,i):f["*"]&&f["*"]._listeners&&E(e,t,f["*"],i,i);return y}function S(e,t,n){var r,i,o=0,a=0,s=this.delimiter,l=s.length;if("string"===typeof e)if(-1!==(r=e.indexOf(s))){i=new Array(5);do{i[o++]=e.slice(a,r),a=r+l}while(-1!==(r=e.indexOf(s,a)));i[o++]=e.slice(a)}else i=[e],o=1;else i=e,o=e.length;if(o>1)for(r=0;r+10&&A._listeners.length>this._maxListeners&&(A._listeners.warned=!0,g.call(this,A._listeners.length,c))):A._listeners=t,!0;return!0}function F(e,t,n,r){var i,o,a,s,l=h(e),c=l.length,A=e["_listeners"];while(c-- >0)o=l[c],i=e[o],a="_listeners"===o?n:n?n.concat(o):[o],s=r||"symbol"===typeof o,A&&t.push(s?a:a.join(this.delimiter)),"object"===typeof i&&F.call(this,i,t,a,s);return t}function T(e){var t,n,r,i=h(e),o=i.length;while(o-- >0)n=i[o],t=e[n],t&&(r=!0,"_listeners"===n||T(t)||delete e[n]);return r}function M(e,t,n){this.emitter=e,this.event=t,this.listener=n}function I(e,t,n){if(!0===n)o=!0;else if(!1===n)r=!0;else{if(!n||"object"!==typeof n)throw TypeError("options should be an object or true");var r=n.async,o=n.promisify,a=n.nextTick,s=n.objectify}if(r||a||o){var c=t,A=t._origin||t;if(a&&!l)throw Error("process.nextTick is not supported");o===i&&(o="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,n=this.event;return o?a?Promise.resolve():new Promise((function(e){d(e)})).then((function(){return t.event=n,c.apply(t,e)})):(a?process.nextTick:d)((function(){t.event=n,c.apply(t,e)}))},t._async=!0,t._origin=A}return[t,s?new M(this,e,t):this]}function N(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,f.call(this,e)}function U(e,t,n){n=y(n,{Promise:Promise,timeout:0,overload:!1},{Promise:w});var r=n.Promise;return B(r,(function(n,r,i){var o;if("function"===typeof e.addEventListener)return o=function(){n(m.apply(null,arguments))},i((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,s=function(){a&&e.removeListener("error",a),n(m.apply(null,arguments))};"error"!==t&&(a=function(n){e.removeListener(t,s),r(n)},e.once("error",a)),i((function(){a&&e.removeListener("error",a),e.removeListener(t,s)})),e.once(t,s)}),{timeout:n.timeout,overload:n.overload})}M.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},N.EventEmitter2=N,N.prototype.listenTo=function(e,t,n){if("object"!==typeof e)throw TypeError("target musts be an object");var r=this;function o(t){if("object"!==typeof t)throw TypeError("events must be an object");var i,o=n.reducers,a=_.call(r,e);i=-1===a?new b(r,e,n):r._observers[a];for(var s,l=h(t),c=l.length,A="function"===typeof o,u=0;u0)r=n[i],e&&r._target!==e||(r.unsubscribe(t),o=!0);return o},N.prototype.delimiter=".",N.prototype.setMaxListeners=function(e){e!==i&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},N.prototype.getMaxListeners=function(){return this._maxListeners},N.prototype.event="",N.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},N.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},N.prototype._once=function(e,t,n,r){return this._many(e,1,t,n,r)},N.prototype.many=function(e,t,n,r){return this._many(e,t,n,!1,r)},N.prototype.prependMany=function(e,t,n,r){return this._many(e,t,n,!0,r)},N.prototype._many=function(e,t,n,r,i){var o=this;if("function"!==typeof n)throw new Error("many only accepts instances of Function");function a(){return 0===--t&&o.off(e,a),n.apply(this,arguments)}return a._origin=n,this._on(e,a,r,i)},N.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||p.call(this);var e,t,n,r,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return!1;if(s&&(e=a,"newListener"!==a&&"removeListener"!==a&&"object"===typeof a)){if(n=a.length,c)for(r=0;r3)for(t=new Array(A-1),i=1;i3)for(n=new Array(u-1),o=1;o0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,g.call(this,this._events[e].length,e))):this._events[e]=t,a)},N.prototype.off=function(e,t){if("function"!==typeof t)throw new Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var i="string"===typeof e?e.split(this.delimiter):e.slice();if(r=E.call(this,null,i,this.listenerTree,0),!r)return this}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var o=0;o0){for(t=this._all,n=0,r=t.length;n0)n=s[t[o]],"function"===typeof n?r.push(n):r.push.apply(r,n);return r}if(this.wildcard){if(a=this.listenerTree,!a)return[];var l=[],c="string"===typeof e?e.split(this.delimiter):e.slice();return E.call(this,l,c,a,0),l}return s?(n=s[e],n?"function"===typeof n?[n]:n:[]):[]},N.prototype.eventNames=function(e){var t=this._events;return this.wildcard?F.call(this,this.listenerTree,[],null,e):t?h(t):[]},N.prototype.listenerCount=function(e){return this.listeners(e).length},N.prototype.hasListeners=function(e){if(this.wildcard){var t=[],n="string"===typeof e?e.split(this.delimiter):e.slice();return E.call(this,t,n,this.listenerTree,0),t.length>0}var r=this._events,o=this._all;return!!(o&&o.length||r&&(e===i?h(r).length:r[e]))},N.prototype.listenersAny=function(){return this._all?this._all:[]},N.prototype.waitFor=function(e,t){var n=this,r=typeof t;return"number"===r?t={timeout:t}:"function"===r&&(t={filter:t}),t=y(t,{timeout:0,filter:i,handleError:!1,Promise:Promise,overload:!1},{filter:k,Promise:w}),B(t.Promise,(function(r,i,o){function a(){var o=t.filter;if(!o||o.apply(n,arguments))if(n.off(e,a),t.handleError){var s=arguments[0];s?i(s):r(m.apply(null,arguments).slice(1))}else r(m.apply(null,arguments))}o((function(){n.off(e,a)})),n._on(e,a,!1)}),{timeout:t.timeout,overload:t.overload})};var L=N.prototype;Object.defineProperties(N,{defaultMaxListeners:{get:function(){return L._maxListeners},set:function(e){if("number"!==typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");L._maxListeners=e},enumerable:!0},once:{value:U,writable:!0,configurable:!0}}),Object.defineProperties(L,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),r=function(){return N}.call(t,n,t,e),r===i||(e.exports=r)}()},70263:function(e){ /*! 2020 Jason Mulligan @version 6.4.0 */ !function(t,n){e.exports=n()}(0,(function(){"use strict";var e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]},r={floor:Math.floor,ceil:Math.ceil};function i(i){var o,a,s,l,c,A,u,d,h,p,f,g,m,v,b,y,w,x,k,C,B,_=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},E=[],S=0;if(isNaN(i))throw new TypeError("Invalid number");if(s=!0===_.bits,b=!0===_.unix,g=!0===_.pad,a=_.base||2,m=void 0!==_.round?_.round:b?1:2,u=void 0!==_.locale?_.locale:"",d=_.localeOptions||{},y=void 0!==_.separator?_.separator:"",w=void 0!==_.spacer?_.spacer:b?"":" ",k=_.symbols||{},x=2===a&&_.standard||"jedec",f=_.output||"string",c=!0===_.fullform,A=_.fullforms instanceof Array?_.fullforms:[],o=void 0!==_.exponent?_.exponent:-1,C=r[_.roundingMethod]||Math.round,h=(p=Number(i))<0,l=a>2?1e3:1024,B=!1===isNaN(_.precision)?parseInt(_.precision,10):0,h&&(p=-p),(-1===o||isNaN(o))&&(o=Math.floor(Math.log(p)/Math.log(l)))<0&&(o=0),o>8&&(B>0&&(B+=8-o),o=8),"exponent"===f)return o;if(0===p)E[0]=0,v=E[1]=b?"":t[x][s?"bits":"bytes"][o];else{S=p/(2===a?Math.pow(2,10*o):Math.pow(1e3,o)),s&&(S*=8)>=l&&o<8&&(S/=l,o++);var F=Math.pow(10,o>0?m:0);E[0]=C(S*F)/F,E[0]===l&&o<8&&void 0===_.exponent&&(E[0]=1,o++),v=E[1]=10===a&&1===o?s?"kb":"kB":t[x][s?"bits":"bytes"][o],b&&(E[1]="jedec"===x?E[1].charAt(0):o>0?E[1].replace(/B$/,""):E[1],e.test(E[1])&&(E[0]=Math.floor(E[0]),E[1]=""))}if(h&&(E[0]=-E[0]),B>0&&(E[0]=E[0].toPrecision(B)),E[1]=k[E[1]]||E[1],!0===u?E[0]=E[0].toLocaleString():u.length>0?E[0]=E[0].toLocaleString(u,d):y.length>0&&(E[0]=E[0].toString().replace(".",y)),g&&!1===Number.isInteger(E[0])&&m>0){var T=y||".",M=E[0].toString().split(T),I=M[1]||"",N=I.length,U=m-N;E[0]="".concat(M[0]).concat(T).concat(I.padEnd(N+U,"0"))}return c&&(E[1]=A[o]?A[o]:n[x][o]+(s?"bit":"byte")+(1===E[0]?"":"s")),"array"===f?E:"object"===f?{value:E[0],symbol:E[1],exponent:o,unit:v}:E.join(w)}return i.partial=function(e){return function(t){return i(t,e)}},i}))},92269:function(e,t,n){n(57658),n(1439),n(87585),n(55315),n(92087), /*! * html2canvas 1.4.1 * Copyright (c) 2022 Niklas von Hertzen * Released under MIT License */ function(t,n){e.exports=n()}(0,(function(){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=55296&&i<=56319&&n>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="undefined"===typeof Uint8Array?[]:new Uint8Array(256),h=0;h>4,A[l++]=(15&r)<<4|i>>2,A[l++]=(3&i)<<6|63&o;return c},v=function(e){for(var t=e.length,n=[],r=0;r>y,B=1<>y,S=C+E,F=S,T=32,M=F+T,I=65536>>w,N=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>y],t=(t<>y)],t=(t<>w),t=this.index[t],t+=e>>y&U,t=this.index[t],t=(t<P?(i.push(!0),a-=P):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(o),n.push(ie);if(a===j||a===J){if(0===o)return r.push(o),n.push(ve);var s=n[o-1];return-1===Ze.indexOf(s)?(r.push(r[o-1]),n.push(s)):(r.push(o),n.push(ve))}return r.push(o),a===be?n.push("strict"===t?ce:Be):a===Te||a===me?n.push(ve):a===Me?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(Be):n.push(ve):void n.push(a)})),[r,n,i]},Ke=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?-1!==e.indexOf(i):e===i){var o=n;while(o<=r.length){o++;var a=r[o];if(a===t)return!0;if(a!==X)break}}if(i===X){o=n;while(o>0){o--;var s=r[o];if(Array.isArray(e)?-1!==e.indexOf(s):e===s){var l=n;while(l<=r.length){l++;a=r[l];if(a===t)return!0;if(a!==X)break}}if(s!==X)break}}return!1},We=function(e,t){var n=e;while(n>=0){var r=t[n];if(r!==X)return r;n--}return 0},je=function(e,t,n,r,i){if(0===n[r])return Ue;var o=r-1;if(Array.isArray(i)&&!0===i[o])return Ue;var a=o-1,s=o+1,l=t[o],c=a>=0?t[a]:0,A=t[s];if(l===K&&A===W)return Ue;if(-1!==He.indexOf(l))return Ne;if(-1!==He.indexOf(A))return Ue;if(-1!==Oe.indexOf(A))return Ue;if(We(o,t)===$)return Le;if(Qe.get(e[o])===J)return Ue;if((l===ye||l===we)&&Qe.get(e[s])===J)return Ue;if(l===G||A===G)return Ue;if(l===Y)return Ue;if(-1===[X,te,re].indexOf(l)&&A===Y)return Ue;if(-1!==[oe,ae,se,de,ge].indexOf(A))return Ue;if(We(o,t)===Ae)return Ue;if(Ke(ue,Ae,o,t))return Ue;if(Ke([oe,ae],ce,o,t))return Ue;if(Ke(ee,ee,o,t))return Ue;if(l===X)return Le;if(l===ue||A===ue)return Ue;if(A===ie||l===ie)return Le;if(-1!==[te,re,ce].indexOf(A)||l===ne)return Ue;if(c===Ce&&-1!==Pe.indexOf(l))return Ue;if(l===ge&&A===Ce)return Ue;if(A===le)return Ue;if(-1!==De.indexOf(A)&&l===he||-1!==De.indexOf(l)&&A===he)return Ue;if(l===fe&&-1!==[Be,ye,we].indexOf(A)||-1!==[Be,ye,we].indexOf(l)&&A===pe)return Ue;if(-1!==De.indexOf(l)&&-1!==ze.indexOf(A)||-1!==ze.indexOf(l)&&-1!==De.indexOf(A))return Ue;if(-1!==[fe,pe].indexOf(l)&&(A===he||-1!==[Ae,re].indexOf(A)&&t[s+1]===he)||-1!==[Ae,re].indexOf(l)&&A===he||l===he&&-1!==[he,ge,de].indexOf(A))return Ue;if(-1!==[he,ge,de,oe,ae].indexOf(A)){var u=o;while(u>=0){var d=t[u];if(d===he)return Ue;if(-1===[ge,de].indexOf(d))break;u--}}if(-1!==[fe,pe].indexOf(A)){u=-1!==[oe,ae].indexOf(l)?a:o;while(u>=0){d=t[u];if(d===he)return Ue;if(-1===[ge,de].indexOf(d))break;u--}}if(_e===l&&-1!==[_e,Ee,xe,ke].indexOf(A)||-1!==[Ee,xe].indexOf(l)&&-1!==[Ee,Se].indexOf(A)||-1!==[Se,ke].indexOf(l)&&A===Se)return Ue;if(-1!==Re.indexOf(l)&&-1!==[le,pe].indexOf(A)||-1!==Re.indexOf(A)&&l===fe)return Ue;if(-1!==De.indexOf(l)&&-1!==De.indexOf(A))return Ue;if(l===de&&-1!==De.indexOf(A))return Ue;if(-1!==De.concat(he).indexOf(l)&&A===Ae&&-1===Ie.indexOf(e[s])||-1!==De.concat(he).indexOf(A)&&l===ae)return Ue;if(l===Fe&&A===Fe){var h=n[o],p=1;while(h>0){if(h--,t[h]!==Fe)break;p++}if(p%2!==0)return Ue}return l===ye&&A===we?Ue:Le},Ve=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=qe(e,t.lineBreak),r=n[0],i=n[1],o=n[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map((function(e){return-1!==[he,ve,Te].indexOf(e)?Be:e})));var a="keep-all"===t.wordBreak?o.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):void 0;return[r,i,a]},Ge=function(){function e(e,t,n,r){this.codePoints=e,this.required=t===Ne,this.start=n,this.end=r}return e.prototype.slice=function(){return A.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),$e=function(e,t){var n=c(e),r=Ve(n,t),i=r[0],o=r[1],a=r[2],s=n.length,l=0,A=0;return{next:function(){if(A>=s)return{done:!0,value:null};var e=Ue;while(A=Pt&&e<=57},tn=function(e){return e>=55296&&e<=57343},nn=function(e){return en(e)||e>=Gt&&e<=Yt||e>=qt&&e<=Wt},rn=function(e){return e>=qt&&e<=Vt},on=function(e){return e>=Gt&&e<=Jt},an=function(e){return rn(e)||on(e)},sn=function(e){return e>=St},ln=function(e){return e===tt||e===it||e===ot},cn=function(e){return an(e)||sn(e)||e===pt},An=function(e){return cn(e)||en(e)||e===ft},un=function(e){return e>=Qt&&e<=Dt||e===Ht||e>=Ot&&e<=zt||e===Zt},dn=function(e,t){return e===rt&&t!==tt},hn=function(e,t,n){return e===ft?cn(t)||dn(t,n):!!cn(e)||!(e!==rt||!dn(e,t))},pn=function(e,t,n){return e===Mt||e===ft?!!en(t)||t===Lt&&en(n):en(e===Lt?t:e)},fn=function(e){var t=0,n=1;e[t]!==Mt&&e[t]!==ft||(e[t]===ft&&(n=-1),t++);var r=[];while(en(e[t]))r.push(e[t++]);var i=r.length?parseInt(A.apply(void 0,r),10):0;e[t]===Lt&&t++;var o=[];while(en(e[t]))o.push(e[t++]);var a=o.length,s=a?parseInt(A.apply(void 0,o),10):0;e[t]!==$t&&e[t]!==Kt||t++;var l=1;e[t]!==Mt&&e[t]!==ft||(e[t]===ft&&(l=-1),t++);var c=[];while(en(e[t]))c.push(e[t++]);var u=c.length?parseInt(A.apply(void 0,c),10):0;return n*(i+s*Math.pow(10,-a))*Math.pow(10,l*u)},gn={type:2},mn={type:3},vn={type:4},bn={type:13},yn={type:8},wn={type:21},xn={type:9},kn={type:10},Cn={type:11},Bn={type:12},_n={type:14},En={type:23},Sn={type:1},Fn={type:25},Tn={type:24},Mn={type:26},In={type:27},Nn={type:28},Un={type:29},Ln={type:31},Qn={type:32},Dn=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(c(e))},e.prototype.read=function(){var e=[],t=this.consumeToken();while(t!==Qn)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case at:return this.consumeStringToken(at);case lt:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(An(t)||dn(n,r)){var i=hn(t,n,r)?Xe:Ye,o=this.consumeName();return{type:5,value:o,flags:i}}break;case ct:if(this.peekCodePoint(0)===st)return this.consumeCodePoint(),bn;break;case ut:return this.consumeStringToken(ut);case dt:return gn;case ht:return mn;case Tt:if(this.peekCodePoint(0)===st)return this.consumeCodePoint(),_n;break;case Mt:if(pn(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case It:return vn;case ft:var a=e,s=this.peekCodePoint(0),l=this.peekCodePoint(1);if(pn(a,s,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(hn(a,s,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===ft&&l===vt)return this.consumeCodePoint(),this.consumeCodePoint(),Tn;break;case Lt:if(pn(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case nt:if(this.peekCodePoint(0)===Tt){this.consumeCodePoint();while(1){var c=this.consumeCodePoint();if(c===Tt&&(c=this.consumeCodePoint(),c===nt))return this.consumeToken();if(c===Rt)return this.consumeToken()}}break;case Nt:return Mn;case Ut:return In;case mt:if(this.peekCodePoint(0)===gt&&this.peekCodePoint(1)===ft&&this.peekCodePoint(2)===ft)return this.consumeCodePoint(),this.consumeCodePoint(),Fn;break;case bt:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(hn(u,d,h)){o=this.consumeName();return{type:7,value:o}}break;case yt:return Nn;case rt:if(dn(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case wt:return Un;case xt:if(this.peekCodePoint(0)===st)return this.consumeCodePoint(),yn;break;case kt:return Cn;case Bt:return Bn;case jt:case Xt:var p=this.peekCodePoint(0),f=this.peekCodePoint(1);return p!==Mt||!nn(f)&&f!==Ct||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case _t:if(this.peekCodePoint(0)===st)return this.consumeCodePoint(),xn;if(this.peekCodePoint(0)===_t)return this.consumeCodePoint(),wn;break;case Et:if(this.peekCodePoint(0)===st)return this.consumeCodePoint(),kn;break;case Rt:return Qn}return ln(e)?(this.consumeWhiteSpace(),Ln):en(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):cn(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:A(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return"undefined"===typeof e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){var e=[],t=this.consumeCodePoint();while(nn(t)&&e.length<6)e.push(t),t=this.consumeCodePoint();var n=!1;while(t===Ct&&e.length<6)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(A.apply(void 0,e.map((function(e){return e===Ct?Pt:e}))),16),i=parseInt(A.apply(void 0,e.map((function(e){return e===Ct?Yt:e}))),16);return{type:30,start:r,end:i}}var o=parseInt(A.apply(void 0,e),16);if(this.peekCodePoint(0)===ft&&nn(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();var a=[];while(nn(t)&&a.length<6)a.push(t),t=this.consumeCodePoint();i=parseInt(A.apply(void 0,a),16);return{type:30,start:o,end:i}}return{type:30,start:o,end:o}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===dt?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===dt?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Rt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===ut||t===at){var n=this.consumeStringToken(this.consumeCodePoint());return 0===n.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Rt||this.peekCodePoint(0)===ht)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),En)}while(1){var r=this.consumeCodePoint();if(r===Rt||r===ht)return{type:22,value:A.apply(void 0,e)};if(ln(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Rt||this.peekCodePoint(0)===ht?(this.consumeCodePoint(),{type:22,value:A.apply(void 0,e)}):(this.consumeBadUrlRemnants(),En);if(r===at||r===ut||r===dt||un(r))return this.consumeBadUrlRemnants(),En;if(r===rt){if(!dn(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),En;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){while(ln(this.peekCodePoint(0)))this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){while(1){var e=this.consumeCodePoint();if(e===ht||e===Rt)return;dn(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){var t=5e4,n="";while(e>0){var r=Math.min(t,e);n+=A.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),n},e.prototype.consumeStringToken=function(e){var t="",n=0;do{var r=this._value[n];if(r===Rt||void 0===r||r===e)return t+=this.consumeStringSlice(n),{type:0,value:t};if(r===tt)return this._value.splice(0,n),Sn;if(r===rt){var i=this._value[n+1];i!==Rt&&void 0!==i&&(i===tt?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):dn(r,i)&&(t+=this.consumeStringSlice(n),t+=A(this.consumeEscapedCodePoint()),n=-1))}n++}while(1)},e.prototype.consumeNumber=function(){var e=[],t=Je,n=this.peekCodePoint(0);n!==Mt&&n!==ft||e.push(this.consumeCodePoint());while(en(this.peekCodePoint(0)))e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(n===Lt&&en(r)){e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=et;while(en(this.peekCodePoint(0)))e.push(this.consumeCodePoint())}n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((n===$t||n===Kt)&&((r===Mt||r===ft)&&en(i)||en(r))){e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=et;while(en(this.peekCodePoint(0)))e.push(this.consumeCodePoint())}return[fn(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),o=this.peekCodePoint(2);if(hn(r,i,o)){var a=this.consumeName();return{type:15,number:t,flags:n,unit:a}}return r===At?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(nn(e)){var t=A(e);while(nn(this.peekCodePoint(0))&&t.length<6)t+=A(this.consumeCodePoint());ln(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||tn(n)||n>1114111?Ft:n}return e===Rt?Ft:e},e.prototype.consumeName=function(){var e="";while(1){var t=this.consumeCodePoint();if(An(t))e+=A(t);else{if(!dn(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=A(this.consumeEscapedCodePoint())}}},e}(),Hn=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Dn;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){var e=this.consumeToken();while(31===e.type)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){var e=[];while(1){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){var t={type:e,values:[]},n=this.consumeToken();while(1){if(32===n.type||jn(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){var t={name:e.value,values:[],type:18};while(1){var n=this.consumeToken();if(32===n.type||3===n.type)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return"undefined"===typeof e?Qn:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),On=function(e){return 15===e.type},zn=function(e){return 17===e.type},Zn=function(e){return 20===e.type},Rn=function(e){return 0===e.type},Pn=function(e,t){return Zn(e)&&e.value===t},qn=function(e){return 31!==e.type},Kn=function(e){return 31!==e.type&&4!==e.type},Wn=function(e){var t=[],n=[];return e.forEach((function(e){if(4===e.type){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}31!==e.type&&n.push(e)})),n.length&&t.push(n),t},jn=function(e,t){return 11===t&&12===e.type||(28===t&&29===e.type||2===t&&3===e.type)},Vn=function(e){return 17===e.type||15===e.type},Gn=function(e){return 16===e.type||Vn(e)},$n=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Yn={type:17,number:0,flags:Je},Xn={type:16,number:50,flags:Je},Jn={type:16,number:100,flags:Je},er=function(e,t,n){var r=e[0],i=e[1];return[tr(r,t),tr("undefined"!==typeof i?i:r,n)]},tr=function(e,t){if(16===e.type)return e.number/100*t;if(On(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},nr="deg",rr="grad",ir="rad",or="turn",ar={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case nr:return Math.PI*t.number/180;case rr:return Math.PI/200*t.number;case ir:return t.number;case or:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},sr=function(e){return 15===e.type&&(e.unit===nr||e.unit===rr||e.unit===ir||e.unit===or)},lr=function(e){var t=e.filter(Zn).map((function(e){return e.value})).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Yn,Yn];case"to top":case"bottom":return cr(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Yn,Jn];case"to right":case"left":return cr(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Jn,Jn];case"to bottom":case"top":return cr(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Jn,Yn];case"to left":case"right":return cr(270)}return 0},cr=function(e){return Math.PI*e/180},Ar={name:"color",parse:function(e,t){if(18===t.type){var n=vr[t.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return n(e,t.values)}if(5===t.type){if(3===t.value.length){var r=t.value.substring(0,1),i=t.value.substring(1,2),o=t.value.substring(2,3);return hr(parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16),1)}if(4===t.value.length){r=t.value.substring(0,1),i=t.value.substring(1,2),o=t.value.substring(2,3);var a=t.value.substring(3,4);return hr(parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16),parseInt(a+a,16)/255)}if(6===t.value.length){r=t.value.substring(0,2),i=t.value.substring(2,4),o=t.value.substring(4,6);return hr(parseInt(r,16),parseInt(i,16),parseInt(o,16),1)}if(8===t.value.length){r=t.value.substring(0,2),i=t.value.substring(2,4),o=t.value.substring(4,6),a=t.value.substring(6,8);return hr(parseInt(r,16),parseInt(i,16),parseInt(o,16),parseInt(a,16)/255)}}if(20===t.type){var s=yr[t.value.toUpperCase()];if("undefined"!==typeof s)return s}return yr.TRANSPARENT}},ur=function(e){return 0===(255&e)},dr=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},hr=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(255*r)<<0)>>>0},pr=function(e,t){if(17===e.type)return e.number;if(16===e.type){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},fr=function(e,t){var n=t.filter(Kn);if(3===n.length){var r=n.map(pr),i=r[0],o=r[1],a=r[2];return hr(i,o,a,1)}if(4===n.length){var s=n.map(pr),l=(i=s[0],o=s[1],a=s[2],s[3]);return hr(i,o,a,l)}return 0};function gr(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var mr=function(e,t){var n=t.filter(Kn),r=n[0],i=n[1],o=n[2],a=n[3],s=(17===r.type?cr(r.number):ar.parse(e,r))/(2*Math.PI),l=Gn(i)?i.number/100:0,c=Gn(o)?o.number/100:0,A="undefined"!==typeof a&&Gn(a)?tr(a,1):1;if(0===l)return hr(255*c,255*c,255*c,1);var u=c<=.5?c*(l+1):c+l-c*l,d=2*c-u,h=gr(d,u,s+1/3),p=gr(d,u,s),f=gr(d,u,s-1/3);return hr(255*h,255*p,255*f,A)},vr={hsl:mr,hsla:mr,rgb:fr,rgba:fr},br=function(e,t){return Ar.parse(e,Hn.create(t).parseComponentValue())},yr={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},wr={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(Zn(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},xr={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},kr=function(e,t){var n=Ar.parse(e,t[0]),r=t[1];return r&&Gn(r)?{color:n,stop:r}:{color:n,stop:null}},Cr=function(e,t){var n=e[0],r=e[e.length-1];null===n.stop&&(n.stop=Yn),null===r.stop&&(r.stop=Jn);for(var i=[],o=0,a=0;ao?i.push(l):i.push(o),o=l}else i.push(null)}var c=null;for(a=0;ae.optimumDistance)?{optimumCorner:t,optimumDistance:s}:e}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Fr=function(e,t,n,r,i){var o=0,a=0;switch(e.size){case 0:0===e.shape?o=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):1===e.shape&&(o=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(0===e.shape)o=a=Math.min(Er(t,n),Er(t,n-i),Er(t-r,n),Er(t-r,n-i));else if(1===e.shape){var s=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),l=Sr(r,i,t,n,!0),c=l[0],A=l[1];o=Er(c-t,(A-n)/s),a=s*o}break;case 1:0===e.shape?o=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):1===e.shape&&(o=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(0===e.shape)o=a=Math.max(Er(t,n),Er(t,n-i),Er(t-r,n),Er(t-r,n-i));else if(1===e.shape){s=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r));var u=Sr(r,i,t,n,!1);c=u[0],A=u[1];o=Er(c-t,(A-n)/s),a=s*o}break}return Array.isArray(e.size)&&(o=tr(e.size[0],r),a=2===e.size.length?tr(e.size[1],i):o),[o,a]},Tr=function(e,t){var n=cr(180),r=[];return Wn(t).forEach((function(t,i){if(0===i){var o=t[0];if(20===o.type&&"to"===o.value)return void(n=lr(t));if(sr(o))return void(n=ar.parse(e,o))}var a=kr(e,t);r.push(a)})),{angle:n,stops:r,type:1}},Mr=function(e,t){var n=cr(180),r=[];return Wn(t).forEach((function(t,i){if(0===i){var o=t[0];if(20===o.type&&-1!==["top","left","right","bottom"].indexOf(o.value))return void(n=lr(t));if(sr(o))return void(n=(ar.parse(e,o)+cr(270))%cr(360))}var a=kr(e,t);r.push(a)})),{angle:n,stops:r,type:1}},Ir=function(e,t){var n=cr(180),r=[],i=1,o=0,a=3,s=[];return Wn(t).forEach((function(t,n){var o=t[0];if(0===n){if(Zn(o)&&"linear"===o.value)return void(i=1);if(Zn(o)&&"radial"===o.value)return void(i=2)}if(18===o.type)if("from"===o.name){var a=Ar.parse(e,o.values[0]);r.push({stop:Yn,color:a})}else if("to"===o.name){a=Ar.parse(e,o.values[0]);r.push({stop:Jn,color:a})}else if("color-stop"===o.name){var s=o.values.filter(Kn);if(2===s.length){a=Ar.parse(e,s[1]);var l=s[0];zn(l)&&r.push({stop:{type:16,number:100*l.number,flags:l.flags},color:a})}}})),1===i?{angle:(n+cr(180))%cr(360),stops:r,type:i}:{size:a,shape:o,stops:r,position:s,type:i}},Nr="closest-side",Ur="farthest-side",Lr="closest-corner",Qr="farthest-corner",Dr="circle",Hr="ellipse",Or="cover",zr="contain",Zr=function(e,t){var n=0,r=3,i=[],o=[];return Wn(t).forEach((function(t,a){var s=!0;if(0===a){var l=!1;s=t.reduce((function(e,t){if(l)if(Zn(t))switch(t.value){case"center":return o.push(Xn),e;case"top":case"left":return o.push(Yn),e;case"right":case"bottom":return o.push(Jn),e}else(Gn(t)||Vn(t))&&o.push(t);else if(Zn(t))switch(t.value){case Dr:return n=0,!1;case Hr:return n=1,!1;case"at":return l=!0,!1;case Nr:return r=0,!1;case Or:case Ur:return r=1,!1;case zr:case Lr:return r=2,!1;case Qr:return r=3,!1}else if(Vn(t)||Gn(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e}),s)}if(s){var c=kr(e,t);i.push(c)}})),{size:r,shape:n,stops:i,position:o,type:2}},Rr=function(e,t){var n=0,r=3,i=[],o=[];return Wn(t).forEach((function(t,a){var s=!0;if(0===a?s=t.reduce((function(e,t){if(Zn(t))switch(t.value){case"center":return o.push(Xn),!1;case"top":case"left":return o.push(Yn),!1;case"right":case"bottom":return o.push(Jn),!1}else if(Gn(t)||Vn(t))return o.push(t),!1;return e}),s):1===a&&(s=t.reduce((function(e,t){if(Zn(t))switch(t.value){case Dr:return n=0,!1;case Hr:return n=1,!1;case zr:case Nr:return r=0,!1;case Ur:return r=1,!1;case Lr:return r=2,!1;case Or:case Qr:return r=3,!1}else if(Vn(t)||Gn(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e}),s)),s){var l=kr(e,t);i.push(l)}})),{size:r,shape:n,stops:i,position:o,type:2}},Pr=function(e){return 1===e.type},qr=function(e){return 2===e.type},Kr={name:"image",parse:function(e,t){if(22===t.type){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(18===t.type){var r=Vr[t.name];if("undefined"===typeof r)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Wr(e){return!(20===e.type&&"none"===e.value)&&(18!==e.type||!!Vr[e.name])}var jr,Vr={"linear-gradient":Tr,"-moz-linear-gradient":Mr,"-ms-linear-gradient":Mr,"-o-linear-gradient":Mr,"-webkit-linear-gradient":Mr,"radial-gradient":Zr,"-moz-radial-gradient":Rr,"-ms-radial-gradient":Rr,"-o-radial-gradient":Rr,"-webkit-radial-gradient":Rr,"-webkit-gradient":Ir},Gr={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var n=t[0];return 20===n.type&&"none"===n.value?[]:t.filter((function(e){return Kn(e)&&Wr(e)})).map((function(t){return Kr.parse(e,t)}))}},$r={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(Zn(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Yr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Wn(t).map((function(e){return e.filter(Gn)})).map($n)}},Xr={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Wn(t).map((function(e){return e.filter(Zn).map((function(e){return e.value})).join(" ")})).map(Jr)}},Jr=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}};(function(e){e["AUTO"]="auto",e["CONTAIN"]="contain",e["COVER"]="cover"})(jr||(jr={}));var ei,ti={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Wn(t).map((function(e){return e.filter(ni)}))}},ni=function(e){return Zn(e)||Gn(e)},ri=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ii=ri("top"),oi=ri("right"),ai=ri("bottom"),si=ri("left"),li=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return $n(t.filter(Gn))}}},ci=li("top-left"),Ai=li("top-right"),ui=li("bottom-right"),di=li("bottom-left"),hi=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},pi=hi("top"),fi=hi("right"),gi=hi("bottom"),mi=hi("left"),vi=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return On(t)?t.number:0}}},bi=vi("top"),yi=vi("right"),wi=vi("bottom"),xi=vi("left"),ki={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ci={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},Bi={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Zn).reduce((function(e,t){return e|_i(t.value)}),0)}},_i=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ei={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Si={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};(function(e){e["NORMAL"]="normal",e["STRICT"]="strict"})(ei||(ei={}));var Fi,Ti={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return ei.STRICT;case"normal":default:return ei.NORMAL}}},Mi={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ii=function(e,t){return Zn(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Gn(e)?tr(e,t):t},Ni={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Kr.parse(e,t)}},Ui={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},Li={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},Qi=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Di=Qi("top"),Hi=Qi("right"),Oi=Qi("bottom"),zi=Qi("left"),Zi={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Zn).map((function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}}))}},Ri={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},Pi=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},qi=Pi("top"),Ki=Pi("right"),Wi=Pi("bottom"),ji=Pi("left"),Vi={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},Gi={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},$i={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Pn(t[0],"none")?[]:Wn(t).map((function(t){for(var n={color:yr.TRANSPARENT,offsetX:Yn,offsetY:Yn,blur:Yn},r=0,i=0;i1?1:0],this.overflowWrap=Io(e,Ri,t.overflowWrap),this.paddingTop=Io(e,qi,t.paddingTop),this.paddingRight=Io(e,Ki,t.paddingRight),this.paddingBottom=Io(e,Wi,t.paddingBottom),this.paddingLeft=Io(e,ji,t.paddingLeft),this.paintOrder=Io(e,_o,t.paintOrder),this.position=Io(e,Gi,t.position),this.textAlign=Io(e,Vi,t.textAlign),this.textDecorationColor=Io(e,Ao,null!==(n=t.textDecorationColor)&&void 0!==n?n:t.color),this.textDecorationLine=Io(e,uo,null!==(r=t.textDecorationLine)&&void 0!==r?r:t.textDecoration),this.textShadow=Io(e,$i,t.textShadow),this.textTransform=Io(e,Yi,t.textTransform),this.transform=Io(e,Xi,t.transform),this.transformOrigin=Io(e,io,t.transformOrigin),this.visibility=Io(e,oo,t.visibility),this.webkitTextStrokeColor=Io(e,Eo,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Io(e,So,t.webkitTextStrokeWidth),this.wordBreak=Io(e,ao,t.wordBreak),this.zIndex=Io(e,so,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return ur(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return vo(this.display,4)||vo(this.display,33554432)||vo(this.display,268435456)||vo(this.display,536870912)||vo(this.display,67108864)||vo(this.display,134217728)},e}(),To=function(){function e(e,t){this.content=Io(e,bo,t.content),this.quotes=Io(e,ko,t.quotes)}return e}(),Mo=function(){function e(e,t){this.counterIncrement=Io(e,yo,t.counterIncrement),this.counterReset=Io(e,wo,t.counterReset)}return e}(),Io=function(e,t,n){var r=new Dn,i=null!==n&&"undefined"!==typeof n?n.toString():t.initialValue;r.write(i);var o=new Hn(r.read());switch(t.type){case 2:var a=o.parseComponentValue();return t.parse(e,Zn(a)?a.value:t.initialValue);case 0:return t.parse(e,o.parseComponentValue());case 1:return t.parse(e,o.parseComponentValues());case 4:return o.parseComponentValue();case 3:switch(t.format){case"angle":return ar.parse(e,o.parseComponentValue());case"color":return Ar.parse(e,o.parseComponentValue());case"image":return Kr.parse(e,o.parseComponentValue());case"length":var s=o.parseComponentValue();return Vn(s)?s:Yn;case"length-percentage":var l=o.parseComponentValue();return Gn(l)?l:Yn;case"time":return lo.parse(e,o.parseComponentValue())}break}},No="data-html2canvas-debug",Uo=function(e){var t=e.getAttribute(No);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Lo=function(e,t){var n=Uo(e);return 1===n||t===n},Qo=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Lo(t,3),this.styles=new Fo(e,window.getComputedStyle(t,null)),Ts(t)&&(this.styles.animationDuration.some((function(e){return e>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=s(this.context,t),Lo(t,4)&&(this.flags|=16)}return e}(),Do="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Ho="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oo="undefined"===typeof Uint8Array?[]:new Uint8Array(256),zo=0;zo>4,A[l++]=(15&r)<<4|i>>2,A[l++]=(3&i)<<6|63&o;return c},Ro=function(e){for(var t=e.length,n=[],r=0;r>qo,Go=1<>qo,Xo=Vo+Yo,Jo=Xo,ea=32,ta=Jo+ea,na=65536>>Ko,ra=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>qo],t=(t<>qo)],t=(t<>Ko),t=this.index[t],t+=e>>qo&ia,t=this.index[t],t=(t<=55296&&i<=56319&&n>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},Fa=sa(Do),Ta="×",Ma="÷",Ia=function(e){return Fa.get(e)},Na=function(e,t,n){var r=n-2,i=t[r],o=t[n-1],a=t[n];if(o===pa&&a===fa)return Ta;if(o===pa||o===fa||o===ga)return Ma;if(a===pa||a===fa||a===ga)return Ma;if(o===ba&&-1!==[ba,ya,xa,ka].indexOf(a))return Ta;if((o===xa||o===ya)&&(a===ya||a===wa))return Ta;if((o===ka||o===wa)&&a===wa)return Ta;if(a===Ca||a===ma)return Ta;if(a===va)return Ta;if(o===ha)return Ta;if(o===Ca&&a===Ba){while(i===ma)i=t[--r];if(i===Ba)return Ta}if(o===_a&&a===_a){var s=0;while(i===_a)s++,i=t[--r];if(s%2===0)return Ta}return Ma},Ua=function(e){var t=Ea(e),n=t.length,r=0,i=0,o=t.map(Ia);return{next:function(){if(r>=n)return{done:!0,value:null};var e=Ta;while(ra.x||i.y>a.y;return a=i,0===t||s}));return e.body.removeChild(t),s},Ha=function(){return"undefined"!==typeof(new Image).crossOrigin},Oa=function(){return"string"===typeof(new XMLHttpRequest).responseType},za=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),n.toDataURL()}catch(Kt){return!1}return!0},Za=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Ra=function(e){var t=e.createElement("canvas"),n=100;t.width=n,t.height=n;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,o=t.toDataURL();i.src=o;var a=Pa(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),qa(a).then((function(t){r.drawImage(t,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var a=e.createElement("div");return a.style.backgroundImage="url("+o+")",a.style.height=n+"px",Za(i)?qa(Pa(n,n,0,0,a)):Promise.reject(!1)})).then((function(e){return r.drawImage(e,0,0),Za(r.getImageData(0,0,n,n).data)})).catch((function(){return!1}))},Pa=function(e,t,n,r,i){var o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),s=document.createElementNS(o,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.setAttributeNS(null,"x",n.toString()),s.setAttributeNS(null,"y",r.toString()),s.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(s),s.appendChild(i),a},qa=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Ka={get SUPPORT_RANGE_BOUNDS(){var e=Qa(document);return Object.defineProperty(Ka,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Ka.SUPPORT_RANGE_BOUNDS&&Da(document);return Object.defineProperty(Ka,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=za(document);return Object.defineProperty(Ka,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"===typeof Array.from&&"function"===typeof window.fetch?Ra(document):Promise.resolve(!1);return Object.defineProperty(Ka,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=Ha();return Object.defineProperty(Ka,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=Oa();return Object.defineProperty(Ka,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ka,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"===typeof Intl||!Intl.Segmenter);return Object.defineProperty(Ka,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Wa=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),ja=function(e,t,n,r){var i=Xa(t,n),o=[],s=0;return i.forEach((function(t){if(n.textDecorationLine.length||t.trim().length>0)if(Ka.SUPPORT_RANGE_BOUNDS){var i=Ga(r,s,t.length).getClientRects();if(i.length>1){var l=$a(t),c=0;l.forEach((function(t){o.push(new Wa(t,a.fromDOMRectList(e,Ga(r,c+s,t.length).getClientRects()))),c+=t.length}))}else o.push(new Wa(t,a.fromDOMRectList(e,i)))}else{var A=r.splitText(t.length);o.push(new Wa(t,Va(e,r))),r=A}else Ka.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));s+=t.length})),o},Va=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var o=s(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),o}}return a.EMPTY},Ga=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},$a=function(e){if(Ka.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map((function(e){return e.segment}))}return La(e)},Ya=function(e,t){if(Ka.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(e)).map((function(e){return e.segment}))}return es(e,t)},Xa=function(e,t){return 0!==t.letterSpacing?$a(e):Ya(e,t)},Ja=[32,160,4961,65792,65793,4153,4241],es=function(e,t){var n,r=$e(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),i=[],o=function(){if(n.value){var e=n.value.slice(),t=c(e),r="";t.forEach((function(e){-1===Ja.indexOf(e)?r+=A(e):(r.length&&i.push(r),i.push(A(e)),r="")})),r.length&&i.push(r)}};while(!(n=r.next()).done)o();return i},ts=function(){function e(e,t,n){this.text=ns(t.data,n.textTransform),this.textBounds=ja(e,this.text,n,t)}return e}(),ns=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(rs,is);case 2:return e.toUpperCase();default:return e}},rs=/(^|\s|:|-|\(|\))([a-z])/g,is=function(e,t,n){return e.length>0?t+n.toUpperCase():e},os=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return t(n,e),n}(Qo),as=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return t(n,e),n}(Qo),ss=function(e){function n(t,n){var r=e.call(this,t,n)||this,i=new XMLSerializer,o=s(t,n);return n.setAttribute("width",o.width+"px"),n.setAttribute("height",o.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t(n,e),n}(Qo),ls=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.value=n.value,r}return t(n,e),n}(Qo),cs=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.start=n.start,r.reversed="boolean"===typeof n.reversed&&!0===n.reversed,r}return t(n,e),n}(Qo),As=[{type:15,flags:0,unit:"px",number:3}],us=[{type:16,flags:0,number:50}],ds=function(e){return e.width>e.height?new a(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width0)n.textNodes.push(new ts(e,i,n.styles));else if(Fs(i))if(Ws(i)&&i.assignedNodes)i.assignedNodes().forEach((function(t){return ks(e,t,n,r)}));else{var a=Cs(e,i);a.styles.isVisible()&&(_s(i,a,r)?a.flags|=4:Es(a.styles)&&(a.flags|=2),-1!==xs.indexOf(i.tagName)&&(a.flags|=8),n.elements.push(a),i.slot,i.shadowRoot?ks(e,i.shadowRoot,a,r):qs(i)||Qs(i)||Ks(i)||ks(e,i,a,r))}},Cs=function(e,t){return zs(t)?new os(e,t):Hs(t)?new as(e,t):Qs(t)?new ss(e,t):Is(t)?new ls(e,t):Ns(t)?new cs(e,t):Us(t)?new vs(e,t):Ks(t)?new bs(e,t):qs(t)?new ys(e,t):Zs(t)?new ws(e,t):new Qo(e,t)},Bs=function(e,t){var n=Cs(e,t);return n.flags|=4,ks(e,t,n,n),n},_s=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||Ds(e)&&n.styles.isTransparent()},Es=function(e){return e.isPositioned()||e.isFloating()},Ss=function(e){return e.nodeType===Node.TEXT_NODE},Fs=function(e){return e.nodeType===Node.ELEMENT_NODE},Ts=function(e){return Fs(e)&&"undefined"!==typeof e.style&&!Ms(e)},Ms=function(e){return"object"===typeof e.className},Is=function(e){return"LI"===e.tagName},Ns=function(e){return"OL"===e.tagName},Us=function(e){return"INPUT"===e.tagName},Ls=function(e){return"HTML"===e.tagName},Qs=function(e){return"svg"===e.tagName},Ds=function(e){return"BODY"===e.tagName},Hs=function(e){return"CANVAS"===e.tagName},Os=function(e){return"VIDEO"===e.tagName},zs=function(e){return"IMG"===e.tagName},Zs=function(e){return"IFRAME"===e.tagName},Rs=function(e){return"STYLE"===e.tagName},Ps=function(e){return"SCRIPT"===e.tagName},qs=function(e){return"TEXTAREA"===e.tagName},Ks=function(e){return"SELECT"===e.tagName},Ws=function(e){return"SLOT"===e.tagName},js=function(e){return e.tagName.indexOf("-")>0},Vs=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;null!==n&&n.forEach((function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=e.increment)}));var o=[];return i&&r.forEach((function(e){var n=t.counters[e.counter];o.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)})),o},e}(),Gs={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},$s={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Ys={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Xs={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Js=function(e,t,n,r,i,o){return en?dl(e,i,o.length>0):r.integers.reduce((function(t,n,i){while(e>=n)e-=n,t+=r.values[i];return t}),"")+o},el=function(e,t,n,r){var i="";do{n||e--,i=r(e)+i,e/=t}while(e*t>=t);return i},tl=function(e,t,n,r,i){var o=n-t+1;return(e<0?"-":"")+(el(Math.abs(e),o,r,(function(e){return A(Math.floor(e%o)+t)}))+i)},nl=function(e,t,n){void 0===n&&(n=". ");var r=t.length;return el(Math.abs(e),r,!1,(function(e){return t[Math.floor(e%r)]}))+n},rl=1,il=2,ol=4,al=8,sl=function(e,t,n,r,i,o){if(e<-9999||e>9999)return dl(e,4,i.length>0);var a=Math.abs(e),s=i;if(0===a)return t[0]+s;for(var l=0;a>0&&l<=4;l++){var c=a%10;0===c&&vo(o,rl)&&""!==s?s=t[c]+s:c>1||1===c&&0===l||1===c&&1===l&&vo(o,il)||1===c&&1===l&&vo(o,ol)&&e>100||1===c&&l>1&&vo(o,al)?s=t[c]+(l>0?n[l-1]:"")+s:1===c&&l>0&&(s=n[l-1]+s),a=Math.floor(a/10)}return(e<0?r:"")+s},ll="十百千萬",cl="拾佰仟萬",Al="マイナス",ul="마이너스",dl=function(e,t,n){var r=n?". ":"",i=n?"、":"",o=n?", ":"",a=n?" ":"";switch(t){case 0:return"•"+a;case 1:return"◦"+a;case 2:return"◾"+a;case 5:var s=tl(e,48,57,!0,r);return s.length<4?"0"+s:s;case 4:return nl(e,"〇一二三四五六七八九",i);case 6:return Js(e,1,3999,Gs,3,r).toLowerCase();case 7:return Js(e,1,3999,Gs,3,r);case 8:return tl(e,945,969,!1,r);case 9:return tl(e,97,122,!1,r);case 10:return tl(e,65,90,!1,r);case 11:return tl(e,1632,1641,!0,r);case 12:case 49:return Js(e,1,9999,$s,3,r);case 35:return Js(e,1,9999,$s,3,r).toLowerCase();case 13:return tl(e,2534,2543,!0,r);case 14:case 30:return tl(e,6112,6121,!0,r);case 15:return nl(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return nl(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return sl(e,"零一二三四五六七八九",ll,"負",i,il|ol|al);case 47:return sl(e,"零壹貳參肆伍陸柒捌玖",cl,"負",i,rl|il|ol|al);case 42:return sl(e,"零一二三四五六七八九",ll,"负",i,il|ol|al);case 41:return sl(e,"零壹贰叁肆伍陆柒捌玖",cl,"负",i,rl|il|ol|al);case 26:return sl(e,"〇一二三四五六七八九","十百千万",Al,i,0);case 25:return sl(e,"零壱弐参四伍六七八九","拾百千万",Al,i,rl|il|ol);case 31:return sl(e,"영일이삼사오육칠팔구","십백천만",ul,o,rl|il|ol);case 33:return sl(e,"零一二三四五六七八九","十百千萬",ul,o,0);case 32:return sl(e,"零壹貳參四五六七八九","拾百千",ul,o,rl|il|ol);case 18:return tl(e,2406,2415,!0,r);case 20:return Js(e,1,19999,Xs,3,r);case 21:return tl(e,2790,2799,!0,r);case 22:return tl(e,2662,2671,!0,r);case 22:return Js(e,1,10999,Ys,3,r);case 23:return nl(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return nl(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return tl(e,3302,3311,!0,r);case 28:return nl(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return nl(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return tl(e,3792,3801,!0,r);case 37:return tl(e,6160,6169,!0,r);case 38:return tl(e,4160,4169,!0,r);case 39:return tl(e,2918,2927,!0,r);case 40:return tl(e,1776,1785,!0,r);case 43:return tl(e,3046,3055,!0,r);case 44:return tl(e,3174,3183,!0,r);case 45:return tl(e,3664,3673,!0,r);case 46:return tl(e,3872,3881,!0,r);case 3:default:return tl(e,48,57,!0,r)}},hl="data-html2canvas-ignore",pl=function(){function e(e,t,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=t,this.counters=new Vs,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var n=this,o=gl(e,t);if(!o.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,l=o.contentWindow,c=l.document,A=bl(o).then((function(){return r(n,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(Cl),l&&(l.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.scrollY===t.top&&l.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-t.left,l.scrollY-t.top,0,0))),e=this.options.onclone,n=this.clonedReferenceElement,"undefined"===typeof n?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,vl(c)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"===typeof e?[2,Promise.resolve().then((function(){return e(c,n)})).then((function(){return o}))]:[2,o]}}))}))}));return c.open(),c.write(xl(document.doctype)+""),kl(this.referenceElement.ownerDocument,a,s),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),A},e.prototype.createElementClone=function(e){if(Lo(e,2),Hs(e))return this.createCanvasClone(e);if(Os(e))return this.createVideoClone(e);if(Rs(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return zs(t)&&(zs(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),js(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return wl(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"===typeof t.cssText?e+t.cssText:e}),""),r=e.cloneNode(!1);return r.textContent=n,r}}catch(Kt){if(this.context.logger.error("Unable to access cssRules property",Kt),"SecurityError"!==Kt.name)throw Kt}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch(Kt){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext("2d"),o=r.getContext("2d");if(o)if(!this.options.allowTaint&&i)o.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var a=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(a){var s=a.getContextAttributes();!1===(null===s||void 0===s?void 0:s.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}o.drawImage(e,0,0)}return r}catch(Kt){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var n=t.getContext("2d");try{return n&&(n.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||n.getImageData(0,0,t.width,t.height)),t}catch(Kt){this.context.logger.info("Unable to clone video as it is tainted",e)}var r=e.ownerDocument.createElement("canvas");return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,n){Fs(t)&&(Ps(t)||t.hasAttribute(hl)||"function"===typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Fs(t)&&Rs(t)||e.appendChild(this.cloneNode(t,n))},e.prototype.cloneChildNodes=function(e,t,n){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(Fs(i)&&Ws(i)&&"function"===typeof i.assignedNodes){var o=i.assignedNodes();o.length&&o.forEach((function(e){return r.appendChildNode(t,e,n)}))}else this.appendChildNode(t,i,n)},e.prototype.cloneNode=function(e,t){if(Ss(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&Fs(e)&&(Ts(e)||Ms(e))){var r=this.createElementClone(e);r.style.transitionProperty="none";var i=n.getComputedStyle(e),o=n.getComputedStyle(e,":before"),a=n.getComputedStyle(e,":after");this.referenceElement===e&&Ts(r)&&(this.clonedReferenceElement=r),Ds(r)&&Tl(r);var s=this.counters.parse(new Mo(this.context,i)),l=this.resolvePseudoContent(e,r,o,da.BEFORE);js(e)&&(t=!0),Os(e)||this.cloneChildNodes(e,r,t),l&&r.insertBefore(l,r.firstChild);var c=this.resolvePseudoContent(e,r,a,da.AFTER);return c&&r.appendChild(c),this.counters.pop(s),(i&&(this.options.copyStyles||Ms(e))&&!Zs(e)||t)&&wl(i,r),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(qs(e)||Ks(e))&&(qs(r)||Ks(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var o=n.content,a=t.ownerDocument;if(a&&o&&"none"!==o&&"-moz-alt-content"!==o&&"none"!==n.display){this.counters.parse(new Mo(this.context,n));var s=new To(this.context,n),l=a.createElement("html2canvaspseudoelement");wl(n,l),s.content.forEach((function(t){if(0===t.type)l.appendChild(a.createTextNode(t.value));else if(22===t.type){var n=a.createElement("img");n.src=t.value,n.style.opacity="1",l.appendChild(n)}else if(18===t.type){if("attr"===t.name){var r=t.values.filter(Zn);r.length&&l.appendChild(a.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var o=t.values.filter(Kn),c=o[0],A=o[1];if(c&&Zn(c)){var u=i.counters.getCounterValue(c.value),d=A&&Zn(A)?Li.parse(i.context,A.value):3;l.appendChild(a.createTextNode(dl(u,d,!1)))}}else if("counters"===t.name){var h=t.values.filter(Kn),p=(c=h[0],h[1]);A=h[2];if(c&&Zn(c)){var f=i.counters.getCounterValues(c.value),g=A&&Zn(A)?Li.parse(i.context,A.value):3,m=p&&0===p.type?p.value:"",v=f.map((function(e){return dl(e,g,!1)})).join(m);l.appendChild(a.createTextNode(v))}}}else if(20===t.type)switch(t.value){case"open-quote":l.appendChild(a.createTextNode(Co(s.quotes,i.quoteDepth++,!0)));break;case"close-quote":l.appendChild(a.createTextNode(Co(s.quotes,--i.quoteDepth,!1)));break;default:l.appendChild(a.createTextNode(t.value))}})),l.className=El+" "+Sl;var c=r===da.BEFORE?" "+El:" "+Sl;return Ms(t)?t.className.baseValue+=c:t.className+=c,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();(function(e){e[e["BEFORE"]=0]="BEFORE",e[e["AFTER"]=1]="AFTER"})(da||(da={}));var fl,gl=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(hl,"true"),e.body.appendChild(n),n},ml=function(e){return new Promise((function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()}))},vl=function(e){return Promise.all([].slice.call(e.images,0).map(ml))},bl=function(e){return new Promise((function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),t(e))}),50)}}))},yl=["all","d","content"],wl=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);-1===yl.indexOf(r)&&t.style.setProperty(r,e.getPropertyValue(r))}return t},xl=function(e){var t="";return e&&(t+=""),t},kl=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},Cl=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},Bl=":before",_l=":after",El="___html2canvas___pseudoelement_before",Sl="___html2canvas___pseudoelement_after",Fl='{\n content: "" !important;\n display: none !important;\n}',Tl=function(e){Ml(e,"."+El+Bl+Fl+"\n ."+Sl+_l+Fl)},Ml=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}},Il=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Nl=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:zl(e)||Dl(e)?((this._cache[e]=this.loadImage(e)).catch((function(){})),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a=this;return i(this,(function(i){switch(i.label){case 0:return t=Il.isSameOrigin(e),n=!Hl(e)&&!0===this._options.useCORS&&Ka.SUPPORT_CORS_IMAGES&&!t,r=!Hl(e)&&!t&&!zl(e)&&"string"===typeof this._options.proxy&&Ka.SUPPORT_CORS_XHR&&!n,t||!1!==this._options.allowTaint||Hl(e)||zl(e)||r||n?(o=e,r?[4,this.proxy(o)]:[3,2]):[2];case 1:o=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise((function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(Ol(o)||n)&&(r.crossOrigin="anonymous"),r.src=o,!0===r.complete&&setTimeout((function(){return e(r)}),500),a._options.imageTimeout>0&&setTimeout((function(){return t("Timed out ("+a._options.imageTimeout+"ms) loading image")}),a._options.imageTimeout)}))];case 3:return[2,i.sent()]}}))}))},e.prototype.has=function(e){return"undefined"!==typeof this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise((function(i,o){var a=Ka.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(200===s.status)if("text"===a)i(s.response);else{var e=new FileReader;e.addEventListener("load",(function(){return i(e.result)}),!1),e.addEventListener("error",(function(e){return o(e)}),!1),e.readAsDataURL(s.response)}else o("Failed to proxy resource "+r+" with status code "+s.status)},s.onerror=o;var l=n.indexOf("?")>-1?"&":"?";if(s.open("GET",""+n+l+"url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&s instanceof XMLHttpRequest&&(s.responseType=a),t._options.imageTimeout){var c=t._options.imageTimeout;s.timeout=c,s.ontimeout=function(){return o("Timed out ("+c+"ms) proxying "+r)}}s.send()}))},e}(),Ul=/^data:image\/svg\+xml/i,Ll=/^data:image\/.*;base64,/i,Ql=/^data:image\/.*/i,Dl=function(e){return Ka.SUPPORT_SVG_DRAWING||!Zl(e)},Hl=function(e){return Ql.test(e)},Ol=function(e){return Ll.test(e)},zl=function(e){return"blob"===e.substr(0,4)},Zl=function(e){return"svg"===e.substr(-3).toLowerCase()||Ul.test(e)},Rl=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Pl=function(e,t,n){return new Rl(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},ql=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=Pl(this.start,this.startControl,t),i=Pl(this.startControl,this.endControl,t),o=Pl(this.endControl,this.end,t),a=Pl(r,i,t),s=Pl(i,o,t),l=Pl(a,s,t);return n?new e(this.start,r,a,l):new e(l,s,o,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Kl=function(e){return 1===e.type},Wl=function(){function e(e){var t=e.styles,n=e.bounds,r=er(t.borderTopLeftRadius,n.width,n.height),i=r[0],o=r[1],a=er(t.borderTopRightRadius,n.width,n.height),s=a[0],l=a[1],c=er(t.borderBottomRightRadius,n.width,n.height),A=c[0],u=c[1],d=er(t.borderBottomLeftRadius,n.width,n.height),h=d[0],p=d[1],f=[];f.push((i+s)/n.width),f.push((h+A)/n.width),f.push((o+p)/n.height),f.push((l+u)/n.height);var g=Math.max.apply(Math,f);g>1&&(i/=g,o/=g,s/=g,l/=g,A/=g,u/=g,h/=g,p/=g);var m=n.width-s,v=n.height-u,b=n.width-A,y=n.height-p,w=t.borderTopWidth,x=t.borderRightWidth,k=t.borderBottomWidth,C=t.borderLeftWidth,B=tr(t.paddingTop,e.bounds.width),_=tr(t.paddingRight,e.bounds.width),E=tr(t.paddingBottom,e.bounds.width),S=tr(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||o>0?jl(n.left+C/3,n.top+w/3,i-C/3,o-w/3,fl.TOP_LEFT):new Rl(n.left+C/3,n.top+w/3),this.topRightBorderDoubleOuterBox=i>0||o>0?jl(n.left+m,n.top+w/3,s-x/3,l-w/3,fl.TOP_RIGHT):new Rl(n.left+n.width-x/3,n.top+w/3),this.bottomRightBorderDoubleOuterBox=A>0||u>0?jl(n.left+b,n.top+v,A-x/3,u-k/3,fl.BOTTOM_RIGHT):new Rl(n.left+n.width-x/3,n.top+n.height-k/3),this.bottomLeftBorderDoubleOuterBox=h>0||p>0?jl(n.left+C/3,n.top+y,h-C/3,p-k/3,fl.BOTTOM_LEFT):new Rl(n.left+C/3,n.top+n.height-k/3),this.topLeftBorderDoubleInnerBox=i>0||o>0?jl(n.left+2*C/3,n.top+2*w/3,i-2*C/3,o-2*w/3,fl.TOP_LEFT):new Rl(n.left+2*C/3,n.top+2*w/3),this.topRightBorderDoubleInnerBox=i>0||o>0?jl(n.left+m,n.top+2*w/3,s-2*x/3,l-2*w/3,fl.TOP_RIGHT):new Rl(n.left+n.width-2*x/3,n.top+2*w/3),this.bottomRightBorderDoubleInnerBox=A>0||u>0?jl(n.left+b,n.top+v,A-2*x/3,u-2*k/3,fl.BOTTOM_RIGHT):new Rl(n.left+n.width-2*x/3,n.top+n.height-2*k/3),this.bottomLeftBorderDoubleInnerBox=h>0||p>0?jl(n.left+2*C/3,n.top+y,h-2*C/3,p-2*k/3,fl.BOTTOM_LEFT):new Rl(n.left+2*C/3,n.top+n.height-2*k/3),this.topLeftBorderStroke=i>0||o>0?jl(n.left+C/2,n.top+w/2,i-C/2,o-w/2,fl.TOP_LEFT):new Rl(n.left+C/2,n.top+w/2),this.topRightBorderStroke=i>0||o>0?jl(n.left+m,n.top+w/2,s-x/2,l-w/2,fl.TOP_RIGHT):new Rl(n.left+n.width-x/2,n.top+w/2),this.bottomRightBorderStroke=A>0||u>0?jl(n.left+b,n.top+v,A-x/2,u-k/2,fl.BOTTOM_RIGHT):new Rl(n.left+n.width-x/2,n.top+n.height-k/2),this.bottomLeftBorderStroke=h>0||p>0?jl(n.left+C/2,n.top+y,h-C/2,p-k/2,fl.BOTTOM_LEFT):new Rl(n.left+C/2,n.top+n.height-k/2),this.topLeftBorderBox=i>0||o>0?jl(n.left,n.top,i,o,fl.TOP_LEFT):new Rl(n.left,n.top),this.topRightBorderBox=s>0||l>0?jl(n.left+m,n.top,s,l,fl.TOP_RIGHT):new Rl(n.left+n.width,n.top),this.bottomRightBorderBox=A>0||u>0?jl(n.left+b,n.top+v,A,u,fl.BOTTOM_RIGHT):new Rl(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=h>0||p>0?jl(n.left,n.top+y,h,p,fl.BOTTOM_LEFT):new Rl(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||o>0?jl(n.left+C,n.top+w,Math.max(0,i-C),Math.max(0,o-w),fl.TOP_LEFT):new Rl(n.left+C,n.top+w),this.topRightPaddingBox=s>0||l>0?jl(n.left+Math.min(m,n.width-x),n.top+w,m>n.width+x?0:Math.max(0,s-x),Math.max(0,l-w),fl.TOP_RIGHT):new Rl(n.left+n.width-x,n.top+w),this.bottomRightPaddingBox=A>0||u>0?jl(n.left+Math.min(b,n.width-C),n.top+Math.min(v,n.height-k),Math.max(0,A-x),Math.max(0,u-k),fl.BOTTOM_RIGHT):new Rl(n.left+n.width-x,n.top+n.height-k),this.bottomLeftPaddingBox=h>0||p>0?jl(n.left+C,n.top+Math.min(y,n.height-k),Math.max(0,h-C),Math.max(0,p-k),fl.BOTTOM_LEFT):new Rl(n.left+C,n.top+n.height-k),this.topLeftContentBox=i>0||o>0?jl(n.left+C+S,n.top+w+B,Math.max(0,i-(C+S)),Math.max(0,o-(w+B)),fl.TOP_LEFT):new Rl(n.left+C+S,n.top+w+B),this.topRightContentBox=s>0||l>0?jl(n.left+Math.min(m,n.width+C+S),n.top+w+B,m>n.width+C+S?0:s-C+S,l-(w+B),fl.TOP_RIGHT):new Rl(n.left+n.width-(x+_),n.top+w+B),this.bottomRightContentBox=A>0||u>0?jl(n.left+Math.min(b,n.width-(C+S)),n.top+Math.min(v,n.height+w+B),Math.max(0,A-(x+_)),u-(k+E),fl.BOTTOM_RIGHT):new Rl(n.left+n.width-(x+_),n.top+n.height-(k+E)),this.bottomLeftContentBox=h>0||p>0?jl(n.left+C+S,n.top+y,Math.max(0,h-(C+S)),p-(k+E),fl.BOTTOM_LEFT):new Rl(n.left+C+S,n.top+n.height-(k+E))}return e}();(function(e){e[e["TOP_LEFT"]=0]="TOP_LEFT",e[e["TOP_RIGHT"]=1]="TOP_RIGHT",e[e["BOTTOM_RIGHT"]=2]="BOTTOM_RIGHT",e[e["BOTTOM_LEFT"]=3]="BOTTOM_LEFT"})(fl||(fl={}));var jl=function(e,t,n,r,i){var o=(Math.sqrt(2)-1)/3*4,a=n*o,s=r*o,l=e+n,c=t+r;switch(i){case fl.TOP_LEFT:return new ql(new Rl(e,c),new Rl(e,c-s),new Rl(l-a,t),new Rl(l,t));case fl.TOP_RIGHT:return new ql(new Rl(e,t),new Rl(e+a,t),new Rl(l,c-s),new Rl(l,c));case fl.BOTTOM_RIGHT:return new ql(new Rl(l,t),new Rl(l,t+s),new Rl(e+a,c),new Rl(e,c));case fl.BOTTOM_LEFT:default:return new ql(new Rl(l,c),new Rl(l-a,c),new Rl(e,t+s),new Rl(e,t))}},Vl=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Gl=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},$l=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Yl=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),Xl=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Jl=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),ec=function(e){return 0===e.type},tc=function(e){return 1===e.type},nc=function(e){return 2===e.type},rc=function(e,t){return e.length===t.length&&e.some((function(e,n){return e===t[n]}))},ic=function(e,t,n,r,i){return e.map((function(e,o){switch(o){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e}))},oc=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),ac=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Wl(this.container),this.container.styles.opacity<1&&this.effects.push(new Jl(this.container.styles.opacity)),null!==this.container.styles.transform){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Yl(n,r,i))}if(0!==this.container.styles.overflowX){var o=Vl(this.curves),a=$l(this.curves);rc(o,a)?this.effects.push(new Xl(o,6)):(this.effects.push(new Xl(o,2)),this.effects.push(new Xl(a,4)))}}return e.prototype.getEffects=function(e){var t=-1===[2,3].indexOf(this.container.styles.position),n=this.parent,r=this.effects.slice(0);while(n){var i=n.effects.filter((function(e){return!tc(e)}));if(t||0!==n.container.styles.position||!n.parent){if(r.unshift.apply(r,i),t=-1===[2,3].indexOf(n.container.styles.position),0!==n.container.styles.overflowX){var o=Vl(n.curves),a=$l(n.curves);rc(o,a)||r.unshift(new Xl(a,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter((function(t){return vo(t.target,e)}))},e}(),sc=function(e,t,n,r){e.container.elements.forEach((function(i){var o=vo(i.flags,4),a=vo(i.flags,2),s=new ac(i,e);vo(i.styles.display,2048)&&r.push(s);var l=vo(i.flags,8)?[]:r;if(o||a){var c=o||i.styles.isPositioned()?n:t,A=new oc(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some((function(e,t){return u>e.element.container.styles.zIndex.order?(d=t,!1):d>0})),c.negativeZIndex.splice(d,0,A)}else if(u>0){var h=0;c.positiveZIndex.some((function(e,t){return u>=e.element.container.styles.zIndex.order?(h=t+1,!1):h>0})),c.positiveZIndex.splice(h,0,A)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(A)}else i.styles.isFloating()?c.nonPositionedFloats.push(A):c.nonPositionedInlineLevel.push(A);sc(s,A,o?A:n,l)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),sc(s,t,n,l);vo(i.flags,8)&&lc(i,l)}))},lc=function(e,t){for(var n=e instanceof cs?e.start:1,r=e instanceof cs&&e.reversed,i=0;i0&&e.intrinsicHeight>0){var r=mc(e),i=$l(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return r(this,void 0,void 0,(function(){var t,r,o,s,l,c,A,u,d,h,p,f,g,m,v,b,y,w,x;return i(this,(function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,r=e.curves,o=t.styles,s=0,l=t.textNodes,i.label=1;case 1:return s0&&C>0&&(v=r.ctx.createPattern(f,"repeat"),r.renderRepeat(y,v,_,E))):qr(n)&&(b=yc(e,t,[null,null,null]),y=b[0],w=b[1],x=b[2],k=b[3],C=b[4],B=0===n.position.length?[Xn]:n.position,_=tr(B[0],k),E=tr(B[B.length-1],C),S=Fr(n,_,E,k,C),F=S[0],T=S[1],F>0&&T>0&&(M=r.ctx.createRadialGradient(w+_,x+E,0,w+_,x+E,F),Cr(n.stops,2*F).forEach((function(e){return M.addColorStop(e.stop,dr(e.color))})),r.path(y),r.ctx.fillStyle=M,F!==T?(I=e.bounds.left+.5*e.bounds.width,N=e.bounds.top+.5*e.bounds.height,U=T/F,L=1/U,r.ctx.save(),r.ctx.translate(I,N),r.ctx.transform(1,0,0,U,0,0),r.ctx.translate(-I,-N),r.ctx.fillRect(w,L*(x-N)+N,k,C*L),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return t--,[2]}}))},r=this,o=0,a=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return o0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,2)]:[3,11]):[3,13];case 4:return i.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,3)];case 6:return i.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,a,e.curves)];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,a,e.curves)];case 10:i.sent(),i.label=11;case 11:a++,i.label=12;case 12:return s++,[3,3];case 13:return[2]}}))}))},n.prototype.renderDashedDottedBorder=function(e,t,n,o,a){return r(this,void 0,void 0,(function(){var r,s,l,c,A,u,d,h,p,f,g,m,v,b,y,w;return i(this,(function(i){return this.ctx.save(),r=hc(o,n),s=Ac(o,n),2===a&&(this.path(s),this.ctx.clip()),Kl(s[0])?(l=s[0].start.x,c=s[0].start.y):(l=s[0].x,c=s[0].y),Kl(s[1])?(A=s[1].end.x,u=s[1].end.y):(A=s[1].x,u=s[1].y),d=0===n||2===n?Math.abs(l-A):Math.abs(c-u),this.ctx.beginPath(),3===a?this.formatPath(r):this.formatPath(s.slice(0,2)),h=t<3?3*t:2*t,p=t<3?2*t:t,3===a&&(h=t,p=t),f=!0,d<=2*h?f=!1:d<=2*h+p?(g=d/(2*h+p),h*=g,p*=g):(m=Math.floor((d+p)/(h+p)),v=(d-m*h)/(m-1),b=(d-(m+1)*h)/m,p=b<=0||Math.abs(p-v)1;v&&(m=m.slice(0,-1));var b=h(m),y=r[b];if(m.length>1&&!y&&!i[m]&&!o[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==l&&y||(n?a.key=b:a.which=d(m)),y&&(a[y]=!v||null)}}catch(w){u=!0,p=w}finally{try{!A&&g.return&&g.return()}finally{if(u)throw p}}return a}function u(e,t){for(var n in e){var r=e[n],i=void 0;if(null!=r&&(i="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n],(null!=i||!1!==r)&&i!==r))return!1}return!0}function d(e){e=h(e);var t=o[e]||e.toUpperCase().charCodeAt(0);return t}function h(e){return e=e.toLowerCase(),e=i[e]||e,e}t.ZP=s,t.P6=s},29662:function(e,t,n){n(57658),function(t){var n,r={},i={16:!1,18:!1,17:!1,91:!1},o="all",a={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},s={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},l=function(e){return s[e]||e.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)s["f"+n]=111+n;function A(e,t){var n=e.length;while(n--)if(e[n]===t)return n;return-1}function u(e,t){if(e.length!=t.length)return!1;for(var n=0;n0,i)(!i[o]&&A(n.mods,+o)>-1||i[o]&&-1==A(n.mods,+o))&&(l=!1);(0!=n.mods.length||i[16]||i[18]||i[17]||i[91])&&!l||!1===n.method(e,n)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function f(e){var t,n=e.keyCode,r=A(c,n);if(r>=0&&c.splice(r,1),93!=n&&224!=n||(n=91),n in i)for(t in i[n]=!1,a)a[t]==n&&(m[t]=!1)}function g(){for(n in i)i[n]=!1;for(n in a)m[n]=!1}function m(e,t,n){var i,o;i=B(e),void 0===n&&(n=t,t="all");for(var a=0;a1&&(o=_(e),e=[e[e.length-1]]),e=e[0],e=l(e),e in r||(r[e]=[]),r[e].push({shortcut:i[a],scope:t,method:n,key:i[a],mods:o})}function v(e,t){var n,i,o,a,s,c=[];for(n=B(e),a=0;a1&&(c=_(i),e=i[i.length-1]),e=l(e),void 0===t&&(t=k()),!r[e])return;for(o=0;o=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},h="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",p="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function f(e){e.__index__=-1,e.__text_cache__=""}function g(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function m(){return function(e,t){t.normalize(e)}}function v(e){var t=e.re=n(78215)(e.__opts__),r=e.__tlds__.slice();function i(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push(h),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");var A=[];function u(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,a(n))return s(n.validate)?r.validate=g(n.validate):l(n.validate)?r.validate=n.validate:u(t,n),void(l(n.normalize)?r.normalize=n.normalize:n.normalize?u(t,n):r.normalize=m());o(n)?A.push(t):u(t,n)}})),A.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:m()};var d=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(c).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+d+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+d+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),f(e)}function b(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function y(e,t){var n=new b(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function w(e,t){if(!(this instanceof w))return new w(e,t);t||u(e)&&(t=e,e={}),this.__opts__=r({},A,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},d,e),this.__compiled__={},this.__tlds__=p,this.__tlds_replaced__=!1,this.re={},v(this)}w.prototype.add=function(e,t){return this.__schemas__[e]=t,v(this),this},w.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},w.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,s,l,c;if(this.re.schema_test.test(e)){s=this.re.schema_search,s.lastIndex=0;while(null!==(t=s.exec(e)))if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0},w.prototype.pretest=function(e){return this.re.pretest.test(e)},w.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},w.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(y(this,t)),t=this.__last_index__);var r=t?e.slice(t):e;while(this.test(r))n.push(y(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},w.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;var t=this.re.schema_at_start.exec(e);if(!t)return null;var n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,y(this,0)):null},w.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),v(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,v(this),this)},w.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},w.prototype.onCompile=function(){},e.exports=w},78215:function(e,t,n){"use strict";e.exports=function(e){var t={};e=e||{},t.src_Any=n(25580).source,t.src_Cc=n(22321).source,t.src_Z=n(56259).source,t.src_P=n(33031).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var r="[><|]";return t.src_pseudo_letter="(?:(?!"+r+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+r+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+r+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},72573:function(e,t,n){var r=n(16213),i=n(69159),o=r(i,"DataView");e.exports=o},45623:function(e,t,n){var r=n(53301),i=n(3992),o=n(92762),a=n(3584),s=n(15745);function l(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=t?e:t)),e}e.exports=t},39746:function(e,t,n){var r=n(4614),i=n(32383),o=n(61767),a=n(5640),s=n(60494),l=n(9097),c=n(61548),A=n(33446),u=n(69376),d=n(64823),h=n(50592),p=n(30453),f=n(3035),g=n(60243),m=n(68895),v=n(26602),b=n(21976),y=n(35458),w=n(70150),x=n(2792),k=n(24337),C=n(74494),B=1,_=2,E=4,S="[object Arguments]",F="[object Array]",T="[object Boolean]",M="[object Date]",I="[object Error]",N="[object Function]",U="[object GeneratorFunction]",L="[object Map]",Q="[object Number]",D="[object Object]",H="[object RegExp]",O="[object Set]",z="[object String]",Z="[object Symbol]",R="[object WeakMap]",P="[object ArrayBuffer]",q="[object DataView]",K="[object Float32Array]",W="[object Float64Array]",j="[object Int8Array]",V="[object Int16Array]",G="[object Int32Array]",$="[object Uint8Array]",Y="[object Uint8ClampedArray]",X="[object Uint16Array]",J="[object Uint32Array]",ee={};function te(e,t,n,F,T,M){var I,L=t&B,Q=t&_,H=t&E;if(n&&(I=T?n(e,F,T,M):n(e)),void 0!==I)return I;if(!w(e))return e;var O=v(e);if(O){if(I=f(e),!L)return c(e,I)}else{var z=p(e),Z=z==N||z==U;if(b(e))return l(e,L);if(z==D||z==S||Z&&!T){if(I=Q||Z?{}:m(e),!L)return Q?u(e,s(I,e)):A(e,a(I,e))}else{if(!ee[z])return T?e:{};I=g(e,z,L)}}M||(M=new r);var R=M.get(e);if(R)return R;M.set(e,I),x(e)?e.forEach((function(r){I.add(te(r,t,n,r,e,M))})):y(e)&&e.forEach((function(r,i){I.set(i,te(r,t,n,i,e,M))}));var P=H?Q?h:d:Q?C:k,q=O?void 0:P(e);return i(q||e,(function(r,i){q&&(i=r,r=e[i]),o(I,i,te(r,t,n,i,e,M))})),I}ee[S]=ee[F]=ee[P]=ee[q]=ee[T]=ee[M]=ee[K]=ee[W]=ee[j]=ee[V]=ee[G]=ee[L]=ee[Q]=ee[D]=ee[H]=ee[O]=ee[z]=ee[Z]=ee[$]=ee[Y]=ee[X]=ee[J]=!0,ee[I]=ee[N]=ee[R]=!1,e.exports=te},21262:function(e,t,n){var r=n(70150),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},22659:function(e){function t(e,t,n,r){var i=e.length,o=n+(r?1:-1);while(r?o--:++o0&&n(A)?t>1?o(A,t-1,n,a,s):r(s,A):a||(s[s.length]=A)}return s}e.exports=o},94427:function(e,t,n){var r=n(1686),i=r();e.exports=i},77727:function(e,t,n){var r=n(5299),i=n(88952);function o(e,t){t=r(t,e);var n=0,o=t.length;while(null!=e&&ni?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;var o=Array(i);while(++r1?n[o-1]:void 0,s=o>2?n[2]:void 0;a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);while(++rd))return!1;var p=A.get(e),f=A.get(t);if(p&&f)return p==t&&f==e;var g=-1,m=!0,v=n&s?new r:void 0;A.set(e,t),A.set(t,e);while(++g-1&&e%1==0&&e-1}e.exports=i},12405:function(e,t,n){n(57658);var r=n(46637);function i(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}e.exports=i},41052:function(e,t,n){var r=n(45623),i=n(25094),o=n(19014);function a(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}e.exports=a},99240:function(e,t,n){var r=n(93582);function i(e){var t=r(this,e)["delete"](e);return this.size-=t?1:0,t}e.exports=i},68843:function(e,t,n){var r=n(93582);function i(e){return r(this,e).get(e)}e.exports=i},80027:function(e,t,n){var r=n(93582);function i(e){return r(this,e).has(e)}e.exports=i},19154:function(e,t,n){var r=n(93582);function i(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}e.exports=i},27317:function(e){function t(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}e.exports=t},78497:function(e){function t(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}e.exports=t},94541:function(e,t,n){var r=n(36564),i=500;function o(e){var t=r(e,(function(e){return n.size===i&&n.clear(),e})),n=t.cache;return t}e.exports=o},90988:function(e,t,n){var r=n(16213),i=r(Object,"create");e.exports=i},47348:function(e,t,n){var r=n(31867),i=r(Object.keys,Object);e.exports=i},15083:function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}n(57658),e.exports=r},71330:function(e,t,n){e=n.nmd(e);var r=n(791),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a&&r.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(t){}}();e.exports=l},52886:function(e){var t=Object.prototype,n=t.toString;function r(e){return n.call(e)}e.exports=r},31867:function(e){function t(e,t){return function(n){return e(t(n))}}e.exports=t},2187:function(e,t,n){var r=n(29707),i=Math.max;function o(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);while(++a0){if(++i>=t)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}e.exports=i},846:function(e,t,n){var r=n(25094);function i(){this.__data__=new r,this.size=0}e.exports=i},91353:function(e){function t(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}e.exports=t},42334:function(e){function t(e){return this.__data__.get(e)}e.exports=t},70252:function(e){function t(e){return this.__data__.has(e)}e.exports=t},81538:function(e,t,n){n(57658);var r=n(25094),i=n(19014),o=n(58082),a=200;function s(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length=t||n<0||m&&r>=u}function k(){var e=i();if(x(e))return C(e);h=setTimeout(k,w(e))}function C(e){return h=void 0,v&&c?b(e):(c=A=void 0,d)}function B(){void 0!==h&&clearTimeout(h),f=0,c=p=A=h=void 0}function _(){return void 0===h?d:C(i())}function E(){var e=i(),n=x(e);if(c=arguments,A=this,p=e,n){if(void 0===h)return y(p);if(m)return clearTimeout(h),h=setTimeout(k,t),b(p)}return void 0===h&&(h=setTimeout(k,t)),d}return t=o(t)||0,r(n)&&(g=!!n.leading,m="maxWait"in n,u=m?s(o(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),E.cancel=B,E.flush=_,E}e.exports=c},64240:function(e){function t(e,t){return e===t||e!==e&&t!==t}e.exports=t},62568:function(e,t,n){var r=n(22659),i=n(23615),o=n(85949),a=Math.max,s=Math.min;function l(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var c=l-1;return void 0!==n&&(c=o(n),c=n<0?a(l+c,0):s(c,l-1)),r(e,i(t,3),c,!0)}e.exports=l},92453:function(e,t,n){var r=n(24251);function i(e){var t=null==e?0:e.length;return t?r(e,1):[]}e.exports=i},15309:function(e,t,n){var r=n(77727);function i(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}e.exports=i},28208:function(e,t,n){var r=n(95281),i=n(32240);function o(e,t){return null!=e&&i(e,t,r)}e.exports=o},59761:function(e){function t(e){return e}e.exports=t},68804:function(e,t,n){var r=n(29986),i=n(74430),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},26602:function(e){var t=Array.isArray;e.exports=t},45372:function(e,t,n){var r=n(59314),i=n(84629);function o(e){return null!=e&&i(e.length)&&!r(e)}e.exports=o},88306:function(e,t,n){var r=n(45372),i=n(74430);function o(e){return i(e)&&r(e)}e.exports=o},21976:function(e,t,n){e=n.nmd(e);var r=n(69159),i=n(22225),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,A=c||i;e.exports=A},91148:function(e,t,n){var r=n(43409);function i(e,t){return r(e,t)}e.exports=i},59314:function(e,t,n){var r=n(96423),i=n(70150),o="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",l="[object Proxy]";function c(e){if(!i(e))return!1;var t=r(e);return t==a||t==s||t==o||t==l}e.exports=c},77898:function(e,t,n){var r=n(85949);function i(e){return"number"==typeof e&&e==r(e)}e.exports=i},84629:function(e){var t=9007199254740991;function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}e.exports=n},35458:function(e,t,n){var r=n(96889),i=n(87362),o=n(71330),a=o&&o.isMap,s=a?i(a):r;e.exports=s},70150:function(e){function t(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=t},74430:function(e){function t(e){return null!=e&&"object"==typeof e}e.exports=t},71012:function(e,t,n){var r=n(96423),i=n(94677),o=n(74430),a="[object Object]",s=Function.prototype,l=Object.prototype,c=s.toString,A=l.hasOwnProperty,u=c.call(Object);function d(e){if(!o(e)||r(e)!=a)return!1;var t=i(e);if(null===t)return!0;var n=A.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==u}e.exports=d},2792:function(e,t,n){var r=n(51665),i=n(87362),o=n(71330),a=o&&o.isSet,s=a?i(a):r;e.exports=s},17691:function(e,t,n){var r=n(96423),i=n(74430),o="[object Symbol]";function a(e){return"symbol"==typeof e||i(e)&&r(e)==o}e.exports=a},56965:function(e,t,n){var r=n(86930),i=n(87362),o=n(71330),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},24337:function(e,t,n){var r=n(7498),i=n(841),o=n(45372);function a(e){return o(e)?r(e):i(e)}e.exports=a},74494:function(e,t,n){var r=n(7498),i=n(86101),o=n(45372);function a(e){return o(e)?r(e,!0):i(e)}e.exports=a},491:function(e){function t(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=t},74806:function(e,t,n){var r;e=n.nmd(e),n(57658),function(){var i,o="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",A="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,f=4,g=1,m=2,v=1,b=2,y=4,w=8,x=16,k=32,C=64,B=128,_=256,E=512,S=30,F="...",T=800,M=16,I=1,N=2,U=3,L=1/0,Q=9007199254740991,D=17976931348623157e292,H=NaN,O=4294967295,z=O-1,Z=O>>>1,R=[["ary",B],["bind",v],["bindKey",b],["curry",w],["curryRight",x],["flip",E],["partial",k],["partialRight",C],["rearg",_]],P="[object Arguments]",q="[object Array]",K="[object AsyncFunction]",W="[object Boolean]",j="[object Date]",V="[object DOMException]",G="[object Error]",$="[object Function]",Y="[object GeneratorFunction]",X="[object Map]",J="[object Number]",ee="[object Null]",te="[object Object]",ne="[object Promise]",re="[object Proxy]",ie="[object RegExp]",oe="[object Set]",ae="[object String]",se="[object Symbol]",le="[object Undefined]",ce="[object WeakMap]",Ae="[object WeakSet]",ue="[object ArrayBuffer]",de="[object DataView]",he="[object Float32Array]",pe="[object Float64Array]",fe="[object Int8Array]",ge="[object Int16Array]",me="[object Int32Array]",ve="[object Uint8Array]",be="[object Uint8ClampedArray]",ye="[object Uint16Array]",we="[object Uint32Array]",xe=/\b__p \+= '';/g,ke=/\b(__p \+=) '' \+/g,Ce=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,_e=/[&<>"']/g,Ee=RegExp(Be.source),Se=RegExp(_e.source),Fe=/<%-([\s\S]+?)%>/g,Te=/<%([\s\S]+?)%>/g,Me=/<%=([\s\S]+?)%>/g,Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ne=/^\w*$/,Ue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,Qe=RegExp(Le.source),De=/^\s+/,He=/\s/,Oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ze=/\{\n\/\* \[wrapped with (.+)\] \*/,Ze=/,? & /,Re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pe=/[()=,{}\[\]\/\s]/,qe=/\\(\\)?/g,Ke=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,We=/\w*$/,je=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,Ge=/^\[object .+?Constructor\]$/,$e=/^0o[0-7]+$/i,Ye=/^(?:0|[1-9]\d*)$/,Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Je=/($^)/,et=/['\n\r\u2028\u2029\\]/g,tt="\\ud800-\\udfff",nt="\\u0300-\\u036f",rt="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",ot=nt+rt+it,at="\\u2700-\\u27bf",st="a-z\\xdf-\\xf6\\xf8-\\xff",lt="\\xac\\xb1\\xd7\\xf7",ct="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",At="\\u2000-\\u206f",ut=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="A-Z\\xc0-\\xd6\\xd8-\\xde",ht="\\ufe0e\\ufe0f",pt=lt+ct+At+ut,ft="['’]",gt="["+tt+"]",mt="["+pt+"]",vt="["+ot+"]",bt="\\d+",yt="["+at+"]",wt="["+st+"]",xt="[^"+tt+pt+bt+at+st+dt+"]",kt="\\ud83c[\\udffb-\\udfff]",Ct="(?:"+vt+"|"+kt+")",Bt="[^"+tt+"]",_t="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",St="["+dt+"]",Ft="\\u200d",Tt="(?:"+wt+"|"+xt+")",Mt="(?:"+St+"|"+xt+")",It="(?:"+ft+"(?:d|ll|m|re|s|t|ve))?",Nt="(?:"+ft+"(?:D|LL|M|RE|S|T|VE))?",Ut=Ct+"?",Lt="["+ht+"]?",Qt="(?:"+Ft+"(?:"+[Bt,_t,Et].join("|")+")"+Lt+Ut+")*",Dt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ht="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ot=Lt+Ut+Qt,zt="(?:"+[yt,_t,Et].join("|")+")"+Ot,Zt="(?:"+[Bt+vt+"?",vt,_t,Et,gt].join("|")+")",Rt=RegExp(ft,"g"),Pt=RegExp(vt,"g"),qt=RegExp(kt+"(?="+kt+")|"+Zt+Ot,"g"),Kt=RegExp([St+"?"+wt+"+"+It+"(?="+[mt,St,"$"].join("|")+")",Mt+"+"+Nt+"(?="+[mt,St+Tt,"$"].join("|")+")",St+"?"+Tt+"+"+It,St+"+"+Nt,Ht,Dt,bt,zt].join("|"),"g"),Wt=RegExp("["+Ft+tt+ot+ht+"]"),jt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gt=-1,$t={};$t[he]=$t[pe]=$t[fe]=$t[ge]=$t[me]=$t[ve]=$t[be]=$t[ye]=$t[we]=!0,$t[P]=$t[q]=$t[ue]=$t[W]=$t[de]=$t[j]=$t[G]=$t[$]=$t[X]=$t[J]=$t[te]=$t[ie]=$t[oe]=$t[ae]=$t[ce]=!1;var Yt={};Yt[P]=Yt[q]=Yt[ue]=Yt[de]=Yt[W]=Yt[j]=Yt[he]=Yt[pe]=Yt[fe]=Yt[ge]=Yt[me]=Yt[X]=Yt[J]=Yt[te]=Yt[ie]=Yt[oe]=Yt[ae]=Yt[se]=Yt[ve]=Yt[be]=Yt[ye]=Yt[we]=!0,Yt[G]=Yt[$]=Yt[ce]=!1;var Xt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Jt={"&":"&","<":"<",">":">",'"':""","'":"'"},en={"&":"&","<":"<",">":">",""":'"',"'":"'"},tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,rn=parseInt,on="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,an="object"==typeof self&&self&&self.Object===Object&&self,sn=on||an||Function("return this")(),ln=t&&!t.nodeType&&t,cn=ln&&e&&!e.nodeType&&e,An=cn&&cn.exports===ln,un=An&&on.process,dn=function(){try{var e=cn&&cn.require&&cn.require("util").types;return e||un&&un.binding&&un.binding("util")}catch(t){}}(),hn=dn&&dn.isArrayBuffer,pn=dn&&dn.isDate,fn=dn&&dn.isMap,gn=dn&&dn.isRegExp,mn=dn&&dn.isSet,vn=dn&&dn.isTypedArray;function bn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function yn(e,t,n,r){var i=-1,o=null==e?0:e.length;while(++i-1}function _n(e,t,n){var r=-1,i=null==e?0:e.length;while(++r-1);return n}function Jn(e,t){var n=e.length;while(n--&&Dn(t,e[n],0)>-1);return n}function er(e,t){var n=e.length,r=0;while(n--)e[n]===t&&++r;return r}var tr=Rn(Xt),nr=Rn(Jt);function rr(e){return"\\"+tn[e]}function ir(e,t){return null==e?i:e[t]}function or(e){return Wt.test(e)}function ar(e){return jt.test(e)}function sr(e){var t,n=[];while(!(t=e.next()).done)n.push(t.value);return n}function lr(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cr(e,t){return function(n){return e(t(n))}}function Ar(e,t){var n=-1,r=e.length,i=0,o=[];while(++n-1}function Rr(e,t){var n=this.__data__,r=Ai(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Pr(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t=t?e:t)),e}function mi(e,t,n,r,o,a){var s,l=t&h,c=t&p,A=t&f;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!CA(e))return e;var u=lA(e);if(u){if(s=ts(e),!l)return ia(e,s)}else{var d=Ya(e),g=d==$||d==Y;if(hA(e))return Vo(e,l);if(d==te||d==P||g&&!o){if(s=c||g?{}:ns(e),!l)return c?sa(e,hi(s,e)):aa(e,di(s,e))}else{if(!Yt[d])return o?e:{};s=rs(e,d,l)}}a||(a=new Xr);var m=a.get(e);if(m)return m;a.set(e,s),DA(e)?e.forEach((function(r){s.add(mi(r,t,n,r,e,a))})):_A(e)&&e.forEach((function(r,i){s.set(i,mi(r,t,n,i,e,a))}));var v=A?c?za:Oa:c?ku:xu,b=u?i:v(e);return wn(b||e,(function(r,i){b&&(i=r,r=e[i]),ci(s,i,mi(r,t,n,i,e,a))})),s}function vi(e){var t=xu(e);return function(n){return bi(n,e,t)}}function bi(e,t,n){var r=n.length;if(null==e)return!r;e=nt(e);while(r--){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function yi(e,t,n){if("function"!=typeof e)throw new ot(l);return Bs((function(){e.apply(i,n)}),t)}function wi(e,t,n,r){var i=-1,o=Bn,s=!0,l=e.length,c=[],A=t.length;if(!l)return c;n&&(t=En(t,Gn(n))),r?(o=_n,s=!1):t.length>=a&&(o=Yn,s=!1,t=new Gr(t));e:while(++io?0:o+n),r=r===i||r>o?o:VA(r),r<0&&(r+=o),r=n>r?0:GA(r);while(n0&&n(s)?t>1?Si(s,t-1,n,r,i):Sn(i,s):r||(i[i.length]=s)}return i}var Fi=ua(),Ti=ua(!0);function Mi(e,t){return e&&Fi(e,t,xu)}function Ii(e,t){return e&&Ti(e,t,xu)}function Ni(e,t){return Cn(t,(function(t){return wA(e[t])}))}function Ui(e,t){t=qo(t,e);var n=0,r=t.length;while(null!=e&&nt}function Hi(e,t){return null!=e&&ut.call(e,t)}function Oi(e,t){return null!=e&&t in nt(e)}function zi(e,t,n){return e>=Zt(t,n)&&e=120&&d.length>=120)?new Gr(l&&d):i}d=e[0];var h=-1,p=c[0];e:while(++h-1)s!==e&&Bt.call(s,l,1),Bt.call(e,l,1)}return e}function mo(e,t){var n=e?t.length:0,r=n-1;while(n--){var i=t[n];if(n==r||i!==o){var o=i;as(i)?Bt.call(e,i,1):Qo(e,i)}}return e}function vo(e,t){return e+Ut(Wt()*(t-e+1))}function bo(e,t,r,i){var o=-1,a=zt(Nt((t-e)/(r||1)),0),s=n(a);while(a--)s[i?a:++o]=e,e+=r;return s}function yo(e,t){var n="";if(!e||t<1||t>Q)return n;do{t%2&&(n+=e),t=Ut(t/2),t&&(e+=e)}while(t);return n}function wo(e,t){return _s(ys(e,t,Td),e+"")}function xo(e){return oi(Zu(e))}function ko(e,t){var n=Zu(e);return Fs(n,gi(t,0,n.length))}function Co(e,t,n,r){if(!CA(e))return e;t=qo(t,e);var o=-1,a=t.length,s=a-1,l=e;while(null!=l&&++oo?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;var a=n(o);while(++i>>1,a=e[o];null!==a&&!OA(a)&&(n?a<=t:a=a){var A=t?null:Fa(e);if(A)return ur(A);s=!1,i=Yn,c=new Gr}else c=t?[]:l;e:while(++r=r?e:So(e,t,n)}var jo=Tt||function(e){return sn.clearTimeout(e)};function Vo(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function Go(e){var t=new e.constructor(e.byteLength);return new yt(t).set(new yt(e)),t}function $o(e,t){var n=t?Go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Yo(e){var t=new e.constructor(e.source,We.exec(e));return t.lastIndex=e.lastIndex,t}function Xo(e){return br?nt(br.call(e)):{}}function Jo(e,t){var n=t?Go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ea(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,a=OA(e),s=t!==i,l=null===t,c=t===t,A=OA(t);if(!l&&!A&&!a&&e>t||a&&s&&c&&!l&&!A||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!A&&e=s)return l;var c=n[r];return l*("desc"==c?-1:1)}}return e.index-t.index}function na(e,t,r,i){var o=-1,a=e.length,s=r.length,l=-1,c=t.length,A=zt(a-s,0),u=n(c+A),d=!i;while(++l1?n[o-1]:i,s=o>2?n[2]:i;a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ss(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=nt(t);while(++r-1?o[a?t[s]:s]:i}}function va(e){return Ha((function(t){var n=t.length,r=n,o=_r.prototype.thru;e&&t.reverse();while(r--){var a=t[r];if("function"!=typeof a)throw new ot(l);if(o&&!s&&"wrapper"==Ra(a))var s=new _r([],!0)}r=s?r:n;while(++r1&&v.reverse(),d&&Al))return!1;var A=a.get(e),u=a.get(t);if(A&&u)return A==t&&u==e;var d=-1,h=!0,p=n&m?new Gr:i;a.set(e,t),a.set(t,e);while(++d1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Oe,"{\n/* [wrapped with "+t+"] */\n")}function os(e){return lA(e)||sA(e)||!!(_t&&e&&e[_t])}function as(e,t){var n=typeof e;return t=null==t?Q:t,!!t&&("number"==n||"symbol"!=n&&Ye.test(e))&&e>-1&&e%1==0&&e0){if(++t>=T)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fs(e,t){var n=-1,r=e.length,o=r-1;t=t===i?r:t;while(++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,Ql(e,n)}));function Kl(e){var t=xr(e);return t.__chain__=!0,t}function Wl(e,t){return t(e),e}function jl(e,t){return t(e)}var Vl=Ha((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return fi(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Er&&as(n)?(r=r.slice(n,+n+(t?1:0)),r.__actions__.push({func:jl,args:[o],thisArg:i}),new _r(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));function Gl(){return Kl(this)}function $l(){return new _r(this.value(),this.__chain__)}function Yl(){this.__values__===i&&(this.__values__=WA(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function Xl(){return this}function Jl(e){var t,n=this;while(n instanceof Br){var r=Us(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t}function ec(){var e=this.__wrapped__;if(e instanceof Er){var t=e;return this.__actions__.length&&(t=new Er(this)),t=t.reverse(),t.__actions__.push({func:jl,args:[pl],thisArg:i}),new _r(t,this.__chain__)}return this.thru(pl)}function tc(){return Oo(this.__wrapped__,this.__actions__)}var nc=la((function(e,t,n){ut.call(e,n)?++e[n]:pi(e,n,1)}));function rc(e,t,n){var r=lA(e)?kn:Ci;return n&&ss(e,t,n)&&(t=i),r(e,qa(t,3))}function ic(e,t){var n=lA(e)?Cn:Ei;return n(e,qa(t,3))}var oc=ma(Ws),ac=ma(js);function sc(e,t){return Si(gc(e,t),1)}function lc(e,t){return Si(gc(e,t),L)}function cc(e,t,n){return n=n===i?1:VA(n),Si(gc(e,t),n)}function Ac(e,t){var n=lA(e)?wn:xi;return n(e,qa(t,3))}function uc(e,t){var n=lA(e)?xn:ki;return n(e,qa(t,3))}var dc=la((function(e,t,n){ut.call(e,n)?e[n].push(t):pi(e,n,[t])}));function hc(e,t,n,r){e=AA(e)?e:Zu(e),n=n&&!r?VA(n):0;var i=e.length;return n<0&&(n=zt(i+n,0)),HA(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Dn(e,t,n)>-1}var pc=wo((function(e,t,r){var i=-1,o="function"==typeof t,a=AA(e)?n(e.length):[];return xi(e,(function(e){a[++i]=o?bn(t,e,r):Pi(e,t,r)})),a})),fc=la((function(e,t,n){pi(e,n,t)}));function gc(e,t){var n=lA(e)?En:oo;return n(e,qa(t,3))}function mc(e,t,n,r){return null==e?[]:(lA(t)||(t=null==t?[]:[t]),n=r?i:n,lA(n)||(n=null==n?[]:[n]),uo(e,t,n))}var vc=la((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function bc(e,t,n){var r=lA(e)?Fn:Pn,i=arguments.length<3;return r(e,qa(t,4),n,i,xi)}function yc(e,t,n){var r=lA(e)?Tn:Pn,i=arguments.length<3;return r(e,qa(t,4),n,i,ki)}function wc(e,t){var n=lA(e)?Cn:Ei;return n(e,Zc(qa(t,3)))}function xc(e){var t=lA(e)?oi:xo;return t(e)}function kc(e,t,n){t=(n?ss(e,t,n):t===i)?1:VA(t);var r=lA(e)?ai:ko;return r(e,t)}function Cc(e){var t=lA(e)?si:Eo;return t(e)}function Bc(e){if(null==e)return 0;if(AA(e))return HA(e)?fr(e):e.length;var t=Ya(e);return t==X||t==oe?e.size:no(e).length}function _c(e,t,n){var r=lA(e)?Mn:Fo;return n&&ss(e,t,n)&&(t=i),r(e,qa(t,3))}var Ec=wo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ss(e,t[0],t[1])?t=[]:n>2&&ss(t[0],t[1],t[2])&&(t=[t[0]]),uo(e,Si(t,1),[])})),Sc=Mt||function(){return sn.Date.now()};function Fc(e,t){if("function"!=typeof t)throw new ot(l);return e=VA(e),function(){if(--e<1)return t.apply(this,arguments)}}function Tc(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ma(e,B,i,i,i,i,t)}function Mc(e,t){var n;if("function"!=typeof t)throw new ot(l);return e=VA(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ic=wo((function(e,t,n){var r=v;if(n.length){var i=Ar(n,Pa(Ic));r|=k}return Ma(e,r,t,n,i)})),Nc=wo((function(e,t,n){var r=v|b;if(n.length){var i=Ar(n,Pa(Nc));r|=k}return Ma(t,r,e,n,i)}));function Uc(e,t,n){t=n?i:t;var r=Ma(e,w,i,i,i,i,i,t);return r.placeholder=Uc.placeholder,r}function Lc(e,t,n){t=n?i:t;var r=Ma(e,x,i,i,i,i,i,t);return r.placeholder=Lc.placeholder,r}function Qc(e,t,n){var r,o,a,s,c,A,u=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new ot(l);function f(t){var n=r,a=o;return r=o=i,u=t,s=e.apply(a,n),s}function g(e){return u=e,c=Bs(b,t),d?f(e):s}function m(e){var n=e-A,r=e-u,i=t-n;return h?Zt(i,a-r):i}function v(e){var n=e-A,r=e-u;return A===i||n>=t||n<0||h&&r>=a}function b(){var e=Sc();if(v(e))return y(e);c=Bs(b,m(e))}function y(e){return c=i,p&&r?f(e):(r=o=i,s)}function w(){c!==i&&jo(c),u=0,r=A=o=c=i}function x(){return c===i?s:y(Sc())}function k(){var e=Sc(),n=v(e);if(r=arguments,o=this,A=e,n){if(c===i)return g(A);if(h)return jo(c),c=Bs(b,t),f(A)}return c===i&&(c=Bs(b,t)),s}return t=$A(t)||0,CA(n)&&(d=!!n.leading,h="maxWait"in n,a=h?zt($A(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),k.cancel=w,k.flush=x,k}var Dc=wo((function(e,t){return yi(e,1,t)})),Hc=wo((function(e,t,n){return yi(e,$A(t)||0,n)}));function Oc(e){return Ma(e,E)}function zc(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ot(l);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(zc.Cache||Pr),n}function Zc(e){if("function"!=typeof e)throw new ot(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Rc(e){return Mc(2,e)}zc.Cache=Pr;var Pc=Ko((function(e,t){t=1==t.length&&lA(t[0])?En(t[0],Gn(qa())):En(Si(t,1),Gn(qa()));var n=t.length;return wo((function(r){var i=-1,o=Zt(r.length,n);while(++i=t})),sA=qi(function(){return arguments}())?qi:function(e){return BA(e)&&ut.call(e,"callee")&&!Ct.call(e,"callee")},lA=n.isArray,cA=hn?Gn(hn):Ki;function AA(e){return null!=e&&kA(e.length)&&!wA(e)}function uA(e){return BA(e)&&AA(e)}function dA(e){return!0===e||!1===e||BA(e)&&Qi(e)==W}var hA=Qt||Vd,pA=pn?Gn(pn):Wi;function fA(e){return BA(e)&&1===e.nodeType&&!UA(e)}function gA(e){if(null==e)return!0;if(AA(e)&&(lA(e)||"string"==typeof e||"function"==typeof e.splice||hA(e)||zA(e)||sA(e)))return!e.length;var t=Ya(e);if(t==X||t==oe)return!e.size;if(hs(e))return!no(e).length;for(var n in e)if(ut.call(e,n))return!1;return!0}function mA(e,t){return ji(e,t)}function vA(e,t,n){n="function"==typeof n?n:i;var r=n?n(e,t):i;return r===i?ji(e,t,i,n):!!r}function bA(e){if(!BA(e))return!1;var t=Qi(e);return t==G||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!UA(e)}function yA(e){return"number"==typeof e&&Dt(e)}function wA(e){if(!CA(e))return!1;var t=Qi(e);return t==$||t==Y||t==K||t==re}function xA(e){return"number"==typeof e&&e==VA(e)}function kA(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Q}function CA(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function BA(e){return null!=e&&"object"==typeof e}var _A=fn?Gn(fn):Gi;function EA(e,t){return e===t||$i(e,t,Wa(t))}function SA(e,t,n){return n="function"==typeof n?n:i,$i(e,t,Wa(t),n)}function FA(e){return NA(e)&&e!=+e}function TA(e){if(ds(e))throw new He(s);return Yi(e)}function MA(e){return null===e}function IA(e){return null==e}function NA(e){return"number"==typeof e||BA(e)&&Qi(e)==J}function UA(e){if(!BA(e)||Qi(e)!=te)return!1;var t=xt(e);if(null===t)return!0;var n=ut.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&At.call(n)==ft}var LA=gn?Gn(gn):Xi;function QA(e){return xA(e)&&e>=-Q&&e<=Q}var DA=mn?Gn(mn):Ji;function HA(e){return"string"==typeof e||!lA(e)&&BA(e)&&Qi(e)==ae}function OA(e){return"symbol"==typeof e||BA(e)&&Qi(e)==se}var zA=vn?Gn(vn):eo;function ZA(e){return e===i}function RA(e){return BA(e)&&Ya(e)==ce}function PA(e){return BA(e)&&Qi(e)==Ae}var qA=_a(io),KA=_a((function(e,t){return e<=t}));function WA(e){if(!e)return[];if(AA(e))return HA(e)?gr(e):ia(e);if(Et&&e[Et])return sr(e[Et]());var t=Ya(e),n=t==X?lr:t==oe?ur:Zu;return n(e)}function jA(e){if(!e)return 0===e?e:0;if(e=$A(e),e===L||e===-L){var t=e<0?-1:1;return t*D}return e===e?e:0}function VA(e){var t=jA(e),n=t%1;return t===t?n?t-n:t:0}function GA(e){return e?gi(VA(e),0,O):0}function $A(e){if("number"==typeof e)return e;if(OA(e))return H;if(CA(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=CA(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Vn(e);var n=Ve.test(e);return n||$e.test(e)?rn(e.slice(2),n?2:8):je.test(e)?H:+e}function YA(e){return oa(e,ku(e))}function XA(e){return e?gi(VA(e),-Q,Q):0===e?e:0}function JA(e){return null==e?"":Uo(e)}var eu=ca((function(e,t){if(hs(t)||AA(t))oa(t,xu(t),e);else for(var n in t)ut.call(t,n)&&ci(e,n,t[n])})),tu=ca((function(e,t){oa(t,ku(t),e)})),nu=ca((function(e,t,n,r){oa(t,ku(t),e,r)})),ru=ca((function(e,t,n,r){oa(t,xu(t),e,r)})),iu=Ha(fi);function ou(e,t){var n=Cr(e);return null==t?n:di(n,t)}var au=wo((function(e,t){e=nt(e);var n=-1,r=t.length,o=r>2?t[2]:i;o&&ss(t[0],t[1],o)&&(r=1);while(++n1),t})),oa(e,za(e),n),r&&(n=mi(n,h|p|f,Ua));var i=t.length;while(i--)Qo(n,t[i]);return n}));function Fu(e,t){return Mu(e,Zc(qa(t)))}var Tu=Ha((function(e,t){return null==e?{}:ho(e,t)}));function Mu(e,t){if(null==e)return{};var n=En(za(e),(function(e){return[e]}));return t=qa(t),po(e,n,(function(e,n){return t(e,n[0])}))}function Iu(e,t,n){t=qo(t,e);var r=-1,o=t.length;o||(o=1,e=i);while(++rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Wt();return Zt(e+o*(t-e+nn("1e-"+((o+"").length-1))),t)}return vo(e,t)}var Wu=pa((function(e,t,n){return t=t.toLowerCase(),e+(n?ju(t):t)}));function ju(e){return yd(JA(e).toLowerCase())}function Vu(e){return e=JA(e),e&&e.replace(Xe,tr).replace(Pt,"")}function Gu(e,t,n){e=JA(e),t=Uo(t);var r=e.length;n=n===i?r:gi(VA(n),0,r);var o=n;return n-=t.length,n>=0&&e.slice(n,o)==t}function $u(e){return e=JA(e),e&&Se.test(e)?e.replace(_e,nr):e}function Yu(e){return e=JA(e),e&&Qe.test(e)?e.replace(Le,"\\$&"):e}var Xu=pa((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ju=pa((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ed=ha("toLowerCase");function td(e,t,n){e=JA(e),t=VA(t);var r=t?fr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ka(Ut(i),n)+e+ka(Nt(i),n)}function nd(e,t,n){e=JA(e),t=VA(t);var r=t?fr(e):0;return t&&r>>0,n?(e=JA(e),e&&("string"==typeof t||null!=t&&!LA(t))&&(t=Uo(t),!t&&or(e))?Wo(gr(e),0,n):e.split(t,n)):[]}var cd=pa((function(e,t,n){return e+(n?" ":"")+yd(t)}));function Ad(e,t,n){return e=JA(e),n=null==n?0:gi(VA(n),0,e.length),t=Uo(t),e.slice(n,n+t.length)==t}function ud(e,t,n){var r=xr.templateSettings;n&&ss(e,t,n)&&(t=i),e=JA(e),t=nu({},t,r,Ia);var o,a,s=nu({},t.imports,r.imports,Ia),l=xu(s),A=$n(s,l),u=0,d=t.interpolate||Je,h="__p += '",p=rt((t.escape||Je).source+"|"+d.source+"|"+(d===Me?Ke:Je).source+"|"+(t.evaluate||Je).source+"|$","g"),f="//# sourceURL="+(ut.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gt+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(u,l).replace(et,rr),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),h+="';\n";var g=ut.call(t,"variable")&&t.variable;if(g){if(Pe.test(g))throw new He(c)}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(xe,""):h).replace(ke,"$1").replace(Ce,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=xd((function(){return Re(l,f+"return "+h).apply(i,A)}));if(m.source=h,bA(m))throw m;return m}function dd(e){return JA(e).toLowerCase()}function hd(e){return JA(e).toUpperCase()}function pd(e,t,n){if(e=JA(e),e&&(n||t===i))return Vn(e);if(!e||!(t=Uo(t)))return e;var r=gr(e),o=gr(t),a=Xn(r,o),s=Jn(r,o)+1;return Wo(r,a,s).join("")}function fd(e,t,n){if(e=JA(e),e&&(n||t===i))return e.slice(0,mr(e)+1);if(!e||!(t=Uo(t)))return e;var r=gr(e),o=Jn(r,gr(t))+1;return Wo(r,0,o).join("")}function gd(e,t,n){if(e=JA(e),e&&(n||t===i))return e.replace(De,"");if(!e||!(t=Uo(t)))return e;var r=gr(e),o=Xn(r,gr(t));return Wo(r,o).join("")}function md(e,t){var n=S,r=F;if(CA(t)){var o="separator"in t?t.separator:o;n="length"in t?VA(t.length):n,r="omission"in t?Uo(t.omission):r}e=JA(e);var a=e.length;if(or(e)){var s=gr(e);a=s.length}if(n>=a)return e;var l=n-fr(r);if(l<1)return r;var c=s?Wo(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),LA(o)){if(e.slice(l).search(o)){var A,u=c;o.global||(o=rt(o.source,JA(We.exec(o))+"g")),o.lastIndex=0;while(A=o.exec(u))var d=A.index;c=c.slice(0,d===i?l:d)}}else if(e.indexOf(Uo(o),l)!=l){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+r}function vd(e){return e=JA(e),e&&Ee.test(e)?e.replace(Be,vr):e}var bd=pa((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),yd=ha("toUpperCase");function wd(e,t,n){return e=JA(e),t=n?i:t,t===i?ar(e)?wr(e):Un(e):e.match(t)||[]}var xd=wo((function(e,t){try{return bn(e,i,t)}catch(n){return bA(n)?n:new He(n)}})),kd=Ha((function(e,t){return wn(t,(function(t){t=Ms(t),pi(e,t,Ic(e[t],e))})),e}));function Cd(e){var t=null==e?0:e.length,n=qa();return e=t?En(e,(function(e){if("function"!=typeof e[1])throw new ot(l);return[n(e[0]),e[1]]})):[],wo((function(n){var r=-1;while(++rQ)return[];var n=O,r=Zt(e,O);t=qa(t),e-=O;var i=Wn(r,t);while(++n0||t<0)?new Er(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=VA(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},Er.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Er.prototype.toArray=function(){return this.take(O)},Mi(Er.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=xr[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(xr.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Er,c=s[0],A=l||lA(t),u=function(e){var t=o.apply(xr,Sn([e],s));return r&&d?t[0]:t};A&&n&&"function"==typeof c&&1!=c.length&&(l=A=!1);var d=this.__chain__,h=!!this.__actions__.length,p=a&&!d,f=l&&!h;if(!a&&A){t=f?t:new Er(this);var g=e.apply(t,s);return g.__actions__.push({func:jl,args:[u],thisArg:i}),new _r(g,d)}return p&&f?e.apply(this,s):(g=this.thru(u),p?r?g.value()[0]:g.value():g)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);xr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(lA(i)?i:[],e)}return this[n]((function(n){return t.apply(lA(n)?n:[],e)}))}})),Mi(Er.prototype,(function(e,t){var n=xr[t];if(n){var r=n.name+"";ut.call(cn,r)||(cn[r]=[]),cn[r].push({name:t,func:n})}})),cn[ba(i,b).name]=[{name:"wrapper",func:i}],Er.prototype.clone=Sr,Er.prototype.reverse=Fr,Er.prototype.value=Tr,xr.prototype.at=Vl,xr.prototype.chain=Gl,xr.prototype.commit=$l,xr.prototype.next=Yl,xr.prototype.plant=Jl,xr.prototype.reverse=ec,xr.prototype.toJSON=xr.prototype.valueOf=xr.prototype.value=tc,xr.prototype.first=xr.prototype.head,Et&&(xr.prototype[Et]=Xl),xr},kr=xr();sn._=kr,r=function(){return kr}.call(t,n,t,e),r===i||(e.exports=r)}.call(this)},36564:function(e,t,n){var r=n(58082),i="Expected a function";function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},31823:function(e,t,n){var r=n(41720),i=n(65882),o=i((function(e,t,n){r(e,t,n)}));e.exports=o},14705:function(e,t,n){var r=n(69159),i=function(){return r.Date.now()};e.exports=i},69208:function(e,t,n){var r=n(58664),i=n(39746),o=n(36890),a=n(5299),s=n(66877),l=n(27962),c=n(1443),A=n(50592),u=1,d=2,h=4,p=c((function(e,t){var n={};if(null==e)return n;var c=!1;t=r(t,(function(t){return t=a(t,e),c||(c=t.length>1),t})),s(e,A(e),n),c&&(n=i(n,u|d|h,l));var p=t.length;while(p--)o(n,t[p]);return n}));e.exports=p},52322:function(e,t,n){var r=n(28638),i=n(4568),o=n(9020),a=n(88952);function s(e){return o(e)?r(a(e)):i(e)}e.exports=s},20826:function(e,t,n){var r=n(77912),i=n(13973),o=n(85949),a=n(59459);function s(e,t,n){return e=a(e),n=null==n?0:r(o(n),0,e.length),t=i(t),e.slice(n,n+t.length)==t}e.exports=s},13538:function(e){function t(){return[]}e.exports=t},22225:function(e){function t(){return!1}e.exports=t},79289:function(e,t,n){var r=n(73738),i=n(70150),o="Expected a function";function a(e,t,n){var a=!0,s=!0;if("function"!=typeof e)throw new TypeError(o);return i(n)&&(a="leading"in n?!!n.leading:a,s="trailing"in n?!!n.trailing:s),r(e,t,{leading:a,maxWait:t,trailing:s})}e.exports=a},776:function(e,t,n){var r=n(62012),i=1/0,o=17976931348623157e292;function a(e){if(!e)return 0===e?e:0;if(e=r(e),e===i||e===-i){var t=e<0?-1:1;return t*o}return e===e?e:0}e.exports=a},85949:function(e,t,n){var r=n(776);function i(e){var t=r(e),n=t%1;return t===t?n?t-n:t:0}e.exports=i},62012:function(e,t,n){var r=n(66009),i=n(70150),o=n(17691),a=NaN,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,A=parseInt;function u(e){if("number"==typeof e)return e;if(o(e))return a;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||c.test(e)?A(e.slice(2),n?2:8):s.test(e)?a:+e}e.exports=u},55791:function(e,t,n){var r=n(66877),i=n(74494);function o(e){return r(e,i(e))}e.exports=o},59459:function(e,t,n){var r=n(13973);function i(e){return null==e?"":r(e)}e.exports=i},60041:function(e,t,n){"use strict";n(57658),e.exports=function(e,t,n){function r(e){return e.trim().split(" ",2)[0]===t}function i(e,n,r,i,o){return 1===e[n].nesting&&e[n].attrJoin("class",t),o.renderToken(e,n,r,i,o)}n=n||{};var o=3,a=n.marker||":",s=a.charCodeAt(0),l=a.length,c=n.validate||r,A=n.render||i;function u(e,n,r,i){var A,u,d,h,p,f,g,m,v=!1,b=e.bMarks[n]+e.tShift[n],y=e.eMarks[n];if(s!==e.src.charCodeAt(b))return!1;for(A=b+1;A<=y;A++)if(a[(A-b)%l]!==e.src[A])break;if(d=Math.floor((A-b)/l),d=r)break;if(b=e.bMarks[u]+e.tShift[u],y=e.eMarks[u],b=4)){for(A=b+1;A<=y;A++)if(a[(A-b)%l]!==e.src[A])break;if(!(Math.floor((A-b)/l)?@[\]^_`{|}~-])/g;function i(e,t){var n,i,o,a=e.posMax,s=e.pos;if(126!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=a)return!1;e.pos=s+1;while(e.pos?@[\]^_`{|}~-])/g;function i(e,t){var n,i,o,a=e.posMax,s=e.pos;if(94!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=a)return!1;e.pos=s+1;while(e.pos`\\x00-\\x20]+",r="'[^']*'",i='"[^"]*"',o="(?:"+n+"|"+r+"|"+i+")",a="(?:\\s+"+t+"(?:\\s*=\\s*"+o+")?)",s="<[A-Za-z][A-Za-z0-9\\-]*"+a+"*\\s*\\/?>",l="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",c="\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e",A="<[?][\\s\\S]*?[?]>",u="]*>",d="",h=new RegExp("^(?:"+s+"|"+l+"|"+c+"|"+A+"|"+u+"|"+d+")"),p=new RegExp("^(?:"+s+"|"+l+")");e.exports.n=h,e.exports.q=p},58341:function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===r(e)}var o=Object.prototype.hasOwnProperty;function a(e,t){return o.call(e,t)}function s(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!==typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}function l(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function c(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!==(65535&e)&&65534!==(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function A(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,d=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(u.source+"|"+d.source,"gi"),p=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,f=n(78761);function g(e,t){var n=0;return a(f,t)?f[t]:35===t.charCodeAt(0)&&p.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),c(n))?A(n):e}function m(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}function v(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(h,(function(e,t,n){return t||g(e,n)}))}var b=/[&<>"]/,y=/[&<>"]/g,w={"&":"&","<":"<",">":">",'"':"""};function x(e){return w[e]}function k(e){return b.test(e)?e.replace(y,x):e}var C=/[.?*+^$[\]\\(){}|-]/g;function B(e){return e.replace(C,"\\$&")}function _(e){switch(e){case 9:case 32:return!0}return!1}function E(e){if(e>=8192&&e<=8202)return!0;switch(e){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}var S=n(33031);function F(e){return S.test(e)}function T(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}}function M(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}t.lib={},t.lib.mdurl=n(44389),t.lib.ucmicro=n(58229),t.assign=s,t.isString=i,t.has=a,t.unescapeMd=m,t.unescapeAll=v,t.isValidEntityCode=c,t.fromCodePoint=A,t.escapeHtml=k,t.arrayReplaceAt=l,t.isSpace=_,t.isWhiteSpace=E,t.isMdAsciiPunct=T,t.isPunctChar=F,t.escapeRE=B,t.normalizeReference=M},921:function(e,t,n){"use strict";t.parseLinkLabel=n(93811),t.parseLinkDestination=n(21058),t.parseLinkTitle=n(14970)},21058:function(e,t,n){"use strict";var r=n(58341).unescapeAll;e.exports=function(e,t,n){var i,o,a=0,s=t,l={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){t++;while(t32))return l;if(41===i){if(0===o)break;o--}t++}}return s===t||0!==o||(l.str=r(e.slice(s,t)),l.lines=a,l.pos=t,l.ok=!0),l}},93811:function(e){"use strict";e.exports=function(e,t,n){var r,i,o,a,s=-1,l=e.posMax,c=e.pos;e.pos=t+1,r=1;while(e.pos=n)return l;if(o=e.charCodeAt(t),34!==o&&39!==o&&40!==o)return l;t++,40===o&&(o=41);while(t=0))try{t.hostname=u.toASCII(t.hostname)}catch(n){}return A.encode(A.format(t))}function v(e){var t=A.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=u.toUnicode(t.hostname)}catch(n){}return A.decode(A.format(t),A.decode.defaultChars+"%")}function b(e,t){if(!(this instanceof b))return new b(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new l,this.block=new s,this.core=new a,this.renderer=new o,this.linkify=new c,this.validateLink=f,this.normalizeLink=m,this.normalizeLinkText=v,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(e),t&&this.set(t)}b.prototype.set=function(e){return r.assign(this.options,e),this},b.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&(t=e,e=d[t],!e))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},b.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},b.prototype.parse=function(e,t){if("string"!==typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},b.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},b.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=b},97574:function(e,t,n){"use strict";n(57658);var r=n(67963),i=[["table",n(51462),["paragraph","reference"]],["code",n(93292)],["fence",n(57333),["paragraph","reference","blockquote","list"]],["blockquote",n(89348),["paragraph","reference","blockquote","list"]],["hr",n(18882),["paragraph","reference","blockquote","list"]],["list",n(75733),["paragraph","reference","blockquote"]],["reference",n(62035)],["html_block",n(84558),["paragraph","reference","blockquote"]],["heading",n(75860),["paragraph","reference","blockquote"]],["lheading",n(86002)],["paragraph",n(56577)]];function o(){this.ruler=new r;for(var e=0;e=n)break;if(e.sCount[s]=c){e.line=n;break}for(i=0;i=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},a.prototype.parse=function(e,t,n,r){var i,o,a,s=new this.State(e,t,n,r);for(this.tokenize(s),o=this.ruler2.getRules(""),a=o.length,i=0;i"+o(e[t].content)+""},a.code_block=function(e,t,n,r,i){var a=e[t];return""+o(e[t].content)+"\n"},a.fence=function(e,t,n,r,a){var s,l,c,A,u,d=e[t],h=d.info?i(d.info).trim():"",p="",f="";return h&&(c=h.split(/(\s+)/g),p=c[0],f=c.slice(2).join("")),s=n.highlight&&n.highlight(d.content,p,f)||o(d.content),0===s.indexOf(""+s+"\n"):"
      "+s+"
      \n"},a.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},a.hardbreak=function(e,t,n){return n.xhtmlOut?"
      \n":"
      \n"},a.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
      \n":"
      \n":"\n"},a.text=function(e,t){return o(e[t].content)},a.html_block=function(e,t){return e[t].content},a.html_inline=function(e,t){return e[t].content},s.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">",i)},s.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,s=e.length;a=4)return!1;if(62!==e.src.charCodeAt(_++))return!1;if(i)return!0;l=h=e.sCount[t]+1,32===e.src.charCodeAt(_)?(_++,l++,h++,o=!1,y=!0):9===e.src.charCodeAt(_)?(y=!0,(e.bsCount[t]+h)%4===3?(_++,l++,h++,o=!1):o=!0):y=!1,p=[e.bMarks[t]],e.bMarks[t]=_;while(_=E,v=[e.sCount[t]],e.sCount[t]=h-l,b=[e.tShift[t]],e.tShift[t]=_-e.bMarks[t],x=e.md.block.ruler.getRules("blockquote"),m=e.parentType,e.parentType="blockquote",d=t+1;d=E)break;if(62!==e.src.charCodeAt(_++)||C){if(A)break;for(w=!1,s=0,c=x.length;s=E,f.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(y?1:0),v.push(e.sCount[d]),e.sCount[d]=h-l,b.push(e.tShift[d]),e.tShift[d]=_-e.bMarks[d]}}for(g=e.blkIndent,e.blkIndent=0,k=e.push("blockquote_open","blockquote",1),k.markup=">",k.map=u=[t,0],e.md.block.tokenize(e,t,d),k=e.push("blockquote_close","blockquote",-1),k.markup=">",e.lineMax=B,e.parentType=m,u[1]=e.line,s=0;s=4))break;r++,i=r}return e.line=i,o=e.push("code_block","code",0),o.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}},57333:function(e,t,n){"use strict";n(57658),e.exports=function(e,t,n,r){var i,o,a,s,l,c,A,u=!1,d=e.bMarks[t]+e.tShift[t],h=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(d+3>h)return!1;if(i=e.src.charCodeAt(d),126!==i&&96!==i)return!1;if(l=d,d=e.skipChars(d,i),o=d-l,o<3)return!1;if(A=e.src.slice(l,d),a=e.src.slice(d,h),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=t;;){if(s++,s>=n)break;if(d=l=e.bMarks[s]+e.tShift[s],h=e.eMarks[s],d=4)&&(d=e.skipChars(d,i),!(d-l=4)return!1;if(o=e.src.charCodeAt(c),35!==o||c>=A)return!1;a=1,o=e.src.charCodeAt(++c);while(35===o&&c6||cc&&r(e.src.charCodeAt(s-1))&&(A=s),e.line=t+1,l=e.push("heading_open","h"+String(a),1),l.markup="########".slice(0,a),l.map=[t,e.line],l=e.push("inline","",0),l.content=e.src.slice(c,A).trim(),l.map=[t,e.line],l.children=[],l=e.push("heading_close","h"+String(a),-1),l.markup="########".slice(0,a)),!0)}},18882:function(e,t,n){"use strict";n(57658);var r=n(58341).isSpace;e.exports=function(e,t,n,i){var o,a,s,l,c=e.bMarks[t]+e.tShift[t],A=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(o=e.src.charCodeAt(c++),42!==o&&45!==o&&95!==o)return!1;a=1;while(c|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var i,a,s,l,c=e.bMarks[t]+e.tShift[t],A=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(l=e.src.slice(c,A),i=0;i=4)return!1;for(d=e.parentType,e.parentType="paragraph";h3)){if(e.sCount[h]>=e.blkIndent&&(l=e.bMarks[h]+e.tShift[h],c=e.eMarks[h],l=c)))){A=61===u?1:2;break}if(!(e.sCount[h]<0)){for(i=!1,o=0,a=p.length;o=a)return-1;if(n=e.src.charCodeAt(o++),n<48||n>57)return-1;for(;;){if(o>=a)return-1;if(n=e.src.charCodeAt(o++),!(n>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-i>=10)return-1}return o=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(L=!0),(F=o(e,t))>=0){if(h=!0,M=e.bMarks[t]+e.tShift[t],b=Number(e.src.slice(M,F-1)),L&&1!==b)return!1}else{if(!((F=i(e,t))>=0))return!1;h=!1}if(L&&e.skipSpaces(F)>=e.eMarks[t])return!1;if(v=e.src.charCodeAt(F-1),r)return!0;m=e.tokens.length,h?(U=e.push("ordered_list_open","ol",1),1!==b&&(U.attrs=[["start",b]])):U=e.push("bullet_list_open","ul",1),U.map=g=[t,0],U.markup=String.fromCharCode(v),w=t,T=!1,N=e.md.block.ruler.getRules("list"),C=e.parentType,e.parentType="list";while(w=y?1:x-d,u>4&&(u=1),A=d+u,U=e.push("list_item_open","li",1),U.markup=String.fromCharCode(v),U.map=p=[t,0],h&&(U.info=e.src.slice(M,F-1)),E=e.tight,_=e.tShift[t],B=e.sCount[t],k=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=A,e.tight=!0,e.tShift[t]=l-e.bMarks[t],e.sCount[t]=x,l>=y&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!T||(Q=!1),T=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=k,e.tShift[t]=_,e.sCount[t]=B,e.tight=E,U=e.push("list_item_close","li",-1),U.markup=String.fromCharCode(v),w=t=e.line,p[1]=w,l=e.bMarks[t],w>=n)break;if(e.sCount[w]=4)break;for(I=!1,c=0,f=N.length;c3)&&!(e.sCount[l]<0)){for(r=!1,i=0,o=c.length;i=4)return!1;if(91!==e.src.charCodeAt(k))return!1;while(++k3)&&!(e.sCount[B]<0)){for(b=!1,u=0,d=y.length;u0&&this.level++,this.tokens.push(i),i},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et)if(!i(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;en)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,a,s,l,c,A,u,d=e;if(e>=t)return"";for(A=new Array(t-e),o=0;dn?new Array(a-n+1).join(" ")+this.src.slice(l,c):this.src.slice(l,c)}return A.join("")},o.prototype.Token=r,e.exports=o},51462:function(e,t,n){"use strict";n(57658);var r=n(58341).isSpace;function i(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function o(e){var t,n=[],r=0,i=e.length,o=!1,a=0,s="";t=e.charCodeAt(r);while(rn)return!1;if(d=t+1,e.sCount[d]=4)return!1;if(c=e.bMarks[d]+e.tShift[d],c>=e.eMarks[d])return!1;if(k=e.src.charCodeAt(c++),124!==k&&45!==k&&58!==k)return!1;if(c>=e.eMarks[d])return!1;if(C=e.src.charCodeAt(c++),124!==C&&45!==C&&58!==C&&!r(C))return!1;if(45===k&&r(C))return!1;while(c=4)return!1;if(h=o(l),h.length&&""===h[0]&&h.shift(),h.length&&""===h[h.length-1]&&h.pop(),p=h.length,0===p||p!==g.length)return!1;if(a)return!0;for(y=e.parentType,e.parentType="table",x=e.md.block.ruler.getRules("blockquote"),f=e.push("table_open","table",1),f.map=v=[t,0],f=e.push("thead_open","thead",1),f.map=[t,t+1],f=e.push("tr_open","tr",1),f.map=[t,t+1],A=0;A=4)break;for(h=o(l),h.length&&""===h[0]&&h.shift(),h.length&&""===h[h.length-1]&&h.pop(),d===t+2&&(f=e.push("tbody_open","tbody",1),f.map=b=[t+2,0]),f=e.push("tr_open","tr",1),f.map=[d,d+1],A=0;A\s]/i.test(e)}function o(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,a,s,l,c,A,u,d,h,p,f,g,m,v,b,y,w=e.tokens;if(e.md.options.linkify)for(n=0,a=w.length;n=0;t--)if(c=s[t],"link_close"!==c.type){if("html_inline"===c.type&&(i(c.content)&&g>0&&g--,o(c.content)&&g++),!(g>0)&&"text"===c.type&&e.md.linkify.test(c.content)){for(d=c.content,y=e.md.linkify.match(d),A=[],f=c.level,p=0,y.length>0&&0===y[0].index&&t>0&&"text_special"===s[t-1].type&&(y=y.slice(1)),u=0;up&&(l=new e.Token("text","",0),l.content=d.slice(p,h),l.level=f,A.push(l)),l=new e.Token("link_open","a",1),l.attrs=[["href",v]],l.level=f++,l.markup="linkify",l.info="auto",A.push(l),l=new e.Token("text","",0),l.content=b,l.level=f,A.push(l),l=new e.Token("link_close","a",-1),l.level=--f,l.markup="linkify",l.info="auto",A.push(l),p=y[u].lastIndex);p=0;t--)n=e[t],"text"!==n.type||i||(n.content=n.content.replace(r,o)),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}function s(e){var n,r,i=0;for(n=e.length-1;n>=0;n--)r=e[n],"text"!==r.type||i||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&i--,"link_close"===r.type&&"auto"===r.info&&i++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&a(e.tokens[r].children),t.test(e.tokens[r].content)&&s(e.tokens[r].children))}},85839:function(e,t,n){"use strict";n(57658);var r=n(58341).isWhiteSpace,i=n(58341).isPunctChar,o=n(58341).isMdAsciiPunct,a=/['"]/,s=/['"]/g,l="’";function c(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function A(e,t){var n,a,A,u,d,h,p,f,g,m,v,b,y,w,x,k,C,B,_,E,S;for(_=[],n=0;n=0;C--)if(_[C].level<=p)break;if(_.length=C+1,"text"===a.type){A=a.content,d=0,h=A.length;e:while(d=0)g=A.charCodeAt(u.index-1);else for(C=n-1;C>=0;C--){if("softbreak"===e[C].type||"hardbreak"===e[C].type)break;if(e[C].content){g=e[C].content.charCodeAt(e[C].content.length-1);break}}if(m=32,d=48&&g<=57&&(k=x=!1),x&&k&&(x=v,k=b),x||k){if(k)for(C=_.length-1;C>=0;C--){if(f=_[C],_[C].level=0;t--)"inline"===e.tokens[t].type&&a.test(e.tokens[t].content)&&A(e.tokens[t].children,e)}},90883:function(e,t,n){"use strict";var r=n(13944);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=r,e.exports=i},11098:function(e){"use strict";e.exports=function(e){var t,n,r,i,o,a,s=e.tokens;for(t=0,n=s.length;t\x00-\x20]*)$/;e.exports=function(e,t){var n,o,a,s,l,c,A=e.pos;if(60!==e.src.charCodeAt(A))return!1;for(l=e.pos,c=e.posMax;;){if(++A>=c)return!1;if(s=e.src.charCodeAt(A),60===s)return!1;if(62===s)break}return n=e.src.slice(l+1,A),i.test(n)?(o=e.md.normalizeLink(n),!!e.md.validateLink(o)&&(t||(a=e.push("link_open","a",1),a.attrs=[["href",o]],a.markup="autolink",a.info="auto",a=e.push("text","",0),a.content=e.md.normalizeLinkText(n),a=e.push("link_close","a",-1),a.markup="autolink",a.info="auto"),e.pos+=n.length+2,!0)):!!r.test(n)&&(o=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(o)&&(t||(a=e.push("link_open","a",1),a.attrs=[["href",o]],a.markup="autolink",a.info="auto",a=e.push("text","",0),a.content=e.md.normalizeLinkText(n),a=e.push("link_close","a",-1),a.markup="autolink",a.info="auto"),e.pos+=n.length+2,!0))}},18314:function(e,t,n){"use strict";n(57658),e.exports=function(e,t){var n,r,i,o,a,s,l,c,A=e.pos,u=e.src.charCodeAt(A);if(96!==u)return!1;n=A,A++,r=e.posMax;while(Aa;r-=p[r]+1)if(o=t[r],o.marker===i.marker&&o.open&&o.end<0&&(l=!1,(o.close||i.open)&&(o.length+i.length)%3===0&&(o.length%3===0&&i.length%3===0||(l=!0)),!l)){c=r>0&&!t[r-1].open?p[r-1]+1:0,p[n]=n-r+c,p[r]=c,i.open=!1,o.end=n,o.close=!1,s=-1,h=-2;break}-1!==s&&(A[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}}n(57658),e.exports=function(e){var t,n=e.tokens_meta,i=e.tokens_meta.length;for(r(e,e.delimiters),t=0;t=0;n--)r=t[n],95!==r.marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1,a=String.fromCharCode(r.marker),o=e.tokens[r.token],o.type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",o=e.tokens[i.token],o.type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}n(57658),e.exports.w=function(e,t){var n,r,i,o=e.pos,a=e.src.charCodeAt(o);if(t)return!1;if(95!==a&&42!==a)return!1;for(r=e.scanDelims(e.pos,42===a),n=0;n=h)return!1;if(n=e.src.charCodeAt(d+1),35===n){if(A=e.src.slice(d).match(s),A)return t||(c="x"===A[1][0].toLowerCase()?parseInt(A[1].slice(1),16):parseInt(A[1],10),u=e.push("text_special","",0),u.content=o(c)?a(c):a(65533),u.markup=A[0],u.info="entity"),e.pos+=A[0].length,!0}else if(A=e.src.slice(d).match(l),A&&i(r,A[1]))return t||(u=e.push("text_special","",0),u.content=r[A[1]],u.markup=A[0],u.info="entity"),e.pos+=A[0].length,!0;return!1}},3097:function(e,t,n){"use strict";n(57658);for(var r=n(58341).isSpace,i=[],o=0;o<256;o++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){i[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o,a,s,l,c=e.pos,A=e.posMax;if(92!==e.src.charCodeAt(c))return!1;if(c++,c>=A)return!1;if(n=e.src.charCodeAt(c),10===n){t||e.push("hardbreak","br",0),c++;while(c=55296&&n<=56319&&c+1=56320&&o<=57343&&(s+=e.src[c+1],c++)),a="\\"+s,t||(l=e.push("text_special","",0),n<256&&0!==i[n]?l.content=s:l.content=a,l.markup=a,l.info="escape"),e.pos=c+1,!0}},88785:function(e){"use strict";e.exports=function(e){var t,n,r=0,i=e.tokens,o=e.tokens.length;for(t=n=0;t0&&r++,"text"===i[t].type&&t+1\s]/i.test(e)}function o(e){return/^<\/a\s*>/i.test(e)}function a(e){var t=32|e;return t>=97&&t<=122}e.exports=function(e,t){var n,s,l,c,A=e.pos;return!!e.md.options.html&&(l=e.posMax,!(60!==e.src.charCodeAt(A)||A+2>=l)&&(n=e.src.charCodeAt(A+1),!(33!==n&&63!==n&&47!==n&&!a(n))&&(s=e.src.slice(A).match(r),!!s&&(t||(c=e.push("html_inline","",0),c.content=e.src.slice(A,A+s[0].length),i(c.content)&&e.linkLevel++,o(c.content)&&e.linkLevel--),e.pos+=s[0].length,!0))))}},51029:function(e,t,n){"use strict";n(57658);var r=n(58341).normalizeReference,i=n(58341).isSpace;e.exports=function(e,t){var n,o,a,s,l,c,A,u,d,h,p,f,g,m="",v=e.pos,b=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(c=e.pos+2,l=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),l<0)return!1;if(A=l+1,A=b)return!1;for(g=A,d=e.md.helpers.parseLinkDestination(e.src,A,e.posMax),d.ok&&(m=e.md.normalizeLink(d.str),e.md.validateLink(m)?A=d.pos:m=""),g=A;A=b||41!==e.src.charCodeAt(A))return e.pos=v,!1;A++}else{if("undefined"===typeof e.env.references)return!1;if(A=0?s=e.src.slice(g,A++):A=l+1):A=l+1,s||(s=e.src.slice(c,l)),u=e.env.references[r(s)],!u)return e.pos=v,!1;m=u.href,h=u.title}return t||(a=e.src.slice(c,l),e.md.inline.parse(a,e.md,e.env,f=[]),p=e.push("image","img",0),p.attrs=n=[["src",m],["alt",""]],p.children=f,p.content=a,h&&n.push(["title",h])),e.pos=A,e.posMax=b,!0}},18973:function(e,t,n){"use strict";n(57658);var r=n(58341).normalizeReference,i=n(58341).isSpace;e.exports=function(e,t){var n,o,a,s,l,c,A,u,d,h="",p="",f=e.pos,g=e.posMax,m=e.pos,v=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(l=e.pos+1,s=e.md.helpers.parseLinkLabel(e,e.pos,!0),s<0)return!1;if(c=s+1,c=g)return!1;if(m=c,A=e.md.helpers.parseLinkDestination(e.src,c,e.posMax),A.ok){for(h=e.md.normalizeLink(A.str),e.md.validateLink(h)?c=A.pos:h="",m=c;c=g||41!==e.src.charCodeAt(c))&&(v=!0),c++}if(v){if("undefined"===typeof e.env.references)return!1;if(c=0?a=e.src.slice(m,c++):c=s+1):c=s+1,a||(a=e.src.slice(l,s)),u=e.env.references[r(a)],!u)return e.pos=f,!1;h=u.href,p=u.title}return t||(e.pos=l,e.posMax=s,d=e.push("link_open","a",1),d.attrs=n=[["href",h]],p&&n.push(["title",p]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,d=e.push("link_close","a",-1)),e.pos=c,e.posMax=g,!0}},5927:function(e,t,n){"use strict";n(57658);var r=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;e.exports=function(e,t){var n,i,o,a,s,l,c,A;return!!e.md.options.linkify&&(!(e.linkLevel>0)&&(n=e.pos,i=e.posMax,!(n+3>i)&&(58===e.src.charCodeAt(n)&&(47===e.src.charCodeAt(n+1)&&(47===e.src.charCodeAt(n+2)&&(o=e.pending.match(r),!!o&&(a=o[1],s=e.md.linkify.matchAtStart(e.src.slice(n-a.length)),!!s&&(l=s.url,l=l.replace(/\*+$/,""),c=e.md.normalizeLink(l),!!e.md.validateLink(c)&&(t||(e.pending=e.pending.slice(0,-a.length),A=e.push("link_open","a",1),A.attrs=[["href",c]],A.markup="linkify",A.info="auto",A=e.push("text","",0),A.content=e.md.normalizeLinkText(l),A=e.push("link_close","a",-1),A.markup="linkify",A.info="auto"),e.pos+=l.length-a.length,!0)))))))))}},29479:function(e,t,n){"use strict";n(57658);var r=n(58341).isSpace;e.exports=function(e,t){var n,i,o,a=e.pos;if(10!==e.src.charCodeAt(a))return!1;if(n=e.pending.length-1,i=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){o=n-1;while(o>=1&&32===e.pending.charCodeAt(o-1))o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);a++;while(a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i},s.prototype.scanDelims=function(e,t){var n,r,s,l,c,A,u,d,h,p=e,f=!0,g=!0,m=this.posMax,v=this.src.charCodeAt(e);n=e>0?this.src.charCodeAt(e-1):32;while(p=0&&(n=this.attrs[t][1]),n},r.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=r},18496:function(e,t,n){"use strict";n(57658);var r={};function i(e){var t,n,i=r[e];if(i)return i;for(i=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),i.push(n);for(t=0;t=55296&&l<=57343?"���":String.fromCharCode(l),t+=6):240===(248&i)&&t+91114111?c+="����":(l-=65536,c+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):c+="�";return c}))}o.defaultChars=";/?:@&=+$,#",o.componentChars="",e.exports=o},76640:function(e,t,n){"use strict";n(57658);var r={};function i(e){var t,n,i=r[e];if(i)return i;for(i=r[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1=56320&&l<=57343)){A+=encodeURIComponent(e[r]+e[r+1]),r++;continue}A+="%EF%BF%BD"}else A+=encodeURIComponent(e[r]);return A}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",e.exports=o},92734:function(e){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}},44389:function(e,t,n){"use strict";e.exports.encode=n(76640),e.exports.decode=n(18496),e.exports.format=n(92734),e.exports.parse=n(48685)},48685:function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}n(57658);var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(s),c=["'"].concat(l),A=["%","/","?",";","#"].concat(c),u=["/","?","#"],d=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function m(e,t){if(e&&e instanceof r)return e;var n=new r;return n.parse(e,t),n}r.prototype.parse=function(e,t){var n,r,o,s,l,c=e;if(c=c.trim(),!t&&1===e.split("#").length){var m=a.exec(c);if(m)return this.pathname=m[1],m[2]&&(this.search=m[2]),this}var v=i.exec(c);if(v&&(v=v[0],o=v.toLowerCase(),this.protocol=v,c=c.substr(v.length)),(t||v||c.match(/^\/\/[^@\/]+@[^@\/]+/))&&(l="//"===c.substr(0,2),!l||v&&f[v]||(c=c.substr(2),this.slashes=!0)),!f[v]&&(l||v&&!g[v])){var b,y,w=-1;for(n=0;n127?_+="x":_+=B[E];if(!_.match(h)){var F=C.slice(0,n),T=C.slice(n+1),M=B.match(p);M&&(F.push(M[1]),T.unshift(M[2])),T.length&&(c=T.join(".")+c),this.hostname=F.join(".");break}}}}this.hostname.length>d&&(this.hostname=""),k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var I=c.indexOf("#");-1!==I&&(this.hash=c.substr(I),c=c.slice(0,I));var N=c.indexOf("?");return-1!==N&&(this.search=c.substr(N),c=c.slice(0,N)),c&&(this.pathname=c),g[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(e){var t=o.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=m},77209:function(e,t,n){var r,i; /*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08 * http://photoswipe.com * Copyright (c) 2019 Dmitry Semenov; */(function(o,a){r=a,i="function"===typeof r?r.call(t,n,t,e):r,void 0===i||(e.exports=i)})(0,(function(){"use strict";var e=function(e,t){var n,r,i,o,a,s,l,c,A,u,d,h,p,f,g,m,v,b,y=this,w=!1,x=!0,k=!0,C={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return e.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return e.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},B=function(e){if(m)return!0;e=e||window.event,g.timeToIdle&&g.mouseUsed&&!A&&L();for(var n,r,i=e.target||e.srcElement,o=i.getAttribute("class")||"",a=0;a-1&&(n.onTap(),r=!0);if(r){e.stopPropagation&&e.stopPropagation(),m=!0;var s=t.features.isOldAndroid?600:30;setTimeout((function(){m=!1}),s)}},_=function(){return!e.likelyTouchDevice||g.mouseUsed||screen.width>g.fitControlsWidth},E=function(e,n,r){t[(r?"add":"remove")+"Class"](e,"pswp__"+n)},S=function(){var e=1===g.getNumItemsFn();e!==f&&(E(r,"ui--one-slide",e),f=e)},F=function(){E(l,"share-modal--hidden",k)},T=function(){return k=!k,k?(t.removeClass(l,"pswp__share-modal--fade-in"),setTimeout((function(){k&&F()}),300)):(F(),setTimeout((function(){k||t.addClass(l,"pswp__share-modal--fade-in")}),30)),k||I(),!1},M=function(t){t=t||window.event;var n=t.target||t.srcElement;return e.shout("shareLinkClick",t,n),!!n.href&&(!!n.hasAttribute("download")||(window.open(n.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),k||T(),!1))},I=function(){for(var e,t,n,r,i,o="",a=0;a