(window.webpackJsonp=window.webpackJsonp||[]).push([[255,5,6,7],{"+NIl":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.defineMode("stex",function($,P){"use strict";function Y(u,l){u.cmdState.push(l)}function j(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function U(u){var l=u.cmdState.pop();l&&l.closeBracket()}function z(u){for(var l=u.cmdState,d=l.length-1;d>=0;d--){var o=l[d];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(u,l,d){return function(){this.name=u,this.bracketNo=0,this.style=l,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=G("importmodule","tag",["string","builtin"]),n.documentclass=G("documentclass","tag",["","atom"]),n.usepackage=G("usepackage","tag",["atom"]),n.begin=G("begin","tag",["atom"]),n.end=G("end","tag",["atom"]),n.label=G("label","tag",["atom"]),n.ref=G("ref","tag",["atom"]),n.eqref=G("eqref","tag",["atom"]),n.cite=G("cite","tag",["atom"]),n.bibitem=G("bibitem","tag",["atom"]),n.Bibitem=G("Bibitem","tag",["atom"]),n.RBibitem=G("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(u,l){u.f=l}function v(u,l){var d;if(u.match(/^\\[a-zA-Z@]+/)){var o=u.current().slice(1);return d=n.hasOwnProperty(o)?n[o]:n.DEFAULT,d=new d,Y(l,d),R(l,p),d.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return R(l,function(s,a){return m(s,a,"\\]")}),"keyword";if(u.match("\\("))return R(l,function(s,a){return m(s,a,"\\)")}),"keyword";if(u.match("$$"))return R(l,function(s,a){return m(s,a,"$$")}),"keyword";if(u.match("$"))return R(l,function(s,a){return m(s,a,"$")}),"keyword";var h=u.next();if(h=="%")return u.skipToEnd(),"comment";if(h=="}"||h=="]"){if(d=j(l),d)d.closeBracket(h),R(l,p);else return"error";return"bracket"}else return h=="{"||h=="["?(d=n.DEFAULT,d=new d,Y(l,d),"bracket"):/\d/.test(h)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),d=z(l),d.name=="begin"&&(d.argument=u.current()),d.styleIdentifier())}function m(u,l,d){if(u.eatSpace())return null;if(d&&u.match(d))return R(l,v),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=u.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(u.skipToEnd(),"comment"):"error"}function p(u,l){var d=u.peek(),o;return d=="{"||d=="["?(o=j(l),o.openBracket(d),u.eat(d),R(l,v),"bracket"):/[ \t\r]/.test(d)?(u.eat(d),null):(R(l,v),U(l),v(u,l))}return{startState:function(){var u=P.inMathMode?function(l,d){return m(l,d)}:v;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,l){return l.f(u,l)},blankLine:function(u){u.f=v,u.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(ot,xe,Z){},"/cxE":function(ot,xe,Z){"use strict";Z.d(xe,"f",function(){return P}),Z.d(xe,"g",function(){return Y}),Z.d(xe,"h",function(){return j}),Z.d(xe,"e",function(){return z}),Z.d(xe,"b",function(){return G}),Z.d(xe,"c",function(){return n}),Z.d(xe,"d",function(){return R}),Z.d(xe,"a",function(){return v});class re{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const $=new re;function P(m){z(m)||$.onUnexpectedError(m);return}function Y(m){z(m)||$.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:u}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:u,stack:l}}return m}const U="Canceled";function z(m){return m instanceof Error&&m.name===U&&m.message===U}function G(){const m=new Error(U);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function R(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){re.defineOption("placeholder","",function(G,n,R){var v=R&&R!=re.Init;if(n&&!v)G.on("blur",j),G.on("change",U),G.on("swapDoc",U),re.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){Y(G)}),U(G);else if(!n&&v){G.off("blur",j),G.off("change",U),G.off("swapDoc",U),re.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),$(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}n&&!G.hasFocus()&&j(G)});function $(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){$(G);var n=G.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=G.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),n.appendChild(R),G.display.lineSpace.insertBefore(n,G.display.lineSpace.firstChild)}function Y(G){setTimeout(function(){var n=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?n=!R.value:G.lineCount()==1&&(n=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),n?P(G):$(G)},20)}function j(G){z(G)&&P(G)}function U(G){var n=G.getWrapperElement(),R=z(G);n.className=n.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(G):$(G)}function z(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(Y,j){var U=Y.indentUnit,z={},G=j.htmlMode?$:P;for(var n in G)z[n]=G[n];for(var n in j)z[n]=j[n];var R,v;function m(f,C){function y(F){return C.tokenize=F,F(f,C)}var b=f.next();if(b=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?y(l("atom","]]>")):null:f.match("--")?y(l("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),y(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=l("meta","?>"),"meta"):(R=f.eat("/")?"closeTag":"openTag",C.tokenize=p,"tag bracket");if(b=="&"){var B;return f.eat("#")?f.eat("x")?B=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):B=f.eatWhile(/[\d]/)&&f.eat(";"):B=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),B?"atom":"error"}else return f.eatWhile(/[^&<]/),null}m.isInText=!0;function p(f,C){var y=f.next();if(y==">"||y=="/"&&f.eat(">"))return C.tokenize=m,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){C.tokenize=m,C.state=a,C.tagName=C.tagStart=null;var b=C.tokenize(f,C);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(C.tokenize=u(y),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var C=function(y,b){for(;!y.eol();)if(y.next()==f){b.tokenize=p;break}return"string"};return C.isInAttribute=!0,C}function l(f,C){return function(y,b){for(;!y.eol();){if(y.match(C)){b.tokenize=m;break}y.next()}return f}}function d(f){return function(C,y){for(var b;(b=C.next())!=null;){if(b=="<")return y.tokenize=d(f+1),y.tokenize(C,y);if(b==">")if(f==1){y.tokenize=m;break}else return y.tokenize=d(f-1),y.tokenize(C,y)}return"meta"}}function o(f,C,y){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=y,(z.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function h(f){f.context&&(f.context=f.context.prev)}function s(f,C){for(var y;;){if(!f.context)return;if(y=f.context.tagName,!z.contextGrabbers.hasOwnProperty(y)||!z.contextGrabbers[y].hasOwnProperty(C))return;h(f)}}function a(f,C,y){return f=="openTag"?(y.tagStart=C.column(),A):f=="closeTag"?E:a}function A(f,C,y){return f=="word"?(y.tagName=C.current(),v="tag",L):z.allowMissingTagName&&f=="endTag"?(v="tag bracket",L(f,C,y)):(v="error",A)}function E(f,C,y){if(f=="word"){var b=C.current();return y.context&&y.context.tagName!=b&&z.implicitlyClosed.hasOwnProperty(y.context.tagName)&&h(y),y.context&&y.context.tagName==b||z.matchClosing===!1?(v="tag",T):(v="tag error",D)}else return z.allowMissingTagName&&f=="endTag"?(v="tag bracket",T(f,C,y)):(v="error",D)}function T(f,C,y){return f!="endTag"?(v="error",T):(h(y),a)}function D(f,C,y){return v="error",T(f,C,y)}function L(f,C,y){if(f=="word")return v="attribute",w;if(f=="endTag"||f=="selfcloseTag"){var b=y.tagName,B=y.tagStart;return y.tagName=y.tagStart=null,f=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new o(y,b,B==y.indented)),a}return v="error",L}function w(f,C,y){return f=="equals"?O:(z.allowMissing||(v="error"),L(f,C,y))}function O(f,C,y){return f=="string"?S:f=="word"&&z.allowUnquoted?(v="string",L):(v="error",L(f,C,y))}function S(f,C,y){return f=="string"?S:L(f,C,y)}return{startState:function(f){var C={tokenize:m,state:a,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;R=null;var y=C.tokenize(f,C);return(y||R)&&y!="comment"&&(v=null,C.state=C.state(R||y,f,C),v&&(y=v=="error"?y+" error":v)),y},indent:function(f,C,y){var b=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+U;if(b&&b.noIndent)return re.Pass;if(f.tokenize!=p&&f.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(f.tagName)return z.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+U*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/$/,blockCommentStart:"",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(f){f.state==O&&(f.state=L)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],y=f.context;y;y=y.prev)y.tagName&&C.push(y.tagName);return C.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});class re{constructor(P){this.element=P,this.next=re.Undefined,this.prev=re.Undefined}}re.Undefined=new re(void 0);class ${constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let P=this._first;for(;P!==re.Undefined;){const Y=P.next;P.prev=re.Undefined,P.next=re.Undefined,P=Y}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,Y){const j=new re(P);if(this._first===re.Undefined)this._first=j,this._last=j;else if(Y){const z=this._last;this._last=j,j.prev=z,z.next=j}else{const z=this._first;this._first=j,j.next=z,z.prev=j}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===re.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===re.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==re.Undefined&&P.next!==re.Undefined){const Y=P.prev;Y.next=P.next,P.next.prev=Y}else P.prev===re.Undefined&&P.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):P.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):P.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==re.Undefined;)yield P.element,P=P.next}}},"3/fG":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return $});function re(P,Y){let j;return Y.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,z){const G=z[0];return typeof Y[G]!="undefined"?Y[G]:U}),j}function $(P,Y,...j){return re(Y,j)}},"5VLF":function(ot,xe,Z){"use strict";var re,$;function P(Y,j,U){var z=function(G,n){return Y.js_beautify(G,n)};return z.js=Y.js_beautify,z.css=j.css_beautify,z.html=U.html_beautify,z.js_beautify=Y.js_beautify,z.css_beautify=j.css_beautify,z.html_beautify=U.html_beautify,z}!(re=[Z("6UM0"),Z("TXwP"),Z("psGv")],$=function(Y,j,U){return P(Y,j,U)}.apply(xe,re),$!==void 0&&(ot.exports=$))},"5Y4S":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var re=Z("MNsG");const $=re.b.performance&&typeof re.b.performance.now=="function";class P{constructor(Y){this._highResolution=$&&Y,this._startTime=this._now(),this._stopTime=-1}static create(Y=!0){return new P(Y)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?re.b.performance.now():Date.now()}}},"6UM0":function(ot,xe,Z){var re,$;(function(){var P;(function(){"use strict";var j=[function(n,R,v){var m=v(1).Beautifier,p=v(5).Options;function u(l,d){var o=new m(l,d);return o.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new p}},function(n,R,v){var m=v(2).Output,p=v(3).Token,u=v(4),l=v(5).Options,d=v(7).Tokenizer,o=v(7).line_starters,h=v(7).positionable_operators,s=v(7).TOKEN;function a(g,W){return W.indexOf(g)!==-1}function A(g){return g.replace(/^\s+/g,"")}function E(g){for(var W={},J=0;JJ&&(J=g.line_indent_level));var ie={mode:W,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:J,alignment:0,line_indent_level:g?g.line_indent_level:J,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},N.prototype._reset=function(g){var W=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var J=new d(g,this._options);return this._tokens=J.tokenize(),g},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,W=this._reset(this._source_text),J=this._options.eol;this._options.eol==="auto"&&(J=`
`,W&&u.lineBreak.test(W||"")&&(J=W.match(u.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return g=this._output.get_code(J),g},N.prototype.handle_token=function(g,W){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,W):g.type===s.COMMENT?this.handle_comment(g,W):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,W):this.handle_unknown(g,W)},N.prototype.handle_whitespace_and_comments=function(g,W){var J=g.newlines,ie=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var ue=g.comments_before.next();ue;)this.handle_whitespace_and_comments(ue,W),this.handle_token(ue,W),ue=g.comments_before.next();if(ie)for(var Re=0;Re0,W);else if(this._options.max_preserve_newlines&&J>this._options.max_preserve_newlines&&(J=this._options.max_preserve_newlines),this._options.preserve_newlines&&J>1){this.print_newline(!1,W);for(var ve=1;ve0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},N.prototype.start_of_statement=function(g){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,W=W||T(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&D(this._flags.last_token,I)&&!g.newlines,W=W||T(this._flags.last_token,"else")&&!(T(g,"if")&&!g.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,W=W||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},N.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var W=f.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=f.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=f.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=f.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var J=this._tokens.peek(-3);if(this._options.space_after_named_function&&J){var ie=this._tokens.peek(-4);D(J,["async","function"])||J.text==="*"&&D(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(J.text==="{"||J.text===","||J.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},N.prototype.handle_end_expr=function(g){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},N.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var W=this._tokens.peek(),J=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):J&&(a(J.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a(J.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(J.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!W.comments_before&&W.text==="}",ue=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,ve=null;this._flags.inline_frame=!0;do if(Re+=1,ve=this._tokens.peek(Re-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==s.EOF&&!(ve.type===s.END_BLOCK&&ve.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ue||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},N.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===f.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},N.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===f.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(T(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),T(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var J="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?J="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?J="NEWLINE":(J="SPACE",this._output.space_before_token=!0):J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===f.BlockStatement?J="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?J="SPACE":this._flags.last_token.type===s.STRING?J="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&a(this._last_last_text,["{",","]))?J="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?J="SPACE":J="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,J="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?J="SPACE":J="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else J==="NEWLINE"?D(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(g,"if")&&T(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():J==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(g,"from")&&(this._flags.import_block=!1))},N.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},N.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},N.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},N.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(B(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},N.prototype.handle_operator=function(g){var W=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),J=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ie=!W;this.handle_whitespace_and_comments(g,ie)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,S)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ue=!0,Re=!0,ve=!1;if(g.text===":"?this._flags.ternary_depth===0?ue=!1:(this._flags.ternary_depth-=1,ve=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!J&&!W&&this._options.preserve_newlines&&a(g.text,h)){var Se=g.text===":",Le=Se&&ve,be=Se&&!ve;switch(this._options.operator_position){case O.before_newline:this._output.space_before_token=!be,this.print_token(g),(!Se||Le)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case O.after_newline:this._output.space_before_token=!0,!Se||Le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case O.preserve_newline:be||this.allow_wrap_or_preserved_newline(g),ue=!(this._output.just_added_newline()||be),this._output.space_before_token=ue,this.print_token(g),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(g),ue=!1;var ce=this._tokens.peek();Re=ce&&a(ce.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),ue=this._flags.last_token.type===s.START_BLOCK,Re=!1;else if(a(g.text,["--","++","!","~"])||J){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),ue=!1,Re=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var he=D(this._flags.last_token,L)&&g.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ue=!0),this._flags.last_token.type===s.RESERVED?ue=!0:this._flags.last_token.type===s.END_EXPR?ue=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ue=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ue,this.print_token(g),this._output.space_before_token=Re},N.prototype.handle_block_comment=function(g,W){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,W),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,W)},N.prototype.print_block_commment=function(g,W){var J=y(g.text),ie,ue=!1,Re=!1,ve=g.whitespace_before,Se=ve.length;if(this.print_newline(!1,W),this.print_token_line_indentation(g),this._output.add_token(J[0]),this.print_newline(!1,W),J.length>1){for(J=J.slice(1),ue=F(J,"*"),Re=x(J,ve),ue&&(this._flags.alignment=1),ie=0;ie=0;u--)if(this.__items[u].match(p))return!0;return!1},R.prototype.set_indent=function(p,u){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var u=p.lastIndexOf(`
`);u!==-1?this.__character_count=p.length-u:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,u){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),u=u||"",p.indent_level>0&&(u=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}v.prototype.get_indent_size=function(p,u){var l=this.__base_string_length;return u=u||0,p<0&&(l=0),l+=p*this.__indent_size,l+=u,l},v.prototype.get_indent_string=function(p,u){var l=this.__base_string;return u=u||0,p<0&&(p=0,l=""),u+=p*this.__indent_size,this.__ensure_cache(u),l+=this.__cache[u],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,u=0,l="";this.__indent_size&&p>=this.__indent_size&&(u=Math.floor(p/this.__indent_size),p-=u*this.__indent_size,l=new Array(u+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,u){this.__indent_cache=new v(p,u),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,u){return this.__indent_cache.get_indent_string(p,u)},m.prototype.get_indent_size=function(p,u){return this.__indent_cache.get_indent_size(p,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return p!==`
`&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,u){return p=p||0,u=u||0,this.next_line.set_indent(p,u),this.__lines.length>1?(this.current_line.set_indent(p,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,u){for(var l=this.__lines.length-2;l>=0;){var d=this.__lines[l];if(d.is_empty())break;if(d.item(0).indexOf(p)!==0&&d.item(-1)!==u){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},n.exports.Output=m},function(n){function R(v,m,p,u){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=R},function(n,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])*";R.identifier=new RegExp(l+d,"g"),R.identifierStart=new RegExp(l),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+u+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(n,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function u(l){m.call(this,l,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var h=0;h>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var O=new RegExp(w),S="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=S.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),y,b=function(F,x){p.call(this,F,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var N=new o(this._input),I=new h(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(d.identifier).matching(d.identifierMatch),number:N.matching(E),punct:N.matching(O),comment:N.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:N.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:N.matching(//),include:N.starting_with(/#include/).until_after(d.lineBreak),shebang:N.starting_with(/#!/).until_after(d.lineBreak),xml:N.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,x){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&x&&(F.text==="]"&&x.text==="["||F.text===")"&&x.text==="("||F.text==="}"&&x.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,x){var N=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(N=N||this._read_non_javascript(I),N=N||this._read_string(I),N=N||this._read_word(F),N=N||this._read_singles(I),N=N||this._read_comment(I),N=N||this._read_regexp(I,F),N=N||this._read_xml(I,F),N=N||this._read_punctuation(),N=N||this._create_token(a.UNKNOWN,this._input.next()),N)},b.prototype._read_word=function(F){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(d.allLineBreaks,`
`),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&C.test(x)?(x==="in"||x==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,x):this._create_token(a.RESERVED,x):this._create_token(a.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(a.WORD,x)},b.prototype._read_singles=function(F){var x=null;return F==="("||F==="["?x=this._create_token(a.START_EXPR,F):F===")"||F==="]"?x=this._create_token(a.END_EXPR,F):F==="{"?x=this._create_token(a.START_BLOCK,F):F==="}"?x=this._create_token(a.END_BLOCK,F):F===";"?x=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?x=this._create_token(a.DOT,F):F===","&&(x=this._create_token(a.COMMA,F)),x&&this._input.next(),x},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var x="";if(F==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(a.UNKNOWN,x.trim()+`
`);if(x=this.__patterns.include.read(),x)return this._create_token(a.UNKNOWN,x.trim()+`
`);F=this._input.next();var N="#";if(this._input.hasNext()&&this._input.testChar(T)){do F=this._input.next(),N+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(N+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(N+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,N)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)x+=this._input.next();return y=!0,this._create_token(a.COMMENT,x)}}else if(y&&F==="-"&&(x=this.__patterns.html_comment_end.read(),x))return y=!1,this._create_token(a.COMMENT,x);return null},b.prototype._read_comment=function(F){var x=null;if(F==="/"){var N="";if(this._input.peek(1)==="*"){N=this.__patterns.block_comment.read();var I=A.get_directives(N);I&&I.ignore==="start"&&(N+=A.readIgnored(this._input)),N=N.replace(d.allLineBreaks,`
`),x=this._create_token(a.BLOCK_COMMENT,N),x.directives=I}else this._input.peek(1)==="/"&&(N=this.__patterns.comment.read(),x=this._create_token(a.COMMENT,N))}return x},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var x=this._input.next();return this.has_char_escapes=!1,F==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(x=B(x)),this._input.peek()===F&&(x+=this._input.next()),x=x.replace(d.allLineBreaks,`
`),this._create_token(a.STRING,x)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,x){if(F==="/"&&this._allow_regexp_or_xml(x)){for(var N=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(d.newline);)N+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(N+=this._input.next(),N+=this._input.read(d.identifier)),this._create_token(a.STRING,N)}return null},b.prototype._read_xml=function(F,x){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(x)){var N="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=g.indexOf("{")===0,J=0;I;){var ie=!!I[1],ue=I[2],Re=!!I[I.length-1]||ue.slice(0,8)==="![CDATA[";if(!Re&&(ue===g||W&&ue.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--J:++J),N+=I[0],J<=0)break;I=this.__patterns.xml.read_match()}return I||(N+=this._input.match(/[\s\S]*/g)[0]),N=N.replace(d.allLineBreaks,`
`),this._create_token(a.STRING,N)}}return null};function B(F){for(var x="",N=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(x+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",I.hasNext()&&(x+=I.next());continue}if(!g)return F;if(N=parseInt(g[1],16),N>126&&N<=255&&g[0].indexOf("x")===0)return F;if(N>=0&&N<32){x+="\\"+g[0];continue}else N===34||N===39||N===92?x+="\\"+String.fromCharCode(N):x+=String.fromCharCode(N)}return x}b.prototype._read_string_recursive=function(F,x,N){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var W=g.read(),J="";this._input.hasNext();){if(J=this._input.next(),J===F||!x&&d.newline.test(J)){this._input.back();break}else J==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),J+=this._input.next()):N&&(N==="${"&&J==="$"&&this._input.peek()==="{"&&(J+=this._input.next()),N===J&&(F==="`"?J+=this._read_string_recursive("}",x,"`"):J+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(J+=this._input.next())));J+=g.read(),W+=J}return W},n.exports.Tokenizer=b,n.exports.TOKEN=a,n.exports.positionable_operators=L.slice(),n.exports.line_starters=S.slice()},function(n){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},n.exports.InputScanner=v},function(n,R,v){var m=v(8).InputScanner,p=v(3).Token,u=v(10).TokenStream,l=v(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(h,s){this._input=new m(h),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var h,s=new p(d.START,""),a=null,A=[],E=new u;s.type!==d.EOF;){for(h=this._get_next_token(s,a);this._is_comment(h);)E.add(h),h=this._get_next_token(s,a);E.isEmpty()||(h.comments_before=E,E=new u),h.parent=a,this._is_opening(h)?(A.push(a),a=h):a&&this._is_closing(h,a)&&(h.opened=a,a.closed=h,a=A.pop(),h.parent=a),h.previous=s,s.next=h,this.__tokens.add(h),s=h}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(h,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(d.RAW,a):this._create_token(d.EOF,"")},o.prototype._is_comment=function(h){return!1},o.prototype._is_opening=function(h){return!1},o.prototype._is_closing=function(h,s){return!1},o.prototype._create_token=function(h,s){var a=new p(h,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=o,n.exports.TOKEN=d},function(n){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&v/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new m,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(l){var d=this._create();return d._disabled[l]=!0,d._update(),d},u.prototype.read_options=function(l){var d=this._create();for(var o in p)d._disabled[o]=l.templating.indexOf(o)===-1;return d._update(),d},u.prototype.exclude=function(l){var d=this._create();return d._excluded[l]=!0,d._update(),d},u.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),l+=d,d=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},u.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},u.prototype._read_template=function(){var l="",d=this._input.peek();if(d==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},n.exports.TemplatablePattern=u}],U={};function z(n){var R=U[n];if(R!==void 0)return R.exports;var v=U[n]={exports:{}};return j[n](v,v.exports,z),v.exports}var G=z(0);P=G})();var Y=P;!(re=[],$=function(){return{js_beautify:Y}}.apply(xe,re),$!==void 0&&(ot.exports=$))})()},"746U":function(ot,xe,Z){"use strict";Z.d(xe,"f",function(){return re}),Z.d(xe,"l",function(){return $}),Z.d(xe,"k",function(){return P}),Z.d(xe,"j",function(){return Y}),Z.d(xe,"g",function(){return j}),Z.d(xe,"m",function(){return U}),Z.d(xe,"h",function(){return z}),Z.d(xe,"n",function(){return G}),Z.d(xe,"c",function(){return n}),Z.d(xe,"a",function(){return R}),Z.d(xe,"i",function(){return v}),Z.d(xe,"o",function(){return m}),Z.d(xe,"e",function(){return l}),Z.d(xe,"d",function(){return d}),Z.d(xe,"p",function(){return o}),Z.d(xe,"b",function(){return h});function re(s){return Array.isArray(s)}function $(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Y(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function z(s){return!G(s)}function G(s){return U(s)||s===null}function n(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(G(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const A=Math.min(s.length,a.length);for(let E=0;Efunction(){const D=Array.prototype.slice.call(arguments,0);return a(T,D)};let E={};for(const T of s)E[T]=A(T);return E}function o(s){return s===null?void 0:s}function h(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(ot,xe,Z){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function P(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re($)}var Y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function j(p){return typeof p=="string"&&Y.test(p)}for(var U=j,z=[],G=0;G<256;++G)z.push((G+256).toString(16).substr(1));function n(p){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(z[p[u+0]]+z[p[u+1]]+z[p[u+2]]+z[p[u+3]]+"-"+z[p[u+4]]+z[p[u+5]]+"-"+z[p[u+6]]+z[p[u+7]]+"-"+z[p[u+8]]+z[p[u+9]]+"-"+z[p[u+10]]+z[p[u+11]]+z[p[u+12]]+z[p[u+13]]+z[p[u+14]]+z[p[u+15]]).toLowerCase();if(!U(l))throw TypeError("Stringified UUID is invalid");return l}var R=n;function v(p,u,l){p=p||{};var d=p.random||(p.rng||P)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,u){l=l||0;for(var o=0;o<16;++o)u[l+o]=d[o];return u}return R(d)}var m=xe.a=v},"7ahc":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return A});var re=Z("k1fw"),$=Z("0Owb"),P=Z("+L6B"),Y=Z("2/Rp"),j=Z("y8nQ"),U=Z("Vl3Y"),z=Z("tJVT"),G=Z("OaEy"),n=Z("2fM7"),R=Z("q1tI"),v=Z.n(R),m=Z("VrN/"),p=Z.n(m),u=Z("p77/"),l=Z.n(u),d=Z("c5Ni"),o=Z.n(d),h=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};xe.b=function(E){var T=E.callback,D=E.onCancel,L=Object(R.useState)("python"),w=Object(z.a)(L,2),O=w[0],S=w[1];function f(y){S(a[y][1])}function C(y){T(y)}return v.a.createElement(U.a,Object($.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(n.a,{onChange:f},Object.keys(a).map(function(y){return v.a.createElement(h,{key:y,value:y},a[y][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(A,{mode:O})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(Y.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function A(E){var T=E.value,D=E.onChange,L=E.mode,w=E.options,O=w===void 0?{}:w,S=Object(R.useRef)(),f=Object(R.useState)(),C=Object(z.a)(f,2),y=C[0],b=C[1];return Object(R.useEffect)(function(){if(y){function B(F){var x=F.getValue();D&&D(x)}return y.on("change",B),function(){y.off("change",B)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(R.useEffect)(function(){y&&((T!==y.getValue()||T==="")&&setTimeout(function(){y.setValue(T||" ")},300))},[y,T]),Object(R.useEffect)(function(){if(S.current&&!y){var B=p.a.fromTextArea(S.current,Object(re.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},O));b(B)}},[S.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:S}))}},"8EBN":function(ot,xe,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";re.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"]},{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"]},{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 $=0;$-1&&Y.substring(z+1,Y.length);if(G)return re.findModeByExtension(G)},re.findModeByName=function(Y){Y=Y.toLowerCase();for(var j=0;j=H.length?ee.slice(H.length):ee}).join(`
`)}var o=[],h=[""],s=new u.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){o.length=0,h=[""]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(X,_,k,H){if(_>=X.length||X[_].level<=k)return _;var ee=X[_];H.push("- "+ee.text+""),_++;var V=[];return _=T(X,_,ee.level,V),V.length>0&&(H.push("
"),V.forEach(function(Ee){H.push(Ee)}),H.push("
")),H.push(" "),_=T(X,_,k,H),_}function D(){return T(o,0,0,h),h.push("
"),h.join("")}var L={heading:function(_){var k=a.exec(_);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(_){var k=this.rules.block.fences.exec(_);if(k){var H=k[0],ee=d(H,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Ee=S(),Ke=ee;ee=Ee,f[Ee]={type:"block",expression:Ke}}return{type:"code",raw:H,lang:V,text:ee}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,O=0,S=function(){return"__special_katext_id_".concat(O++,"__")},f={};function C(){return f}function y(){O=0,f={}}function b(X){return X=X.replace(w,function(_,k){var H=S();return f[H]={type:"inline",expression:k},H}),X}var B=s.listitem;s.listitem=function(X){return B(b(X))};var F=s.paragraph;s.paragraph=function(X){return F(b(X))};var x=s.tablecell;s.tablecell=function(X,_){return x(b(X),_)},s.code=function(X,_,k){var H=(_||"").match(/\S*/)[0];return H?["latex","katex","math"].indexOf(H)>=0?"".concat(X,"
"):'
').concat(k?X:Object(l.escape)(X,!0),`
`):''+(k?X:Object(l.escape)(X,!0))+"
"},s.heading=function(X,_,k){var H=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:H,level:_,text:X}),"'+X+""},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:L,renderer:s});var N=u.a,I=Z("SJMd"),g=Z("ulZh"),W=Z.n(g),J=Z("m3rI"),ie=Z("Oy/b"),ue=Z("p5ED"),Re=Z("ErOA");/*! *****************************************************************************
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 ve=function(X,_){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,H){k.__proto__=H}||function(k,H){for(var ee in H)Object.prototype.hasOwnProperty.call(H,ee)&&(k[ee]=H[ee])})(X,_)};function Se(X,_){function k(){this.constructor=X}ve(X,_),X.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}function Le(X,_,k,H){return new(k||(k=Promise))(function(ee,V){function Ee(vt){try{it(H.next(vt))}catch(Ve){V(Ve)}}function Ke(vt){try{it(H.throw(vt))}catch(Ve){V(Ve)}}function it(vt){var Ve;vt.done?ee(vt.value):(Ve=vt.value,Ve instanceof k?Ve:new k(function(Tt){Tt(Ve)})).then(Ee,Ke)}it((H=H.apply(X,_||[])).next())})}function be(X,_){var k,H,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(it){return function(vt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,H&&(ee=2&Ve[0]?H.return:Ve[0]?H.throw||((ee=H.return)&&ee.call(H),0):H.next)&&!(ee=ee.call(H,Ve[1])).done)return ee;switch(H=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,H=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]',"select"),this.addActionButton(H,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(H,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(H,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(H,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(H,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(H,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(H,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var Ee=document.createElement("div");Ee.className=""+k.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",V.typeName),Ee.innerHTML=V.icon,Ee.addEventListener("click",function(){k.markerToolbarButtonClicked(Ee,V)}),k.buttons.push(Ee),k.markerButtons.push(Ee)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'',"render"),this.addActionButton(ee,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(_){this.buttonClickListeners.push(_)},X.prototype.removeButtonClickListener=function(_){this.buttonClickListeners.indexOf(_)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(_),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var _=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k0&&this.buttonClickListeners.forEach(function(H){return H("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(_,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(H){return H("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(_){this.resetButtonStyles(),_.className=_.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),_.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(_){var k=this.markerButtons.find(function(H){return H.getAttribute("data-type-name")===_});k&&this.setActiveButton(k)},X.prototype.setCurrentMarker=function(_){var k=this;this.currentMarker=_,this.buttons.filter(function(H){return/delete|notes/.test(H.getAttribute("data-action"))}).forEach(function(H){k.currentMarker===void 0?(H.style.fillOpacity="0.4",H.style.pointerEvents="none"):(H.style.fillOpacity="1",H.style.pointerEvents="all")})},X}(),Be=function(){function X(_,k,H,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=_,this.displayMode=k,this.uiStyleSettings=H,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var _;this.toolboxStyleClass=this.styles.addClass(new Ae("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-panel-row_colors",`
background-color: `+((_=this.uiStyleSettings.toolboxBackgroundColor)!==null&&_!==void 0?_:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(_){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=_,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(_){var k,H,ee=this;this.panels=_,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ee;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(_){var k=this,H=-1;if(_!==this.activePanel){H=this.panels.indexOf(_),this.panelRow.innerHTML="";var ee=_.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=_}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ee){var Ke,it;V.className=k.toolboxButtonStyleClass.name+" "+(Ee===H?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((it=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&it!==void 0?it:k.toolboxButtonStyleColorsClass.name))})},X}(),oe=function(X,_){this.title=X,this.icon=_},ge=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||this;return Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=H,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);H.appendChild(V),k.colorBoxes.push(V)}),H},_.prototype.getColorBox=function(k){var H=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=V-2+"px",Ee.style.height=V-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(V+2)/2+"px",Ee.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){H.setCurrentColor(k,Ee)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.innerHTML=``),Ee.appendChild(Ke),Ee},_.prototype.setCurrentColor=function(k,H){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},_}(oe),Oe=function(){function X(_,k,H){this._state="new",this._isSelected=!1,this._container=_,this._overlayContainer=k,this.globalSettings=H,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(_){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(_,k){},X.prototype.dblClick=function(_,k){},X.prototype.manipulate=function(_){},X.prototype.pointerUp=function(_){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(_){this.container.childNodes.length>0?this.container.insertBefore(_,this.container.childNodes[0]):this.container.appendChild(_)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(_){this._state=_.state,this.notes=_.notes},X.prototype.scale=function(_,k){},X.prototype.colorChanged=function(_){this.onColorChanged&&this.onColorChanged(_),this.stateChanged()},X.prototype.fillColorChanged=function(_){this.onFillColorChanged&&this.onFillColorChanged(_),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var _=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),_.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(_)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Ie=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(_){return this.topLeft.ownsTarget(_)?this.topLeft:this.topCenter.ownsTarget(_)?this.topCenter:this.topRight.ownsTarget(_)?this.topRight:this.centerLeft.ownsTarget(_)?this.centerLeft:this.centerRight.ownsTarget(_)?this.centerRight:this.bottomLeft.ownsTarget(_)?this.bottomLeft:this.bottomCenter.ownsTarget(_)?this.bottomCenter:this.bottomRight.ownsTarget(_)?this.bottomRight:void 0},X}(),He=function(){function X(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},X}(),Xe=function(){function X(){}return X.toITransformMatrix=function(_){return{a:_.a,b:_.b,c:_.c,d:_.d,e:_.e,f:_.f}},X.toSVGMatrix=function(_,k){return _.a=k.a,_.b=k.b,_.c=k.c,_.d=k.d,_.e=k.e,_.f=k.f,_},X}(),qe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return Se(_,X),Object.defineProperty(_.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var H=he.createTransform();this._visual.transform.baseVal.appendItem(H)},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(H),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},_.prototype.pointerUp=function(k){var H=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",H==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},_.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},_.prototype.manipulate=function(k){var H=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(H.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(H.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(H):this.state==="rotate"&&this.rotate(k)},_.prototype.resize=function(k){var H=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:H=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-H;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=H,this.width=ee):(this.left=H+ee,this.width=-ee),Ee>=0?(this.top=V,this.height=Ee):(this.top=V+Ee,this.height=-Ee),this.setSize()},_.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},_.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var H=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*H,this.applyRotation()}},_.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},_.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var H=this.container.getCTM(),ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(H)).x,y:ee.y}},_.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var H=this.container.getCTM();H=H.inverse();var ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(H)).x,y:ee.y}},_.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var k=he.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=he.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=he.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},_.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},_.prototype.createGrip=function(){var k=new He;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},_.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,H=-k/2,ee=H,V=(this.width+this.CB_DISTANCE)/2-k/2,Ee=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,it=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,H,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,it,ee),this.positionGrip(this.controlGrips.centerLeft.visual,H,Ee),this.positionGrip(this.controlGrips.centerRight.visual,it,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,H,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,it,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},_.prototype.positionGrip=function(k,H,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(H,ee),k.transform.baseVal.replaceItem(V,0)},_.prototype.hideControlBox=function(){this.controlBox.style.display="none"},_.prototype.showControlBox=function(){this.controlBox.style.display=""},_.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.left=H.left,this.top=H.top,this.width=H.width,this.height=H.height,this.rotationAngle=H.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,H.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,H.containerTransformMatrix))},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*H});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*H,this.adjustControlBox()},_}(Oe),Ze=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=he.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){X.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){var H=k;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize()},_.title="Rectangle marker",_}(qe),nt=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=H,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",V.appendChild(Ee);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var it=document.createElement("hr");it.style.minWidth="20px",it.style.border="0px",it.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,it.style.flexGrow="2",Ke.appendChild(it),V.appendChild(Ke),k.widthBoxes.push(V)}),H},_.prototype.setCurrentWidth=function(k,H){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},_}(oe),$e=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||this;return Ee.styles=[],Ee.styleBoxes=[],Ee.styles=H,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ke=``;Ee.innerHTML=Ke,V.appendChild(Ee),k.styleBoxes.push(V)}),H},_.prototype.setCurrentStyle=function(k,H){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},_}(oe),Qe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="FrameMarker",_.title="Frame marker",_.icon='',_}(Ze),Fe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ut=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(_,X),_.prototype.ownsTarget=function(k){return!!X.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(H)?this.activeGrip=this.grip1:this.grip2.ownsTarget(H)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},_.prototype.pointerUp=function(k){var H=this.state;X.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",H==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},_.prototype.adjustVisual=function(){},_.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},_.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},_.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},_.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},_.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},_.prototype.adjustControlBox=function(){this.positionGrips()},_.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},_.prototype.createGrip=function(){var k=new He;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},_.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},_.prototype.positionGrip=function(k,H,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(H,ee),k.transform.baseVal.replaceItem(V,0)},_.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.x1=H.x1,this.y1=H.y1,this.x2=H.x2,this.y2=H.y2},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.x1=this.x1*k,this.y1=this.y1*H,this.x2=this.x2*k,this.y2=this.y2*H,this.adjustVisual(),this.adjustControlBox()},_}(Oe),lt=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},_.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.createVisual(),this.adjustVisual()},_.typeName="LineMarker",_.title="Line marker",_.icon='',_}(ut),je=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||this;return Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=H,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.overflow="hidden",H.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ke),V.appendChild(Ee),k.fontBoxes.push(V)}),H},_.prototype.setCurrentFont=function(k,H){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},_}(oe),We=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(_,X),_.prototype.ownsTarget=function(k){if(X.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var H=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(H=!0)}),H},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(H){k.textElement.appendChild(he.createTSpan(H.trim()===""?" ":H.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},_.prototype.getTextScale=function(){var k=this.textElement.getBBox(),H=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;H=Math.min(ee,V)}return H},_.prototype.getTextPosition=function(k){var H=this.textElement.getBBox(),ee=0,V=0;return H.width>0&&H.height>0&&(ee=(this.width-H.width*k)/2,V=this.height/2-H.height*k/2),{x:ee,y:V}},_.prototype.sizeText=function(){var k=this.textElement.getBBox(),H=this.getTextScale(),ee=this.getTextPosition(H);ee.y-=k.y*H,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+H+", "+H+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(H,H))},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},_.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},_.prototype.pointerUp=function(k){var H=this.state;H==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,k),this.setSize(),(H==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},_.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(H){H.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var H=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&H>.9;)H-=.1,k.textEditor.style.fontSize=Math.max(H,.9)+"em"}),this.textEditor.addEventListener("keyup",function(H){H.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(H){if(H.clipboardData){var ee=H.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),H.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},_.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),H=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};H.x-=V.x/2,H.y-=V.y/2,this.textEditor.style.top=H.y+"px",this.textEditor.style.left=H.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-H.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},_.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},_.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},_.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},_.prototype.dblClick=function(k,H){X.prototype.dblClick.call(this,k,H),this.showTextEditor()},_.prototype.setColor=function(k){this.textElement&&he.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},_.prototype.setFont=function(k){this.textElement&&he.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},_.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},_.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var H=k;this.color=H.color,this.fontFamily=H.fontFamily,this.padding=H.padding,this.text=H.text,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize(),this.sizeText(),this.positionTextEditor()},_.typeName="TextMarker",_.title="Text marker",_.icon='',_}(qe),Ce=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ge("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var k=he.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):X.prototype.pointerDown.call(this,k,H)},_.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},_.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,k)},_.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},_.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},_.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},_.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),H=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=H[0],V=H[1],Ee=H[2],Ke=H[3],it=!1,vt=0;vt0&&(it=!0,vtKe&&(Ke=vt),Ve>Ee&&(Ee=Ve));if(it){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var Tt=document.createElement("canvas");Tt.width=Ee-ee,Tt.height=Ke-V,Tt.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Ee-ee,Ke-V),0,0),this.drawingImgUrl=Tt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},_.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},_.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},_.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){this.createVisual(),X.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setDrawingImage()},_.typeName="FreehandMarker",_.title="Freehand marker",_.icon='',_}(qe),_e=function(X){function _(k,H,ee){var V=X.call(this,k,ee||'')||this;return V.typeBoxes=[],V.currentType=H,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2";for(var ee=function(Ke){var it="both";switch(Ke){case 0:it="both";break;case 1:it="start";break;case 2:it="end";break;case 3:it="none"}var vt=document.createElement("div");if(vt.style.display="flex",vt.style.flexGrow="2",vt.style.alignItems="center",vt.style.justifyContent="space-between",vt.style.padding="5px",vt.style.borderWidth="2px",vt.style.borderStyle="solid",vt.style.borderColor=it===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",vt.addEventListener("click",function(){k.setCurrentType(it,vt)}),H.appendChild(vt),it==="both"||it==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.innerHTML=``,Ve.style.marginLeft="5px",vt.appendChild(Ve)}var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.style.flexGrow="2";var Wt=document.createElement("hr");if(Wt.style.minWidth="20px",Wt.style.border="0px",Wt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),Wt.style.flexGrow="2",Tt.appendChild(Wt),vt.appendChild(Tt),it==="both"||it==="end"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.innerHTML=``,qt.style.marginRight="5px",vt.appendChild(qt)}V.typeBoxes.push(vt)},V=this,Ee=0;Ee<4;Ee++)ee(Ee);return H},_.prototype.setCurrentType=function(k,H){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},_}(oe),Te=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new _e("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},_.prototype.getArrowPoints=function(k,H){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(H+V/2)+" "+k+","+(H-V/2)+" "+(k+ee/2)+","+(H+V/2)},_.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.arrow1.transform.baseVal.getItem(0);H.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(H,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},_.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.arrowType=H.arrowType,this.createTips(),this.adjustVisual()},_.typeName="ArrowMarker",_.title="Arrow marker",_.icon='',_}(lt),ae=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ge("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="CoverMarker",_.title="Cover marker",_.icon='',_}(Ze),le=function(X){function _(k,H,ee,V){var Ee=X.call(this,k,V||'')||this;return Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=H,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Se(_,X),_.prototype.getUi=function(){var k=this,H=document.createElement("div");return H.style.display="flex",H.style.overflow="hidden",H.style.flexGrow="2",H.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),H.appendChild(V);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",V.appendChild(Ee),k.opacityBoxes.push(V)}),H},_.prototype.setCurrentOpacity=function(k,H){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===H?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},_}(oe),fe=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ge("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(_,X),_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="HighlightMarker",_.title="Highlight marker",_.icon='',_}(ae),me='',we=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ge("Text color",ee.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ge("Fill color",ee.defaultColorSet,V.bgColor,me),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new je("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new He,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(_,X),_.prototype.ownsTarget=function(k){return X.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},_.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},_.prototype.pointerDown=function(k,H){this.state==="new"&&X.prototype.pointerDown.call(this,k,H),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(H)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,k,H)},_.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,k);else{var H=this.state==="creating";X.prototype.pointerUp.call(this,k),this.setTipPoints(H),this.positionTip()}},_.prototype.manipulate=function(k){if(this.tipMoving){var H=this.unrotatePoint(k);this.tipPosition={x:H.x-this.manipulationStartLeft,y:H.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,k)},_.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",k]]),he.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},_.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},_.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var H=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:H+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V',_}(We),Ue=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.fillColor=ee.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new ge("Line color",ce(ee.defaultColorSet,["transparent"]),ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new ge("Fill color",ce(ee.defaultColorSet,["transparent"]),V.fillColor,me),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new le("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual)},_.prototype.createVisual=function(){this.visual=he.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},_.prototype.manipulate=function(k){X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){X.prototype.resize.call(this,k),this.setSize()},_.prototype.setSize=function(){X.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},_.prototype.pointerUp=function(k){X.prototype.pointerUp.call(this,k),this.setSize()},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},_.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},_.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){var H=k;this.fillColor=H.fillColor,this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.opacity=H.opacity,this.createVisual(),X.prototype.restoreState.call(this,k),this.setSize()},_.prototype.scale=function(k,H){X.prototype.scale.call(this,k,H),this.setSize()},_.typeName="EllipseMarker",_.title="Ellipse marker",_.icon='',_}(qe),ze=function(X){function _(k,H,ee){return X.call(this,k,H,ee)||this}return Se(_,X),Object.defineProperty(_.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},_.prototype.createTips=function(){this.tip1=he.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.tip2)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.state==="creating"&&this.createTips()},_.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),H=this.tip1.transform.baseVal.getItem(0);H.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(H,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},_.typeName="MeasurementMarker",_.title="Measurement marker",_.icon='',_}(lt),rt=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Se(_,X),Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=X.prototype.getState.call(this);return k.typeName=_.typeName,k},_.typeName="EllipseFrameMarker",_.title="Ellipse frame marker",_.icon='',_}(Ue),pt=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(_){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(_)||(this.undoStack.push(_),JSON.stringify(this.lastRedoStep)!==JSON.stringify(_)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(_){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=_)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var _=this.undoStack.pop();return _!==void 0&&this.redoStack.push(_),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),ct=function(X){function _(k,H,ee){var V=X.call(this,k,H,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ge("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new nt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new $e("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(_,X),_.prototype.ownsTarget=function(k){return!(!X.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},_.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},_.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},_.prototype.pointerDown=function(k,H){X.prototype.pointerDown.call(this,k,H),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(H)&&(this.activeGrip=this.curveGrip,this._state="resize")},_.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},_.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},_.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},_.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},_.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),X.prototype.manipulate.call(this,k)},_.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),X.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},_.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},_.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},_.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},_.prototype.scale=function(k,H){this.curveX=this.curveX*k,this.curveY=this.curveY*H,X.prototype.scale.call(this,k,H)},Object.defineProperty(_.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),_.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return k.typeName=_.typeName,k},_.prototype.restoreState=function(k){X.prototype.restoreState.call(this,k);var H=k;this.strokeColor=H.strokeColor,this.strokeWidth=H.strokeWidth,this.strokeDasharray=H.strokeDasharray,this.curveX=H.curveX,this.curveY=H.curveY,this.createVisual(),this.adjustVisual()},_.typeName="CurveMarker",_.title="Curve marker",_.icon='',_}(ut),At=function(){function X(_,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=_,this.cancelable=k}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),St=function(X){function _(k,H,ee){var V=X.call(this,k,!1)||this;return V.dataUrl=H,V.state=ee,V}return Se(_,X),_}(At),dt=function(X){function _(k,H,ee){ee===void 0&&(ee=!1);var V=X.call(this,k,ee)||this;return V.marker=H,V}return Se(_,X),_}(At),Ft=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(_,k){this[_].push(k)},X.prototype.removeEventListener=function(_,k){var H=this[_].indexOf(k);H>-1&&this[_].splice(H,1)},X}(),gt=function(){function X(_){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new pt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=_,this.targetRoot=document.body,this.width=_.clientWidth,this.height=_.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,rt,Ue,fe,we,ze,ae,lt,ct]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,Ue,fe,we]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Ce,Te,We,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(_){var k=this;this._availableMarkerTypes.splice(0),_.forEach(function(H){if(typeof H=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===H});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(H)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(_){this._zoomLevel=_,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var _=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new At(_))})},X.prototype.render=function(){return Le(this,void 0,void 0,function(){var _;return be(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(_=new de).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.markersOnly=this.renderMarkersOnly,_.width=this.renderWidth,_.height=this.renderHeight,[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,_.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},X.prototype.close=function(_){var k=this;if(_===void 0&&(_=!1),this.isOpen){var H=!1;_||this.eventListeners.beforeclose.forEach(function(ee){var V=new At(k,!0);ee(V),V.defaultPrevented&&(H=!0)}),H||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new At(k))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var _,k=[],H=0;Hthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*_:this.editorCanvas.clientWidth,H=k',_.title="Powered by marker.js",_.style.display="grid",_.style.alignItems="center",_.style.justifyItems="center",_.style.padding="3px",_.style.width="20px",_.style.height="20px",this.logoUI.appendChild(_),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Pe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(_),1),_.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(_,k){if(_==="marker"&&k!==void 0)this.createNewMarker(k);else if(_==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var _=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new dt(_,_._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var H=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new dt(_,H))})}}},X.prototype.clear=function(){var _=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ke=new dt(_,void 0,!0);Ee(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var H=function(Ee){var Ke=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(it){return it(new dt(_,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)H(V);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var _;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(_=this._currentMarker.notes)!==null&&_!==void 0?_:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var _=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),H=this.undoRedoManager.getLastUndoStep();if(!H||H.width===k.width&&H.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee1&&this.panTo({x:_.clientX,y:_.clientY}))},X.prototype.onPointerUp=function(_){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(_.clientX,_.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(_){this._currentMarker===void 0||this.notesArea!==void 0||_.key!=="Delete"&&_.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.markerImage.getBoundingClientRect();return{x:(_-H.left)/this.zoomLevel,y:(k-H.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var _=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=_+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(_){ne.addKey(_)},X.prototype.addEventListener=function(_,k){this.eventListeners.addEventListener(_,k)},X.prototype.removeEventListener=function(_,k){this.eventListeners.removeEventListener(_,k)},X.prototype.renderState=function(_){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(_),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var _=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new At(_))}))},X.prototype.blur=function(){var _=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new At(_))}))},X.instanceCounter=0,X}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
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 Lt=function(X,_){return(Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,H){k.__proto__=H}||function(k,H){for(var ee in H)Object.prototype.hasOwnProperty.call(H,ee)&&(k[ee]=H[ee])})(X,_)};function Dt(X,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function k(){this.constructor=X}Lt(X,_),X.prototype=_===null?Object.create(_):(k.prototype=_.prototype,new k)}function tt(X,_,k,H){return new(k||(k=Promise))(function(ee,V){function Ee(vt){try{it(H.next(vt))}catch(Ve){V(Ve)}}function Ke(vt){try{it(H.throw(vt))}catch(Ve){V(Ve)}}function it(vt){var Ve;vt.done?ee(vt.value):(Ve=vt.value,Ve instanceof k?Ve:new k(function(Tt){Tt(Ve)})).then(Ee,Ke)}it((H=H.apply(X,_||[])).next())})}function fn(X,_){var k,H,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(it){return function(vt){return function(Ve){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,H&&(ee=2&Ve[0]?H.return:Ve[0]?H.throw||((ee=H.return)&&ee.call(H),0):H.next)&&!(ee=ee.call(H,Ve[1])).done)return ee;switch(H=0,ee&&(Ve=[2&Ve[0],ee.value]),Ve[0]){case 0:case 1:ee=Ve;break;case 4:return Ee.label++,{value:Ve[1],done:!1};case 5:Ee.label++,H=Ve[1],Ve=[0];continue;case 7:Ve=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ve[0]!==6&&Ve[0]!==2)){Ee=0;continue}if(Ve[0]===3&&(!ee||Ve[1]>ee[0]&&Ve[1]0&&k>0){var H=new Hn(_,k),ee=H.ratio>=1?20:H.getHorizontalLength(20),V=H.ratio<1?20:H.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ke=bt.createDefs();Ee.appendChild(Ke);var it=bt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(it);var vt=bt.createPath(bt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Ee.appendChild(vt);var Ve=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(bt.createTSpan(_+":"+k)),Ee.appendChild(Ve);var Tt=Ve.getBBox();bt.setAttributes(Ve,[["x",((24-Tt.width)/2).toString()],["y",((24-Tt.height)/2-Tt.y).toString()]]);var Wt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Tt.width))/2,(24-Math.ceil(Tt.height))/2,Math.ceil(Tt.width),Math.ceil(Tt.height)));return it.appendChild(Wt),bt.setAttributes(vt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.outerHTML}return''},X}(),en=function(X){function _(k,H,ee){var V=X.call(this,k,H)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Dt(_,X),_.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(H){H.className=k.className,H.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(H.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},_.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},_.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},_.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},_.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},_.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},_}(Ut),It=function(){function X(_,k){this.GRIP_SIZE=10,this.color=_,this.fillColor=k,this.visual=bt.createGroup(),this.visual.appendChild(bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(_){return _===this.visual||_===this.visual.childNodes[0]||_===this.visual.childNodes[1]},X.prototype.setCenter=function(_,k){this.visual.childNodes.forEach(function(H){return bt.setAttributes(H,[["cx",_.toString()],["cy",k.toString()]])})},X}(),hn=function(){function X(_,k,H,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=_,this.canvasHeight=k,this.margin=H,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(_){this._aspectRatio=_,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(_){this._zoomFactor=_,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var _=this;this.cropShadeElement=bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;kthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),bt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var H=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ee){var Ke=k.y+H*(Ee+1);bt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ee){var Ke=k.x+ee*(Ee+1);bt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.container.getBoundingClientRect();return{x:_-H.left+this.margin,y:k-H.top+this.margin}},X.prototype.onPointerDown=function(_){this.container.setPointerCapture(_.pointerId),this.previousPoint=this.clientToLocalCoordinates(_.clientX,_.clientY),this.cropRectElement===_.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(_.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(_.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(_.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(_.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(_){if(this.isMoving)this.move(this.clientToLocalCoordinates(_.clientX,_.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(_.clientX,_.clientY);this.resize(k)}_.preventDefault()},X.prototype.onPointerUp=function(_){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(_.pointerId)},X.prototype.move=function(_){var k=_.x-this.previousPoint.x,H=_.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,H=-H/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+H),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=_},X.prototype.resize=function(_){var k=Object.assign({},this.cropRect),H=_.x-this.previousPoint.x,ee=_.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+Hthis.canvasWidth*this.zoomFactor&&(H=this.canvasWidth*this.zoomFactor-k.width),k.width+=H}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(H),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=_,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var _=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,H=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);H/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=_-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(_,k,H,ee,V,Ee){var Ke=H/_,it=ee/k;return{x:(V.x-Ee)*Ke+Ee,y:(V.y-Ee)*it+Ee,width:V.width*Ke,height:V.height*it}},X.prototype.scaleCanvas=function(_,k){var H=this.getRescaledRect(this.canvasWidth,this.canvasHeight,_,k,this.cropRect,this.margin);this.canvasWidth=_,this.canvasHeight=k,this.onCropChange&&this.onCropChange(H),this.setCropRectangle(H)},X}(),kn=function(){function X(_){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=_,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(_){this._angle=_,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},X.prototype.onPointerDown=function(_){this.controlContainer.setPointerCapture(_.pointerId),this.isDragging=!0,this.previousPoint={x:_.clientX,y:_.clientY}},X.prototype.onPointerMove=function(_){this.isDragging&&(this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.previousPoint.x=_.clientX)},X.prototype.onPointerUp=function(_){this.isDragging&&this.onAngleChange&&this.onAngleChange((_.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(_.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var _=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-_.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var _=this.scaleShape.transform.baseVal.getItem(0);_.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(_,0)}},X.prototype.getVisual=function(){var _=document.createElementNS("http://www.w3.org/2000/svg","svg");_.setAttribute("xmlns","http://www.w3.org/2000/svg"),_.setAttribute("width",this.width+"px"),_.setAttribute("height",this.height+"px"),_.setAttribute("viewBox","0 0 "+this.width+" "+this.height),_.style.flexShrink="0",document.body.appendChild(_);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,H=1;H<=this.width/5+10;H++){var ee=H%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=bt.createPath(k);var V=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),_.appendChild(this.scaleShape),this.angleLabelElement=bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=bt.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),_.appendChild(this.angleLabelElement),document.body.removeChild(_),_},X}(),$n=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(_,k,H,ee,V,Ee,Ke){var it=this;return new Promise(function(vt){var Ve=document.createElement("canvas");Ve.width=_.width.baseVal.value-2*ee,Ve.height=_.height.baseVal.value-2*ee;var Tt=1,Wt=1;it.naturalSize===!0?(Tt=k.naturalWidth/(_.width.baseVal.value-2*ee)/Ee,Wt=k.naturalHeight/(_.height.baseVal.value-2*ee)/Ke,Ve.width=k.naturalWidth/Ee,Ve.height=k.naturalHeight/Ke):it.width!==void 0&&it.height!==void 0&&(Tt=it.width/H.width,Wt=it.height/H.height,Ve.width*=Tt,Ve.height*=Wt);var qt=Ve.getContext("2d");qt.translate(Ve.width/2,Ve.height/2),qt.rotate(V*Math.PI/180),qt.scale(Ee,Ke),qt.translate(-Ve.width/2,-Ve.height/2),qt.drawImage(k,0,0,Ve.width,Ve.height);var Wn=document.createElement("canvas");Wn.width=H.width*Tt,Wn.height=H.height*Wt,Wn.getContext("2d").putImageData(qt.getImageData((H.x-ee)*Tt,(H.y-ee)*Wt,H.width*Tt,H.height*Wt),0,0),vt(Wn.toDataURL(it.imageType,it.imageQuality))})},X}(),Je=function(){function X(_){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new Vt(this.instanceNo),this.target=_,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(_){this._zoomToCropEnabled=_,_?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(_){this._isGridVisible=_,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(_){this._gridLines=_,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(_){this._rotationAngle=_,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var _;return(_=this._aspectRatio)!==null&&_!==void 0?_:this.aspectRatios[0]},set:function(_){this._aspectRatio=_},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(_){_===void 0&&(_=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),_||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(_){this.renderEventListeners.push(_)},X.prototype.removeRenderEventListener=function(_){this.renderEventListeners.indexOf(_)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(_),1)},X.prototype.addCloseEventListener=function(_){this.closeEventListeners.push(_)},X.prototype.removeCloseEventListener=function(_){this.closeEventListeners.indexOf(_)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(_),1)},X.prototype.setupResizeObserver=function(){var _=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){_.resize(_.target.clientWidth,_.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var _=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/_>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*_:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,H=k+2*this.CANVAS_MARGIN_+this.CANVAS_MARGIN?this.target.offsetTop-(_+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var _=this;this.topToolbar=new Bt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new pn;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var H=[];this.aspectRatios.forEach(function(Wt){var qt=new Ut(Jt.getIcon(Wt.horizontal,Wt.vertical),Wt.horizontal===0&&Wt.vertical===0?"FREE":Wt.horizontal+":"+Wt.vertical);qt.onClick=function(){return _.ratioButtonClicked(Wt)},H.push(qt)}),this.aspectRatioButton=new en(Jt.getIcon(0,0),"Aspect ratio",H),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Ut('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){_.isGridVisible=!_.isGridVisible,ee.isActive=_.isGridVisible},k.addButton(ee);var V=new Ut('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){_.zoomToCropEnabled=!_.zoomToCropEnabled,V.isActive=_.zoomToCropEnabled},k.addButton(V),!En.isLicensed){var Ee=new mt;this.topToolbar.addElementBlock(Ee);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var it=document.createElement("a");it.style.color="currentColor",it.href="https://markerjs.com/products/cropro",it.target="_blank",it.innerHTML='',Ke.appendChild(it),Ee.addElement(Ke)}var vt=new pn;vt.minWidth=3*this.toolbarHeight+"px",vt.contentAlign="end",this.topToolbar.addButtonBlock(vt);var Ve=new Ut('',"OK");Ve.onClick=this.startRenderAndClose,vt.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Tt=new Ut('',"Close");Tt.onClick=this.close,vt.addButton(Tt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Tt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var _=this;this.bottomToolbar=new Bt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new pn;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var H=new Ut('',"Rotate left");H.onClick=this.rotateLeftButtonClicked,k.addButton(H);var ee=new Ut('',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new mt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new kn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(vt){_.rotateBy(vt),_.straightener.angle=_.rotationAngle},V.addElement(this.straightener.getUI());var Ee=new pn;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ke=new Ut('',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ke);var it=new Ut('',"Flip vertical");it.onClick=this.flipVerticallyButtonClicked,Ee.addButton(it)},X.prototype.ratioButtonClicked=function(_){this.aspectRatio=_,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(_){if(_){var k=this.cropLayer.getRescaledRect(_.width,_.height,this.imageWidth,this.imageHeight,_.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=_.flippedHorizontally,this.flippedVertically=_.flippedVertically,this.applyFlip(),this.rotationAngle=_.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(_,k){var H=this.cropImage.getBoundingClientRect();return{x:_-H.left,y:k-H.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var _=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=_+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var _=this.rotationAngle-90;this.rotationAngle%90!=0&&(_+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(_)},X.prototype.rotateRightButtonClicked=function(){var _=this.rotationAngle+90;this.rotationAngle%90!=0&&(_-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(_)},X.prototype.rotateTo=function(_){_=(_=_>180?_-360:_)<=-180?_+360:_,this.rotationAngle=_,this.applyRotation()},X.prototype.rotateBy=function(_){this.rotateTo((this.rotationAngle+_)%360)},X.prototype.applyRotation=function(){var _=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var H=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/H.width,this.imageHeight/H.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=_},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return tt(this,void 0,void 0,function(){var _,k;return fn(this,function(H){switch(H.label){case 0:return[4,this.render()];case 1:return _=H.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(_,k)}),this.close(!0),[2]}})})},X.prototype.render=function(){return tt(this,void 0,void 0,function(){var _;return fn(this,function(k){switch(k.label){case 0:return(_=new $n).naturalSize=this.renderAtNaturalSize,_.imageType=this.renderImageType,_.imageQuality=this.renderImageQuality,_.width=this.renderWidth,_.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,_.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,_.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new xt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var _=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*_)+`px;
height: `+(this.toolbarHeight-2*_)+`px;
padding: `+_+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new _t("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new xt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new xt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*_)+`px;
padding: `+_+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},X.instanceCounter=0,X}(),Ot=Z("8hTe"),mi=Z.n(Ot),gi=/]*>/g;function vi(X){var _=document.createElement("div");return _.innerHTML=X,_.childNodes.length===0?"":_.childNodes[0].nodeValue}var yi=xe.a=function(X){var _=X.value,k=_===void 0?"":_,H=X.edit,ee=H===void 0?!1:H,V=X.className,Ee=X.showTextOnly,Ke=X.showLines,it=X.replaces,vt=X.zoomImg,Ve=X.hasMask,Tt=X.style,Wt=Tt===void 0?{}:Tt,qt=X.stylesPrev,Wn=qt===void 0?{}:qt,Sn=String(k),Cn=Object(R.useRef)(),Zn=Object(R.useRef)(),Di=Object(R.useState)(""),mn=Object(z.a)(Di,2),Vn=mn[0],ui=mn[1],hi=Object(R.useState)("office"),Gn=Object(z.a)(hi,2),ki=Gn[0],bi=Gn[1],Ki=function(){var Gt=new Je(Zn.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var xn=Object(U.a)(n.a.mark(function Pt(on){var Xt;return n.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return Cn.current.style.display="none",gn.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Xt=gn.sent,Xt!=null&&Xt.id&&it(Zn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return gn.stop()}},Pt)}));return function(Pt){return xn.apply(this,arguments)}}()),Gt.show()},Vi=function(){var Gt=new gt(Zn.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var xn=Object(U.a)(n.a.mark(function Pt(on){var Xt;return n.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:if(Cn.current.style.display="none",!Zn.current){gn.next=6;break}return gn.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Xt=gn.sent,Xt!=null&&Xt.id&&it(Zn.current.getAttribute("src").replace(J.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return gn.stop()}},Pt)}));return function(Pt){return xn.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},qn=Object(R.useMemo)(function(){Cn.current&&(Cn.current.style.zIndex=-1);try{var an=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Sn=Sn.replace(an,"("+J.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+J.a.API_SERVER+"/api/attachments/").replace(xn,'"'+J.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(ri){}var Pt=N(Sn),on=C();if(Sn.match(/\[TOC\]/)&&(Pt=Pt.replace("[TOC]
",D()),A()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(ri,gn){var Ln=on[gn],Xi=Ln.type,xi=Ln.expression;return Object(ie.renderToString)(vi(xi)||"",{displayMode:Xi==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),y(),Ee){var Xt=document.createElement("div");return Xt.innerHTML=Pt,Xt.innerText}return setTimeout(function(){return cr()},500),Pt},[Sn]),Jn=Object(R.useRef)();E.WebkitLineClamp=Ke,Ke&&(Wt=Object(j.a)(Object(j.a)({},Wt),E));function _i(an){var Gt=an.target;if(Gt.tagName.toUpperCase()==="IMG"){if(vt){var xn=Gt.getAttribute("src");ui(xn),bi("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Pt=Gt.getAttribute("href");if(Pt.indexOf("office")>-1)an.preventDefault(),ui(Pt),bi("office");else if(Pt.indexOf("application/pdf")>-1)an.preventDefault(),ui(Pt),bi("pdf");else if(Pt.indexOf("text/html")>-1)an.preventDefault(),ui(Pt),bi("html");else if(Pt.startsWith("#")){an.preventDefault();var on=document.getElementById(Pt.replace("#",""));on&&on.scrollIntoView(!0)}}}var cr=function(){var Gt,xn=(Gt=Jn.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");xn==null||xn.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var on=new W.a;on.loadSource(Pt.src),on.attachMedia(Pt)}}})};Object(R.useEffect)(function(){if(Jn.current&&qn&&(qn.match(gi)&&window.PR.prettyPrint()),Jn.current)return Jn.current.addEventListener("click",_i),function(){Jn.current.removeEventListener("click",_i),y(),A()}},[qn,Jn.current,_i]);var Ei=function(Gt){if(!ee)return;Gt.target.nodeName==="IMG"?(Cn.current.style.zIndex=1,Cn.current.style.display="flex",Cn.current.style.width=Gt.target.clientWidth+"px",Cn.current.style.height=Gt.target.clientHeight+"px",Cn.current.style.top=Gt.target.offsetTop+"px",Cn.current.style.left=Gt.target.offsetLeft+"px",Zn.current.src=Gt.target.getAttribute("src")):Cn.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:Jn,style:Object(j.a)({},Wt),className:"".concat(V||""," markdown-body ").concat(mi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:qn}}),v.a.createElement("div",{ref:Cn,className:mi.a.button},v.a.createElement($.a,null,v.a.createElement(Y.a,{onClick:function(){return Ki()}},"\u88C1\u526A"),v.a.createElement(Y.a,{onClick:function(){return Vi()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Zn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(ue.a,{close:!0,data:Vn,type:Vn!=null&&Vn.length?ki:"",style:Object(j.a)({},Wn),onClose:function(){return ui("")}}))}},"9VGf":function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return P});var re=Z("q1tI"),$=Z.n(re);function P(Y,j){var U=Object(re.useRef)();Object(re.useEffect)(function(){U.current=Y}),Object(re.useEffect)(function(){function z(){U.current()}if(j!==null){var G=setInterval(z,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return U});var re=Z("MNnm"),$="rc-util-key";function P(z){if(z.attachTo)return z.attachTo;var G=document.querySelector("head");return G||document.body}function Y(z){var G,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var R=document.createElement("style");if((G=n.csp)===null||G===void 0?void 0:G.nonce){var v;R.nonce=(v=n.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=z;var m=P(n),p=m.firstChild;return n.prepend&&m.prepend?m.prepend(R):n.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var j=new Map;function U(z,G){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(n);if(!j.has(R)){var v=Y("",n),m=v.parentNode;j.set(R,m),m.removeChild(v)}var p=Array.from(j.get(R).children).find(function(h){return h.tagName==="STYLE"&&h[$]===G});if(p){var u,l;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&p.nonce!==((l=n.csp)===null||l===void 0?void 0:l.nonce)){var d;p.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return p.innerHTML!==z&&(p.innerHTML=z),p}var o=Y(z,n);return o[$]=G,o}},Bd2K:function(ot,xe,Z){(function(re){re(Z("VrN/"),Z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(n,R,v){if(v!=re.Init&&v&&n.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return Y(p)}),n.addKeyMap(m)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Y(n){if(n.getOption("disableInput"))return re.Pass;for(var R=n.listSelections(),v=[],m=n.getOption("autoCloseTags"),p=0;pu.ch&&(s=s.slice(0,s.length-l.end+u.ch));var T=s.toLowerCase();if(!s||l.type=="string"&&(l.end!=u.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&h.close||l.string.indexOf("/")==u.ch-l.start-1||A&&z(A,T)>-1||G(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(o)||[],s,u,!0))return re.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&z(D,s)>-1){v[p]={text:"/>",newPos:re.Pos(u.line,u.ch+2)};continue}var L=E&&z(E,T)>-1;v[p]={indent:L,text:">"+(L?`
`:"")+""+s+">",newPos:L?re.Pos(u.line+1,0):re.Pos(u.line,u.ch+1)}}for(var w=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var O=v[p];n.replaceRange(O.text,R[p].head,R[p].anchor,"+insert");var S=n.listSelections().slice(0);S[p]={head:O.newPos,anchor:O.newPos},n.setSelections(S),!w&&O.indent&&(n.indentLine(O.newPos.line,null,!0),n.indentLine(O.newPos.line+1,null,!0))}}function j(n,R){for(var v=n.listSelections(),m=[],p=R?"/":"",u=n.getOption("autoCloseTags"),l=typeof u=="object"&&u.dontIndentOnSlash,d=0;d"&&(A+=">"),m[d]=A}if(n.replaceSelections(m),v=n.listSelections(),!l)for(var d=0;d=0&&R[o]==v;o--)++d;m=l.to;for(var o=1;o0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;vU,re.serviceIds.set(U,z),z}function j(U){return function(z,G,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,z,n,!0)}}},DlQD:function(ot,xe,Z){(function(re,$){ot.exports=$()})(this,function(){"use strict";function re(Ce,_e){for(var Te=0;Te<_e.length;Te++){var ae=_e[Te];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Ce,ae.key,ae)}}function $(Ce,_e,Te){return _e&&re(Ce.prototype,_e),Te&&re(Ce,Te),Ce}function P(Ce,_e){if(!Ce)return;if(typeof Ce=="string")return Y(Ce,_e);var Te=Object.prototype.toString.call(Ce).slice(8,-1);if(Te==="Object"&&Ce.constructor&&(Te=Ce.constructor.name),Te==="Map"||Te==="Set")return Array.from(Ce);if(Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te))return Y(Ce,_e)}function Y(Ce,_e){(_e==null||_e>Ce.length)&&(_e=Ce.length);for(var Te=0,ae=new Array(_e);Te<_e;Te++)ae[Te]=Ce[Te];return ae}function j(Ce,_e){var Te;if(typeof Symbol=="undefined"||Ce[Symbol.iterator]==null){if(Array.isArray(Ce)||(Te=P(Ce))||_e&&Ce&&typeof Ce.length=="number"){Te&&(Ce=Te);var ae=0;return function(){return ae>=Ce.length?{done:!0}:{done:!1,value:Ce[ae++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Te=Ce[Symbol.iterator](),Te.next.bind(Te)}function U(Ce,_e){return _e={exports:{}},Ce(_e,_e.exports),_e.exports}var z=U(function(Ce){function _e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Te(ae){Ce.exports.defaults=ae}Ce.exports={defaults:_e(),getDefaults:_e,changeDefaults:Te}}),G=z.defaults,n=z.getDefaults,R=z.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(_e){return l[_e]};function o(Ce,_e){if(_e){if(v.test(Ce))return Ce.replace(m,d)}else if(p.test(Ce))return Ce.replace(u,d);return Ce}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ce){return Ce.replace(h,function(_e,Te){return Te=Te.toLowerCase(),Te==="colon"?":":Te.charAt(0)==="#"?Te.charAt(1)==="x"?String.fromCharCode(parseInt(Te.substring(2),16)):String.fromCharCode(+Te.substring(1)):""})}var a=/(^|[^\[])\^/g;function A(Ce,_e){Ce=Ce.source||Ce,_e=_e||"";var Te={replace:function(le,fe){return fe=fe.source||fe,fe=fe.replace(a,"$1"),Ce=Ce.replace(le,fe),Te},getRegex:function(){return new RegExp(Ce,_e)}};return Te}var E=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ce,_e,Te){if(Ce){var ae;try{ae=decodeURIComponent(s(Te)).replace(E,"").toLowerCase()}catch(le){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}_e&&!T.test(Te)&&(Te=f(_e,Te));try{Te=encodeURI(Te).replace(/%25/g,"%")}catch(le){return null}return Te}var L={},w=/^[^:]+:\/*[^/]*$/,O=/^([^:]+:)[\s\S]*$/,S=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Ce,_e){L[" "+Ce]||(w.test(Ce)?L[" "+Ce]=Ce+"/":L[" "+Ce]=B(Ce,"/",!0)),Ce=L[" "+Ce];var Te=Ce.indexOf(":")===-1;return _e.substring(0,2)==="//"?Te?_e:Ce.replace(O,"$1")+_e:_e.charAt(0)==="/"?Te?_e:Ce.replace(S,"$1")+_e:Ce+_e}var C={exec:function(){}};function y(Ce){for(var _e=1,Te,ae;_e=0&&we[ze]==="\\";)Ue=!Ue;return Ue?"|":" |"}),ae=Te.split(/ \|/),le=0;if(ae.length>_e)ae.splice(_e);else for(;ae.length<_e;)ae.push("");for(;le=ae.length?le.slice(ae.length):le}).join(`
`)}var ve=function(){function Ce(Te){this.options=Te||I}var _e=Ce.prototype;return _e.space=function(ae){var le=this.rules.block.newline.exec(ae);if(le)return le[0].length>1?{type:"space",raw:le[0]}:{raw:`
`}},_e.code=function(ae,le){var fe=this.rules.block.code.exec(ae);if(fe){var me=le[le.length-1];if(me&&me.type==="paragraph")return{raw:fe[0],text:fe[0].trimRight()};var we=fe[0].replace(/^ {4}/gm,"");return{type:"code",raw:fe[0],codeBlockStyle:"indented",text:this.options.pedantic?we:g(we,`
`)}}},_e.fences=function(ae){var le=this.rules.block.fences.exec(ae);if(le){var fe=le[0],me=Re(fe,le[3]||"");return{type:"code",raw:fe,lang:le[2]?le[2].trim():le[2],text:me}}},_e.heading=function(ae){var le=this.rules.block.heading.exec(ae);if(le)return{type:"heading",raw:le[0],depth:le[1].length,text:le[2]}},_e.nptable=function(ae){var le=this.rules.block.nptable.exec(ae);if(le){var fe={type:"table",header:W(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
`):[],raw:le[0]};if(fe.header.length===fe.align.length){var me=fe.align.length,we;for(we=0;we ?/gm,"");return{type:"blockquote",raw:le[0],text:fe}}},_e.list=function(ae){var le=this.rules.block.list.exec(ae);if(le){for(var fe=le[0],me=le[2],we=me.length>1,Ue=me[me.length-1]===")",ze={type:"list",raw:fe,ordered:we,start:we?+me.slice(0,-1):"",loose:!1,items:[]},rt=le[0].match(this.rules.block.item),pt=!1,ct,At,St,dt,Ft,gt,Lt,Dt=rt.length,tt=0;tt1||this.options.smartLists&&St!==me)&&(dt=rt.slice(tt+1).join(`
`),ze.raw=ze.raw.substring(0,ze.raw.length-dt.length),tt=Dt-1)),Ft=pt||/\n\n(?!\s*$)/.test(ct),tt!==Dt-1&&(pt=ct.charAt(ct.length-1)===`
`,Ft||(Ft=pt)),Ft&&(ze.loose=!0),gt=/^\[[ xX]\] /.test(ct),Lt=void 0,gt&&(Lt=ct[1]!==" ",ct=ct.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:fe,task:gt,checked:Lt,loose:Ft,text:ct});return ze}},_e.html=function(ae){var le=this.rules.block.html.exec(ae);if(le)return{type:this.options.sanitize?"paragraph":"html",raw:le[0],pre:!this.options.sanitizer&&(le[1]==="pre"||le[1]==="script"||le[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):J(le[0]):le[0]}},_e.def=function(ae){var le=this.rules.block.def.exec(ae);if(le){le[3]&&(le[3]=le[3].substring(1,le[3].length-1));var fe=le[1].toLowerCase().replace(/\s+/g," ");return{tag:fe,raw:le[0],href:le[2],title:le[3]}}},_e.table=function(ae){var le=this.rules.block.table.exec(ae);if(le){var fe={type:"table",header:W(le[1].replace(/^ *| *\| *$/g,"")),align:le[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:le[3]?le[3].replace(/\n$/,"").split(`
`):[]};if(fe.header.length===fe.align.length){fe.raw=le[0];var me=fe.align.length,we;for(we=0;we/i.test(me[0])&&(le=!1),!fe&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?fe=!0:fe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(fe=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:le,inRawBlock:fe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):J(me[0]):me[0]}},_e.link=function(ae){var le=this.rules.inline.link.exec(ae);if(le){var fe=ie(le[2],"()");if(fe>-1){var me=le[0].indexOf("!")===0?5:4,we=me+le[1].length+fe;le[2]=le[2].substring(0,fe),le[0]=le[0].substring(0,we).trim(),le[3]=""}var Ue=le[2],ze="";if(this.options.pedantic){var rt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);rt?(Ue=rt[1],ze=rt[3]):ze=""}else ze=le[3]?le[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=ue(le,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},le[0]);return pt}},_e.reflink=function(ae,le){var fe;if((fe=this.rules.inline.reflink.exec(ae))||(fe=this.rules.inline.nolink.exec(ae))){var me=(fe[2]||fe[1]).replace(/\s+/g," ");if(me=le[me.toLowerCase()],!me||!me.href){var we=fe[0].charAt(0);return{type:"text",raw:we,text:we}}var Ue=ue(fe,me,fe[0]);return Ue}},_e.strong=function(ae,le,fe){fe===void 0&&(fe="");var me=this.rules.inline.strong.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){le=le.slice(-1*ae.length);var we=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;we.lastIndex=0;for(var Ue;(me=we.exec(le))!=null;)if(Ue=this.rules.inline.strong.middle.exec(le.slice(0,me.index+3)),Ue)return{type:"strong",raw:ae.slice(0,Ue[0].length),text:ae.slice(2,Ue[0].length-2)}}},_e.em=function(ae,le,fe){fe===void 0&&(fe="");var me=this.rules.inline.em.start.exec(ae);if(me&&(!me[1]||me[1]&&(fe===""||this.rules.inline.punctuation.exec(fe)))){le=le.slice(-1*ae.length);var we=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;we.lastIndex=0;for(var Ue;(me=we.exec(le))!=null;)if(Ue=this.rules.inline.em.middle.exec(le.slice(0,me.index+2)),Ue)return{type:"em",raw:ae.slice(0,Ue[0].length),text:ae.slice(1,Ue[0].length-1)}}},_e.codespan=function(ae){var le=this.rules.inline.code.exec(ae);if(le){var fe=le[2].replace(/\n/g," "),me=/[^ ]/.test(fe),we=fe.startsWith(" ")&&fe.endsWith(" ");return me&&we&&(fe=fe.substring(1,fe.length-1)),fe=J(fe,!0),{type:"codespan",raw:le[0],text:fe}}},_e.br=function(ae){var le=this.rules.inline.br.exec(ae);if(le)return{type:"br",raw:le[0]}},_e.del=function(ae){var le=this.rules.inline.del.exec(ae);if(le)return{type:"del",raw:le[0],text:le[1]}},_e.autolink=function(ae,le){var fe=this.rules.inline.autolink.exec(ae);if(fe){var me,we;return fe[2]==="@"?(me=J(this.options.mangle?le(fe[1]):fe[1]),we="mailto:"+me):(me=J(fe[1]),we=me),{type:"link",raw:fe[0],text:me,href:we,tokens:[{type:"text",raw:me,text:me}]}}},_e.url=function(ae,le){var fe;if(fe=this.rules.inline.url.exec(ae)){var me,we;if(fe[2]==="@")me=J(this.options.mangle?le(fe[0]):fe[0]),we="mailto:"+me;else{var Ue;do Ue=fe[0],fe[0]=this.rules.inline._backpedal.exec(fe[0])[0];while(Ue!==fe[0]);me=J(fe[0]),fe[1]==="www."?we="http://"+me:we=me}return{type:"link",raw:fe[0],text:me,href:we,tokens:[{type:"text",raw:me,text:me}]}}},_e.inlineText=function(ae,le,fe){var me=this.rules.inline.text.exec(ae);if(me){var we;return le?we=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):J(me[0]):me[0]:we=J(this.options.smartypants?fe(me[0]):me[0]),{type:"text",raw:me[0],text:we}}},Ce}(),Se=N.noopTest,Le=N.edit,be=N.merge,ce={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Le(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Le(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Le(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce._comment=//,ce.html=Le(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Le(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.blockquote=Le(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=be({},ce),ce.gfm=be({},ce.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ce.gfm.nptable=Le(ce.gfm.nptable).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.gfm.table=Le(ce.gfm.table).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.pedantic=be({},ce.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:Le(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Le(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Le(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Le(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Le(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Le(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Le(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Le(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Le(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Le(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Le(he._blockSkip,"g").getRegex(),he.overlapSkip=Le(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Le(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Le(he.tag).replace("comment",ce._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Le(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Le(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Le(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=be({},he),he.pedantic=be({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=be({},he.normal,{escape:Le(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ae="x"+ae.toString(16)),_e+=""+ae+";";return _e}var Pe=function(){function Ce(Te){this.tokens=[],this.tokens.links=Object.create(null),this.options=Te||de,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:De.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=De.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=De.breaks:ae.inline=De.gfm),this.tokenizer.rules=ae}Ce.lex=function(ae,le){var fe=new Ce(le);return fe.lex(ae)};var _e=Ce.prototype;return _e.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ae,le,fe){le===void 0&&(le=[]),fe===void 0&&(fe=!0),ae=ae.replace(/^ +$/gm,"");for(var me,we,Ue,ze;ae;){if(me=this.tokenizer.space(ae)){ae=ae.substring(me.raw.length),me.type&&le.push(me);continue}if(me=this.tokenizer.code(ae,le)){ae=ae.substring(me.raw.length),me.type?le.push(me):(ze=le[le.length-1],ze.raw+=`
`+me.raw,ze.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.heading(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.nptable(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.hr(ae)){ae=ae.substring(me.raw.length),le.push(me);continue}if(me=this.tokenizer.blockquote(ae)){ae=ae.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],fe),le.push(me);continue}if(me=this.tokenizer.list(ae)){for(ae=ae.substring(me.raw.length),Ue=me.items.length,we=0;we0)for(;(rt=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)pt.includes(rt[0].slice(rt[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rt=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ue=this.tokenizer.escape(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.tag(ae,fe,me)){ae=ae.substring(Ue.raw.length),fe=Ue.inLink,me=Ue.inRawBlock,le.push(Ue);continue}if(Ue=this.tokenizer.link(ae)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),le.push(Ue);continue}if(Ue=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,me)),le.push(Ue);continue}if(Ue=this.tokenizer.strong(ae,ze,we)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.em(ae,ze,we)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.codespan(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.br(ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.del(ae)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],fe,me),le.push(Ue);continue}if(Ue=this.tokenizer.autolink(ae,Ae)){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(!fe&&(Ue=this.tokenizer.url(ae,Ae))){ae=ae.substring(Ue.raw.length),le.push(Ue);continue}if(Ue=this.tokenizer.inlineText(ae,me,Ne)){ae=ae.substring(Ue.raw.length),we=Ue.raw.slice(-1),le.push(Ue);continue}if(ae){var ct="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ct);break}else throw new Error(ct)}}return le},$(Ce,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ce}(),Be=z.defaults,oe=N.cleanUrl,ge=N.escape,Oe=function(){function Ce(Te){this.options=Te||Be}var _e=Ce.prototype;return _e.code=function(ae,le,fe){var me=(le||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(ae,me);we!=null&&we!==ae&&(fe=!0,ae=we)}return me?''+(fe?ae:ge(ae,!0))+`
`:""+(fe?ae:ge(ae,!0))+`
`},_e.blockquote=function(ae){return`
`+ae+`
`},_e.html=function(ae){return ae},_e.heading=function(ae,le,fe,me){return this.options.headerIds?"
`:""+ae+"
`},_e.hr=function(){return this.options.xhtml?`
`:`
`},_e.list=function(ae,le,fe){var me=le?"ol":"ul",we=le&&fe!==1?' start="'+fe+'"':"";return"<"+me+we+`>
`+ae+""+me+`>
`},_e.listitem=function(ae){return""+ae+`
`},_e.checkbox=function(ae){return" "},_e.paragraph=function(ae){return""+ae+`
`},_e.table=function(ae,le){return le&&(le=""+le+""),`
`},_e.tablerow=function(ae){return`
`+ae+`
`},_e.tablecell=function(ae,le){var fe=le.header?"th":"td",me=le.align?"<"+fe+' align="'+le.align+'">':"<"+fe+">";return me+ae+""+fe+`>
`},_e.strong=function(ae){return""+ae+""},_e.em=function(ae){return""+ae+""},_e.codespan=function(ae){return""+ae+""},_e.br=function(){return this.options.xhtml?"
":"
"},_e.del=function(ae){return""+ae+""},_e.link=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='"+fe+"",me},_e.image=function(ae,le,fe){if(ae=oe(this.options.sanitize,this.options.baseUrl,ae),ae===null)return fe;var me='
":">",me},_e.text=function(ae){return ae},Ce}(),Ie=function(){function Ce(){}var _e=Ce.prototype;return _e.strong=function(ae){return ae},_e.em=function(ae){return ae},_e.codespan=function(ae){return ae},_e.del=function(ae){return ae},_e.html=function(ae){return ae},_e.text=function(ae){return ae},_e.link=function(ae,le,fe){return""+fe},_e.image=function(ae,le,fe){return""+fe},_e.br=function(){return""},Ce}(),He=function(){function Ce(){this.seen={}}var _e=Ce.prototype;return _e.slug=function(ae){var le=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(le)){var fe=le;do this.seen[fe]++,le=fe+"-"+this.seen[fe];while(this.seen.hasOwnProperty(le))}return this.seen[le]=0,le},Ce}(),Xe=z.defaults,qe=N.unescape,Ze=function(){function Ce(Te){this.options=Te||Xe,this.options.renderer=this.options.renderer||new Oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new He}Ce.parse=function(ae,le){var fe=new Ce(le);return fe.parse(ae)};var _e=Ce.prototype;return _e.parse=function(ae,le){le===void 0&&(le=!0);var fe="",me,we,Ue,ze,rt,pt,ct,At,St,dt,Ft,gt,Lt,Dt,tt,fn,En,bt,Vt=ae.length;for(me=0;me0&&tt.tokens[0].type==="text"?(tt.tokens[0].text=bt+" "+tt.tokens[0].text,tt.tokens[0].tokens&&tt.tokens[0].tokens.length>0&&tt.tokens[0].tokens[0].type==="text"&&(tt.tokens[0].tokens[0].text=bt+" "+tt.tokens[0].tokens[0].text)):tt.tokens.unshift({type:"text",text:bt}):Dt+=bt),Dt+=this.parse(tt.tokens,Lt),St+=this.renderer.listitem(Dt,En,fn);fe+=this.renderer.list(St,Ft,gt);continue}case"html":{fe+=this.renderer.html(dt.text);continue}case"paragraph":{fe+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(St=dt.tokens?this.parseInline(dt.tokens):dt.text;me+1An error occurred:
"+Qe(Ue.message+"",!0)+"
";throw Ue}}je.options=je.setOptions=function(Ce){return nt(je.defaults,Ce),ut(je.defaults),je},je.getDefaults=Fe,je.defaults=lt,je.use=function(Ce){var _e=nt({},Ce);if(Ce.renderer&&function(){var ae=je.defaults.renderer||new Oe,le=function(we){var Ue=ae[we];ae[we]=function(){for(var ze=arguments.length,rt=new Array(ze),pt=0;pt`,triples:"",explode:"[]{}"},P=re.Pos;re.defineOption("autoCloseBrackets",!1,function(l,d,o){o&&o!=re.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),d&&(U(Y(d,"pairs")),l.state.closeBrackets=d,l.addKeyMap(j))});function Y(l,d){return d=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[d]!=null?l[d]:$[d]}var j={Backspace:n,Enter:R};function U(l){for(var d=0;d=0;s--){var A=h[s].head;l.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function R(l){var d=G(l),o=d&&Y(d,"explode");if(!o||l.getOption("disableInput"))return re.Pass;for(var h=l.listSelections(),s=0;s0;return{anchor:new P(l.anchor.line,l.anchor.ch+(d?-1:1)),head:new P(l.head.line,l.head.ch+(d?1:-1))}}function m(l,d){var o=G(l);if(!o||l.getOption("disableInput"))return re.Pass;var h=Y(o,"pairs"),s=h.indexOf(d);if(s==-1)return re.Pass;for(var a=Y(o,"closeBefore"),A=Y(o,"triples"),E=h.charAt(s+1)==d,T=l.listSelections(),D=s%2==0,L,w=0;w=0&&l.getRange(S,P(S.line,S.ch+3))==d+d+d?f="skipThree":f="skip";else if(E&&S.ch>1&&A.indexOf(d)>=0&&l.getRange(P(S.line,S.ch-2),S)==d+d){if(S.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(S.line,S.ch-2))))return re.Pass;f="addFour"}else if(E){var y=S.ch==0?" ":l.getRange(P(S.line,S.ch-1),S);if(!re.isWordChar(C)&&y!=d&&!re.isWordChar(y))f="both";else return re.Pass}else if(D&&(C.length===0||/\s/.test(C)||a.indexOf(C)>-1))f="both";else return re.Pass;if(!L)L=f;else if(L!=f)return re.Pass}var b=s%2?h.charAt(s-1):d,B=s%2?d:h.charAt(s+1);l.operation(function(){if(L=="skip")l.execCommand("goCharRight");else if(L=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(L=="surround"){for(var x=l.getSelections(),F=0;F0&&(ie.percent=ie.loaded/ie.total*100),N.onProgress(ie)});var g=new FormData;N.data&&Object.keys(N.data).forEach(function(J){var ie=N.data[J];if(Array.isArray(ie)){ie.forEach(function(ue){g.append(J+"[]",ue)});return}g.append(J,N.data[J])}),N.file instanceof Blob?g.append(N.filename,N.file,N.file.name):g.append(N.filename,N.file),I.onerror=function(ie){N.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?N.onError(j(N,I),U(I)):N.onSuccess(U(I),I)},I.open(N.method,N.action,!0),N.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=N.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(J){W[J]!==null&&I.setRequestHeader(J,W[J])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,n=0;function R(){return"rc-upload-"+G+"-"+ ++n}function v(N,I){return N.indexOf(I,N.length-I.length)!==-1}var m=function(N,I){if(N&&I){var g=Array.isArray(I)?I:I.split(","),W=N.name||"",J=N.type||"",ie=J.replace(/\/.*$/,"");return g.some(function(ue){var Re=ue.trim();return Re.charAt(0)==="."?v(W.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?ie===Re.replace(/\/.*$/,""):J===Re})}return!0};function p(N,I){var g=N.createReader(),W=[];function J(){g.readEntries(function(ie){var ue=Array.prototype.slice.apply(ie);W=W.concat(ue);var Re=!ue.length;Re?I(W):J()})}J()}var u=function(I,g,W){var J=function ie(ue,Re){Re=Re||"",ue.isFile?ue.file(function(ve){W(ve)&&(ue.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),g([ve]))}):ue.isDirectory&&p(ue,function(ve){ve.forEach(function(Se){ie(Se,""+Re+ue.name+"/")})})};I.forEach(function(ie){J(ie.webkitGetAsEntry())})},l=u,d=Object.assign||function(N){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(N,W))continue;g[W]=N[W]}return g}function A(N,I){if(!(N instanceof I))throw new TypeError("Cannot call a class as a function")}function E(N,I){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:N}function T(N,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);N.prototype=Object.create(I&&I.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(N,I):N.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(g[W]=I[W]),g},{})},L=function(N){T(I,N);function I(){var g,W,J,ie;A(this,I);for(var ue=arguments.length,Re=Array(ue),ve=0;vea.length&&(E=a.length);AT===D){const T=a[Symbol.iterator](),D=A[Symbol.iterator]();for(;;){const L=T.next(),w=D.next();if(L.done!==w.done)return!1;if(L.done)return!0;if(!E(L.value,w.value))return!1}}$.equals=s})(re||(re={}))},LdHM:function(ot,xe,Z){"use strict";Z.d(xe,"b",function(){return a}),Z.d(xe,"a",function(){return E});var re=Z("1OyB"),$=Z("vuIU"),P=Z("Ji7U"),Y=Z("LK+K"),j=Z("q1tI"),U=Z("rePB"),z=Z("Ff2n"),G=Z("ODXe"),n=Z("4IlW"),R=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),u=Z("+nKL"),l=Z("8OUc"),d=function(W,J){var ie=W.prefixCls,ue=W.id,Re=W.flattenOptions,ve=W.childrenAsData,Se=W.values,Le=W.searchValue,be=W.multiple,ce=W.defaultActiveFirstOption,he=W.height,ne=W.itemHeight,de=W.notFoundContent,se=W.open,De=W.menuItemSelectedIcon,Ne=W.virtual,Ae=W.onSelect,Pe=W.onToggleOpen,Be=W.onActiveValue,oe=W.onScroll,ge=W.onMouseEnter,Oe="".concat(ie,"-item"),Ie=Object(v.a)(function(){return Re},[se,Re],function(We,Ce){return Ce[0]&&We[1]!==Ce[1]}),He=j.useRef(null),Xe=function(Ce){Ce.preventDefault()},qe=function(Ce){He.current&&He.current.scrollTo({index:Ce})},Ze=function(Ce){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=Ie.length,ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function(J,ie){if(!j.isValidElement(J)||!J.type)return null;var ue=J.type.isSelectOptGroup,Re=J.key,ve=J.props,Se=ve.children,Le=Object(z.a)(ve,["children"]);return W||!ue?L(J):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ie:Re,"__"),label:Re},Le),{},{options:w(Se)})}).filter(function(J){return J})}var O=Z("2Qr1"),S=Z("qNPg"),f=Z("U8pU"),C=Z("Kwbf"),y=Z("WKfj");function b(g){var W=g.mode,J=g.options,ie=g.children,ue=g.backfill,Re=g.allowClear,ve=g.placeholder,Se=g.getInputElement,Le=g.showSearch,be=g.onSearch,ce=g.defaultOpen,he=g.autoFocus,ne=g.labelInValue,de=g.value,se=g.inputValue,De=g.optionLabelProp,Ne=W==="multiple"||W==="tags",Ae=Le!==void 0?Le:Ne||W==="combobox",Pe=J||w(ie);if(Object(C.a)(W!=="tags"||Pe.every(function(Oe){return!Oe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Be=Pe.some(function(Oe){return Oe.options?Oe.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in Oe?Oe.value:Oe.key)=="number"});Object(C.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(W!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(W==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(C.a)(W==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(C.b)(W!=="combobox"||!Se||!Re||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),be&&!Ae&&W!=="combobox"&&W!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!ce||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var oe=Object(y.d)(de);Object(C.a)(!ne||oe.every(function(Oe){return Object(f.a)(Oe)==="object"&&("key"in Oe||"value"in Oe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!Ne||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var ge=null;Object(D.a)(ie).some(function(Oe){if(!j.isValidElement(Oe)||!Oe.type)return!1;var Ie=Oe.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var He=Object(D.a)(Oe.props.children).every(function(Xe){return!j.isValidElement(Xe)||!Oe.type||Xe.type.isSelectOption?!0:(ge=Xe.type,!1)});return!He}return ge=Ie,!0}),ge&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(C.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=b,F=Object(S.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:w,flattenOptions:O.d,getLabeledValue:O.e,filterOptions:O.b,isValueDisabled:O.g,findValueOption:O.c,warningProps:B,fillOptionsWithMissingValue:O.a}),x=function(g){Object(P.a)(J,g);var W=Object(Y.a)(J);function J(){var ie;return Object(re.a)(this,J),ie=W.apply(this,arguments),ie.selectRef=j.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object($.a)(J,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),J}(j.Component);x.Option=a,x.OptGroup=E;var N=x,I=xe.c=N},M8RZ:function(ot,xe,Z){"use strict";Z.d(xe,"a",function(){return n});var re=Z("fWQN"),$=Z("mtLc"),P=Z("yKVA"),Y=Z("879j"),j=Z("q1tI"),U=Z.n(j),z=Z("i8i4"),G=Z.n(z),n=function(R){Object(P.a)(m,R);var v=Object(Y.a)(m);function m(p){var u;Object(re.a)(this,m),u=v.call(this,p);var l=window.document;return u.node=l.createElement("div"),l.body.appendChild(u.node),u}return Object($.a)(m,[{key:"render",value:function(){var u=this.props.children;return Object(z.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(ot,xe,Z){"use strict";Z.d(xe,"c",function(){return j}),Z.d(xe,"b",function(){return n}),Z.d(xe,"e",function(){return R}),Z.d(xe,"a",function(){return v}),Z.d(xe,"d",function(){return m}),Z.d(xe,"f",function(){return p});var re=Z("/cxE"),$=Z("pmY6"),P=Z("24hK"),Y=Z("5Y4S"),j;(function(u){u.None=()=>$.a.None;function l(b){return(B,F=null,x)=>{let N=!1,I;return I=b(g=>N?void 0:(I?I.dispose():N=!0,B.call(F,g)),null,x),N&&I.dispose(),I}}u.once=l;function d(b,B){return E((F,x=null,N)=>b(I=>F.call(x,B(I)),null,N))}u.map=d;function o(b,B){return E((F,x=null,N)=>b(I=>{B(I),F.call(x,I)},null,N))}u.forEach=o;function h(b,B){return E((F,x=null,N)=>b(I=>B(I)&&F.call(x,I),null,N))}u.filter=h;function s(b){return b}u.signal=s;function a(...b){return(B,F=null,x)=>Object($.e)(...b.map(N=>N(I=>B.call(F,I),null,x)))}u.any=a;function A(b,B,F){let x=F;return d(b,N=>(x=B(x,N),x))}u.reduce=A;function E(b){let B;const F=new n({onFirstListenerAdd(){B=b(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function T(b,B,F=100,x=!1,N){let I,g,W,J=0;const ie=new n({leakWarningThreshold:N,onFirstListenerAdd(){I=b(ue=>{J++,g=B(g,ue),x&&!W&&(ie.fire(g),g=void 0),clearTimeout(W),W=setTimeout(()=>{const Re=g;g=void 0,W=void 0,(!x||J>1)&&ie.fire(Re),J=0},F)})},onLastListenerRemove(){I.dispose()}});return ie.event}u.debounce=T;function D(b,B=(F,x)=>F===x){let F=!0,x;return h(b,N=>{const I=F||!B(N,x);return F=!1,x=N,I})}u.latch=D;function L(b,B){return[u.filter(b,B),u.filter(b,F=>!B(F))]}u.split=L;function w(b,B=!1,F=[]){let x=F.slice(),N=b(W=>{x?x.push(W):g.fire(W)});const I=()=>{x&&x.forEach(W=>g.fire(W)),x=null},g=new n({onFirstListenerAdd(){N||(N=b(W=>g.fire(W)))},onFirstListenerDidAdd(){x&&(B?setTimeout(I):I())},onLastListenerRemove(){N&&N.dispose(),N=null}});return g.event}u.buffer=w;class O{constructor(b){this.event=b}map(b){return new O(d(this.event,b))}forEach(b){return new O(o(this.event,b))}filter(b){return new O(h(this.event,b))}reduce(b,B){return new O(A(this.event,b,B))}latch(){return new O(D(this.event))}debounce(b,B=100,F=!1,x){return new O(T(this.event,b,B,F,x))}on(b,B,F){return this.event(b,B,F)}once(b,B,F){return l(this.event)(b,B,F)}}function S(b){return new O(b)}u.chain=S;function f(b,B,F=x=>x){const x=(...W)=>g.fire(F(...W)),N=()=>b.on(B,x),I=()=>b.removeListener(B,x),g=new n({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}u.fromNodeEventEmitter=f;function C(b,B,F=x=>x){const x=(...W)=>g.fire(F(...W)),N=()=>b.addEventListener(B,x),I=()=>b.removeEventListener(B,x),g=new n({onFirstListenerAdd:N,onLastListenerRemove:I});return g.event}u.fromDOMEventEmitter=C;function y(b){return new Promise(B=>l(b)(B))}u.toPromise=y})(j||(j={}));class U{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${U._idPool++}`}start(u){this._stopWatch=new Y.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let z=-1;class G{constructor(u,l=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let l=z;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||u{const h=this._stacks.get(d)||0;this._stacks.set(d,h-1)}}}class n{constructor(u){var l;this._disposed=!1,this._options=u,this._leakageMon=z>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(u,l,d)=>{var o;this._listeners||(this._listeners=new P.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[u,l]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,l);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),A=Object($.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return d instanceof $.b?d.add(A):Array.isArray(d)&&d.push(A),A}),this._event}fire(u){var l,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,u]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,h]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,h):o[0].call(o[1],h)}catch(s){Object(re.f)(s)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var u,l,d,o,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||o===void 0||o.call(d),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class R extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class v extends R{constructor(u){var l;super(u);this._delay=(l=u.delay)!==null&&l!==void 0?l:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class m{constructor(){this.buffers=[]}wrapEvent(u){return(l,d,o)=>u(h=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(d,h)):l.call(d,h)},void 0,o)}bufferEvents(u){const l=[];this.buffers.push(l);const d=u();return this.buffers.pop(),l.forEach(o=>o()),d}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=$.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ot,xe,Z){"use strict";(function(re,$){Z.d(xe,"b",function(){return d}),Z.d(xe,"i",function(){return a}),Z.d(xe,"f",function(){return A}),Z.d(xe,"d",function(){return E}),Z.d(xe,"g",function(){return T}),Z.d(xe,"h",function(){return D}),Z.d(xe,"c",function(){return L}),Z.d(xe,"k",function(){return w}),Z.d(xe,"j",function(){return O}),Z.d(xe,"a",function(){return S}),Z.d(xe,"e",function(){return y});var P;const Y="en";let j=!1,U=!1,z=!1,G=!1,n=!1,R=!1,v=!1,m,p=Y,u,l;const d=typeof self=="object"?self:typeof re=="object"?re:{};let o;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?o=d.vscode.process:typeof $!="undefined"&&(o=$);const h=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!h)l=navigator.userAgent,j=l.indexOf("Windows")>=0,U=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,z=l.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",U=o.platform==="darwin",z=o.platform==="linux",G=z&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=Y,p=Y;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const B=JSON.parse(b),F=B.availableLanguages["*"];m=B.locale,p=F||Y,u=B._translationsConfigFile}catch(B){}n=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:z&&(s=2);const a=j,A=U,E=z,T=n,D=R,L=v,w=l,O=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let F=[];d.addEventListener("message",N=>{if(N.data&&N.data.vscodeSetImmediateId)for(let I=0,g=F.length;I{const I=++x;F.push({id:I,callback:N}),d.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const B=Promise.resolve();return F=>B.then(F)}(),S=U||v?2:j?1:3;let f=!0,C=!1;function y(){if(!C){C=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const B=new Uint16Array(b.buffer);f=B[0]===(2<<8)+1}return f}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(ot,xe,Z){"use strict";Z.d(xe,"C",function(){return re}),Z.d(xe,"v",function(){return P}),Z.d(xe,"s",function(){return Y}),Z.d(xe,"t",function(){return j}),Z.d(xe,"U",function(){return U}),Z.d(xe,"J",function(){return z}),Z.d(xe,"O",function(){return G}),Z.d(xe,"p",function(){return n}),Z.d(xe,"T",function(){return R}),Z.d(xe,"q",function(){return v}),Z.d(xe,"N",function(){return m}),Z.d(xe,"M",function(){return p}),Z.d(xe,"Q",function(){return u}),Z.d(xe,"u",function(){return l}),Z.d(xe,"x",function(){return d}),Z.d(xe,"I",function(){return o}),Z.d(xe,"f",function(){return h}),Z.d(xe,"h",function(){return s}),Z.d(xe,"g",function(){return a}),Z.d(xe,"i",function(){return A}),Z.d(xe,"G",function(){return E}),Z.d(xe,"H",function(){return T}),Z.d(xe,"r",function(){return D}),Z.d(xe,"R",function(){return L}),Z.d(xe,"d",function(){return w}),Z.d(xe,"e",function(){return O}),Z.d(xe,"E",function(){return S}),Z.d(xe,"F",function(){return f}),Z.d(xe,"j",function(){return C}),Z.d(xe,"z",function(){return y}),Z.d(xe,"K",function(){return B}),Z.d(xe,"L",function(){return F}),Z.d(xe,"m",function(){return N}),Z.d(xe,"k",function(){return g}),Z.d(xe,"A",function(){return J}),Z.d(xe,"a",function(){return ie}),Z.d(xe,"n",function(){return ue}),Z.d(xe,"l",function(){return Re}),Z.d(xe,"D",function(){return ve}),Z.d(xe,"B",function(){return Se}),Z.d(xe,"b",function(){return Le}),Z.d(xe,"S",function(){return be}),Z.d(xe,"o",function(){return ce}),Z.d(xe,"P",function(){return he}),Z.d(xe,"w",function(){return ne}),Z.d(xe,"c",function(){return de}),Z.d(xe,"y",function(){return Ne});function re(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const $=/{(\d+)}/g;function P(oe,...ge){return ge.length===0?oe:oe.replace($,function(Oe,Ie){const He=parseInt(Ie,10);return isNaN(He)||He<0||He>=ge.length?Oe:ge[He]})}function Y(oe){return oe.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"<";case">":return">";case"&":return"&";default:return ge}})}function j(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(oe,ge=" "){const Oe=z(oe,ge);return G(Oe,ge)}function z(oe,ge){if(!oe||!ge)return oe;const Oe=ge.length;if(Oe===0||oe.length===0)return oe;let Ie=0;for(;oe.indexOf(ge,Ie)===Ie;)Ie=Ie+Oe;return oe.substring(Ie)}function G(oe,ge){if(!oe||!ge)return oe;const Oe=ge.length,Ie=oe.length;if(Oe===0||Ie===0)return oe;let He=Ie,Xe=-1;for(;!(Xe=oe.lastIndexOf(ge,He-1),Xe===-1||Xe+Oe!==He);){if(Xe===0)return"";He=Xe}return oe.substring(0,He)}function n(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(oe){return oe.replace(/\*/g,"")}function v(oe,ge,Oe={}){if(!oe)throw new Error("Cannot create regex from empty string");ge||(oe=j(oe)),Oe.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let Ie="";return Oe.global&&(Ie+="g"),Oe.matchCase||(Ie+="i"),Oe.multiline&&(Ie+="m"),Oe.unicode&&(Ie+="u"),new RegExp(oe,Ie)}function m(oe){if(oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$")return!1;const ge=oe.exec("");return!!(ge&&oe.lastIndex===0)}function p(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function u(oe){return oe.split(/\r\n|\r|\n/)}function l(oe){for(let ge=0,Oe=oe.length;ge=0;Oe--){const Ie=oe.charCodeAt(Oe);if(Ie!==32&&Ie!==9)return Oe}return-1}function h(oe,ge){return oege?1:0}function s(oe,ge,Oe=0,Ie=oe.length,He=0,Xe=ge.length){for(;Oe$e)return 1}const qe=Ie-Oe,Ze=Xe-He;return qeZe?1:0}function a(oe,ge){return A(oe,ge,0,oe.length,0,ge.length)}function A(oe,ge,Oe=0,Ie=oe.length,He=0,Xe=ge.length){for(;Oe=128||$e>=128)return s(oe.toLowerCase(),ge.toLowerCase(),Oe,Ie,He,Xe);E(nt)&&(nt-=32),E($e)&&($e-=32);const Qe=nt-$e;if(Qe===0)continue;return Qe}const qe=Ie-Oe,Ze=Xe-He;return qeZe?1:0}function E(oe){return oe>=97&&oe<=122}function T(oe){return oe>=65&&oe<=90}function D(oe,ge){return oe.length===ge.length&&A(oe,ge)===0}function L(oe,ge){const Oe=ge.length;return ge.length>oe.length?!1:A(oe,ge,0,Oe)===0}function w(oe,ge){let Oe,Ie=Math.min(oe.length,ge.length);for(Oe=0;Oe1){const Ie=oe.charCodeAt(ge-2);if(S(Ie))return C(Ie,Oe)}return Oe}function B(oe,ge){const Oe=se.getInstance(),Ie=ge,He=oe.length,Xe=y(oe,He,ge);ge+=Xe>=65536?2:1;let qe=Oe.getGraphemeBreakType(Xe);for(;ge=65536?2:1,qe=nt}return ge-Ie}function F(oe,ge){const Oe=se.getInstance(),Ie=ge,He=b(oe,ge);ge-=He>=65536?2:1;let Xe=Oe.getGraphemeBreakType(He);for(;ge>0;){const qe=b(oe,ge),Ze=Oe.getGraphemeBreakType(qe);if(de(Ze,Xe))break;ge-=qe>=65536?2:1,Xe=Ze}return Ie-ge}const x=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function N(oe){return x.test(oe)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function g(oe){return I.test(oe)}const W=/^[\t\n\r\x20-\x7E]*$/;function J(oe){return W.test(oe)}const ie=/[\u2028\u2029]/;function ue(oe){return ie.test(oe)}function Re(oe){for(let ge=0,Oe=oe.length;ge=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function Se(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Le=String.fromCharCode(65279);function be(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function ce(oe,ge=!1){return oe?(ge&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function he(oe){const ge=90-65+1;return oe=oe%(2*ge),oege[3*Ie+1])Ie=2*Ie+1;else return ge[3*Ie+2];return 0}}se._INSTANCE=null;function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(oe,ge){if(oe===0)return 0;const Oe=Ae(oe,ge);if(Oe!==void 0)return Oe;const Ie=b(ge,oe);return oe-=Pe(Ie),oe}function Ae(oe,ge){let Oe=b(ge,oe);for(oe-=Pe(Oe);Be(Oe)||Oe===65039||Oe===8419;){if(oe===0)return;Oe=b(ge,oe),oe-=Pe(Oe)}if(!Se(Oe))return;if(oe>=0){const Ie=b(ge,oe);Ie===8205&&(oe-=Pe(Ie))}return oe}function Pe(oe){return oe>=65536?2:1}function Be(oe){return 127995<=oe&&oe<=127999}},Ot1p:function(ot,xe,Z){"use strict";var re=Z("2qtc"),$=Z("kLXV"),P=Z("rAM+"),Y=Z("miYZ"),j=Z("tsqr"),U=Z("9og8"),z=Z("tJVT"),G=Z("jrin"),n=Z("WmNS"),R=Z.n(n),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),u=Z.n(p),l=Z("bdgK"),d=Z("p77/"),o=Z("Bd2K"),h=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),T=Z("9Bee"),D=function(we){var Ue=we.value,ze=Ue===void 0?"":Ue,rt=we.className,pt=we.showTextOnly,ct=we.showLines,At=we.style,St=At===void 0?{}:At,dt=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},L=Z("0Owb"),w=Z("dejd"),O=Z("C+DQ"),S=Z("1vsH"),f=Z("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(we){var Ue=we.onActionCallback,ze=we.title,rt=we.icon,pt=we.actionName,ct=we.className,At=ct===void 0?"":ct,St=we.children;function dt(){Ue(pt)}return m.a.createElement("a",{title:ze,className:At,onClick:dt},m.a.createElement("i",{className:"md-iconfont ".concat(rt)}),St)}var b=function(we){var Ue=we.watch,ze=we.showNullButton,rt=we.onActionCallback,pt=we.fullScreen,ct=we.insertTemp,At=we.hidetoolBar,St=we.uuid,dt=we.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(S.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(S.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ft=[].concat(C,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&Ft.map(function(gt,Lt){return m.a.createElement("li",{key:Lt},gt.actionName?m.a.createElement(y,Object(L.a)({},gt,{onActionCallback:rt})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ct&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ct),onActionCallback:rt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(pt?"icon-shrink":"icon-enlarge"),title:pt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},B=Z("M8RZ"),F=Z("+L6B"),x=Z("2/Rp"),N=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),W=Z("5rEg"),J={labelCol:{span:4},wrapperCol:{span:20}},ie=function(we){var Ue=we.callback,ze=we.onCancel;function rt(pt){Ue(pt)}return m.a.createElement(I.a,Object(L.a)({},J,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(W.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},ue=Z("7ahc"),Re=Z("HmJG"),ve=Z("BjJ7"),Se=I.a.useForm,Le={width:280,marginRight:10},be={labelCol:{span:5},wrapperCol:{span:19}},ce=function(we){var Ue=we.callback,ze=we.onCancel,rt=Se(),pt=Object(z.a)(rt,1),ct=pt[0];function At(Ft){Ue(Ft)}function St(Ft,gt){if(Ft.status===-1){j.b.error(Ft.message);return}ct.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:gt.type})}function dt(Ft){var gt=Ft.target.files[0];ne(gt,St)}return m.a.createElement(I.a,Object(L.a)({form:ct},be,{className:"upload-image-panel",onFinish:At}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(W.a,{style:Le})),m.a.createElement(he,{onFileChange:dt}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function he(we){var Ue=we.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ue}))}function ne(we,Ue){if(!we)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",we),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(pt){Ue(JSON.parse(pt.target.responseText),we)},!1),rt.addEventListener("error",function(pt){console.error(pt)},!1),rt.open("POST","".concat(ve.a,"/api/attachments.json")),rt.send(ze)}var de=Z("giR+"),se=Z("fyUT"),De=Z("7Kak"),Ne=Z("9yH6"),Ae=Ne.a.Group,Pe={margin:"0 8px"},Be=function(we){var Ue=we.callback,ze=we.onCancel;function rt(pt){Ue(pt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Ae,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(x.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("ErOA"),ge=Z("7Cbv"),Oe="link",Ie="upload-image",He="code-block",Xe="add-table",qe="------------",Ze={default:qe,left:":".concat(qe),center:":".concat(qe,":"),right:"".concat(qe,":")},nt=Z("9VGf"),$e,Qe;function Fe(){}var ut=0,lt=1e4,je="\u2581",We=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ce(we){return/^\d+$/.test(we)?"".concat(we,"px"):we}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Te=_e?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],le=($e={},Object(G.a)($e,Te+"-B","bold"),Object(G.a)($e,Te+"-I","italic"),$e),fe=(Qe={},Object(G.a)(Qe,Oe,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(Qe,He,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(Qe,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(Qe,Xe,"\u6DFB\u52A0\u8868\u683C"),Qe),me=xe.a=function(we){var Ue=we.defaultValue,ze=Ue===void 0?"":Ue,rt=we.onChange,pt=we.width,ct=pt===void 0?"100%":pt,At=we.height,St=At===void 0?400:At,dt=we.miniToolbar,Ft=dt===void 0?!1:dt,gt=we.isFocus,Lt=gt===void 0?!1:gt,Dt=we.watch,tt=we.insertTemp,fn=we.mode,En=fn===void 0?"markdown":fn,bt=we.id,Vt=bt===void 0?"markdown-editor-id":bt,_t=we.showResizeBar,xt=_t===void 0?!1:_t,Bt=we.noStorage,$t=Bt===void 0?!1:Bt,pn=we.showNullButton,Ut=pn===void 0?!1:pn,mt=we.hidetoolBar,Hn=mt===void 0?!1:mt,Jt=we.fullScreen,en=Jt===void 0?!1:Jt,It=we.onBlur,hn=we.onCMBeforeChange,kn=we.onFullScreen,$n=we.className,Je=$n===void 0?"":$n,Ot=we.disablePaste,mi=Ot===void 0?!1:Ot,gi=we.placeholder,vi=gi===void 0?"":gi,yi=we.values,X=yi===void 0?"":yi,_=Object(v.useState)(null),k=Object(z.a)(_,2),H=k[0],ee=k[1],V=Object(v.useState)(ze),Ee=Object(z.a)(V,2),Ke=Ee[0],it=Ee[1],vt=Object(v.useState)(Dt),Ve=Object(z.a)(vt,2),Tt=Ve[0],Wt=Ve[1],qt=Object(v.useState)(en),Wn=Object(z.a)(qt,2),Sn=Wn[0],Cn=Wn[1],Zn=Object(v.useState)(""),Di=Object(z.a)(Zn,2),mn=Di[0],Vn=Di[1],ui=Object(v.useState)(0),hi=Object(z.a)(ui,2),Gn=hi[0],ki=hi[1],bi=Object(v.useState)(St),Ki=Object(z.a)(bi,2),Vi=Ki[0],qn=Ki[1],Jn=Object(v.useState)(!1),_i=Object(z.a)(Jn,2),cr=_i[0],Ei=_i[1],an=Object(v.useRef)(Object(ge.a)()),Gt=Object(v.useRef)(!1),xn=Object(v.useRef)(),Pt=Object(v.useRef)(),on=Object(v.useRef)(),Xt=Object(v.useRef)(),ri=Object(v.useRef)(),gn=function(){var yt=Object(U.a)(R.a.mark(function Rt(){var wt,Mt;return R.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:an.current}});case 2:Mt=Qt.sent,Mt!=null&&(wt=Mt.attachments)!==null&&wt!==void 0&&wt.length&&(console.log("cm:",H,Pt),Mt.attachments.map(function(jt){jt.content_type.indexOf("image")>-1?H.replaceSelection(".concat(jt.content_type,")")):jt.content_type.indexOf("video")>-1?H.replaceSelection('')):jt.content_type.indexOf("pdf")>-1?H.replaceSelection('').concat(jt.name,"")):H.replaceSelection("[".concat(jt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(jt.id,"?type=").concat(jt.content_type,")"))}));case 4:case"end":return Qt.stop()}},Rt)}));return function(){return yt.apply(this,arguments)}}();Object(v.useEffect)(function(){it(X),H==null||H.setValue(X)},[X]),Object(v.useEffect)(function(){kn==null||kn(Sn)},[Sn]),Object(v.useEffect)(function(){if(Pt.current){var yt=u.a.fromTextArea(Pt.current,{mode:En,lineNumbers:!Ft,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});Lt&&yt.focus();function Rt(wt,Mt){if(mi){Mt.preventDefault();return}var Ht=Mt.clipboardData;if(Ht){var Qt=Ht.types.toString(),jt=Ht.items;if(Qt==="Files"||Ht.types.indexOf("Files")>-1){if(Mt.preventDefault(),En=="stex")return;try{var cn,Mn=jt[1];((cn=jt[0])===null||cn===void 0?void 0:cn.kind)==="file"&&(Mn=jt[0]);var Nt=Mn.getAsFile(),ci=Nt.name.split(".").pop();ne(Nt,function(zt){if(zt.id){var Pn,An,Qn;(Nt==null||((Pn=Nt.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?yt.replaceSelection(".concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(ci)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Rt),yt.on("dragleave",function(wt,Mt){on.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(wt,Mt){on.current.classList.add("mouse-hover-md")}),yt.on("drop",function(wt,Mt){on.current.classList.add("mouse-hover-md");var Ht;if(Ht=Mt.dataTransfer.files,Ht.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Qt=function(Mn){var Nt=Ht[Mn],ci=Nt.name.split(".").pop();ne(Nt,function(zt){if(zt.id){var Pn,An,Qn;(Nt==null||((Pn=Nt.type)===null||Pn===void 0)?void 0:Pn.indexOf("image"))>-1?yt.replaceSelection(".concat(zt.content_type,")")):(Nt==null||((An=Nt.type)===null||An===void 0)?void 0:An.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((Qn=Nt.type)===null||Qn===void 0)?void 0:Qn.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):ae.includes(ci)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},jt=0;jt0||jt.target.offsetWidth>0)&&(Ln(),H.setSize("100%","100%"),H.refresh())}}catch(cn){Ht.e(cn)}finally{Ht.f()}});return wt.observe(Pt.current.parentElement),wt}if(H){var Rt=yt();return function(){Rt.unobserve(Pt.current.parentElement)}}},[H,Ln]),Object(v.useEffect)(function(){if(H){for(var yt=[],Rt=function(){var jt=Mt[wt];Ht=Object(z.a)(jt,2);var cn=Ht[0],Mn=Ht[1],Nt=Object(G.a)({},cn,function(){Xi(Mn)});yt.push(Nt),H.addKeyMap(Nt)},wt=0,Mt=Object.entries(le);wt0){var yt=new Date().getTime(),Rt=window.sessionStorage.getItem(Vt);yt>=Gn+lt&&(!Rt||Rt!==Ke)&&(window.sessionStorage.setItem(Vt,Ke),Ei(!0))}},lt),Object(v.useEffect)(function(){Wt(Dt)},[H,Dt]),Object(v.useEffect)(function(){H&&(Lt&&H.focus())},[H,Lt]),Object(v.useEffect)(function(){if(Tt&&H){var yt=H.getScrollerElement();function Rt(wt){var Mt=wt.target;if(ri.current){var Ht=Mt.scrollTop/Mt.scrollHeight;ri.current.scrollTop=ri.current.scrollHeight*Ht}}return yt.addEventListener("scroll",Rt),function(){yt.removeEventListener("scroll",Rt)}}},[H,Tt]),Object(v.useEffect)(function(){if(H&&hn){function yt(Rt,wt){hn(Rt,wt)}return H.on("beforeChange",yt),function(){H.off("beforeChange",yt)}}},[H,hn]),Object(v.useEffect)(function(){if(H&&It){function yt(){It(H.getValue())}return H.on("blur",yt),function(){H.off("blur",yt)}}},[H,It]),Object(v.useEffect)(function(){if(H){function yt(Rt){var wt=Rt.getValue();it(wt),ki(new Date().getTime()),Rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(wt)}return H.on("change",yt),function(){H.off("change",yt)}}},[H,rt]),Object(v.useEffect)(function(){H&&(ze==null?(H.setValue(""),it("")):ze!==H.getValue()&&(H.setValue(ze),it(ze),H.setCursor(H.lineCount(),0)))},[H,ze]);var Xi=Object(v.useCallback)(function(yt){var Rt=H.getCursor(),wt=H.getSelection(),Mt=wt.split(`
`);switch(yt){case"bold":return H.replaceSelection("**"+wt+"**"),wt===""&&H.setCursor(Rt.line,Rt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+wt+"*"),wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"code":return H.replaceSelection("`"+wt+"`"),wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+wt+"$$`"),wt===""&&H.setCursor(Rt.line,Rt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+wt+"\n```"),H.setCursor(Rt.line+1,wt.length+1),H.focus();case"line-break":return H.replaceSelection(`
`),H.focus();case"list-ul":return wt===""?H.replaceSelection("- "+wt):H.replaceSelection(Mt.map(function(Ht){return Ht===""?"":"- ".concat(Ht)}).join(`
`)),H.focus();case"list-ol":return wt===""?H.replaceSelection("1. "+wt):H.replaceSelection(Mt.map(function(Ht,Qt){return Ht===""?"":"".concat(Qt+1,". ").concat(Ht)}).join(`
`)),H.focus();case"add-null-ch":return wt===""&&H.setCursor(Rt.line,Rt.ch+1),H.replaceSelection(je),H.focus();case"inster-template-1":return wt===""&&H.setCursor(Rt.line,Rt.ch),H.replaceSelection(We),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return Wt(!Tt),H.focus();case"trigger-full-screen":return Cn(!Sn),H.focus();case Oe:Vn(Oe);return;case He:Vn(He);return;case Ie:Vn(Ie);return;case Xe:Vn(Xe);return;default:throw new Error}},[H,Tt,Sn]),xi=Object(v.useCallback)(function(yt){Vn("");switch(mn){case Oe:var Rt=yt.title,wt=yt.link;return H.replaceSelection("[".concat(Rt,"](").concat(wt,")")),H.focus();case He:var Mt=yt.language,Ht=yt.content;return H.replaceSelection(["```"+Mt,Ht,"```"].join(`
`)),H.focus();case Ie:var Qt=yt.src,jt=yt.alt;return jt?H.replaceSelection(".concat(Qt,' "').concat(jt,'" )')):H.replaceSelection("")),H.focus();case Xe:for(var cn=yt.row,Mn=yt.col,Nt=yt.align,ci=`
`,zt=0;zt300&&(cn=300);var Mn=St+cn+"px";qn(Mn)}}return yt.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Qt),document.addEventListener("mouseup",Ht),function(){yt.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Qt),document.removeEventListener("mouseup",Ht)}}},[H,Xt]),Object(v.useEffect)(function(){qn(St)},[St]);var ai=Ce(ct),fr=Ce(Vi),ei={width:ai,height:fr},pr=Object(v.useMemo)(function(){if(Gn){var yt=new Date(Gn),Rt=yt.getHours(),wt=yt.getMinutes(),Mt=yt.getSeconds();return Rt=Rt<10?"0"+Rt:Rt,wt=wt<10?"0"+wt:wt,Mt=Mt<10?"0"+Mt:Mt,"".concat(Rt,":").concat(wt,":").concat(Mt)}return 0},[Gn]);function jr(){window.sessionStorage.removeItem(Vt),Ei(!1),ki(0)}function Mi(){Ei(!1),ki(0),H.setValue(window.sessionStorage.getItem(Vt))}function ua(yt,Rt){var wt=H.getValue();wt=wt.replace(yt,Rt),it(wt),H==null||H.setValue(wt)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:on},m.a.createElement("div",{className:"markdown-editor-container ".concat(Je," ").concat(Tt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Sn?"full-screen":""),style:ei},m.a.createElement(b,{insertTemp:tt,watch:Tt,fullScreen:Sn,showNullButton:Ut,onActionCallback:Xi,hidetoolBar:Hn,uuid:an.current,setOpenPhones:function(){Gt.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Pt,placeholder:vi})),Tt?m.a.createElement("div",{ref:ri,className:"preview-container"},En==="stex"&&m.a.createElement(D,{value:Ke}),En!=="stex"&&m.a.createElement(T.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Xt,className:"editor-resize"}):null,m.a.createElement(B.a,null,fe[mn]?m.a.createElement($.a,{centered:!0,title:fe[mn],visible:!0,onCancel:Ti,footer:null,className:"markdown-popup-form"},dr):null))}},SJMd:function(ot,xe){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Z,re,$,P=!1,Y,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,z;(function(){var G=window,n=["break,continue,do,else,for,if,return,while"],R=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",h=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[m,u,p,d,o,h,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",D="kwd",L="com",w="typ",O="lit",S="pun",f="pln",C="tag",y="dec",b="src",B="atn",F="atv",x="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ae){for(var Pe=0,Be=!1,oe=!1,ge=0,Oe=Ae.length;ge122||(ae<65||Te>90||ut.push([Math.max(65,Te)|32,Math.min(ae,90)|32]),ae<97||Te>122||ut.push([Math.max(97,Te)&~32,Math.min(ae,122)&~32]))}}ut.sort(function(we,Ue){return we[0]-Ue[0]||Ue[1]-we[1]});for(var le=[],fe=[],We=0;Weme[0]&&(me[1]+1>me[0]&&je.push("-"),je.push(qe(me[1])))}return je.push("]"),je.join("")}function nt(Qe){for(var Fe=Qe.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ut=Fe.length,lt=[],je=0,We=0;je=2&&Te==="["?Fe[je]=Ze(Ce):Te!=="\\"&&(Fe[je]=Ce.replace(/[a-zA-Z]/g,function(fe){var me=fe.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Fe.join("")}for(var $e=[],ge=0,Oe=Ae.length;ge=0;)Be[$e.charAt(Qe)]=nt;var Fe=nt[1],ut=""+Fe;Xe.hasOwnProperty(ut)||(He.push(Fe),Xe[ut]=null)}He.push(/[\0-\uffff]/),oe=I(He)})();var ge=Pe.length,Oe=function(Ie){for(var He=Ie.sourceCode,Xe=Ie.basePos,qe=Ie.sourceNode,Ze=[Xe,f],nt=0,$e=He.match(oe)||[],Qe={},Fe=0,ut=$e.length;Fe=5&&je.substring(0,5)==="lang-",Ce&&!(We&&typeof We[1]=="string")&&(Ce=!1,je=b),Ce||(Qe[lt]=je)}var ae=nt;if(nt+=lt.length,!Ce)Ze.push(Xe+ae,je);else{var le=We[1],fe=lt.indexOf(le),me=fe+le.length;We[2]&&(me=lt.length-We[2].length,fe=me-le.length);var we=je.substring(5);W(qe,Xe+ae,lt.substring(0,fe),Oe,Ze),W(qe,Xe+ae+fe,le,he(we,le),Ze),W(qe,Xe+ae+me,lt.substring(me),Oe,Ze)}}Ie.decorations=Ze};return Oe}function Re(Ae){var Pe=[],Be=[];Ae.tripleQuotedStrings?Pe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?Pe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Be.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var oe=Ae.hashComments;oe&&(Ae.cStyleComments?(oe>1?Pe.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([L,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Be.push([L,/^\/\/[^\r\n]*/,null]),Be.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=Ae.regexLiterals;if(ge){var Oe=ge>1?"":`
\r`,Ie=Oe?".":"[\\S\\s]",He="/(?=[^/*"+Oe+"])(?:[^/\\x5B\\x5C"+Oe+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+Oe+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+N+"("+He+")")])}var Xe=Ae.types;Xe&&Be.push([w,Xe]);var qe=(""+Ae.keywords).replace(/^ | $/g,"");qe.length&&Be.push([D,new RegExp("^(?:"+qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([f,/^\s+/,null,` \r
\xA0`]);var Ze="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(Ze+="(?!s*/)"),Be.push([O,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[O,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[S,new RegExp(Ze),null]),ue(Pe,Be)}var ve=Re({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Ae,Pe,Be){for(var oe=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,Oe=Ae.ownerDocument,Ie=Oe.createElement("li");Ae.firstChild;)Ie.appendChild(Ae.firstChild);var He=[Ie];function Xe(Fe){var ut=Fe.nodeType;if(ut==1&&!oe.test(Fe.className))if(Fe.nodeName==="br")qe(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var lt=Fe.firstChild;lt;lt=lt.nextSibling)Xe(lt);else if((ut==3||ut==4)&&Be){var je=Fe.nodeValue,We=je.match(ge);if(We){var Ce=je.substring(0,We.index);Fe.nodeValue=Ce;var _e=je.substring(We.index+We[0].length);if(_e){var Te=Fe.parentNode;Te.insertBefore(Oe.createTextNode(_e),Fe.nextSibling)}qe(Fe),Ce||Fe.parentNode.removeChild(Fe)}}}function qe(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function ut(We,Ce){var _e=Ce?We.cloneNode(!1):We,Te=We.parentNode;if(Te){var ae=ut(Te,1),le=We.nextSibling;ae.appendChild(_e);for(var fe=le;fe;fe=le)le=fe.nextSibling,ae.appendChild(fe)}return _e}for(var lt=ut(Fe.nextSibling,0),je;(je=lt.parentNode)&&je.nodeType===1;)lt=je;He.push(lt)}for(var Ze=0;Ze=Te&&(Xe+=2),Oe>=ae&&(nt+=2)}}finally{je&&(je.style.display=We)}}var be={};function ce(Ae,Pe){for(var Be=Pe.length;--Be>=0;){var oe=Pe[Be];be.hasOwnProperty(oe)?G.console&&console.warn("cannot override language handler %s",oe):be[oe]=Ae}}function he(Ae,Pe){return Ae&&be.hasOwnProperty(Ae)||(Ae=/^\s*]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[S,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^