You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
354 lines
676 KiB
354 lines
676 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[152,6,7],{"+NIl":function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(fe,he){"use strict";function we(E,k){E.cmdState.push(k)}function ve(E){return E.cmdState.length>0?E.cmdState[E.cmdState.length-1]:null}function $(E){var k=E.cmdState.pop();k&&k.closeBracket()}function G(E){for(var k=E.cmdState,I=k.length-1;I>=0;I--){var v=k[I];if(v.name=="DEFAULT")continue;return v}return{styleIdentifier:function(){return null}}}function Q(E,k,I){return function(){this.name=E,this.bracketNo=0,this.style=k,this.styles=I,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var H={};H.importmodule=Q("importmodule","tag",["string","builtin"]),H.documentclass=Q("documentclass","tag",["","atom"]),H.usepackage=Q("usepackage","tag",["atom"]),H.begin=Q("begin","tag",["atom"]),H.end=Q("end","tag",["atom"]),H.label=Q("label","tag",["atom"]),H.ref=Q("ref","tag",["atom"]),H.eqref=Q("eqref","tag",["atom"]),H.cite=Q("cite","tag",["atom"]),H.bibitem=Q("bibitem","tag",["atom"]),H.Bibitem=Q("Bibitem","tag",["atom"]),H.RBibitem=Q("RBibitem","tag",["atom"]),H.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function O(E,k){E.f=k}function x(E,k){var I;if(E.match(/^\\[a-zA-Z@]+/)){var v=E.current().slice(1);return I=H.hasOwnProperty(v)?H[v]:H.DEFAULT,I=new I,we(k,I),O(k,T),I.style}if(E.match(/^\\[$&%#{}_]/))return"tag";if(E.match(/^\\[,;!\/\\]/))return"tag";if(E.match("\\["))return O(k,function(A,F){return b(A,F,"\\]")}),"keyword";if(E.match("\\("))return O(k,function(A,F){return b(A,F,"\\)")}),"keyword";if(E.match("$$"))return O(k,function(A,F){return b(A,F,"$$")}),"keyword";if(E.match("$"))return O(k,function(A,F){return b(A,F,"$")}),"keyword";var y=E.next();if(y=="%")return E.skipToEnd(),"comment";if(y=="}"||y=="]"){if(I=ve(k),I)I.closeBracket(y),O(k,T);else return"error";return"bracket"}else return y=="{"||y=="["?(I=H.DEFAULT,I=new I,we(k,I),"bracket"):/\d/.test(y)?(E.eatWhile(/[\w.%]/),"atom"):(E.eatWhile(/[\w\-_]/),I=G(k),I.name=="begin"&&(I.argument=E.current()),I.styleIdentifier())}function b(E,k,I){if(E.eatSpace())return null;if(I&&E.match(I))return O(k,x),"keyword";if(E.match(/^\\[a-zA-Z@]+/))return"tag";if(E.match(/^[a-zA-Z]+/))return"variable-2";if(E.match(/^\\[$&%#{}_]/))return"tag";if(E.match(/^\\[,;!\/]/))return"tag";if(E.match(/^[\^_&]/))return"tag";if(E.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(E.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var v=E.next();return v=="{"||v=="}"||v=="["||v=="]"||v=="("||v==")"?"bracket":v=="%"?(E.skipToEnd(),"comment"):"error"}function T(E,k){var I=E.peek(),v;return I=="{"||I=="["?(v=ve(k),v.openBracket(I),E.eat(I),O(k,x),"bracket"):/[ \t\r]/.test(I)?(E.eat(I),null):(O(k,x),$(k),x(E,k))}return{startState:function(){var E=he.inMathMode?function(k,I){return b(k,I)}:x;return{cmdState:[],f:E}},copyState:function(E){return{cmdState:E.cmdState.slice(),f:E.f}},token:function(E,k){return k.f(E,k)},blankLine:function(E){E.f=x,E.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(gt,pe,w){},"/cxE":function(gt,pe,w){"use strict";w.d(pe,"e",function(){return he}),w.d(pe,"f",function(){return we}),w.d(pe,"g",function(){return ve}),w.d(pe,"d",function(){return G}),w.d(pe,"a",function(){return Q}),w.d(pe,"b",function(){return H}),w.d(pe,"c",function(){return O});var Z=function(){function x(){this.listeners=[],this.unexpectedErrorHandler=function(b){setTimeout(function(){throw b.stack?new Error(b.message+`
|
|
|
|
`+b.stack):b},0)}}return x.prototype.emit=function(b){this.listeners.forEach(function(T){T(b)})},x.prototype.onUnexpectedError=function(b){this.unexpectedErrorHandler(b),this.emit(b)},x.prototype.onUnexpectedExternalError=function(b){this.unexpectedErrorHandler(b)},x}(),fe=new Z;function he(x){G(x)||fe.onUnexpectedError(x);return}function we(x){G(x)||fe.onUnexpectedExternalError(x);return}function ve(x){if(x instanceof Error){var b=x.name,T=x.message,E=x.stacktrace||x.stack;return{$isError:!0,name:b,message:T,stack:E}}return x}var $="Canceled";function G(x){return x instanceof Error&&x.name===$&&x.message===$}function Q(){var x=new Error($);return x.name=x.message,x}function H(x){return x?new Error("Illegal argument: "+x):new Error("Illegal argument")}function O(x){return x?new Error("Illegal state: "+x):new Error("Illegal state")}},"19Vz":function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(Q,H,O){var x=O&&O!=Z.Init;if(H&&!x)Q.on("blur",ve),Q.on("change",$),Q.on("swapDoc",$),Z.on(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose=function(){we(Q)}),$(Q);else if(!H&&x){Q.off("blur",ve),Q.off("change",$),Q.off("swapDoc",$),Z.off(Q.getInputField(),"compositionupdate",Q.state.placeholderCompose),fe(Q);var b=Q.getWrapperElement();b.className=b.className.replace(" CodeMirror-empty","")}H&&!Q.hasFocus()&&ve(Q)});function fe(Q){Q.state.placeholder&&(Q.state.placeholder.parentNode.removeChild(Q.state.placeholder),Q.state.placeholder=null)}function he(Q){fe(Q);var H=Q.state.placeholder=document.createElement("pre");H.style.cssText="height: 0; overflow: visible",H.style.direction=Q.getOption("direction"),H.className="CodeMirror-placeholder CodeMirror-line-like";var O=Q.getOption("placeholder");typeof O=="string"&&(O=document.createTextNode(O)),H.appendChild(O),Q.display.lineSpace.insertBefore(H,Q.display.lineSpace.firstChild)}function we(Q){setTimeout(function(){var H=!1,O=Q.getInputField();O.nodeName=="TEXTAREA"?H=!O.value:Q.lineCount()==1&&(H=!/[^\u200b]/.test(O.querySelector(".CodeMirror-line").textContent)),H?he(Q):fe(Q)},20)}function ve(Q){G(Q)&&he(Q)}function $(Q){var H=Q.getWrapperElement(),O=G(Q);H.className=H.className.replace(" CodeMirror-empty","")+(O?" CodeMirror-empty":""),O?he(Q):fe(Q)}function G(Q){return Q.lineCount()===1&&Q.getLine(0)===""}})},"1eCo":function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){"use strict";var fe={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},he={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(we,ve){var $=we.indentUnit,G={},Q=ve.htmlMode?fe:he;for(var H in Q)G[H]=Q[H];for(var H in ve)G[H]=ve[H];var O,x;function b(D,be){function ne(U){return be.tokenize=U,U(D,be)}var W=D.next();if(W=="<")return D.eat("!")?D.eat("[")?D.match("CDATA[")?ne(k("atom","]]>")):null:D.match("--")?ne(k("comment","-->")):D.match("DOCTYPE",!0,!0)?(D.eatWhile(/[\w\._\-]/),ne(I(1))):null:D.eat("?")?(D.eatWhile(/[\w\._\-]/),be.tokenize=k("meta","?>"),"meta"):(O=D.eat("/")?"closeTag":"openTag",be.tokenize=T,"tag bracket");if(W=="&"){var ie;return D.eat("#")?D.eat("x")?ie=D.eatWhile(/[a-fA-F\d]/)&&D.eat(";"):ie=D.eatWhile(/[\d]/)&&D.eat(";"):ie=D.eatWhile(/[\w\.\-:]/)&&D.eat(";"),ie?"atom":"error"}else return D.eatWhile(/[^&<]/),null}b.isInText=!0;function T(D,be){var ne=D.next();if(ne==">"||ne=="/"&&D.eat(">"))return be.tokenize=b,O=ne==">"?"endTag":"selfcloseTag","tag bracket";if(ne=="=")return O="equals",null;if(ne=="<"){be.tokenize=b,be.state=F,be.tagName=be.tagStart=null;var W=be.tokenize(D,be);return W?W+" tag error":"tag error"}else return/[\'\"]/.test(ne)?(be.tokenize=E(ne),be.stringStartCol=D.column(),be.tokenize(D,be)):(D.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function E(D){var be=function(ne,W){for(;!ne.eol();)if(ne.next()==D){W.tokenize=T;break}return"string"};return be.isInAttribute=!0,be}function k(D,be){return function(ne,W){for(;!ne.eol();){if(ne.match(be)){W.tokenize=b;break}ne.next()}return D}}function I(D){return function(be,ne){for(var W;(W=be.next())!=null;){if(W=="<")return ne.tokenize=I(D+1),ne.tokenize(be,ne);if(W==">")if(D==1){ne.tokenize=b;break}else return ne.tokenize=I(D-1),ne.tokenize(be,ne)}return"meta"}}function v(D,be,ne){this.prev=D.context,this.tagName=be,this.indent=D.indented,this.startOfLine=ne,(G.doNotIndent.hasOwnProperty(be)||D.context&&D.context.noIndent)&&(this.noIndent=!0)}function y(D){D.context&&(D.context=D.context.prev)}function A(D,be){for(var ne;;){if(!D.context)return;if(ne=D.context.tagName,!G.contextGrabbers.hasOwnProperty(ne)||!G.contextGrabbers[ne].hasOwnProperty(be))return;y(D)}}function F(D,be,ne){return D=="openTag"?(ne.tagStart=be.column(),me):D=="closeTag"?ce:F}function me(D,be,ne){return D=="word"?(ne.tagName=be.current(),x="tag",Ee):G.allowMissingTagName&&D=="endTag"?(x="tag bracket",Ee(D,be,ne)):(x="error",me)}function ce(D,be,ne){if(D=="word"){var W=be.current();return ne.context&&ne.context.tagName!=W&&G.implicitlyClosed.hasOwnProperty(ne.context.tagName)&&y(ne),ne.context&&ne.context.tagName==W||G.matchClosing===!1?(x="tag",ye):(x="tag error",Ne)}else return G.allowMissingTagName&&D=="endTag"?(x="tag bracket",ye(D,be,ne)):(x="error",Ne)}function ye(D,be,ne){return D!="endTag"?(x="error",ye):(y(ne),F)}function Ne(D,be,ne){return x="error",ye(D,be,ne)}function Ee(D,be,ne){if(D=="word")return x="attribute",De;if(D=="endTag"||D=="selfcloseTag"){var W=ne.tagName,ie=ne.tagStart;return ne.tagName=ne.tagStart=null,D=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(W)?A(ne,W):(A(ne,W),ne.context=new v(ne,W,ie==ne.indented)),F}return x="error",Ee}function De(D,be,ne){return D=="equals"?Ke:(G.allowMissing||(x="error"),Ee(D,be,ne))}function Ke(D,be,ne){return D=="string"?le:D=="word"&&G.allowUnquoted?(x="string",Ee):(x="error",Ee(D,be,ne))}function le(D,be,ne){return D=="string"?le:Ee(D,be,ne)}return{startState:function(D){var be={tokenize:b,state:F,indented:D||0,tagName:null,tagStart:null,context:null};return D!=null&&(be.baseIndent=D),be},token:function(D,be){if(!be.tagName&&D.sol()&&(be.indented=D.indentation()),D.eatSpace())return null;O=null;var ne=be.tokenize(D,be);return(ne||O)&&ne!="comment"&&(x=null,be.state=be.state(O||ne,D,be),x&&(ne=x=="error"?ne+" error":x)),ne},indent:function(D,be,ne){var W=D.context;if(D.tokenize.isInAttribute)return D.tagStart==D.indented?D.stringStartCol+1:D.indented+$;if(W&&W.noIndent)return Z.Pass;if(D.tokenize!=T&&D.tokenize!=b)return ne?ne.match(/^(\s*)/)[0].length:0;if(D.tagName)return G.multilineTagIndentPastTag!==!1?D.tagStart+D.tagName.length+2:D.tagStart+$*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(be))return 0;var ie=be&&/^<(\/)?([\w_:\.-]*)/.exec(be);if(ie&&ie[1])for(;W;)if(W.tagName==ie[2]){W=W.prev;break}else if(G.implicitlyClosed.hasOwnProperty(W.tagName))W=W.prev;else break;else if(ie)for(;W;){var U=G.contextGrabbers[W.tagName];if(U&&U.hasOwnProperty(ie[2]))W=W.prev;else break}for(;W&&W.prev&&!W.startOfLine;)W=W.prev;return W?W.indent+$:D.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(D){D.state==Ke&&(D.state=Ee)},xmlCurrentTag:function(D){return D.tagName?{name:D.tagName,close:D.type=="closeTag"}:null},xmlCurrentContext:function(D){for(var be=[],ne=D.context;ne;ne=ne.prev)ne.tagName&&be.push(ne.tagName);return be.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return he});var Z=w("JYp7"),fe=function(){function we(ve){this.element=ve,this.next=we.Undefined,this.prev=we.Undefined}return we.Undefined=new we(void 0),we}(),he=function(){function we(){this._first=fe.Undefined,this._last=fe.Undefined,this._size=0}return Object.defineProperty(we.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),we.prototype.isEmpty=function(){return this._first===fe.Undefined},we.prototype.clear=function(){this._first=fe.Undefined,this._last=fe.Undefined,this._size=0},we.prototype.unshift=function(ve){return this._insert(ve,!1)},we.prototype.push=function(ve){return this._insert(ve,!0)},we.prototype._insert=function(ve,$){var G=this,Q=new fe(ve);if(this._first===fe.Undefined)this._first=Q,this._last=Q;else if($){var H=this._last;this._last=Q,Q.prev=H,H.next=Q}else{var O=this._first;this._first=Q,Q.next=O,O.prev=Q}this._size+=1;var x=!1;return function(){x||(x=!0,G._remove(Q))}},we.prototype.shift=function(){if(this._first===fe.Undefined)return;var ve=this._first.element;return this._remove(this._first),ve},we.prototype.pop=function(){if(this._last===fe.Undefined)return;var ve=this._last.element;return this._remove(this._last),ve},we.prototype._remove=function(ve){if(ve.prev!==fe.Undefined&&ve.next!==fe.Undefined){var $=ve.prev;$.next=ve.next,ve.next.prev=$}else ve.prev===fe.Undefined&&ve.next===fe.Undefined?(this._first=fe.Undefined,this._last=fe.Undefined):ve.next===fe.Undefined?(this._last=this._last.prev,this._last.next=fe.Undefined):ve.prev===fe.Undefined&&(this._first=this._first.next,this._first.prev=fe.Undefined);this._size-=1},we.prototype.iterator=function(){var ve,$=this._first;return{next:function(){return $===fe.Undefined?Z.c:(ve?ve.value=$.element:ve={done:!1,value:$.element},$=$.next,ve)}}},we.prototype.toArray=function(){for(var ve=[],$=this._first;$!==fe.Undefined;$=$.next)ve.push($.element);return ve},we}()},"746U":function(gt,pe,w){"use strict";w.d(pe,"d",function(){return fe}),w.d(pe,"j",function(){return he}),w.d(pe,"i",function(){return we}),w.d(pe,"h",function(){return ve}),w.d(pe,"e",function(){return $}),w.d(pe,"k",function(){return G}),w.d(pe,"l",function(){return Q}),w.d(pe,"a",function(){return H}),w.d(pe,"f",function(){return x}),w.d(pe,"g",function(){return b}),w.d(pe,"m",function(){return T}),w.d(pe,"c",function(){return I}),w.d(pe,"b",function(){return v}),w.d(pe,"n",function(){return y}),w.d(pe,"o",function(){return A});var Z={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function fe(F){return Array.isArray?Array.isArray(F):!!(F&&typeof F.length===Z.number&&F.constructor===Array)}function he(F){return typeof F===Z.string||F instanceof String}function we(F){return typeof F===Z.object&&F!==null&&!Array.isArray(F)&&!(F instanceof RegExp)&&!(F instanceof Date)}function ve(F){return(typeof F===Z.number||F instanceof Number)&&!isNaN(F)}function $(F){return F===!0||F===!1}function G(F){return typeof F===Z.undefined}function Q(F){return G(F)||F===null}function H(F,me){if(!F)throw new Error(me?"Unexpected type, expected '"+me+"'":"Unexpected type")}var O=Object.prototype.hasOwnProperty;function x(F){if(!we(F))return!1;for(var me in F)if(O.call(F,me))return!1;return!0}function b(F){return typeof F===Z.function}function T(F,me){for(var ce=Math.min(F.length,me.length),ye=0;ye<ce;ye++)E(F[ye],me[ye])}function E(F,me){if(he(me)){if(typeof F!==me)throw new Error("argument does not match constraint: typeof "+me)}else if(b(me)){try{if(F instanceof me)return}catch(ce){}if(!Q(F)&&F.constructor===me)return;if(me.length===1&&me.call(void 0,F)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function k(F){for(var me=[],ce=Object.getPrototypeOf(F);Object.prototype!==ce;)me=me.concat(Object.getOwnPropertyNames(ce)),ce=Object.getPrototypeOf(ce);return me}function I(F){for(var me=[],ce=0,ye=k(F);ce<ye.length;ce++){var Ne=ye[ce];typeof F[Ne]=="function"&&me.push(Ne)}return me}function v(F,me){for(var ce=function(Ke){return function(){var le=Array.prototype.slice.call(arguments,0);return me(Ke,le)}},ye={},Ne=0,Ee=F;Ne<Ee.length;Ne++){var De=Ee[Ne];ye[De]=ce(De)}return ye}function y(F){return F===null?void 0:F}function A(F){return typeof F=="undefined"?null:F}},"7Cbv":function(gt,pe,w){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),fe=new Uint8Array(16);function he(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(fe)}var we=/^(?:[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 ve(T){return typeof T=="string"&&we.test(T)}for(var $=ve,G=[],Q=0;Q<256;++Q)G.push((Q+256).toString(16).substr(1));function H(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,k=(G[T[E+0]]+G[T[E+1]]+G[T[E+2]]+G[T[E+3]]+"-"+G[T[E+4]]+G[T[E+5]]+"-"+G[T[E+6]]+G[T[E+7]]+"-"+G[T[E+8]]+G[T[E+9]]+"-"+G[T[E+10]]+G[T[E+11]]+G[T[E+12]]+G[T[E+13]]+G[T[E+14]]+G[T[E+15]]).toLowerCase();if(!$(k))throw TypeError("Stringified UUID is invalid");return k}var O=H;function x(T,E,k){T=T||{};var I=T.random||(T.rng||he)();if(I[6]=I[6]&15|64,I[8]=I[8]&63|128,E){k=k||0;for(var v=0;v<16;++v)E[k+v]=I[v];return E}return O(I)}var b=pe.a=x},"7ahc":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return me});var Z=w("k1fw"),fe=w("0Owb"),he=w("+L6B"),we=w("2/Rp"),ve=w("y8nQ"),$=w("Vl3Y"),G=w("tJVT"),Q=w("OaEy"),H=w("2fM7"),O=w("q1tI"),x=w.n(O),b=w("VrN/"),T=w.n(b),E=w("p77/"),k=w.n(E),I=w("c5Ni"),v=w.n(I),y=H.a.Option,A={labelCol:{span:4},wrapperCol:{span:20}},F={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"]};pe.b=function(ce){var ye=ce.callback,Ne=ce.onCancel,Ee=Object(O.useState)("python"),De=Object(G.a)(Ee,2),Ke=De[0],le=De[1];function D(ne){le(F[ne][1])}function be(ne){ye(ne)}return x.a.createElement($.a,Object(fe.a)({},A,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:be}),x.a.createElement($.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(H.a,{onChange:D},Object.keys(F).map(function(ne){return x.a.createElement(y,{key:ne,value:ne},F[ne][0])}))),x.a.createElement($.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(me,{mode:Ke})),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(we.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(we.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function me(ce){var ye=ce.value,Ne=ce.onChange,Ee=ce.mode,De=ce.options,Ke=De===void 0?{}:De,le=Object(O.useRef)(),D=Object(O.useState)(),be=Object(G.a)(D,2),ne=be[0],W=be[1];return Object(O.useEffect)(function(){if(ne){function ie(U){var B=U.getValue();Ne&&Ne(B)}return ne.on("change",ie),function(){ne.off("change",ie)}}},[ne,Ne]),Object(O.useEffect)(function(){ne&&ne.setOption("mode",Ee)},[ne,Ee]),Object(O.useEffect)(function(){ne&&((ye!==ne.getValue()||ye==="")&&setTimeout(function(){ne.setValue(ye||" ")},300))},[ne,ye]),Object(O.useEffect)(function(){if(le.current&&!ne){var ie=T.a.fromTextArea(le.current,Object(Z.a)({mode:Ee,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ke));W(ie)}},[le.current,ne]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:le}))}},"7ixt":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return he});var Z={adjustX:1,adjustY:1},fe=[0,0],he={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:fe},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:fe},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:fe},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:fe},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:fe},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:fe},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:fe},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:fe},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:fe},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:fe},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:fe},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:fe}},we=he},"8EBN":function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){"use strict";Z.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 fe=0;fe<Z.modeInfo.length;fe++){var he=Z.modeInfo[fe];he.mimes&&(he.mime=he.mimes[0])}Z.findModeByMIME=function(we){we=we.toLowerCase();for(var ve=0;ve<Z.modeInfo.length;ve++){var $=Z.modeInfo[ve];if($.mime==we)return $;if($.mimes){for(var G=0;G<$.mimes.length;G++)if($.mimes[G]==we)return $}}if(/\+xml$/.test(we))return Z.findModeByMIME("application/xml");if(/\+json$/.test(we))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(we){we=we.toLowerCase();for(var ve=0;ve<Z.modeInfo.length;ve++){var $=Z.modeInfo[ve];if($.ext){for(var G=0;G<$.ext.length;G++)if($.ext[G]==we)return $}}},Z.findModeByFileName=function(we){for(var ve=0;ve<Z.modeInfo.length;ve++){var $=Z.modeInfo[ve];if($.file&&$.file.test(we))return $}var G=we.lastIndexOf("."),Q=G>-1&&we.substring(G+1,we.length);if(Q)return Z.findModeByExtension(Q)},Z.findModeByName=function(we){we=we.toLowerCase();for(var ve=0;ve<Z.modeInfo.length;ve++){var $=Z.modeInfo[ve];if($.name.toLowerCase()==we)return $;if($.alias){for(var G=0;G<$.alias.length;G++)if($.alias[G].toLowerCase()==we)return $}}}})},"8HAY":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return $}),w.d(pe,"b",function(){return G});var Z=w("pmY6"),fe=w("MI8n"),he=function(){var Q=function(H,O){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,b){x.__proto__=b}||function(x,b){for(var T in b)b.hasOwnProperty(T)&&(x[T]=b[T])},Q(H,O)};return function(H,O){Q(H,O);function x(){this.constructor=H}H.prototype=O===null?Object.create(O):(x.prototype=O.prototype,new x)}}(),we=function(Q,H,O,x){function b(T){return T instanceof O?T:new O(function(E){E(T)})}return new(O||(O=Promise))(function(T,E){function k(y){try{v(x.next(y))}catch(A){E(A)}}function I(y){try{v(x.throw(y))}catch(A){E(A)}}function v(y){y.done?T(y.value):b(y.value).then(k,I)}v((x=x.apply(Q,H||[])).next())})},ve=function(Q,H){var O={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},x,b,T,E;return E={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function k(v){return function(y){return I([v,y])}}function I(v){if(x)throw new TypeError("Generator is already executing.");for(;O;)try{if(x=1,b&&(T=v[0]&2?b.return:v[0]?b.throw||((T=b.return)&&T.call(b),0):b.next)&&!(T=T.call(b,v[1])).done)return T;(b=0,T)&&(v=[v[0]&2,T.value]);switch(v[0]){case 0:case 1:T=v;break;case 4:return O.label++,{value:v[1],done:!1};case 5:O.label++,b=v[1],v=[0];continue;case 7:v=O.ops.pop(),O.trys.pop();continue;default:if(!(T=O.trys,T=T.length>0&&T[T.length-1])&&(v[0]===6||v[0]===2)){O=0;continue}if(v[0]===3&&(!T||v[1]>T[0]&&v[1]<T[3])){O.label=v[1];break}if(v[0]===6&&O.label<T[1]){O.label=T[1],T=v;break}if(T&&O.label<T[2]){O.label=T[2],O.ops.push(v);break}T[2]&&O.ops.pop(),O.trys.pop();continue}v=H.call(Q,O)}catch(y){v=[6,y],b=0}finally{x=T=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},$=function(Q){he(H,Q);function H(O,x,b,T,E){x===void 0&&(x=""),b===void 0&&(b=""),T===void 0&&(T=!0);var k=Q.call(this)||this;return k._onDidChange=k._register(new fe.a),k.onDidChange=k._onDidChange.event,k._enabled=!0,k._checked=!1,k._id=O,k._label=x,k._cssClass=b,k._enabled=T,k._actionCallback=E,k}return Object.defineProperty(H.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"label",{get:function(){return this._label},set:function(O){this._setLabel(O)},enumerable:!0,configurable:!0}),H.prototype._setLabel=function(O){this._label!==O&&(this._label=O,this._onDidChange.fire({label:O}))},Object.defineProperty(H.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(O){this._setTooltip(O)},enumerable:!0,configurable:!0}),H.prototype._setTooltip=function(O){this._tooltip!==O&&(this._tooltip=O,this._onDidChange.fire({tooltip:O}))},Object.defineProperty(H.prototype,"class",{get:function(){return this._cssClass},set:function(O){this._setClass(O)},enumerable:!0,configurable:!0}),H.prototype._setClass=function(O){this._cssClass!==O&&(this._cssClass=O,this._onDidChange.fire({class:O}))},Object.defineProperty(H.prototype,"enabled",{get:function(){return this._enabled},set:function(O){this._setEnabled(O)},enumerable:!0,configurable:!0}),H.prototype._setEnabled=function(O){this._enabled!==O&&(this._enabled=O,this._onDidChange.fire({enabled:O}))},Object.defineProperty(H.prototype,"checked",{get:function(){return this._checked},set:function(O){this._setChecked(O)},enumerable:!0,configurable:!0}),H.prototype._setChecked=function(O){this._checked!==O&&(this._checked=O,this._onDidChange.fire({checked:O}))},H.prototype.run=function(O,x){return this._actionCallback?this._actionCallback(O):Promise.resolve(!0)},H}(Z.a),G=function(Q){he(H,Q);function H(){var O=Q!==null&&Q.apply(this,arguments)||this;return O._onDidBeforeRun=O._register(new fe.a),O.onDidBeforeRun=O._onDidBeforeRun.event,O._onDidRun=O._register(new fe.a),O.onDidRun=O._onDidRun.event,O}return H.prototype.run=function(O,x){return we(this,void 0,void 0,function(){var b,T;return ve(this,function(E){switch(E.label){case 0:if(!O.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:O}),E.label=1;case 1:return E.trys.push([1,3,,4]),[4,this.runAction(O,x)];case 2:return b=E.sent(),this._onDidRun.fire({action:O,result:b}),[3,4];case 3:return T=E.sent(),this._onDidRun.fire({action:O,error:T}),[3,4];case 4:return[2]}})})},H.prototype.runAction=function(O,x){var b=x?O.run(x):O.run();return Promise.resolve(b)},H}(Z.a)},"8hTe":function(gt,pe,w){gt.exports={button:"button___1wy9m"}},"9Bee":function(gt,pe,w){"use strict";var Z=w("DYRE"),fe=w("zeV3"),he=w("+L6B"),we=w("2/Rp"),ve=w("k1fw"),$=w("9og8"),G=w("tJVT"),Q=w("WmNS"),H=w.n(Q),O=w("q1tI"),x=w.n(O),b=w("vg9a"),T=w("DlQD"),E=w.n(T),k=w("rUJ1");function I(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(f){var c=f.match(/^\s+/);if(c===null)return f;var ee=Object(G.a)(c,1),Ue=ee[0];return Ue.length>=u.length?f.slice(u.length):f}).join(`
|
|
`)}var v=[],y=["<ul>"],A=new E.a.Renderer,F=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function me(){v.length=0,y=["<ul>"]}var ce={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ye(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var f=h[o];u.push("<li><a href='#"+f.anchor+"'>"+f.text+"</a>"),o++;var c=[];return o=ye(h,o,f.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(ee){u.push(ee)}),u.push("</ul>")),u.push("</li>"),o=ye(h,o,a,u),o}function Ne(){return ye(v,0,0,y),y.push("</ul>"),y.join("")}var Ee={heading:function(o){var a=F.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],f=I(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var ee=le(),Ue=f;f=ee,D[ee]={type:"block",expression:Ue}}return{type:"code",raw:u,lang:c,text:f}}}},De=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Ke=0,le=function(){return"__special_katext_id_".concat(Ke++,"__")},D={};function be(){return D}function ne(){Ke=0,D={}}function W(h){return h=h.replace(De,function(o,a){var u=le();return D[u]={type:"inline",expression:a},u}),h}var ie=A.listitem;A.listitem=function(h){return ie(W(h))};var U=A.paragraph;A.paragraph=function(h){return U(W(h))};var B=A.tablecell;A.tablecell=function(h,o){return B(W(h),o)},A.code=function(h,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?h:Object(k.escape)(h,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(k.escape)(h,!0))+"</code></pre>"},A.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return v.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},E.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:Ee,renderer:A});var N=E.a,m=w("SJMd"),d=w("ulZh"),R=w.n(d),V=w("m3rI"),ae=w("Oy/b"),_e=w("p5ED"),Fe=w("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 Le=function(h,o){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(a[f]=u[f])})(h,o)};function Re(h,o){function a(){this.constructor=h}Le(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Ae(h,o,a,u){return new(a||(a=Promise))(function(f,c){function ee(ft){try{qe(u.next(ft))}catch(ze){c(ze)}}function Ue(ft){try{qe(u.throw(ft))}catch(ze){c(ze)}}function qe(ft){var ze;ft.done?f(ft.value):(ze=ft.value,ze instanceof a?ze:new a(function(At){At(ze)})).then(ee,Ue)}qe((u=u.apply(h,o||[])).next())})}function Se(h,o){var a,u,f,c,ee={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(qe){return function(ft){return function(ze){if(a)throw new TypeError("Generator is already executing.");for(;ee;)try{if(a=1,u&&(f=2&ze[0]?u.return:ze[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,ze[1])).done)return f;switch(u=0,f&&(ze=[2&ze[0],f.value]),ze[0]){case 0:case 1:f=ze;break;case 4:return ee.label++,{value:ze[1],done:!1};case 5:ee.label++,u=ze[1],ze=[0];continue;case 7:ze=ee.ops.pop(),ee.trys.pop();continue;default:if(!(f=ee.trys,(f=f.length>0&&f[f.length-1])||ze[0]!==6&&ze[0]!==2)){ee=0;continue}if(ze[0]===3&&(!f||ze[1]>f[0]&&ze[1]<f[3])){ee.label=ze[1];break}if(ze[0]===6&&ee.label<f[1]){ee.label=f[1],f=ze;break}if(f&&ee.label<f[2]){ee.label=f[2],ee.ops.push(ze);break}f[2]&&ee.ops.pop(),ee.trys.pop();continue}ze=o.call(h,ee)}catch(At){ze=[6,At],u=0}finally{a=f=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([qe,ft])}}}function ue(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),f=0;for(o=0;o<a;o++)for(var c=arguments[o],ee=0,Ue=c.length;ee<Ue;ee++,f++)u[f]=c[ee];return u}var q=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,f=a;u<f.length;u++){var c=f[u],ee=c[0],Ue=c[1];o.setAttribute(ee,Ue)}},h.createRect=function(o,a,u){var f=document.createElementNS("http://www.w3.org/2000/svg","rect");return f.setAttribute("width",o.toString()),f.setAttribute("height",a.toString()),u&&h.setAttributes(f,u),f},h.createLine=function(o,a,u,f,c){var ee=document.createElementNS("http://www.w3.org/2000/svg","line");return ee.setAttribute("x1",o.toString()),ee.setAttribute("y1",a.toString()),ee.setAttribute("x2",u.toString()),ee.setAttribute("y2",f.toString()),c&&h.setAttributes(ee,c),ee},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var f=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return f.setAttribute("cx",(o/2).toString()),f.setAttribute("cy",(a/2).toString()),f.setAttribute("rx",(o/2).toString()),f.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(f,u),f},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,f,c,ee,Ue){var qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(qe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",f.toString()],["refX",c.toString()],["refY",ee.toString()]]),qe.appendChild(Ue),qe},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h}(),L=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),K=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var f=this;return new Promise(function(c){var ee=u!==void 0?u:document.createElement("canvas");o===null&&(f.markersOnly=!0,f.naturalSize=!1);var Ue=document.createElementNS("http://www.w3.org/2000/svg","svg");Ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ue.setAttribute("width",a.width.baseVal.valueAsString),Ue.setAttribute("height",a.height.baseVal.valueAsString),Ue.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ue.innerHTML=a.innerHTML,f.naturalSize===!0?(Ue.width.baseVal.value=o.naturalWidth,Ue.height.baseVal.value=o.naturalHeight):f.width!==void 0&&f.height!==void 0&&(Ue.width.baseVal.value=f.width,Ue.height.baseVal.value=f.height),ee.width=Ue.width.baseVal.value,ee.height=Ue.height.baseVal.value;var qe=Ue.outerHTML,ft=ee.getContext("2d");f.markersOnly!==!0&&ft.drawImage(o,0,0,ee.width,ee.height);var ze=window.URL,At=new Image(ee.width,ee.height);At.setAttribute("crossOrigin","anonymous");var jt=new Blob([qe],{type:"image/svg+xml"}),en=ze.createObjectURL(jt);At.onload=function(){ft.drawImage(At,0,0),ze.revokeObjectURL(en);var Xn=ee.toDataURL(f.imageType,f.imageQuality);c(Xn)},At.src=en})},h}(),j=function(){},ke=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new P("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new P("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new P("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new _("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new _("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),P=function(h,o){this.selector=h,this.style=o},_=function(h,o){this.localName=h,this.style=o},re=function(){function h(o,a,u,f,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=f,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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(c){var ee=document.createElement("div");ee.className=""+a.toolbarButtonStyleClass.name,ee.setAttribute("data-type-name",c.typeName),ee.innerHTML=c.icon,ee.addEventListener("click",function(){a.markerToolbarButtonClicked(ee,c)}),a.buttons.push(ee),a.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='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var f=document.createElement("div");f.className=this.toolbarBlockStyleClass.name,f.style.whiteSpace="nowrap",f.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(f),this.addActionButton(f,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(f,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},h.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},h.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},h.prototype.addActionButton=function(o,a,u){var f=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){f.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new _("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new _("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new _("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new P("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new P("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},h.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},h.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},h.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},h}(),Ce=function(){function h(o,a,u,f){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=f,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new _("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 _("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new _("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new _("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new _("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 _("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new _("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
padding: `+a+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new _("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new _("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new P("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new P("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},h.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},h.prototype.setPanelButtons=function(o){var a,u,f=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var ee;c.uiStyleSettings=f.uiStyleSettings;var Ue=document.createElement("div");Ue.className=f.toolboxButtonStyleClass.name+" "+((ee=f.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ee!==void 0?ee:f.toolboxButtonStyleColorsClass.name),Ue.innerHTML=c.icon,Ue.title=c.title,Ue.addEventListener("click",function(){f.panelButtonClick(c)}),f.panelButtons.push(Ue),f.buttonRow.appendChild(Ue)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var f=o.getUi();f.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(f),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=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,ee){var Ue,qe;c.className=a.toolboxButtonStyleClass.name+" "+(ee===u?""+((Ue=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:a.toolboxActiveButtonStyleColorsClass.name):""+((qe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:a.toolboxButtonStyleColorsClass.name))})},h}(),Pe=function(h,o){this.title=h,this.icon=o},Oe=function(h){function o(a,u,f,c){var ee=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ee.colors=[],ee.addTransparent=!1,ee.colorBoxes=[],ee.colors=u,ee.currentColor=f,ee.setCurrentColor=ee.setCurrentColor.bind(ee),ee.getColorBox=ee.getColorBox.bind(ee),ee}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(f){var c=a.getColorBox(f);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,f=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-f,ee=document.createElement("div");ee.style.display="inline-block",ee.style.boxSizing="content-box",ee.style.width=c-2+"px",ee.style.height=c-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=(c+2)/2+"px",ee.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ee.addEventListener("click",function(){u.setCurrentColor(a,ee)});var Ue=document.createElement("div");return Ue.style.display="inline-block",Ue.style.width=c-2+"px",Ue.style.height=c-2+"px",Ue.style.backgroundColor=a,Ue.style.borderRadius=c/2+"px",a==="transparent"&&(Ue.style.fill=this.uiStyleSettings.toolboxAccentColor,Ue.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),ee.appendChild(Ue),ee},o.prototype.setCurrentColor=function(a,u){var f=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Pe),He=function(){function h(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,a){},h.prototype.dblClick=function(o,a){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,a){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},h.typeName="MarkerBase",h}(),Ge=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},h}(),ut=function(){function h(){this.GRIP_SIZE=10,this.visual=q.createGroup(),this.visual.appendChild(q.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(q.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),Ze=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},h}(),it=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(q.createTransform()),c.setupControlBox(),c}return Re(o,h),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=q.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var f=this.unrotatePoint(a);if(this.manipulationStartX=f.x,this.manipulationStartY=f.y,this.offsetX=f.x-this.left,this.offsetY=f.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.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"},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,f=this.manipulationStartWidth,c=this.manipulationStartTop,ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,f=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:f=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,ee=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ee=this.manipulationStartHeight+a.y-this.manipulationStartY}f>=0?(this.left=u,this.width=f):(this.left=u+f,this.width=-f),ee>=0?(this.top=c,this.height=ee):(this.top=c+ee,this.height=-ee),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),f=q.createPoint(a.x,a.y);return{x:(f=f.matrixTransform(u)).x,y:f.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var f=q.createPoint(a.x,a.y);return{x:(f=f.matrixTransform(u)).x,y:f.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=q.createGroup();var a=q.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=q.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=q.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 Ge,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,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()},o.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()},o.prototype.createGrip=function(){var a=new ut;return a.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,f=u,c=(this.width+this.CB_DISTANCE)/2-a/2,ee=(this.height+this.CB_DISTANCE)/2-a/2,Ue=this.height+this.CB_DISTANCE-a/2,qe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,f),this.positionGrip(this.controlGrips.topCenter.visual,c,f),this.positionGrip(this.controlGrips.topRight.visual,qe,f),this.positionGrip(this.controlGrips.centerLeft.visual,u,ee),this.positionGrip(this.controlGrips.centerRight.visual,qe,ee),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ue),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ue),this.positionGrip(this.controlGrips.bottomRight.visual,qe,Ue),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,f-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,f){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,f),a.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ze.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ze.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ze.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var f=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:f.x*a,y:f.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(He),Qe=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=q.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)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(it),yt=function(h){function o(a,u,f,c){var ee=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ee.widths=[],ee.widthBoxes=[],ee.widths=u,ee.currentWidth=f,ee.setCurrentWidth=ee.setCurrentWidth.bind(ee),ee}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(f){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=f===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(f,c)}),u.appendChild(c);var ee=document.createElement("div");ee.innerText=f.toString(),ee.style.marginRight="5px",c.appendChild(ee);var Ue=document.createElement("div");Ue.style.minHeight="20px",Ue.style.flexGrow="2",Ue.style.display="flex",Ue.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=f+"px solid "+a.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",Ue.appendChild(qe),c.appendChild(Ue),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var f=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Pe),ct=function(h){function o(a,u,f,c){var ee=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ee.styles=[],ee.styleBoxes=[],ee.styles=u,ee.currentStyle=f,ee.setCurrentStyle=ee.setCurrentStyle.bind(ee),ee}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(f){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=f===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(f,c)}),u.appendChild(c);var ee=document.createElement("div");ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.overflow="hidden";var Ue=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(f!==""?'stroke-dasharray="'+f+'"':"")+` />
|
|
</svg>`;ee.innerHTML=Ue,c.appendChild(ee),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var f=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Pe),dt=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.strokeColor=f.defaultColor,c.strokeWidth=f.defaultStrokeWidth,c.strokeDasharray=f.defaultStrokeDasharray,c.strokePanel=new Oe("Line color",f.defaultColorSet,f.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new ct("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Re(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(Qe),Me=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},et=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return Re(o,h),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.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(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),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(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=q.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new ut;return a.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,f){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,f),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(He),ht=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=f.defaultColor,c.strokeWidth=f.defaultStrokeWidth,c.strokeDasharray=f.defaultStrokeDasharray,c.strokePanel=new Oe("Line color",f.defaultColorSet,f.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new ct("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorLine=q.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=q.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)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.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()),q.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(et),je=function(h){function o(a,u,f,c){var ee=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ee.fonts=[],ee.fontBoxes=[],ee.fonts=u,ee.currentFont=f,ee.setCurrentFont=ee.setCurrentFont.bind(ee),ee}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(f){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=f===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(f,c)}),u.appendChild(c);var ee=document.createElement("div");ee.style.display="flex",ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.fontFamily=f,ee.style.overflow="hidden";var Ue=document.createElement("div");Ue.style.whiteSpace="nowrap",Ue.style.overflow="hidden",Ue.style.textOverflow="ellipsis",Ue.innerHTML="The quick brown fox jumps over the lazy dog",ee.appendChild(Ue),c.appendChild(ee),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var f=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Pe),Xe=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=f.defaultColor,c.fontFamily=f.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new Oe("Color",f.defaultColorSet,f.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new je("Font",f.defaultFontFamilies,f.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Re(o,h),o.prototype.ownsTarget=function(a){if(h.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(f){f===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=q.createGroup(),this.bgRectangle=q.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=q.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=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(u){a.textElement.appendChild(q.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var f=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(f,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),f=0,c=0;return u.width>0&&u.height>0&&(f=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:f,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),f=this.getTextPosition(u);f.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+f.x+"px, "+f.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(f.x,f.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=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(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var f=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(f)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),f=this.textElement.getBBox(),c={x:f.width*a,y:f.height*a};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){h.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&q.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&q.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(it),se=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=f.defaultColor,c.lineWidth=f.defaultStrokeWidth,c.pixelRatio=f.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new Oe("Color",f.defaultColorSet,f.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=q.createGroup(),this.drawingImage=q.createImage(),this.visual.appendChild(this.drawingImage);var a=q.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){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(a.x,a.y),this.drawing=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):h.prototype.pointerUp.call(this,a)},o.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)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],f=u[0],c=u[1],ee=u[2],Ue=u[3],qe=!1,ft=0;ft<this.canvasElement.height;ft++)for(var ze=0;ze<this.canvasElement.width;ze++)a.data[ft*this.canvasElement.width*4+4*ze+3]>0&&(qe=!0,ft<c&&(c=ft),ze<f&&(f=ze),ft>Ue&&(Ue=ft),ze>ee&&(ee=ze));if(qe){this.left=f/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(ee-f)/this.pixelRatio,this.height=(Ue-c)/this.pixelRatio;var At=document.createElement("canvas");At.width=ee-f,At.height=Ue-c,At.getContext("2d").putImageData(this.canvasContext.getImageData(f,c,ee-f,Ue-c),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),h.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(it),te=function(h){function o(a,u,f){var c=h.call(this,a,f||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var f=function(Ue){var qe="both";switch(Ue){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var ft=document.createElement("div");if(ft.style.display="flex",ft.style.flexGrow="2",ft.style.alignItems="center",ft.style.justifyContent="space-between",ft.style.padding="5px",ft.style.borderWidth="2px",ft.style.borderStyle="solid",ft.style.borderColor=qe===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",ft.addEventListener("click",function(){a.setCurrentType(qe,ft)}),u.appendChild(ft),qe==="both"||qe==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ze.style.marginLeft="5px",ft.appendChild(ze)}var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",At.appendChild(jt),ft.appendChild(At),qe==="both"||qe==="end"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,en.style.marginRight="5px",ft.appendChild(en)}c.typeBoxes.push(ft)},c=this,ee=0;ee<4;ee++)f(ee);return u},o.prototype.setCurrentType=function(a,u){var f=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings!==void 0?f.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Pe),oe=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new te("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var f=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-f/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+f/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=q.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=q.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.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",q.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),q.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var f=this.arrow2.transform.baseVal.getItem(0);f.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(f,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(ht),S=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.fillColor=f.defaultFillColor,c.strokeWidth=0,c.fillPanel=new Oe("Color",f.defaultColorSet,f.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Re(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(Qe),M=function(h){function o(a,u,f,c){var ee=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ee.opacities=[],ee.opacityBoxes=[],ee.opacities=u,ee.currentOpacity=f,ee.setCurrentOpacity=ee.setCurrentOpacity.bind(ee),ee}return Re(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(f){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=f===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(f,c)}),u.appendChild(c);var ee=document.createElement("div");ee.innerText=100*f+"%",c.appendChild(ee),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var f=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?f.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Pe),X=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=f.defaultHighlightColor,c.strokeWidth=0,c.opacity=f.defaultHighlightOpacity,c.fillPanel=new Oe("Color",f.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new M("Opacity",f.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Re(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(S),Y='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Te=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=f.defaultStrokeColor,c.bgColor=f.defaultFillColor,c.fontFamily=f.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new Oe("Text color",f.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new Oe("Fill color",f.defaultColorSet,c.bgColor,Y),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new je("Font",f.defaultFontFamilies,f.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new ut,c.tipGrip.visual.transform.baseVal.appendItem(q.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Re(o,h),o.prototype.ownsTarget=function(a){return h.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){q.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=q.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&h.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";h.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(q.setAttributes(this.bgRectangle,[["fill",a]]),q.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.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},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),f=this.height/5;a&&(this.tipPosition={x:u+f/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(f=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+f,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+f}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(f=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-f,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+f}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(f=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-f,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-f},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(f=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+f,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-f})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){q.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),h.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,h.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(Xe),de=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=f.defaultColor,c.strokeWidth=f.defaultStrokeWidth,c.strokeDasharray=f.defaultStrokeDasharray,c.fillColor=f.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new Oe("Line color",ue(f.defaultColorSet,["transparent"]),f.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new Oe("Fill color",ue(f.defaultColorSet,["transparent"]),c.fillColor,Y),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new ct("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new M("Opacity",f.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=q.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)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),q.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(it),We=function(h){function o(a,u,f){return h.call(this,a,u,f)||this}return Re(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=q.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(q.createTransform()),this.visual.appendChild(this.tip1),this.tip2=q.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(q.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(q.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()]]),q.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 a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var f=this.tip2.transform.baseVal.getItem(0);f.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(f,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(ht),Je=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.strokePanel.colors=f.defaultColorSet,c.fillColor="transparent",c}return Re(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(de),rt=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),Ye=function(h){function o(a,u,f){var c=h.call(this,a,u,f)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=f.defaultColor,c.strokeWidth=f.defaultStrokeWidth,c.strokeDasharray=f.defaultStrokeDasharray,c.strokePanel=new Oe("Line color",f.defaultColorSet,f.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new yt("Line width",f.defaultStrokeWidths,f.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new ct("Line style",f.defaultStrokeDasharrays,f.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Re(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorCurve=q.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=q.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)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),q.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=q.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=q.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)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/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()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),h.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,h.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(et),kt=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),Tt=function(h){function o(a,u,f){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=f,c}return Re(o,h),o}(kt),lt=function(h){function o(a,u,f){f===void 0&&(f=!1);var c=h.call(this,a,f)||this;return c.marker=u,c}return Re(o,h),o}(kt),Ht=function(){function h(){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 h.prototype.addEventListener=function(o,a){this[o].push(a)},h.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},h}(),Ft=function(){function h(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Me,this._isOpen=!1,this.undoRedoManager=new rt,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 Ht,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.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(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[dt,se,oe,Xe,Je,de,X,Te,We,S,ht,Ye]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[dt,se,oe,Xe,de,X,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[dt,se,oe,Xe,X]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var f=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});f!==void 0&&a._availableMarkerTypes.push(f)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),L.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&j.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=j.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new kt(o))})},h.prototype.render=function(){return Ae(this,void 0,void 0,function(){var o;return Se(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new K).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},h.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(f){var c=new kt(a,!0);f(c),c.defaultPrevented&&(u=!0)}),u||(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(f){return f(new kt(a))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,f=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,f),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,f=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==f._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},h.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},h.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},h.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=q.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},h.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},h.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")},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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 o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"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 re(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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ce(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.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())},h.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){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()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(f){var c=new lt(o,o._currentMarker,!0);f(c),c.defaultPrevented&&(a=!0)}),!a){var u=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(f){return f(new lt(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ee){var Ue=new lt(o,void 0,!0);ee(Ue),Ue.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(ee){var Ue=f.markers[ee];f.setCurrentMarker(f.markers[ee]),f._currentMarker.dispose(),f.markerImage.removeChild(f._currentMarker.container),f.markers.splice(f.markers.indexOf(f._currentMarker),1),f.eventListeners.markerdelete.forEach(function(qe){return qe(new lt(o,Ue))})},f=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.prototype.showNotesEditor=function(){var o;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=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},h.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)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var f=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),f<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new kt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new kt(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new kt(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new kt(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return Ae(this,void 0,void 0,function(){var o,a,u=this;return Se(this,function(f){switch(f.label){case 0:return[4,this.render()];case 1:return o=f.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new Tt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var f=a._availableMarkerTypes.find(function(ee){return ee.typeName===u.typeName});if(f!==void 0){var c=a.addNewMarker(f);c.restoreState(u),a.markers.push(c)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new kt(a))})},h.prototype.addNewMarker=function(o){var a=q.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(f){return f.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(f){return f(new lt(u,u._currentMarker))}))},h.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof se&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(se):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new lt(a,a._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new lt(a,o))})},h.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new lt(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new lt(a,a._currentMarker))}))},h.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},h.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"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()},h.prototype.addLicenseKey=function(o){L.addKey(o)},h.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},h.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},h.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new kt(o))}))},h.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new kt(o))}))},h.instanceCounter=0,h}();/* **********************************
|
|
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 Mt=function(h,o){return(Mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(a[f]=u[f])})(h,o)};function Pt(h,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=h}Mt(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Rt(h,o,a,u){return new(a||(a=Promise))(function(f,c){function ee(ft){try{qe(u.next(ft))}catch(ze){c(ze)}}function Ue(ft){try{qe(u.throw(ft))}catch(ze){c(ze)}}function qe(ft){var ze;ft.done?f(ft.value):(ze=ft.value,ze instanceof a?ze:new a(function(At){At(ze)})).then(ee,Ue)}qe((u=u.apply(h,o||[])).next())})}function wn(h,o){var a,u,f,c,ee={label:0,sent:function(){if(1&f[0])throw f[1];return f[1]},trys:[],ops:[]};return c={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ue(qe){return function(ft){return function(ze){if(a)throw new TypeError("Generator is already executing.");for(;ee;)try{if(a=1,u&&(f=2&ze[0]?u.return:ze[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,ze[1])).done)return f;switch(u=0,f&&(ze=[2&ze[0],f.value]),ze[0]){case 0:case 1:f=ze;break;case 4:return ee.label++,{value:ze[1],done:!1};case 5:ee.label++,u=ze[1],ze=[0];continue;case 7:ze=ee.ops.pop(),ee.trys.pop();continue;default:if(!(f=ee.trys,(f=f.length>0&&f[f.length-1])||ze[0]!==6&&ze[0]!==2)){ee=0;continue}if(ze[0]===3&&(!f||ze[1]>f[0]&&ze[1]<f[3])){ee.label=ze[1];break}if(ze[0]===6&&ee.label<f[1]){ee.label=f[1],f=ze;break}if(f&&ee.label<f[2]){ee.label=f[2],ee.ops.push(ze);break}f[2]&&ee.ops.pop(),ee.trys.pop();continue}ze=o.call(h,ee)}catch(At){ze=[6,At],u=0}finally{a=f=0}if(5&ze[0])throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}([qe,ft])}}}var Qn=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),bt=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,f=a;u<f.length;u++){var c=f[u],ee=c[0],Ue=c[1];o.setAttribute(ee,Ue)}},h.createRect=function(o,a,u){var f=document.createElementNS("http://www.w3.org/2000/svg","rect");return f.setAttribute("width",o.toString()),f.setAttribute("height",a.toString()),u&&h.setAttributes(f,u),f},h.createLine=function(o,a,u,f,c){var ee=document.createElementNS("http://www.w3.org/2000/svg","line");return ee.setAttribute("x1",o.toString()),ee.setAttribute("y1",a.toString()),ee.setAttribute("x2",u.toString()),ee.setAttribute("y2",f.toString()),c&&h.setAttributes(ee,c),ee},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var f=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return f.setAttribute("cx",(o/2).toString()),f.setAttribute("cy",(a/2).toString()),f.setAttribute("rx",(o/2).toString()),f.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(f,u),f},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,f,c,ee,Ue){var qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(qe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",f.toString()],["refX",c.toString()],["refY",ee.toString()]]),qe.appendChild(Ue),qe},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&h.setAttributes(u,a),u},h.getHollowRectanglePath=function(o,a,u,f,c,ee,Ue,qe){return"M"+o+","+a+"V"+(a+f)+"H"+(o+u)+"V"+a+"H"+c+"V"+ee+"H"+(c+Ue)+"V"+(ee+qe)+"H"+c+"V"+a+"Z"},h}(),wt=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},h.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},h.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new ot("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ot("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ot("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new xt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),ot=function(h,o){this.selector=h,this.style=o},xt=function(h,o){this.localName=h,this.style=o},Zt=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},h}(),rn=function(){function h(){}return h.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},h}(),nn=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Pt(o,h),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(rn),Ot=function(){function h(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},h.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),mt=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Pt(o,h),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(rn),Dn=function(){function h(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),ni=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new Dn(o,a),f=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.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 Ue=bt.createDefs();ee.appendChild(Ue);var qe=bt.createElement("clipPath",[["id","text-bg-clip"]]);Ue.appendChild(qe);var ft=bt.createPath(bt.getHollowRectanglePath((24-f)/2,(24-c)/2,f,c,(24-f)/2+2,(24-c)/2+2,f-4,c-4));ee.appendChild(ft);var ze=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(bt.createTSpan(o+":"+a)),ee.appendChild(ze);var At=ze.getBBox();bt.setAttributes(ze,[["x",((24-At.width)/2).toString()],["y",((24-At.height)/2-At.y).toString()]]);var jt=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(At.width))/2,(24-Math.ceil(At.height))/2,Math.ceil(At.width),Math.ceil(At.height)));return qe.appendChild(jt),bt.setAttributes(ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ee),ee.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},h}(),Tn=function(h){function o(a,u,f){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=f,c}return Pt(o,h),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Ot),Dt=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,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 h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return bt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),Mn=function(){function h(o,a,u,f){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=f,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(h.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=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 a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Dt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),bt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,ee){var Ue=a.y+u*(ee+1);bt.setAttributes(c,[["x1",""+a.x],["y1",""+Ue],["x2",""+(a.x+a.width)],["y2",""+Ue]])});var f=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,ee){var Ue=a.x+f*(ee+1);bt.setAttributes(c,[["x1",""+Ue],["y1",""+a.y],["x2",""+Ue],["y2",""+(a.y+a.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},h.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)},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},h.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},h.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},h.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,f=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=f,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=f}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),f=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<f/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=f,this.cropRect.width>this.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=o-this.cropRect.width/2,this.cropRect.y=a-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)}},h.prototype.getRescaledRect=function(o,a,u,f,c,ee){var Ue=u/o,qe=f/a;return{x:(c.x-ee)*Ue+ee,y:(c.y-ee)*qe+ee,width:c.width*Ue,height:c.height*qe}},h.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},h}(),Vn=function(){function h(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,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(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.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},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},h.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var f=u%5==0?this.height/3:this.height/6;a+="h4v"+-f+"h1v"+f}a+="v1H0Z",this.scaleShape=bt.createPath(a);var c=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.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),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),ii=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,f,c,ee,Ue){var qe=this;return new Promise(function(ft){var ze=document.createElement("canvas");ze.width=o.width.baseVal.value-2*f,ze.height=o.height.baseVal.value-2*f;var At=1,jt=1;qe.naturalSize===!0?(At=a.naturalWidth/(o.width.baseVal.value-2*f)/ee,jt=a.naturalHeight/(o.height.baseVal.value-2*f)/Ue,ze.width=a.naturalWidth/ee,ze.height=a.naturalHeight/Ue):qe.width!==void 0&&qe.height!==void 0&&(At=qe.width/u.width,jt=qe.height/u.height,ze.width*=At,ze.height*=jt);var en=ze.getContext("2d");en.translate(ze.width/2,ze.height/2),en.rotate(c*Math.PI/180),en.scale(ee,Ue),en.translate(-ze.width/2,-ze.height/2),en.drawImage(a,0,0,ze.width,ze.height);var Xn=document.createElement("canvas");Xn.width=u.width*At,Xn.height=u.height*jt,Xn.getContext("2d").putImageData(en.getImageData((u.x-f)*At,(u.y-f)*jt,u.width*At,u.height*jt),0,0),ft(Xn.toDataURL(qe.imageType,qe.imageQuality))})},h}(),Be=function(){function h(o){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=h.instanceCounter++,this.styles=new wt(this.instanceNo),this.target=o,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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),h.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},h.prototype.show=function(){this.showUI(),this.open()},h.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.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))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},h.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();bt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},h.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},h.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=bt.createGroup(),this.editingTargetRotationScaleContainer=bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=bt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Mn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},h.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},h.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"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},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Zt,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 a=new nn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(jt){var en=new Ot(ni.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);en.onClick=function(){return o.ratioButtonClicked(jt)},u.push(en)}),this.aspectRatioButton=new Tn(ni.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var f=new Ot('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");f.isActive=this.isGridVisible,f.onClick=function(){o.isGridVisible=!o.isGridVisible,f.isActive=o.isGridVisible},a.addButton(f);var c=new Ot('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Qn.isLicensed){var ee=new mt;this.topToolbar.addElementBlock(ee);var Ue=document.createElement("div");Ue.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Ue.appendChild(qe),ee.addElement(Ue)}var ft=new nn;ft.minWidth=3*this.toolbarHeight+"px",ft.contentAlign="end",this.topToolbar.addButtonBlock(ft);var ze=new Ot('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ze.onClick=this.startRenderAndClose,ft.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var At=new Ot('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");At.onClick=this.close,ft.addButton(At),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(At.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Zt,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 a=new nn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Ot('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var f=new Ot('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");f.onClick=this.rotateRightButtonClicked,a.addButton(f);var c=new mt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new Vn("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(ft){o.rotateBy(ft),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var ee=new nn;ee.minWidth=2*this.toolbarHeight+"px",ee.contentAlign="end",this.bottomToolbar.addButtonBlock(ee);var Ue=new Ot('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Ue.onClick=this.flipHorizontallyButtonClicked,ee.addButton(Ue);var qe=new Ot('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");qe.onClick=this.flipVerticallyButtonClicked,ee.addButton(qe)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ni.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Dn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"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()},h.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var o,a;return wn(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(f){return f(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return Rt(this,void 0,void 0,function(){var o;return wn(this,function(a){switch(a.label){case 0:return(o=new ii).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.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 a.sent(),[4,o.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,a.sent()]}})})},h.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 o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*o)+`px;
|
|
height: `+(this.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`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 ot("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ot("."+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*o)+`px;
|
|
padding: `+o+`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;
|
|
`))},h.instanceCounter=0,h}(),at=w("8hTe"),Nt=w.n(at),Xt=/<pre[^>]*>/g;function $t(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var qt=pe.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,f=u===void 0?!1:u,c=h.className,ee=h.showTextOnly,Ue=h.showLines,qe=h.replaces,ft=h.zoomImg,ze=h.hasMask,At=h.style,jt=At===void 0?{}:At,en=h.stylesPrev,Xn=en===void 0?{}:en,Kn=String(a),mn=Object(O.useRef)(),qn=Object(O.useRef)(),zi=Object(O.useState)(""),_n=Object(G.a)(zi,2),Yn=_n[0],Hn=_n[1],bi=Object(O.useState)("office"),ri=Object(G.a)(bi,2),mi=ri[0],hi=ri[1],cr=function(){var zt=new Be(qn.current);zt.displayMode="popup",zt.addRenderEventListener(function(){var En=Object($.a)(H.a.mark(function Wt(cn){var Kt;return H.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return mn.current.style.display="none",un.next=3,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn}});case 3:Kt=un.sent,Kt!=null&&Kt.id&&qe(qn.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return un.stop()}},Wt)}));return function(Wt){return En.apply(this,arguments)}}()),zt.show()},Gi=function(){var zt=new Ft(qn.current);zt.settings.displayMode="popup",zt.addEventListener("render",function(){var En=Object($.a)(H.a.mark(function Wt(cn){var Kt;return H.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(mn.current.style.display="none",!qn.current){un.next=6;break}return un.next=4,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:cn.dataUrl}});case 4:Kt=un.sent,Kt!=null&&Kt.id&&qe(qn.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return un.stop()}},Wt)}));return function(Wt){return En.apply(this,arguments)}}()),zt.show(),window.markerArea=zt},oi=Object(O.useMemo)(function(){try{var sn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,zt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,En=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(sn,"("+V.a.API_SERVER+"/api/attachments/").replace(zt,'"'+V.a.API_SERVER+"/api/attachments/").replace(En,'"'+V.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,`
|
|
`),Kn=Kn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ci){}var Wt=N(Kn),cn=be();if(Kn.match(/\[TOC\]/)&&(Wt=Wt.replace("<p>[TOC]</p>",Ne()),me()),Wt=Wt.replace(/(__special_katext_id_\d+__)/g,function(ci,un){var Pn=cn[un],Vi=Pn.type,Xi=Pn.expression;return Object(ae.renderToString)($t(Xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Wt=Wt.replace(/▁/g,"\u2581\u2581\u2581"),ne(),ee){var Kt=document.createElement("div");return Kt.innerHTML=Wt,Kt.innerText}return setTimeout(function(){return Oi()},500),Wt},[Kn]),$n=Object(O.useRef)();ce.WebkitLineClamp=Ue,Ue&&(jt=Object(ve.a)(Object(ve.a)({},jt),ce));function Ri(sn){var zt=sn.target;if(zt.tagName.toUpperCase()==="IMG"){if(ft){var En=zt.getAttribute("src");Hn(En),hi("image")}}else if(zt.tagName.toUpperCase()==="A"){var Wt=zt.getAttribute("href");if(Wt.indexOf("office")>-1)sn.preventDefault(),Hn(Wt),hi("office");else if(Wt.indexOf("application/pdf")>-1)sn.preventDefault(),Hn(Wt),hi("pdf");else if(Wt.indexOf("type=text")>-1)sn.preventDefault(),Hn(Wt),hi("html");else if(Wt.startsWith("#")){sn.preventDefault();var cn=document.getElementById(Wt.replace("#",""));cn&&cn.scrollIntoView(!0)}}}var Oi=function(){var zt,En=(zt=$n.current)===null||zt===void 0?void 0:zt.querySelectorAll("video");En==null||En.forEach(function(Wt){if(Wt.oncontextmenu=function(){return!1},Wt.src.indexOf(".m3u8")>-1&&!Wt.canPlayType("application/vnd.apple.mpegurl")){if(R.a.isSupported()){var cn=new R.a;cn.loadSource(Wt.src),cn.attachMedia(Wt)}}})};Object(O.useEffect)(function(){if($n.current&&oi&&(oi.match(Xt)&&window.PR.prettyPrint()),$n.current)return $n.current.addEventListener("click",Ri),function(){$n.current.removeEventListener("click",Ri),ne(),me()}},[oi,$n.current,Ri]);var dr=function(zt){if(!f)return;zt.target.nodeName==="IMG"?(mn.current.style.display="flex",mn.current.style.width=zt.target.clientWidth+"px",mn.current.style.height=zt.target.clientHeight+"px",mn.current.style.top=zt.target.offsetTop+"px",mn.current.style.left=zt.target.offsetLeft+"px",qn.current.src=zt.target.getAttribute("src")):mn.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:$n,style:Object(ve.a)({},jt),className:"".concat(c||""," markdown-body ").concat(Nt.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:oi}}),x.a.createElement("div",{ref:mn,className:Nt.a.button},x.a.createElement(fe.a,null,x.a.createElement(we.a,{onClick:function(){return cr()}},"\u88C1\u526A"),x.a.createElement(we.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),x.a.createElement(_e.a,{close:!0,data:Yn,hasMask:ze,type:Yn!=null&&Yn.length?mi:"",style:Object(ve.a)({},Xn),onClose:function(){return Hn("")}}))}},"9VGf":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return he});var Z=w("q1tI"),fe=w.n(Z);function he(we,ve){var $=Object(Z.useRef)();Object(Z.useEffect)(function(){$.current=we}),Object(Z.useEffect)(function(){function G(){$.current()}if(ve!==null){var Q=setInterval(G,ve);return function(){return clearInterval(Q)}}},[ve])}},"9ivq":function(gt,pe,w){},Bd2K:function(gt,pe,w){(function(Z){Z(w("VrN/"),w("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(H,O,x){if(x!=Z.Init&&x&&H.removeKeyMap("autoCloseTags"),!O)return;var b={name:"autoCloseTags"};(typeof O!="object"||O.whenClosing!==!1)&&(b["'/'"]=function(T){return $(T)}),(typeof O!="object"||O.whenOpening!==!1)&&(b["'>'"]=function(T){return we(T)}),H.addKeyMap(b)});var fe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],he=["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 we(H){if(H.getOption("disableInput"))return Z.Pass;for(var O=H.listSelections(),x=[],b=H.getOption("autoCloseTags"),T=0;T<O.length;T++){if(!O[T].empty())return Z.Pass;var E=O[T].head,k=H.getTokenAt(E),I=Z.innerMode(H.getMode(),k.state),v=I.state,y=I.mode.xmlCurrentTag&&I.mode.xmlCurrentTag(v),A=y&&y.name;if(!A)return Z.Pass;var F=I.mode.configuration=="html",me=typeof b=="object"&&b.dontCloseTags||F&&fe,ce=typeof b=="object"&&b.indentTags||F&&he;k.end>E.ch&&(A=A.slice(0,A.length-k.end+E.ch));var ye=A.toLowerCase();if(!A||k.type=="string"&&(k.end!=E.ch||!/[\"\']/.test(k.string.charAt(k.string.length-1))||k.string.length==1)||k.type=="tag"&&y.close||k.string.indexOf("/")==E.ch-k.start-1||me&&G(me,ye)>-1||Q(H,I.mode.xmlCurrentContext&&I.mode.xmlCurrentContext(v)||[],A,E,!0))return Z.Pass;var Ne=typeof b=="object"&&b.emptyTags;if(Ne&&G(Ne,A)>-1){x[T]={text:"/>",newPos:Z.Pos(E.line,E.ch+2)};continue}var Ee=ce&&G(ce,ye)>-1;x[T]={indent:Ee,text:">"+(Ee?`
|
|
|
|
`:"")+"</"+A+">",newPos:Ee?Z.Pos(E.line+1,0):Z.Pos(E.line,E.ch+1)}}for(var De=typeof b=="object"&&b.dontIndentOnAutoClose,T=O.length-1;T>=0;T--){var Ke=x[T];H.replaceRange(Ke.text,O[T].head,O[T].anchor,"+insert");var le=H.listSelections().slice(0);le[T]={head:Ke.newPos,anchor:Ke.newPos},H.setSelections(le),!De&&Ke.indent&&(H.indentLine(Ke.newPos.line,null,!0),H.indentLine(Ke.newPos.line+1,null,!0))}}function ve(H,O){for(var x=H.listSelections(),b=[],T=O?"/":"</",E=H.getOption("autoCloseTags"),k=typeof E=="object"&&E.dontIndentOnSlash,I=0;I<x.length;I++){if(!x[I].empty())return Z.Pass;var v=x[I].head,y=H.getTokenAt(v),A=Z.innerMode(H.getMode(),y.state),F=A.state;if(O&&(y.type=="string"||y.string.charAt(0)!="<"||y.start!=v.ch-1))return Z.Pass;var me,ce=A.mode.name!="xml"&&H.getMode().name=="htmlmixed";if(ce&&A.mode.name=="javascript")me=T+"script";else if(ce&&A.mode.name=="css")me=T+"style";else{var ye=A.mode.xmlCurrentContext&&A.mode.xmlCurrentContext(F);if(!ye||ye.length&&Q(H,ye,ye[ye.length-1],v))return Z.Pass;me=T+ye[ye.length-1]}H.getLine(v.line).charAt(y.end)!=">"&&(me+=">"),b[I]=me}if(H.replaceSelections(b),x=H.listSelections(),!k)for(var I=0;I<x.length;I++)(I==x.length-1||x[I].head.line<x[I+1].head.line)&&H.indentLine(x[I].head.line)}function $(H){return H.getOption("disableInput")?Z.Pass:ve(H,!0)}Z.commands.closeTag=function(H){return ve(H)};function G(H,O){if(H.indexOf)return H.indexOf(O);for(var x=0,b=H.length;x<b;++x)if(H[x]==O)return x;return-1}function Q(H,O,x,b,T){if(!Z.scanForClosingTag)return!1;var E=Math.min(H.lastLine()+1,b.line+500),k=Z.scanForClosingTag(H,b,null,E);if(!k||k.tag!=x)return!1;for(var I=T?1:0,v=O.length-1;v>=0&&O[v]==x;v--)++I;b=k.to;for(var v=1;v<I;v++){var y=Z.scanForClosingTag(H,b,null,E);if(!y||y.tag!=x)return!1;b=y.to}return!0}})},BjJ7:function(gt,pe,w){"use strict";w.d(pe,"d",function(){return fe}),w.d(pe,"c",function(){return he}),w.d(pe,"e",function(){return we}),w.d(pe,"b",function(){return ve}),w.d(pe,"a",function(){return G});var Z=w("m3rI");function fe(Q){var H=!0;if(Q.length>0){for(var O=0;O<Q.length;O++)if(Q[O].compile_success==0||!Q[O].compile_success){H=!1;break}}else H=!1;return H}function he(Q){for(var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",O=[],x=0;x<Q.length;x++){var b=Q[x],T=H?"".concat(H,"/").concat(b.name):"".concat(b.name);O.push({title:b.name,isLeaf:!(b.type==="tree"),key:T})}return O}function we(Q,H,O){for(var x=0;x<Q.length;x++){var b=Q[x];if(b.key===H){b.children=O;break}b.children&&we(b.children,H,O)}return Q}function ve(Q,H,O){var x;return function(){var b=this,T=arguments,E=function(){x=null,O||Q.apply(b,T)},k=O&&!x;clearTimeout(x),x=setTimeout(E,H),k&&Q.apply(b,T)}}var $=!0,G=Z.a.API_SERVER},"C+DQ":function(gt,pe,w){},"C/vA":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return Z});function Z(fe){var he=this,we=!1,ve;return function(){return we||(we=!0,ve=fe.apply(he,arguments)),ve}}},"Cg/j":function(gt,pe,w){"use strict";w.d(pe,"b",function(){return Z}),w.d(pe,"a",function(){return fe}),w.d(pe,"c",function(){return we}),w.d(pe,"d",function(){return ve});var Z;(function($){$.serviceIds=new Map,$.DI_TARGET="$di$target",$.DI_DEPENDENCIES="$di$dependencies";function G(Q){return Q[$.DI_DEPENDENCIES]||[]}$.getServiceDependencies=G})(Z||(Z={}));var fe=we("instantiationService");function he($,G,Q,H){G[Z.DI_TARGET]===G?G[Z.DI_DEPENDENCIES].push({id:$,index:Q,optional:H}):(G[Z.DI_DEPENDENCIES]=[{id:$,index:Q,optional:H}],G[Z.DI_TARGET]=G)}function we($){if(Z.serviceIds.has($))return Z.serviceIds.get($);var G=function(Q,H,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");he(G,Q,O,!1)};return G.toString=function(){return $},Z.serviceIds.set($,G),G}function ve($){return function(G,Q,H){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");he($,G,H,!0)}}},DlQD:function(gt,pe,w){(function(Z,fe){gt.exports=fe()})(this,function(){"use strict";function Z(se,te){for(var oe=0;oe<te.length;oe++){var S=te[oe];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(se,S.key,S)}}function fe(se,te,oe){return te&&Z(se.prototype,te),oe&&Z(se,oe),se}function he(se,te){if(!se)return;if(typeof se=="string")return we(se,te);var oe=Object.prototype.toString.call(se).slice(8,-1);if(oe==="Object"&&se.constructor&&(oe=se.constructor.name),oe==="Map"||oe==="Set")return Array.from(se);if(oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(oe))return we(se,te)}function we(se,te){(te==null||te>se.length)&&(te=se.length);for(var oe=0,S=new Array(te);oe<te;oe++)S[oe]=se[oe];return S}function ve(se,te){var oe;if(typeof Symbol=="undefined"||se[Symbol.iterator]==null){if(Array.isArray(se)||(oe=he(se))||te&&se&&typeof se.length=="number"){oe&&(se=oe);var S=0;return function(){return S>=se.length?{done:!0}:{done:!1,value:se[S++]}}}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 oe=se[Symbol.iterator](),oe.next.bind(oe)}function $(se,te){return te={exports:{}},se(te,te.exports),te.exports}var G=$(function(se){function te(){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 oe(S){se.exports.defaults=S}se.exports={defaults:te(),getDefaults:te,changeDefaults:oe}}),Q=G.defaults,H=G.getDefaults,O=G.changeDefaults,x=/[&<>"']/,b=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,E=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},I=function(te){return k[te]};function v(se,te){if(te){if(x.test(se))return se.replace(b,I)}else if(T.test(se))return se.replace(E,I);return se}var y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function A(se){return se.replace(y,function(te,oe){return oe=oe.toLowerCase(),oe==="colon"?":":oe.charAt(0)==="#"?oe.charAt(1)==="x"?String.fromCharCode(parseInt(oe.substring(2),16)):String.fromCharCode(+oe.substring(1)):""})}var F=/(^|[^\[])\^/g;function me(se,te){se=se.source||se,te=te||"";var oe={replace:function(M,X){return X=X.source||X,X=X.replace(F,"$1"),se=se.replace(M,X),oe},getRegex:function(){return new RegExp(se,te)}};return oe}var ce=/[^\w:]/g,ye=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ne(se,te,oe){if(se){var S;try{S=decodeURIComponent(A(oe)).replace(ce,"").toLowerCase()}catch(M){return null}if(S.indexOf("javascript:")===0||S.indexOf("vbscript:")===0||S.indexOf("data:")===0)return null}te&&!ye.test(oe)&&(oe=D(te,oe));try{oe=encodeURI(oe).replace(/%25/g,"%")}catch(M){return null}return oe}var Ee={},De=/^[^:]+:\/*[^/]*$/,Ke=/^([^:]+:)[\s\S]*$/,le=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(se,te){Ee[" "+se]||(De.test(se)?Ee[" "+se]=se+"/":Ee[" "+se]=ie(se,"/",!0)),se=Ee[" "+se];var oe=se.indexOf(":")===-1;return te.substring(0,2)==="//"?oe?te:se.replace(Ke,"$1")+te:te.charAt(0)==="/"?oe?te:se.replace(le,"$1")+te:se+te}var be={exec:function(){}};function ne(se){for(var te=1,oe,S;te<arguments.length;te++){oe=arguments[te];for(S in oe)Object.prototype.hasOwnProperty.call(oe,S)&&(se[S]=oe[S])}return se}function W(se,te){var oe=se.replace(/\|/g,function(X,Y,Te){for(var de=!1,We=Y;--We>=0&&Te[We]==="\\";)de=!de;return de?"|":" |"}),S=oe.split(/ \|/),M=0;if(S.length>te)S.splice(te);else for(;S.length<te;)S.push("");for(;M<S.length;M++)S[M]=S[M].trim().replace(/\\\|/g,"|");return S}function ie(se,te,oe){var S=se.length;if(S===0)return"";for(var M=0;M<S;){var X=se.charAt(S-M-1);if(X===te&&!oe)M++;else if(X!==te&&oe)M++;else break}return se.substr(0,S-M)}function U(se,te){if(se.indexOf(te[1])===-1)return-1;for(var oe=se.length,S=0,M=0;M<oe;M++)if(se[M]==="\\")M++;else if(se[M]===te[0])S++;else if(se[M]===te[1]&&(S--,S<0))return M;return-1}function B(se){se&&se.sanitize&&!se.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var N={escape:v,unescape:A,edit:me,cleanUrl:Ne,resolveUrl:D,noopTest:be,merge:ne,splitCells:W,rtrim:ie,findClosingBracket:U,checkSanitizeDeprecation:B},m=G.defaults,d=N.rtrim,R=N.splitCells,V=N.escape,ae=N.findClosingBracket;function _e(se,te,oe){var S=te.href,M=te.title?V(te.title):null,X=se[1].replace(/\\([\[\]])/g,"$1");return se[0].charAt(0)!=="!"?{type:"link",raw:oe,href:S,title:M,text:X}:{type:"image",raw:oe,href:S,title:M,text:V(X)}}function Fe(se,te){var oe=se.match(/^(\s+)(?:```)/);if(oe===null)return te;var S=oe[1];return te.split(`
|
|
`).map(function(M){var X=M.match(/^\s+/);if(X===null)return M;var Y=X[0];return Y.length>=S.length?M.slice(S.length):M}).join(`
|
|
`)}var Le=function(){function se(oe){this.options=oe||m}var te=se.prototype;return te.space=function(S){var M=this.rules.block.newline.exec(S);if(M)return M[0].length>1?{type:"space",raw:M[0]}:{raw:`
|
|
`}},te.code=function(S,M){var X=this.rules.block.code.exec(S);if(X){var Y=M[M.length-1];if(Y&&Y.type==="paragraph")return{raw:X[0],text:X[0].trimRight()};var Te=X[0].replace(/^ {4}/gm,"");return{type:"code",raw:X[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:d(Te,`
|
|
`)}}},te.fences=function(S){var M=this.rules.block.fences.exec(S);if(M){var X=M[0],Y=Fe(X,M[3]||"");return{type:"code",raw:X,lang:M[2]?M[2].trim():M[2],text:Y}}},te.heading=function(S){var M=this.rules.block.heading.exec(S);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},te.nptable=function(S){var M=this.rules.block.nptable.exec(S);if(M){var X={type:"table",header:R(M[1].replace(/^ *| *\| *$/g,"")),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:M[3]?M[3].replace(/\n$/,"").split(`
|
|
`):[],raw:M[0]};if(X.header.length===X.align.length){var Y=X.align.length,Te;for(Te=0;Te<Y;Te++)/^ *-+: *$/.test(X.align[Te])?X.align[Te]="right":/^ *:-+: *$/.test(X.align[Te])?X.align[Te]="center":/^ *:-+ *$/.test(X.align[Te])?X.align[Te]="left":X.align[Te]=null;for(Y=X.cells.length,Te=0;Te<Y;Te++)X.cells[Te]=R(X.cells[Te],X.header.length);return X}}},te.hr=function(S){var M=this.rules.block.hr.exec(S);if(M)return{type:"hr",raw:M[0]}},te.blockquote=function(S){var M=this.rules.block.blockquote.exec(S);if(M){var X=M[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:M[0],text:X}}},te.list=function(S){var M=this.rules.block.list.exec(S);if(M){for(var X=M[0],Y=M[2],Te=Y.length>1,de=Y[Y.length-1]===")",We={type:"list",raw:X,ordered:Te,start:Te?+Y.slice(0,-1):"",loose:!1,items:[]},Je=M[0].match(this.rules.block.item),rt=!1,Ye,kt,Tt,lt,Ht,Ft,Mt,Pt=Je.length,Rt=0;Rt<Pt;Rt++)Ye=Je[Rt],X=Ye,kt=Ye.length,Ye=Ye.replace(/^ *([*+-]|\d+[.)]) */,""),~Ye.indexOf(`
|
|
`)&&(kt-=Ye.length,Ye=this.options.pedantic?Ye.replace(/^ {1,4}/gm,""):Ye.replace(new RegExp("^ {1,"+kt+"}","gm"),"")),Rt!==Pt-1&&(Tt=this.rules.block.bullet.exec(Je[Rt+1])[0],(Te?Tt.length===1||!de&&Tt[Tt.length-1]===")":Tt.length>1||this.options.smartLists&&Tt!==Y)&&(lt=Je.slice(Rt+1).join(`
|
|
`),We.raw=We.raw.substring(0,We.raw.length-lt.length),Rt=Pt-1)),Ht=rt||/\n\n(?!\s*$)/.test(Ye),Rt!==Pt-1&&(rt=Ye.charAt(Ye.length-1)===`
|
|
`,Ht||(Ht=rt)),Ht&&(We.loose=!0),Ft=/^\[[ xX]\] /.test(Ye),Mt=void 0,Ft&&(Mt=Ye[1]!==" ",Ye=Ye.replace(/^\[[ xX]\] +/,"")),We.items.push({type:"list_item",raw:X,task:Ft,checked:Mt,loose:Ht,text:Ye});return We}},te.html=function(S){var M=this.rules.block.html.exec(S);if(M)return{type:this.options.sanitize?"paragraph":"html",raw:M[0],pre:!this.options.sanitizer&&(M[1]==="pre"||M[1]==="script"||M[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):V(M[0]):M[0]}},te.def=function(S){var M=this.rules.block.def.exec(S);if(M){M[3]&&(M[3]=M[3].substring(1,M[3].length-1));var X=M[1].toLowerCase().replace(/\s+/g," ");return{tag:X,raw:M[0],href:M[2],title:M[3]}}},te.table=function(S){var M=this.rules.block.table.exec(S);if(M){var X={type:"table",header:R(M[1].replace(/^ *| *\| *$/g,"")),align:M[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:M[3]?M[3].replace(/\n$/,"").split(`
|
|
`):[]};if(X.header.length===X.align.length){X.raw=M[0];var Y=X.align.length,Te;for(Te=0;Te<Y;Te++)/^ *-+: *$/.test(X.align[Te])?X.align[Te]="right":/^ *:-+: *$/.test(X.align[Te])?X.align[Te]="center":/^ *:-+ *$/.test(X.align[Te])?X.align[Te]="left":X.align[Te]=null;for(Y=X.cells.length,Te=0;Te<Y;Te++)X.cells[Te]=R(X.cells[Te].replace(/^ *\| *| *\| *$/g,""),X.header.length);return X}}},te.lheading=function(S){var M=this.rules.block.lheading.exec(S);if(M)return{type:"heading",raw:M[0],depth:M[2].charAt(0)==="="?1:2,text:M[1]}},te.paragraph=function(S){var M=this.rules.block.paragraph.exec(S);if(M)return{type:"paragraph",raw:M[0],text:M[1].charAt(M[1].length-1)===`
|
|
`?M[1].slice(0,-1):M[1]}},te.text=function(S,M){var X=this.rules.block.text.exec(S);if(X){var Y=M[M.length-1];return Y&&Y.type==="text"?{raw:X[0],text:X[0]}:{type:"text",raw:X[0],text:X[0]}}},te.escape=function(S){var M=this.rules.inline.escape.exec(S);if(M)return{type:"escape",raw:M[0],text:V(M[1])}},te.tag=function(S,M,X){var Y=this.rules.inline.tag.exec(S);if(Y)return!M&&/^<a /i.test(Y[0])?M=!0:M&&/^<\/a>/i.test(Y[0])&&(M=!1),!X&&/^<(pre|code|kbd|script)(\s|>)/i.test(Y[0])?X=!0:X&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Y[0])&&(X=!1),{type:this.options.sanitize?"text":"html",raw:Y[0],inLink:M,inRawBlock:X,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):V(Y[0]):Y[0]}},te.link=function(S){var M=this.rules.inline.link.exec(S);if(M){var X=ae(M[2],"()");if(X>-1){var Y=M[0].indexOf("!")===0?5:4,Te=Y+M[1].length+X;M[2]=M[2].substring(0,X),M[0]=M[0].substring(0,Te).trim(),M[3]=""}var de=M[2],We="";if(this.options.pedantic){var Je=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);Je?(de=Je[1],We=Je[3]):We=""}else We=M[3]?M[3].slice(1,-1):"";de=de.trim().replace(/^<([\s\S]*)>$/,"$1");var rt=_e(M,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:We&&We.replace(this.rules.inline._escapes,"$1")},M[0]);return rt}},te.reflink=function(S,M){var X;if((X=this.rules.inline.reflink.exec(S))||(X=this.rules.inline.nolink.exec(S))){var Y=(X[2]||X[1]).replace(/\s+/g," ");if(Y=M[Y.toLowerCase()],!Y||!Y.href){var Te=X[0].charAt(0);return{type:"text",raw:Te,text:Te}}var de=_e(X,Y,X[0]);return de}},te.strong=function(S,M,X){X===void 0&&(X="");var Y=this.rules.inline.strong.start.exec(S);if(Y&&(!Y[1]||Y[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){M=M.slice(-1*S.length);var Te=Y[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var de;(Y=Te.exec(M))!=null;)if(de=this.rules.inline.strong.middle.exec(M.slice(0,Y.index+3)),de)return{type:"strong",raw:S.slice(0,de[0].length),text:S.slice(2,de[0].length-2)}}},te.em=function(S,M,X){X===void 0&&(X="");var Y=this.rules.inline.em.start.exec(S);if(Y&&(!Y[1]||Y[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){M=M.slice(-1*S.length);var Te=Y[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var de;(Y=Te.exec(M))!=null;)if(de=this.rules.inline.em.middle.exec(M.slice(0,Y.index+2)),de)return{type:"em",raw:S.slice(0,de[0].length),text:S.slice(1,de[0].length-1)}}},te.codespan=function(S){var M=this.rules.inline.code.exec(S);if(M){var X=M[2].replace(/\n/g," "),Y=/[^ ]/.test(X),Te=X.startsWith(" ")&&X.endsWith(" ");return Y&&Te&&(X=X.substring(1,X.length-1)),X=V(X,!0),{type:"codespan",raw:M[0],text:X}}},te.br=function(S){var M=this.rules.inline.br.exec(S);if(M)return{type:"br",raw:M[0]}},te.del=function(S){var M=this.rules.inline.del.exec(S);if(M)return{type:"del",raw:M[0],text:M[1]}},te.autolink=function(S,M){var X=this.rules.inline.autolink.exec(S);if(X){var Y,Te;return X[2]==="@"?(Y=V(this.options.mangle?M(X[1]):X[1]),Te="mailto:"+Y):(Y=V(X[1]),Te=Y),{type:"link",raw:X[0],text:Y,href:Te,tokens:[{type:"text",raw:Y,text:Y}]}}},te.url=function(S,M){var X;if(X=this.rules.inline.url.exec(S)){var Y,Te;if(X[2]==="@")Y=V(this.options.mangle?M(X[0]):X[0]),Te="mailto:"+Y;else{var de;do de=X[0],X[0]=this.rules.inline._backpedal.exec(X[0])[0];while(de!==X[0]);Y=V(X[0]),X[1]==="www."?Te="http://"+Y:Te=Y}return{type:"link",raw:X[0],text:Y,href:Te,tokens:[{type:"text",raw:Y,text:Y}]}}},te.inlineText=function(S,M,X){var Y=this.rules.inline.text.exec(S);if(Y){var Te;return M?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):V(Y[0]):Y[0]:Te=V(this.options.smartypants?X(Y[0]):Y[0]),{type:"text",raw:Y[0],text:Te}}},se}(),Re=N.noopTest,Ae=N.edit,Se=N.merge,ue={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*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\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:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ue._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ue._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ue.def=Ae(ue.def).replace("label",ue._label).replace("title",ue._title).getRegex(),ue.bullet=/(?:[*+-]|\d{1,9}[.)])/,ue.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ue.item=Ae(ue.item,"gm").replace(/bull/g,ue.bullet).getRegex(),ue.list=Ae(ue.list).replace(/bull/g,ue.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ue.def.source+")").getRegex(),ue._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",ue._comment=/<!--(?!-?>)[\s\S]*?-->/,ue.html=Ae(ue.html,"i").replace("comment",ue._comment).replace("tag",ue._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue.paragraph=Ae(ue._paragraph).replace("hr",ue.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",ue._tag).getRegex(),ue.blockquote=Ae(ue.blockquote).replace("paragraph",ue.paragraph).getRegex(),ue.normal=Se({},ue),ue.gfm=Se({},ue.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*|$)"}),ue.gfm.nptable=Ae(ue.gfm.nptable).replace("hr",ue.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",ue._tag).getRegex(),ue.gfm.table=Ae(ue.gfm.table).replace("hr",ue.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",ue._tag).getRegex(),ue.pedantic=Se({},ue.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ue._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:Re,paragraph:Ae(ue.normal._paragraph).replace("hr",ue.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ue.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",q.punctuation=Ae(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",q.em.start=Ae(q.em.start).replace(/punctuation/g,q._punctuation).getRegex(),q.em.middle=Ae(q.em.middle).replace(/punctuation/g,q._punctuation).replace(/overlapSkip/g,q._overlapSkip).getRegex(),q.em.endAst=Ae(q.em.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.em.endUnd=Ae(q.em.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.start=Ae(q.strong.start).replace(/punctuation/g,q._punctuation).getRegex(),q.strong.middle=Ae(q.strong.middle).replace(/punctuation/g,q._punctuation).replace(/blockSkip/g,q._blockSkip).getRegex(),q.strong.endAst=Ae(q.strong.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.endUnd=Ae(q.strong.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=Ae(q._blockSkip,"g").getRegex(),q.overlapSkip=Ae(q._overlapSkip,"g").getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=Ae(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=Ae(q.tag).replace("comment",ue._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=Ae(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=Ae(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=Ae(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=Se({},q),q.pedantic=Se({},q.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:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=Se({},q.normal,{escape:Ae(q.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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),q.gfm.url=Ae(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=Se({},q.gfm,{br:Ae(q.br).replace("{2,}","*").getRegex(),text:Ae(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var L={block:ue,inline:q},K=G.defaults,j=L.block,ke=L.inline;function P(se){return se.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function _(se){var te="",oe,S,M=se.length;for(oe=0;oe<M;oe++)S=se.charCodeAt(oe),Math.random()>.5&&(S="x"+S.toString(16)),te+="&#"+S+";";return te}var re=function(){function se(oe){this.tokens=[],this.tokens.links=Object.create(null),this.options=oe||K,this.options.tokenizer=this.options.tokenizer||new Le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var S={block:j.normal,inline:ke.normal};this.options.pedantic?(S.block=j.pedantic,S.inline=ke.pedantic):this.options.gfm&&(S.block=j.gfm,this.options.breaks?S.inline=ke.breaks:S.inline=ke.gfm),this.tokenizer.rules=S}se.lex=function(S,M){var X=new se(M);return X.lex(S)};var te=se.prototype;return te.lex=function(S){return S=S.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(S,this.tokens,!0),this.inline(this.tokens),this.tokens},te.blockTokens=function(S,M,X){M===void 0&&(M=[]),X===void 0&&(X=!0),S=S.replace(/^ +$/gm,"");for(var Y,Te,de,We;S;){if(Y=this.tokenizer.space(S)){S=S.substring(Y.raw.length),Y.type&&M.push(Y);continue}if(Y=this.tokenizer.code(S,M)){S=S.substring(Y.raw.length),Y.type?M.push(Y):(We=M[M.length-1],We.raw+=`
|
|
`+Y.raw,We.text+=`
|
|
`+Y.text);continue}if(Y=this.tokenizer.fences(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.heading(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.nptable(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.hr(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.blockquote(S)){S=S.substring(Y.raw.length),Y.tokens=this.blockTokens(Y.text,[],X),M.push(Y);continue}if(Y=this.tokenizer.list(S)){for(S=S.substring(Y.raw.length),de=Y.items.length,Te=0;Te<de;Te++)Y.items[Te].tokens=this.blockTokens(Y.items[Te].text,[],!1);M.push(Y);continue}if(Y=this.tokenizer.html(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(X&&(Y=this.tokenizer.def(S))){S=S.substring(Y.raw.length),this.tokens.links[Y.tag]||(this.tokens.links[Y.tag]={href:Y.href,title:Y.title});continue}if(Y=this.tokenizer.table(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.lheading(S)){S=S.substring(Y.raw.length),M.push(Y);continue}if(X&&(Y=this.tokenizer.paragraph(S))){S=S.substring(Y.raw.length),M.push(Y);continue}if(Y=this.tokenizer.text(S,M)){S=S.substring(Y.raw.length),Y.type?M.push(Y):(We=M[M.length-1],We.raw+=`
|
|
`+Y.raw,We.text+=`
|
|
`+Y.text);continue}if(S){var Je="Infinite loop on byte: "+S.charCodeAt(0);if(this.options.silent){console.error(Je);break}else throw new Error(Je)}}return M},te.inline=function(S){var M,X,Y,Te,de,We,Je=S.length;for(M=0;M<Je;M++){We=S[M];switch(We.type){case"paragraph":case"text":case"heading":{We.tokens=[],this.inlineTokens(We.text,We.tokens);break}case"table":{for(We.tokens={header:[],cells:[]},Te=We.header.length,X=0;X<Te;X++)We.tokens.header[X]=[],this.inlineTokens(We.header[X],We.tokens.header[X]);for(Te=We.cells.length,X=0;X<Te;X++)for(de=We.cells[X],We.tokens.cells[X]=[],Y=0;Y<de.length;Y++)We.tokens.cells[X][Y]=[],this.inlineTokens(de[Y],We.tokens.cells[X][Y]);break}case"blockquote":{this.inline(We.tokens);break}case"list":{for(Te=We.items.length,X=0;X<Te;X++)this.inline(We.items[X].tokens);break}}}return S},te.inlineTokens=function(S,M,X,Y,Te){M===void 0&&(M=[]),X===void 0&&(X=!1),Y===void 0&&(Y=!1),Te===void 0&&(Te="");var de,We=S,Je;if(this.tokens.links){var rt=Object.keys(this.tokens.links);if(rt.length>0)for(;(Je=this.tokenizer.rules.inline.reflinkSearch.exec(We))!=null;)rt.includes(Je[0].slice(Je[0].lastIndexOf("[")+1,-1))&&(We=We.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Je=this.tokenizer.rules.inline.blockSkip.exec(We))!=null;)We=We.slice(0,Je.index)+"["+"a".repeat(Je[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;S;){if(de=this.tokenizer.escape(S)){S=S.substring(de.raw.length),M.push(de);continue}if(de=this.tokenizer.tag(S,X,Y)){S=S.substring(de.raw.length),X=de.inLink,Y=de.inRawBlock,M.push(de);continue}if(de=this.tokenizer.link(S)){S=S.substring(de.raw.length),de.type==="link"&&(de.tokens=this.inlineTokens(de.text,[],!0,Y)),M.push(de);continue}if(de=this.tokenizer.reflink(S,this.tokens.links)){S=S.substring(de.raw.length),de.type==="link"&&(de.tokens=this.inlineTokens(de.text,[],!0,Y)),M.push(de);continue}if(de=this.tokenizer.strong(S,We,Te)){S=S.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],X,Y),M.push(de);continue}if(de=this.tokenizer.em(S,We,Te)){S=S.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],X,Y),M.push(de);continue}if(de=this.tokenizer.codespan(S)){S=S.substring(de.raw.length),M.push(de);continue}if(de=this.tokenizer.br(S)){S=S.substring(de.raw.length),M.push(de);continue}if(de=this.tokenizer.del(S)){S=S.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],X,Y),M.push(de);continue}if(de=this.tokenizer.autolink(S,_)){S=S.substring(de.raw.length),M.push(de);continue}if(!X&&(de=this.tokenizer.url(S,_))){S=S.substring(de.raw.length),M.push(de);continue}if(de=this.tokenizer.inlineText(S,Y,P)){S=S.substring(de.raw.length),Te=de.raw.slice(-1),M.push(de);continue}if(S){var Ye="Infinite loop on byte: "+S.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return M},fe(se,null,[{key:"rules",get:function(){return{block:j,inline:ke}}}]),se}(),Ce=G.defaults,Pe=N.cleanUrl,Oe=N.escape,He=function(){function se(oe){this.options=oe||Ce}var te=se.prototype;return te.code=function(S,M,X){var Y=(M||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(S,Y);Te!=null&&Te!==S&&(X=!0,S=Te)}return Y?'<pre><code class="'+this.options.langPrefix+Oe(Y,!0)+'">'+(X?S:Oe(S,!0))+`</code></pre>
|
|
`:"<pre><code>"+(X?S:Oe(S,!0))+`</code></pre>
|
|
`},te.blockquote=function(S){return`<blockquote>
|
|
`+S+`</blockquote>
|
|
`},te.html=function(S){return S},te.heading=function(S,M,X,Y){return this.options.headerIds?"<h"+M+' id="'+this.options.headerPrefix+Y.slug(X)+'">'+S+"</h"+M+`>
|
|
`:"<h"+M+">"+S+"</h"+M+`>
|
|
`},te.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},te.list=function(S,M,X){var Y=M?"ol":"ul",Te=M&&X!==1?' start="'+X+'"':"";return"<"+Y+Te+`>
|
|
`+S+"</"+Y+`>
|
|
`},te.listitem=function(S){return"<li>"+S+`</li>
|
|
`},te.checkbox=function(S){return"<input "+(S?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},te.paragraph=function(S){return"<p>"+S+`</p>
|
|
`},te.table=function(S,M){return M&&(M="<tbody>"+M+"</tbody>"),`<table>
|
|
<thead>
|
|
`+S+`</thead>
|
|
`+M+`</table>
|
|
`},te.tablerow=function(S){return`<tr>
|
|
`+S+`</tr>
|
|
`},te.tablecell=function(S,M){var X=M.header?"th":"td",Y=M.align?"<"+X+' align="'+M.align+'">':"<"+X+">";return Y+S+"</"+X+`>
|
|
`},te.strong=function(S){return"<strong>"+S+"</strong>"},te.em=function(S){return"<em>"+S+"</em>"},te.codespan=function(S){return"<code>"+S+"</code>"},te.br=function(){return this.options.xhtml?"<br/>":"<br>"},te.del=function(S){return"<del>"+S+"</del>"},te.link=function(S,M,X){if(S=Pe(this.options.sanitize,this.options.baseUrl,S),S===null)return X;var Y='<a href="'+Oe(S)+'"';return M&&(Y+=' title="'+M+'"'),Y+=">"+X+"</a>",Y},te.image=function(S,M,X){if(S=Pe(this.options.sanitize,this.options.baseUrl,S),S===null)return X;var Y='<img src="'+S+'" alt="'+X+'"';return M&&(Y+=' title="'+M+'"'),Y+=this.options.xhtml?"/>":">",Y},te.text=function(S){return S},se}(),Ge=function(){function se(){}var te=se.prototype;return te.strong=function(S){return S},te.em=function(S){return S},te.codespan=function(S){return S},te.del=function(S){return S},te.html=function(S){return S},te.text=function(S){return S},te.link=function(S,M,X){return""+X},te.image=function(S,M,X){return""+X},te.br=function(){return""},se}(),ut=function(){function se(){this.seen={}}var te=se.prototype;return te.slug=function(S){var M=S.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(M)){var X=M;do this.seen[X]++,M=X+"-"+this.seen[X];while(this.seen.hasOwnProperty(M))}return this.seen[M]=0,M},se}(),Ze=G.defaults,it=N.unescape,Qe=function(){function se(oe){this.options=oe||Ze,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ge,this.slugger=new ut}se.parse=function(S,M){var X=new se(M);return X.parse(S)};var te=se.prototype;return te.parse=function(S,M){M===void 0&&(M=!0);var X="",Y,Te,de,We,Je,rt,Ye,kt,Tt,lt,Ht,Ft,Mt,Pt,Rt,wn,Qn,bt,wt=S.length;for(Y=0;Y<wt;Y++){lt=S[Y];switch(lt.type){case"space":continue;case"hr":{X+=this.renderer.hr();continue}case"heading":{X+=this.renderer.heading(this.parseInline(lt.tokens),lt.depth,it(this.parseInline(lt.tokens,this.textRenderer)),this.slugger);continue}case"code":{X+=this.renderer.code(lt.text,lt.lang,lt.escaped);continue}case"table":{for(kt="",Ye="",We=lt.header.length,Te=0;Te<We;Te++)Ye+=this.renderer.tablecell(this.parseInline(lt.tokens.header[Te]),{header:!0,align:lt.align[Te]});for(kt+=this.renderer.tablerow(Ye),Tt="",We=lt.cells.length,Te=0;Te<We;Te++){for(rt=lt.tokens.cells[Te],Ye="",Je=rt.length,de=0;de<Je;de++)Ye+=this.renderer.tablecell(this.parseInline(rt[de]),{header:!1,align:lt.align[de]});Tt+=this.renderer.tablerow(Ye)}X+=this.renderer.table(kt,Tt);continue}case"blockquote":{Tt=this.parse(lt.tokens),X+=this.renderer.blockquote(Tt);continue}case"list":{for(Ht=lt.ordered,Ft=lt.start,Mt=lt.loose,We=lt.items.length,Tt="",Te=0;Te<We;Te++)Rt=lt.items[Te],wn=Rt.checked,Qn=Rt.task,Pt="",Rt.task&&(bt=this.renderer.checkbox(wn),Mt?Rt.tokens.length>0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Pt+=bt),Pt+=this.parse(Rt.tokens,Mt),Tt+=this.renderer.listitem(Pt,Qn,wn);X+=this.renderer.list(Tt,Ht,Ft);continue}case"html":{X+=this.renderer.html(lt.text);continue}case"paragraph":{X+=this.renderer.paragraph(this.parseInline(lt.tokens));continue}case"text":{for(Tt=lt.tokens?this.parseInline(lt.tokens):lt.text;Y+1<wt&&S[Y+1].type==="text";)lt=S[++Y],Tt+=`
|
|
`+(lt.tokens?this.parseInline(lt.tokens):lt.text);X+=M?this.renderer.paragraph(Tt):Tt;continue}default:{var ot='Token with "'+lt.type+'" type was not found.';if(this.options.silent){console.error(ot);return}else throw new Error(ot)}}}return X},te.parseInline=function(S,M){M=M||this.renderer;var X="",Y,Te,de=S.length;for(Y=0;Y<de;Y++){Te=S[Y];switch(Te.type){case"escape":{X+=M.text(Te.text);break}case"html":{X+=M.html(Te.text);break}case"link":{X+=M.link(Te.href,Te.title,this.parseInline(Te.tokens,M));break}case"image":{X+=M.image(Te.href,Te.title,Te.text);break}case"strong":{X+=M.strong(this.parseInline(Te.tokens,M));break}case"em":{X+=M.em(this.parseInline(Te.tokens,M));break}case"codespan":{X+=M.codespan(Te.text);break}case"br":{X+=M.br();break}case"del":{X+=M.del(this.parseInline(Te.tokens,M));break}case"text":{X+=M.text(Te.text);break}default:{var We='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(We);return}else throw new Error(We)}}}return X},se}(),yt=N.merge,ct=N.checkSanitizeDeprecation,dt=N.escape,Me=G.getDefaults,et=G.changeDefaults,ht=G.defaults;function je(se,te,oe){if(typeof se=="undefined"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof te=="function"&&(oe=te,te=null),te=yt({},je.defaults,te||{}),ct(te),oe){var S=te.highlight,M;try{M=re.lex(se,te)}catch(de){return oe(de)}var X=function(We){var Je;if(!We)try{Je=Qe.parse(M,te)}catch(rt){We=rt}return te.highlight=S,We?oe(We):oe(null,Je)};if(!S||S.length<3)return X();if(delete te.highlight,!M.length)return X();var Y=0;je.walkTokens(M,function(de){de.type==="code"&&(Y++,setTimeout(function(){S(de.text,de.lang,function(We,Je){if(We)return X(We);Je!=null&&Je!==de.text&&(de.text=Je,de.escaped=!0),Y--,Y===0&&X()})},0))}),Y===0&&X();return}try{var Te=re.lex(se,te);return te.walkTokens&&je.walkTokens(Te,te.walkTokens),Qe.parse(Te,te)}catch(de){if(de.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,te.silent)return"<p>An error occurred:</p><pre>"+dt(de.message+"",!0)+"</pre>";throw de}}je.options=je.setOptions=function(se){return yt(je.defaults,se),et(je.defaults),je},je.getDefaults=Me,je.defaults=ht,je.use=function(se){var te=yt({},se);if(se.renderer&&function(){var S=je.defaults.renderer||new He,M=function(Te){var de=S[Te];S[Te]=function(){for(var We=arguments.length,Je=new Array(We),rt=0;rt<We;rt++)Je[rt]=arguments[rt];var Ye=se.renderer[Te].apply(S,Je);return Ye===!1&&(Ye=de.apply(S,Je)),Ye}};for(var X in se.renderer)M(X);te.renderer=S}(),se.tokenizer&&function(){var S=je.defaults.tokenizer||new Le,M=function(Te){var de=S[Te];S[Te]=function(){for(var We=arguments.length,Je=new Array(We),rt=0;rt<We;rt++)Je[rt]=arguments[rt];var Ye=se.tokenizer[Te].apply(S,Je);return Ye===!1&&(Ye=de.apply(S,Je)),Ye}};for(var X in se.tokenizer)M(X);te.tokenizer=S}(),se.walkTokens){var oe=je.defaults.walkTokens;te.walkTokens=function(S){se.walkTokens(S),oe&&oe(S)}}je.setOptions(te)},je.walkTokens=function(se,te){for(var oe=ve(se),S;!(S=oe()).done;){var M=S.value;te(M);switch(M.type){case"table":{for(var X=ve(M.tokens.header),Y;!(Y=X()).done;){var Te=Y.value;je.walkTokens(Te,te)}for(var de=ve(M.tokens.cells),We;!(We=de()).done;)for(var Je=We.value,rt=ve(Je),Ye;!(Ye=rt()).done;){var kt=Ye.value;je.walkTokens(kt,te)}break}case"list":{je.walkTokens(M.items,te);break}default:M.tokens&&je.walkTokens(M.tokens,te)}}},je.Parser=Qe,je.parser=Qe.parse,je.Renderer=He,je.TextRenderer=Ge,je.Lexer=re,je.lexer=re.lex,je.Tokenizer=Le,je.Slugger=ut,je.parse=je;var Xe=je;return Xe})},ELLl:function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){var fe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},he=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(k,I,v){v&&v!=Z.Init&&(k.removeKeyMap(ve),k.state.closeBrackets=null),I&&($(we(I,"pairs")),k.state.closeBrackets=I,k.addKeyMap(ve))});function we(k,I){return I=="pairs"&&typeof k=="string"?k:typeof k=="object"&&k[I]!=null?k[I]:fe[I]}var ve={Backspace:H,Enter:O};function $(k){for(var I=0;I<k.length;I++){var v=k.charAt(I),y="'"+v+"'";ve[y]||(ve[y]=G(v))}}$(fe.pairs+"`");function G(k){return function(I){return b(I,k)}}function Q(k){var I=k.state.closeBrackets;if(!I||I.override)return I;var v=k.getModeAt(k.getCursor());return v.closeBrackets||I}function H(k){var I=Q(k);if(!I||k.getOption("disableInput"))return Z.Pass;for(var v=we(I,"pairs"),y=k.listSelections(),A=0;A<y.length;A++){if(!y[A].empty())return Z.Pass;var F=T(k,y[A].head);if(!F||v.indexOf(F)%2!=0)return Z.Pass}for(var A=y.length-1;A>=0;A--){var me=y[A].head;k.replaceRange("",he(me.line,me.ch-1),he(me.line,me.ch+1),"+delete")}}function O(k){var I=Q(k),v=I&&we(I,"explode");if(!v||k.getOption("disableInput"))return Z.Pass;for(var y=k.listSelections(),A=0;A<y.length;A++){if(!y[A].empty())return Z.Pass;var F=T(k,y[A].head);if(!F||v.indexOf(F)%2!=0)return Z.Pass}k.operation(function(){var me=k.lineSeparator()||`
|
|
`;k.replaceSelection(me+me,null),k.execCommand("goCharLeft"),y=k.listSelections();for(var ce=0;ce<y.length;ce++){var ye=y[ce].head.line;k.indentLine(ye,null,!0),k.indentLine(ye+1,null,!0)}})}function x(k){var I=Z.cmpPos(k.anchor,k.head)>0;return{anchor:new he(k.anchor.line,k.anchor.ch+(I?-1:1)),head:new he(k.head.line,k.head.ch+(I?1:-1))}}function b(k,I){var v=Q(k);if(!v||k.getOption("disableInput"))return Z.Pass;var y=we(v,"pairs"),A=y.indexOf(I);if(A==-1)return Z.Pass;for(var F=we(v,"closeBefore"),me=we(v,"triples"),ce=y.charAt(A+1)==I,ye=k.listSelections(),Ne=A%2==0,Ee,De=0;De<ye.length;De++){var Ke=ye[De],le=Ke.head,D,be=k.getRange(le,he(le.line,le.ch+1));if(Ne&&!Ke.empty())D="surround";else if((ce||!Ne)&&be==I)ce&&E(k,le)?D="both":me.indexOf(I)>=0&&k.getRange(le,he(le.line,le.ch+3))==I+I+I?D="skipThree":D="skip";else if(ce&&le.ch>1&&me.indexOf(I)>=0&&k.getRange(he(le.line,le.ch-2),le)==I+I){if(le.ch>2&&/\bstring/.test(k.getTokenTypeAt(he(le.line,le.ch-2))))return Z.Pass;D="addFour"}else if(ce){var ne=le.ch==0?" ":k.getRange(he(le.line,le.ch-1),le);if(!Z.isWordChar(be)&&ne!=I&&!Z.isWordChar(ne))D="both";else return Z.Pass}else if(Ne&&(be.length===0||/\s/.test(be)||F.indexOf(be)>-1))D="both";else return Z.Pass;if(!Ee)Ee=D;else if(Ee!=D)return Z.Pass}var W=A%2?y.charAt(A-1):I,ie=A%2?I:y.charAt(A+1);k.operation(function(){if(Ee=="skip")k.execCommand("goCharRight");else if(Ee=="skipThree")for(var U=0;U<3;U++)k.execCommand("goCharRight");else if(Ee=="surround"){for(var B=k.getSelections(),U=0;U<B.length;U++)B[U]=W+B[U]+ie;k.replaceSelections(B,"around"),B=k.listSelections().slice();for(var U=0;U<B.length;U++)B[U]=x(B[U]);k.setSelections(B)}else Ee=="both"?(k.replaceSelection(W+ie,null),k.triggerElectric(W+ie),k.execCommand("goCharLeft")):Ee=="addFour"&&(k.replaceSelection(W+W+W+W,"before"),k.execCommand("goCharRight"))})}function T(k,I){var v=k.getRange(he(I.line,I.ch-1),he(I.line,I.ch+1));return v.length==2?v:null}function E(k,I){var v=k.getTokenAt(he(I.line,I.ch+1));return/\bstring/.test(v.type)&&v.start==I.ch&&(I.ch==0||!/\bstring/.test(k.getTokenTypeAt(I)))}})},GfqC:function(gt,pe,w){"use strict";var Z=w("q1tI"),fe=w.n(Z),he=w("TSYQ"),we=w.n(he);function ve(N,m){var d="cannot "+N.method+" "+N.action+" "+m.status+"'",R=new Error(d);return R.status=m.status,R.method=N.method,R.url=N.action,R}function $(N){var m=N.responseText||N.response;if(!m)return m;try{return JSON.parse(m)}catch(d){return m}}function G(N){var m=new XMLHttpRequest;N.onProgress&&m.upload&&(m.upload.onprogress=function(ae){ae.total>0&&(ae.percent=ae.loaded/ae.total*100),N.onProgress(ae)});var d=new FormData;N.data&&Object.keys(N.data).forEach(function(V){var ae=N.data[V];if(Array.isArray(ae)){ae.forEach(function(_e){d.append(V+"[]",_e)});return}d.append(V,N.data[V])}),N.file instanceof Blob?d.append(N.filename,N.file,N.file.name):d.append(N.filename,N.file),m.onerror=function(ae){N.onError(ae)},m.onload=function(){return m.status<200||m.status>=300?N.onError(ve(N,m),$(m)):N.onSuccess($(m),m)},m.open(N.method,N.action,!0),N.withCredentials&&"withCredentials"in m&&(m.withCredentials=!0);var R=N.headers||{};return R["X-Requested-With"]!==null&&m.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(R).forEach(function(V){R[V]!==null&&m.setRequestHeader(V,R[V])}),m.send(d),{abort:function(){m.abort()}}}var Q=+new Date,H=0;function O(){return"rc-upload-"+Q+"-"+ ++H}function x(N,m){return N.indexOf(m,N.length-m.length)!==-1}var b=function(N,m){if(N&&m){var d=Array.isArray(m)?m:m.split(","),R=N.name||"",V=N.type||"",ae=V.replace(/\/.*$/,"");return d.some(function(_e){var Fe=_e.trim();return Fe.charAt(0)==="."?x(R.toLowerCase(),Fe.toLowerCase()):/\/\*$/.test(Fe)?ae===Fe.replace(/\/.*$/,""):V===Fe})}return!0};function T(N,m){var d=N.createReader(),R=[];function V(){d.readEntries(function(ae){var _e=Array.prototype.slice.apply(ae);R=R.concat(_e);var Fe=!_e.length;Fe?m(R):V()})}V()}var E=function(m,d,R){var V=function ae(_e,Fe){Fe=Fe||"",_e.isFile?_e.file(function(Le){R(Le)&&(_e.fullPath&&!Le.webkitRelativePath&&(Object.defineProperties(Le,{webkitRelativePath:{writable:!0}}),Le.webkitRelativePath=_e.fullPath.replace(/^\//,""),Object.defineProperties(Le,{webkitRelativePath:{writable:!1}})),d([Le]))}):_e.isDirectory&&T(_e,function(Le){Le.forEach(function(Re){ae(Re,""+Fe+_e.name+"/")})})};m.forEach(function(ae){V(ae.webkitGetAsEntry())})},k=E,I=Object.assign||function(N){for(var m=1;m<arguments.length;m++){var d=arguments[m];for(var R in d)Object.prototype.hasOwnProperty.call(d,R)&&(N[R]=d[R])}return N},v=function(){function N(m,d){var R=[],V=!0,ae=!1,_e=void 0;try{for(var Fe=m[Symbol.iterator](),Le;!(V=(Le=Fe.next()).done)&&!(R.push(Le.value),d&&R.length===d);V=!0);}catch(Re){ae=!0,_e=Re}finally{try{!V&&Fe.return&&Fe.return()}finally{if(ae)throw _e}}return R}return function(m,d){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return N(m,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function(){function N(m,d){for(var R=0;R<d.length;R++){var V=d[R];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(m,V.key,V)}}return function(m,d,R){return d&&N(m.prototype,d),R&&N(m,R),m}}();function A(N,m,d){return m in N?Object.defineProperty(N,m,{value:d,enumerable:!0,configurable:!0,writable:!0}):N[m]=d,N}function F(N,m){var d={};for(var R in N){if(m.indexOf(R)>=0)continue;if(!Object.prototype.hasOwnProperty.call(N,R))continue;d[R]=N[R]}return d}function me(N,m){if(!(N instanceof m))throw new TypeError("Cannot call a class as a function")}function ce(N,m){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:N}function ye(N,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);N.prototype=Object.create(m&&m.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(N,m):N.__proto__=m)}var Ne=function(m){return Object.keys(m).reduce(function(d,R){return(R.substr(0,5)==="data-"||R.substr(0,5)==="aria-"||R==="role")&&(d[R]=m[R]),d},{})},Ee=function(N){ye(m,N);function m(){var d,R,V,ae;me(this,m);for(var _e=arguments.length,Fe=Array(_e),Le=0;Le<_e;Le++)Fe[Le]=arguments[Le];return ae=(R=(V=ce(this,(d=m.__proto__||Object.getPrototypeOf(m)).call.apply(d,[this].concat(Fe))),V),V.state={uid:O()},V.reqs={},V.onChange=function(Re){var Ae=Re.target.files;V.uploadFiles(Ae),V.reset()},V.onClick=function(Re){var Ae=V.fileInput;if(!Ae)return;var Se=V.props,ue=Se.children,q=Se.onClick;ue&&ue.type==="button"&&(Ae.parentNode.focus(),Ae.parentNode.querySelector("button").blur()),Ae.click(),q&&q(Re)},V.onKeyDown=function(Re){Re.key==="Enter"&&V.onClick()},V.onFileDrop=function(Re){var Ae=V.props.multiple;if(Re.preventDefault(),Re.type==="dragover")return;if(V.props.directory)k(Array.prototype.slice.call(Re.dataTransfer.items),V.uploadFiles,function(ue){return b(ue,V.props.accept)});else{var Se=Array.prototype.slice.call(Re.dataTransfer.files).filter(function(ue){return b(ue,V.props.accept)});Ae===!1&&(Se=Se.slice(0,1)),V.uploadFiles(Se)}},V.uploadFiles=function(Re){var Ae=Array.prototype.slice.call(Re);Ae.map(function(Se){return Se.uid=O(),Se}).forEach(function(Se){V.upload(Se,Ae)})},V.saveFileInput=function(Re){V.fileInput=Re},R),ce(V,ae)}return y(m,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(R,V){var ae=this,_e=this.props;if(!_e.beforeUpload)return setTimeout(function(){return ae.post(R)},0);var Fe=_e.beforeUpload(R,V);Fe&&Fe.then?Fe.then(function(Le){var Re=Object.prototype.toString.call(Le);return Re==="[object File]"||Re==="[object Blob]"?ae.post(Le):ae.post(R)}).catch(function(Le){console.log(Le)}):Fe!==!1&&setTimeout(function(){return ae.post(R)},0);return}},{key:"post",value:function(R){var V=this;if(!this._isMounted)return;var ae=this.props,_e=ae.onStart,Fe=ae.onProgress,Le=ae.transformFile,Re=Le===void 0?function(Ae){return Ae}:Le;new Promise(function(Ae){var Se=ae.action;return typeof Se=="function"&&(Se=Se(R)),Ae(Se)}).then(function(Ae){var Se=R.uid,ue=ae.customRequest||G,q=Promise.resolve(Re(R)).then(function(L){var K=ae.data;return typeof K=="function"&&(K=K(L)),Promise.all([L,K])}).catch(function(L){console.error(L)});q.then(function(L){var K=v(L,2),j=K[0],ke=K[1],P={action:Ae,filename:ae.name,data:ke,file:j,headers:ae.headers,withCredentials:ae.withCredentials,method:ae.method||"post",onProgress:Fe?function(_){Fe(_,R)}:null,onSuccess:function(re,Ce){delete V.reqs[Se],ae.onSuccess(re,R,Ce)},onError:function(re,Ce){delete V.reqs[Se],ae.onError(re,Ce,R)}};_e(R),V.reqs[Se]=ue(P)})})}},{key:"reset",value:function(){this.setState({uid:O()})}},{key:"abort",value:function(R){var V=this.reqs;if(R){var ae=R;R&&R.uid&&(ae=R.uid),V[ae]&&V[ae].abort&&V[ae].abort(),delete V[ae]}else Object.keys(V).forEach(function(_e){V[_e]&&V[_e].abort&&V[_e].abort(),delete V[_e]})}},{key:"render",value:function(){var R,V=this.props,ae=V.component,_e=V.prefixCls,Fe=V.className,Le=V.disabled,Re=V.id,Ae=V.style,Se=V.multiple,ue=V.accept,q=V.children,L=V.directory,K=V.openFileDialogOnClick,j=V.onMouseEnter,ke=V.onMouseLeave,P=F(V,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),_=we()((R={},A(R,_e,!0),A(R,_e+"-disabled",Le),A(R,Fe,Fe),R)),re=Le?{}:{onClick:K?this.onClick:function(){},onKeyDown:K?this.onKeyDown:function(){},onMouseEnter:j,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return fe.a.createElement(ae,I({},re,{className:_,role:"button",style:Ae}),fe.a.createElement("input",I({},Ne(P),{id:Re,type:"file",ref:this.saveFileInput,onClick:function(Pe){return Pe.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ue,directory:L?"directory":null,webkitdirectory:L?"webkitdirectory":null,multiple:Se,onChange:this.onChange})),q)}}]),m}(Z.Component),De=Ee,Ke=Object.assign||function(N){for(var m=1;m<arguments.length;m++){var d=arguments[m];for(var R in d)Object.prototype.hasOwnProperty.call(d,R)&&(N[R]=d[R])}return N},le=function(){function N(m,d){for(var R=0;R<d.length;R++){var V=d[R];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(m,V.key,V)}}return function(m,d,R){return d&&N(m.prototype,d),R&&N(m,R),m}}();function D(N,m){if(!(N instanceof m))throw new TypeError("Cannot call a class as a function")}function be(N,m){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:N}function ne(N,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);N.prototype=Object.create(m&&m.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(N,m):N.__proto__=m)}function W(){}var ie=function(N){ne(m,N);function m(){var d,R,V,ae;D(this,m);for(var _e=arguments.length,Fe=Array(_e),Le=0;Le<_e;Le++)Fe[Le]=arguments[Le];return ae=(R=(V=be(this,(d=m.__proto__||Object.getPrototypeOf(m)).call.apply(d,[this].concat(Fe))),V),V.saveUploader=function(Re){V.uploader=Re},R),be(V,ae)}return le(m,[{key:"abort",value:function(R){this.uploader.abort(R)}},{key:"render",value:function(){return fe.a.createElement(De,Ke({},this.props,{ref:this.saveUploader}))}}]),m}(Z.Component);ie.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:W,onError:W,onSuccess:W,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=ie,B=pe.a=U},Gytx:function(gt,pe){gt.exports=function(Z,fe,he,we){var ve=he?he.call(we,Z,fe):void 0;if(ve!==void 0)return!!ve;if(Z===fe)return!0;if(typeof Z!="object"||!Z||typeof fe!="object"||!fe)return!1;var $=Object.keys(Z),G=Object.keys(fe);if($.length!==G.length)return!1;for(var Q=Object.prototype.hasOwnProperty.bind(fe),H=0;H<$.length;H++){var O=$[H];if(!Q(O))return!1;var x=Z[O],b=fe[O];if(ve=he?he.call(we,x,b,O):void 0,ve===!1||ve===void 0&&x!==b)return!1}return!0}},HmJG:function(gt,pe,w){},JYp7:function(gt,pe,w){"use strict";w.d(pe,"c",function(){return fe}),w.d(pe,"d",function(){return he}),w.d(pe,"f",function(){return ve}),w.d(pe,"a",function(){return $}),w.d(pe,"b",function(){return G}),w.d(pe,"e",function(){return Q});var Z=function(){var H=function(O,x){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,T){b.__proto__=T}||function(b,T){for(var E in T)T.hasOwnProperty(E)&&(b[E]=T[E])},H(O,x)};return function(O,x){H(O,x);function b(){this.constructor=O}O.prototype=x===null?Object.create(x):(b.prototype=x.prototype,new b)}}(),fe={done:!0,value:void 0},he;(function(H){var O={next:function(){return fe}};function x(){return O}H.empty=x;function b(ce){var ye=!1;return{next:function(){return ye?fe:(ye=!0,{done:!1,value:ce})}}}H.single=b;function T(ce,ye,Ne){return ye===void 0&&(ye=0),Ne===void 0&&(Ne=ce.length),{next:function(){return ye>=Ne?fe:{done:!1,value:ce[ye++]}}}}H.fromArray=T;function E(ce){return{next:function(){var ye=ce.next();return ye.done?fe:{done:!1,value:ye.value}}}}H.fromNativeIterator=E;function k(ce){return ce?Array.isArray(ce)?H.fromArray(ce):ce:H.empty()}H.from=k;function I(ce,ye){return{next:function(){var Ne=ce.next();return Ne.done?fe:{done:!1,value:ye(Ne.value)}}}}H.map=I;function v(ce,ye){return{next:function(){for(;;){var Ne=ce.next();if(Ne.done)return fe;if(ye(Ne.value))return{done:!1,value:Ne.value}}}}}H.filter=v;function y(ce,ye){for(var Ne=ce.next();!Ne.done;Ne=ce.next())ye(Ne.value)}H.forEach=y;function A(ce,ye){ye===void 0&&(ye=Number.POSITIVE_INFINITY);var Ne=[];if(ye===0)return Ne;for(var Ee=0,De=ce.next();!De.done&&!(Ne.push(De.value),++Ee>=ye);De=ce.next());return Ne}H.collect=A;function F(){for(var ce=[],ye=0;ye<arguments.length;ye++)ce[ye]=arguments[ye];var Ne=0;return{next:function(){if(Ne>=ce.length)return fe;var Ee=ce[Ne],De=Ee.next();return De.done?(Ne++,this.next()):De}}}H.concat=F;function me(ce){return new we(ce)}H.chain=me})(he||(he={}));var we=function(){function H(O){this.it=O}return H.prototype.next=function(){return this.it.next()},H}();function ve(H){return Array.isArray(H)?he.fromArray(H):H||he.empty()}var $=function(){function H(O,x,b,T){x===void 0&&(x=0),b===void 0&&(b=O.length),T===void 0&&(T=x-1),this.items=O,this.start=x,this.end=b,this.index=T}return H.prototype.first=function(){return this.index=this.start,this.current()},H.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},H.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},H}(),G=function(H){Z(O,H);function O(x,b,T,E){return b===void 0&&(b=0),T===void 0&&(T=x.length),E===void 0&&(E=b-1),H.call(this,x,b,T,E)||this}return O.prototype.current=function(){return H.prototype.current.call(this)},O.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},O.prototype.first=function(){return this.index=this.start,this.current()},O.prototype.last=function(){return this.index=this.end-1,this.current()},O.prototype.parent=function(){return null},O}($),Q=function(){function H(O,x){this.iterator=O,this.fn=x}return H.prototype.next=function(){return this.fn(this.iterator.next())},H}()},LdHM:function(gt,pe,w){"use strict";w.d(pe,"b",function(){return F}),w.d(pe,"a",function(){return ce});var Z=w("1OyB"),fe=w("vuIU"),he=w("Ji7U"),we=w("LK+K"),ve=w("q1tI"),$=w("rePB"),G=w("Ff2n"),Q=w("ODXe"),H=w("4IlW"),O=w("bX4T"),x=w("YrtM"),b=w("TSYQ"),T=w.n(b),E=w("+nKL"),k=w("8OUc"),I=function(R,V){var ae=R.prefixCls,_e=R.id,Fe=R.flattenOptions,Le=R.childrenAsData,Re=R.values,Ae=R.searchValue,Se=R.multiple,ue=R.defaultActiveFirstOption,q=R.height,L=R.itemHeight,K=R.notFoundContent,j=R.open,ke=R.menuItemSelectedIcon,P=R.virtual,_=R.onSelect,re=R.onToggleOpen,Ce=R.onActiveValue,Pe=R.onScroll,Oe=R.onMouseEnter,He="".concat(ae,"-item"),Ge=Object(x.a)(function(){return Fe},[j,Fe],function(Xe,se){return se[0]&&Xe[1]!==se[1]}),ut=ve.useRef(null),Ze=function(se){se.preventDefault()},it=function(se){ut.current&&ut.current.scrollTo({index:se})},Qe=function(se){for(var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,oe=Ge.length,S=0;S<oe;S+=1){var M=(se+S*te+oe)%oe,X=Ge[M],Y=X.group,Te=X.data;if(!Y&&!Te.disabled)return M}return-1},yt=ve.useState(function(){return Qe(0)}),ct=Object(Q.a)(yt,2),dt=ct[0],Me=ct[1],et=function(se){Me(se);var te=Ge[se];if(!te){Ce(null,-1);return}Ce(te.data.value,se)};ve.useEffect(function(){et(ue!==!1?Qe(0):-1)},[Ge.length,Ae]),ve.useEffect(function(){var Xe=setTimeout(function(){if(!Se&&j&&Re.size===1){var se=Array.from(Re)[0],te=Ge.findIndex(function(oe){var S=oe.data;return S.value===se});et(te),it(te)}});return function(){return clearTimeout(Xe)}},[j]);var ht=function(se){se!==void 0&&_(se,{selected:!Re.has(se)}),Se||re(!1)};if(ve.useImperativeHandle(V,function(){return{onKeyDown:function(se){var te=se.which;switch(te){case H.a.UP:case H.a.DOWN:{var oe=0;if(te===H.a.UP?oe=-1:te===H.a.DOWN&&(oe=1),oe!==0){var S=Qe(dt+oe,oe);it(S),et(S)}break}case H.a.ENTER:{var M=Ge[dt];M&&!M.data.disabled?ht(M.data.value):ht(void 0),j&&se.preventDefault();break}case H.a.ESC:re(!1)}},onKeyUp:function(){},scrollTo:function(se){it(se)}}}),Ge.length===0)return ve.createElement("div",{role:"listbox",id:"".concat(_e,"_list"),className:"".concat(He,"-empty"),onMouseDown:Ze},K);function je(Xe){var se=Ge[Xe];if(!se)return null;var te=se.data||{},oe=te.value,S=te.label,M=te.children,X=Object(O.a)(te,!0),Y=Le?M:S;return se?ve.createElement("div",Object.assign({"aria-label":typeof Y=="string"?Y:null},X,{key:Xe,role:"option",id:"".concat(_e,"_list_").concat(Xe),"aria-selected":Re.has(oe)}),oe):null}return ve.createElement(ve.Fragment,null,ve.createElement("div",{role:"listbox",id:"".concat(_e,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(dt-1),je(dt),je(dt+1)),ve.createElement(E.a,{itemKey:"key",ref:ut,data:Ge,height:q,itemHeight:L,fullHeight:!1,onMouseDown:Ze,onScroll:Pe,virtual:P,onMouseEnter:Oe},function(Xe,se){var te,oe=Xe.group,S=Xe.groupOption,M=Xe.data,X=M.label,Y=M.key;if(oe)return ve.createElement("div",{className:T()(He,"".concat(He,"-group"))},X!==void 0?X:Y);var Te=M.disabled,de=M.value,We=M.title,Je=M.children,rt=M.style,Ye=M.className,kt=Object(G.a)(M,["disabled","value","title","children","style","className"]),Tt=Re.has(de),lt="".concat(He,"-option"),Ht=T()(He,lt,Ye,(te={},Object($.a)(te,"".concat(lt,"-grouped"),S),Object($.a)(te,"".concat(lt,"-active"),dt===se&&!Te),Object($.a)(te,"".concat(lt,"-disabled"),Te),Object($.a)(te,"".concat(lt,"-selected"),Tt),te)),Ft=Le?Je:X,Mt=!ke||typeof ke=="function"||Tt;return ve.createElement("div",Object.assign({},kt,{"aria-selected":Tt,className:Ht,title:We,onMouseMove:function(){if(dt===se||Te)return;et(se)},onClick:function(){Te||ht(de)},style:rt}),ve.createElement("div",{className:"".concat(lt,"-content")},Ft||de),ve.isValidElement(ke)||Tt,Mt&&ve.createElement(k.a,{className:"".concat(He,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:Tt}},Tt?"\u2713":null))}))},v=ve.forwardRef(I);v.displayName="OptionList";var y=v,A=function(){return null};A.isSelectOption=!0;var F=A,me=function(){return null};me.isSelectOptGroup=!0;var ce=me,ye=w("VTBJ"),Ne=w("Zm9Q");function Ee(d){var R=d.key,V=d.props,ae=V.children,_e=V.value,Fe=Object(G.a)(V,["children","value"]);return Object(ye.a)({key:R,value:_e!==void 0?_e:R,children:ae},Fe)}function De(d){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ne.a)(d).map(function(V,ae){if(!ve.isValidElement(V)||!V.type)return null;var _e=V.type.isSelectOptGroup,Fe=V.key,Le=V.props,Re=Le.children,Ae=Object(G.a)(Le,["children"]);return R||!_e?Ee(V):Object(ye.a)(Object(ye.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?ae:Fe,"__"),label:Fe},Ae),{},{options:De(Re)})}).filter(function(V){return V})}var Ke=w("2Qr1"),le=w("qNPg"),D=w("U8pU"),be=w("Kwbf"),ne=w("WKfj");function W(d){var R=d.mode,V=d.options,ae=d.children,_e=d.backfill,Fe=d.allowClear,Le=d.placeholder,Re=d.getInputElement,Ae=d.showSearch,Se=d.onSearch,ue=d.defaultOpen,q=d.autoFocus,L=d.labelInValue,K=d.value,j=d.inputValue,ke=d.optionLabelProp,P=R==="multiple"||R==="tags",_=Ae!==void 0?Ae:P||R==="combobox",re=V||De(ae);if(Object(be.a)(R!=="tags"||re.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),R==="tags"||R==="combobox"){var Ce=re.some(function(He){return He.options?He.options.some(function(Ge){return typeof("value"in Ge?Ge.value:Ge.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(be.a)(!Ce,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(be.a)(R!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(be.a)(R==="combobox"||!_e,"`backfill` only works with `combobox` mode."),Object(be.a)(R==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(be.b)(R!=="combobox"||!Re||!Fe||!Le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!_&&R!=="combobox"&&R!=="tags"&&Object(be.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(be.b)(!ue||q,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),K!=null){var Pe=Object(ne.d)(K);Object(be.a)(!L||Pe.every(function(He){return Object(D.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(be.a)(!P||Array.isArray(K),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Oe=null;Object(Ne.a)(ae).some(function(He){if(!ve.isValidElement(He)||!He.type)return!1;var Ge=He.type;if(Ge.isSelectOption)return!1;if(Ge.isSelectOptGroup){var ut=Object(Ne.a)(He.props.children).every(function(Ze){return!ve.isValidElement(Ze)||!He.type||Ze.type.isSelectOption?!0:(Oe=Ze.type,!1)});return!ut}return Oe=Ge,!0}),Oe&&Object(be.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Oe.displayName||Oe.name||Oe,"`.")),Object(be.a)(j===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ie=W,U=Object(le.a)({prefixCls:"rc-select",components:{optionList:y},convertChildrenToData:De,flattenOptions:Ke.d,getLabeledValue:Ke.e,filterOptions:Ke.b,isValueDisabled:Ke.g,findValueOption:Ke.c,warningProps:ie,fillOptionsWithMissingValue:Ke.a}),B=function(d){Object(he.a)(V,d);var R=Object(we.a)(V);function V(){var ae;return Object(Z.a)(this,V),ae=R.apply(this,arguments),ae.selectRef=ve.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(fe.a)(V,[{key:"render",value:function(){return ve.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),V}(ve.Component);B.Option=F,B.OptGroup=ce;var N=B,m=pe.c=N},M8RZ:function(gt,pe,w){"use strict";w.d(pe,"a",function(){return H});var Z=w("fWQN"),fe=w("mtLc"),he=w("yKVA"),we=w("879j"),ve=w("q1tI"),$=w.n(ve),G=w("i8i4"),Q=w.n(G),H=function(O){Object(he.a)(b,O);var x=Object(we.a)(b);function b(T){var E;Object(Z.a)(this,b),E=x.call(this,T);var k=window.document;return E.node=k.createElement("div"),k.body.appendChild(E.node),E}return Object(fe.a)(b,[{key:"render",value:function(){var E=this.props.children;return Object(G.createPortal)(E,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),b}($.a.Component)},MI8n:function(gt,pe,w){"use strict";w.d(pe,"b",function(){return $}),w.d(pe,"a",function(){return H}),w.d(pe,"e",function(){return O}),w.d(pe,"d",function(){return x}),w.d(pe,"c",function(){return b}),w.d(pe,"f",function(){return T});var Z=w("/cxE"),fe=w("C/vA"),he=w("pmY6"),we=w("24hK"),ve=function(){var E=function(k,I){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var A in y)y.hasOwnProperty(A)&&(v[A]=y[A])},E(k,I)};return function(k,I){E(k,I);function v(){this.constructor=k}k.prototype=I===null?Object.create(I):(v.prototype=I.prototype,new v)}}(),$;(function(E){E.None=function(){return he.a.None};function k(ie){return function(U,B,N){B===void 0&&(B=null);var m=!1,d;return d=ie(function(R){return m?void 0:(d?d.dispose():m=!0,U.call(B,R))},null,N),m&&d.dispose(),d}}E.once=k;function I(ie,U){return ce(function(B,N,m){return N===void 0&&(N=null),ie(function(d){return B.call(N,U(d))},null,m)})}E.map=I;function v(ie,U){return ce(function(B,N,m){return N===void 0&&(N=null),ie(function(d){U(d),B.call(N,d)},null,m)})}E.forEach=v;function y(ie,U){return ce(function(B,N,m){return N===void 0&&(N=null),ie(function(d){return U(d)&&B.call(N,d)},null,m)})}E.filter=y;function A(ie){return ie}E.signal=A;function F(){for(var ie=[],U=0;U<arguments.length;U++)ie[U]=arguments[U];return function(B,N,m){return N===void 0&&(N=null),he.e.apply(void 0,ie.map(function(d){return d(function(R){return B.call(N,R)},null,m)}))}}E.any=F;function me(ie,U,B){var N=B;return I(ie,function(m){return N=U(N,m),N})}E.reduce=me;function ce(ie){var U,B=new H({onFirstListenerAdd:function(){U=ie(B.fire,B)},onLastListenerRemove:function(){U.dispose()}});return B.event}E.snapshot=ce;function ye(ie,U,B,N,m){B===void 0&&(B=100),N===void 0&&(N=!1);var d,R=void 0,V=void 0,ae=0,_e=new H({leakWarningThreshold:m,onFirstListenerAdd:function(){d=ie(function(Fe){ae++,R=U(R,Fe),N&&!V&&(_e.fire(R),R=void 0),clearTimeout(V),V=setTimeout(function(){var Le=R;R=void 0,V=void 0,(!N||ae>1)&&_e.fire(Le),ae=0},B)})},onLastListenerRemove:function(){d.dispose()}});return _e.event}E.debounce=ye;function Ne(ie){var U=new Date().getTime();return I(k(ie),function(B){return new Date().getTime()-U})}E.stopwatch=Ne;function Ee(ie){var U=!0,B;return y(ie,function(N){var m=U||N!==B;return U=!1,B=N,m})}E.latch=Ee;function De(ie,U,B){U===void 0&&(U=!1),B===void 0&&(B=[]);var N=B.slice(),m=ie(function(V){N?N.push(V):R.fire(V)}),d=function(){N&&N.forEach(function(V){return R.fire(V)}),N=null},R=new H({onFirstListenerAdd:function(){m||(m=ie(function(V){return R.fire(V)}))},onFirstListenerDidAdd:function(){N&&(U?setTimeout(d):d())},onLastListenerRemove:function(){m&&m.dispose(),m=null}});return R.event}E.buffer=De;var Ke=function(){function ie(U){this.event=U}return ie.prototype.map=function(U){return new ie(I(this.event,U))},ie.prototype.forEach=function(U){return new ie(v(this.event,U))},ie.prototype.filter=function(U){return new ie(y(this.event,U))},ie.prototype.reduce=function(U,B){return new ie(me(this.event,U,B))},ie.prototype.latch=function(){return new ie(Ee(this.event))},ie.prototype.debounce=function(U,B,N,m){return B===void 0&&(B=100),N===void 0&&(N=!1),new ie(ye(this.event,U,B,N,m))},ie.prototype.on=function(U,B,N){return this.event(U,B,N)},ie.prototype.once=function(U,B,N){return k(this.event)(U,B,N)},ie}();function le(ie){return new Ke(ie)}E.chain=le;function D(ie,U,B){B===void 0&&(B=function(V){return V});var N=function(){for(var V=[],ae=0;ae<arguments.length;ae++)V[ae]=arguments[ae];return R.fire(B.apply(void 0,V))},m=function(){return ie.on(U,N)},d=function(){return ie.removeListener(U,N)},R=new H({onFirstListenerAdd:m,onLastListenerRemove:d});return R.event}E.fromNodeEventEmitter=D;function be(ie,U,B){B===void 0&&(B=function(V){return V});var N=function(){for(var V=[],ae=0;ae<arguments.length;ae++)V[ae]=arguments[ae];return R.fire(B.apply(void 0,V))},m=function(){return ie.addEventListener(U,N)},d=function(){return ie.removeEventListener(U,N)},R=new H({onFirstListenerAdd:m,onLastListenerRemove:d});return R.event}E.fromDOMEventEmitter=be;function ne(ie){var U=new H,B=!1;return ie.then(void 0,function(){return null}).then(function(){B?U.fire(void 0):setTimeout(function(){return U.fire(void 0)},0)}),B=!0,U.event}E.fromPromise=ne;function W(ie){return new Promise(function(U){return k(ie)(U)})}E.toPromise=W})($||($={}));var G=-1,Q=function(){function E(k,I){I===void 0&&(I=Math.random().toString(18).slice(2,5)),this.customThreshold=k,this.name=I,this._warnCountdown=0}return E.prototype.dispose=function(){this._stacks&&this._stacks.clear()},E.prototype.check=function(k){var I=this,v=G;if(typeof this.customThreshold=="number"&&(v=this.customThreshold),v<=0||k<v)return;this._stacks||(this._stacks=new Map);var y=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),A=this._stacks.get(y)||0;if(this._stacks.set(y,A+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=v*.5;var F,me=0;this._stacks.forEach(function(ce,ye){(!F||me<ce)&&(F=ye,me=ce)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+k+" listeners already. MOST frequent listener ("+me+"):"),console.warn(F)}return function(){var ce=I._stacks.get(y)||0;I._stacks.set(y,ce-1)}},E}(),H=function(){function E(k){this._disposed=!1,this._options=k,this._leakageMon=G>0?new Q(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(E.prototype,"event",{get:function(){var k=this;return this._event||(this._event=function(I,v,y){k._listeners||(k._listeners=new we.a);var A=k._listeners.isEmpty();A&&k._options&&k._options.onFirstListenerAdd&&k._options.onFirstListenerAdd(k);var F=k._listeners.push(v?[I,v]:I);A&&k._options&&k._options.onFirstListenerDidAdd&&k._options.onFirstListenerDidAdd(k),k._options&&k._options.onListenerDidAdd&&k._options.onListenerDidAdd(k,I,v);var me;k._leakageMon&&(me=k._leakageMon.check(k._listeners.size));var ce;return ce={dispose:function(){if(me&&me(),ce.dispose=E._noop,!k._disposed&&(F(),k._options&&k._options.onLastListenerRemove)){var ye=k._listeners&&!k._listeners.isEmpty();ye||k._options.onLastListenerRemove(k)}}},y instanceof he.b?y.add(ce):Array.isArray(y)&&y.push(ce),ce}),this._event},enumerable:!0,configurable:!0}),E.prototype.fire=function(k){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new we.a);for(var I=this._listeners.iterator(),v=I.next();!v.done;v=I.next())this._deliveryQueue.push([v.value,k]);for(;this._deliveryQueue.size>0;){var y=this._deliveryQueue.shift(),A=y[0],F=y[1];try{typeof A=="function"?A.call(void 0,F):A[0].call(A[1],F)}catch(me){Object(Z.e)(me)}}}},E.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},E._noop=function(){},E}(),O=function(E){ve(k,E);function k(I){var v=E.call(this,I)||this;return v._isPaused=0,v._eventQueue=new we.a,v._mergeFn=I&&I.merge,v}return k.prototype.pause=function(){this._isPaused++},k.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var I=this._eventQueue.toArray();this._eventQueue.clear(),E.prototype.fire.call(this,this._mergeFn(I))}else for(;!this._isPaused&&this._eventQueue.size!==0;)E.prototype.fire.call(this,this._eventQueue.shift())},k.prototype.fire=function(I){this._listeners&&(this._isPaused!==0?this._eventQueue.push(I):E.prototype.fire.call(this,I))},k}(H),x=function(){function E(){var k=this;this.hasListeners=!1,this.events=[],this.emitter=new H({onFirstListenerAdd:function(){return k.onFirstListenerAdd()},onLastListenerRemove:function(){return k.onLastListenerRemove()}})}return Object.defineProperty(E.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),E.prototype.add=function(k){var I=this,v={event:k,listener:null};this.events.push(v),this.hasListeners&&this.hook(v);var y=function(){I.hasListeners&&I.unhook(v);var A=I.events.indexOf(v);I.events.splice(A,1)};return Object(he.h)(Object(fe.a)(y))},E.prototype.onFirstListenerAdd=function(){var k=this;this.hasListeners=!0,this.events.forEach(function(I){return k.hook(I)})},E.prototype.onLastListenerRemove=function(){var k=this;this.hasListeners=!1,this.events.forEach(function(I){return k.unhook(I)})},E.prototype.hook=function(k){var I=this;k.listener=k.event(function(v){return I.emitter.fire(v)})},E.prototype.unhook=function(k){k.listener&&k.listener.dispose(),k.listener=null},E.prototype.dispose=function(){this.emitter.dispose()},E}(),b=function(){function E(){this.buffers=[]}return E.prototype.wrapEvent=function(k){var I=this;return function(v,y,A){return k(function(F){var me=I.buffers[I.buffers.length-1];me?me.push(function(){return v.call(y,F)}):v.call(y,F)},void 0,A)}},E.prototype.bufferEvents=function(k){var I=[];this.buffers.push(I);var v=k();return this.buffers.pop(),I.forEach(function(y){return y()}),v},E}(),T=function(){function E(){var k=this;this.listening=!1,this.inputEvent=$.None,this.inputEventListener=he.a.None,this.emitter=new H({onFirstListenerDidAdd:function(){k.listening=!0,k.inputEventListener=k.inputEvent(k.emitter.fire,k.emitter)},onLastListenerRemove:function(){k.listening=!1,k.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(E.prototype,"input",{set:function(k){this.inputEvent=k,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=k(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),E.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},E}()},N0LK:function(gt,pe,w){"use strict";w.d(pe,"x",function(){return Z}),w.d(pe,"F",function(){return fe}),w.d(pe,"r",function(){return we}),w.d(pe,"o",function(){return ve}),w.d(pe,"p",function(){return $}),w.d(pe,"Q",function(){return G}),w.d(pe,"K",function(){return H}),w.d(pe,"k",function(){return O}),w.d(pe,"N",function(){return x}),w.d(pe,"m",function(){return b}),w.d(pe,"l",function(){return T}),w.d(pe,"I",function(){return E}),w.d(pe,"H",function(){return k}),w.d(pe,"q",function(){return I}),w.d(pe,"t",function(){return v}),w.d(pe,"D",function(){return y}),w.d(pe,"e",function(){return A}),w.d(pe,"f",function(){return F}),w.d(pe,"B",function(){return me}),w.d(pe,"C",function(){return ce}),w.d(pe,"n",function(){return Ne}),w.d(pe,"O",function(){return De}),w.d(pe,"c",function(){return Ke}),w.d(pe,"d",function(){return le}),w.d(pe,"z",function(){return D}),w.d(pe,"A",function(){return be}),w.d(pe,"u",function(){return ne}),w.d(pe,"E",function(){return ie}),w.d(pe,"G",function(){return U}),w.d(pe,"i",function(){return N}),w.d(pe,"g",function(){return d}),w.d(pe,"v",function(){return V}),w.d(pe,"h",function(){return ae}),w.d(pe,"y",function(){return _e}),w.d(pe,"w",function(){return Fe}),w.d(pe,"a",function(){return Le}),w.d(pe,"P",function(){return Re}),w.d(pe,"L",function(){return Ae}),w.d(pe,"J",function(){return Se}),w.d(pe,"j",function(){return ue}),w.d(pe,"M",function(){return q}),w.d(pe,"s",function(){return L}),w.d(pe,"b",function(){return K});function Z(P){return!P||typeof P!="string"?!0:P.trim().length===0}function fe(P,_,re){re===void 0&&(re="0");for(var Ce=""+P,Pe=[Ce],Oe=Ce.length;Oe<_;Oe++)Pe.push(re);return Pe.reverse().join("")}var he=/{(\d+)}/g;function we(P){for(var _=[],re=1;re<arguments.length;re++)_[re-1]=arguments[re];return _.length===0?P:P.replace(he,function(Ce,Pe){var Oe=parseInt(Pe,10);return isNaN(Oe)||Oe<0||Oe>=_.length?Ce:_[Oe]})}function ve(P){return P.replace(/[<>&]/g,function(_){switch(_){case"<":return"<";case">":return">";case"&":return"&";default:return _}})}function $(P){return P.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function G(P,_){_===void 0&&(_=" ");var re=Q(P,_);return H(re,_)}function Q(P,_){if(!P||!_)return P;var re=_.length;if(re===0||P.length===0)return P;for(var Ce=0;P.indexOf(_,Ce)===Ce;)Ce=Ce+re;return P.substring(Ce)}function H(P,_){if(!P||!_)return P;var re=_.length,Ce=P.length;if(re===0||Ce===0)return P;for(var Pe=Ce,Oe=-1;!(Oe=P.lastIndexOf(_,Pe-1),Oe===-1||Oe+re!==Pe);){if(Oe===0)return"";Pe=Oe}return P.substring(0,Pe)}function O(P){return P.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function x(P,_){if(P.length<_.length)return!1;if(P===_)return!0;for(var re=0;re<_.length;re++)if(P[re]!==_[re])return!1;return!0}function b(P,_){var re=P.length-_.length;return re>0?P.indexOf(_,re)===re:re===0?P===_:!1}function T(P,_,re){if(re===void 0&&(re={}),!P)throw new Error("Cannot create regex from empty string");_||(P=$(P)),re.wholeWord&&(/\B/.test(P.charAt(0))||(P="\\b"+P),/\B/.test(P.charAt(P.length-1))||(P=P+"\\b"));var Ce="";return re.global&&(Ce+="g"),re.matchCase||(Ce+="i"),re.multiline&&(Ce+="m"),re.unicode&&(Ce+="u"),new RegExp(P,Ce)}function E(P){if(P.source==="^"||P.source==="^$"||P.source==="$"||P.source==="^\\s*$")return!1;var _=P.exec("");return!!(_&&P.lastIndex===0)}function k(P){return(P.global?"g":"")+(P.ignoreCase?"i":"")+(P.multiline?"m":"")+(P.unicode?"u":"")}function I(P){for(var _=0,re=P.length;_<re;_++){var Ce=P.charCodeAt(_);if(Ce!==32&&Ce!==9)return _}return-1}function v(P,_,re){_===void 0&&(_=0),re===void 0&&(re=P.length);for(var Ce=_;Ce<re;Ce++){var Pe=P.charCodeAt(Ce);if(Pe!==32&&Pe!==9)return P.substring(_,Ce)}return P.substring(_,re)}function y(P,_){_===void 0&&(_=P.length-1);for(var re=_;re>=0;re--){var Ce=P.charCodeAt(re);if(Ce!==32&&Ce!==9)return re}return-1}function A(P,_){return P<_?-1:P>_?1:0}function F(P,_){for(var re=Math.min(P.length,_.length),Ce=0;Ce<re;Ce++){var Pe=P.charCodeAt(Ce),Oe=_.charCodeAt(Ce);if(Pe===Oe)continue;ce(Pe)&&(Pe+=32),ce(Oe)&&(Oe+=32);var He=Pe-Oe;if(He===0)continue;return me(Pe)&&me(Oe)?He:A(P.toLowerCase(),_.toLowerCase())}return P.length<_.length?-1:P.length>_.length?1:0}function me(P){return P>=97&&P<=122}function ce(P){return P>=65&&P<=90}function ye(P){return me(P)||ce(P)}function Ne(P,_){return P.length===_.length&&Ee(P,_)}function Ee(P,_,re){re===void 0&&(re=P.length);for(var Ce=0;Ce<re;Ce++){var Pe=P.charCodeAt(Ce),Oe=_.charCodeAt(Ce);if(Pe===Oe)continue;if(ye(Pe)&&ye(Oe)){var He=Math.abs(Pe-Oe);if(He!==0&&He!==32)return!1}else if(String.fromCharCode(Pe).toLowerCase()!==String.fromCharCode(Oe).toLowerCase())return!1}return!0}function De(P,_){var re=_.length;return _.length>P.length?!1:Ee(P,_,re)}function Ke(P,_){var re,Ce=Math.min(P.length,_.length);for(re=0;re<Ce;re++)if(P.charCodeAt(re)!==_.charCodeAt(re))return re;return Ce}function le(P,_){var re,Ce=Math.min(P.length,_.length),Pe=P.length-1,Oe=_.length-1;for(re=0;re<Ce;re++)if(P.charCodeAt(Pe-re)!==_.charCodeAt(Oe-re))return re;return Ce}function D(P){return 55296<=P&&P<=56319}function be(P){return 56320<=P&&P<=57343}function ne(P,_,re){var Ce=P.charCodeAt(re);if(D(Ce)&&re+1<_){var Pe=P.charCodeAt(re+1);if(be(Pe))return(Ce-55296<<10)+(Pe-56320)+65536}return Ce}function W(P,_){var re=P.charCodeAt(_-1);if(be(re)&&_>1){var Ce=P.charCodeAt(_-2);if(D(Ce))return(Ce-55296<<10)+(re-56320)+65536}return re}function ie(P,_){var re=j.getInstance(),Ce=_,Pe=P.length,Oe=ne(P,Pe,_);_+=Oe>=65536?2:1;for(var He=re.getGraphemeBreakType(Oe);_<Pe;){var Ge=ne(P,Pe,_),ut=re.getGraphemeBreakType(Ge);if(K(He,ut))break;_+=Ge>=65536?2:1,He=ut}return _-Ce}function U(P,_){var re=j.getInstance(),Ce=_,Pe=W(P,_);_-=Pe>=65536?2:1;for(var Oe=re.getGraphemeBreakType(Pe);_>0;){var He=W(P,_),Ge=re.getGraphemeBreakType(He);if(K(Ge,Oe))break;_-=He>=65536?2:1,Oe=Ge}return Ce-_}var B=/(?:[\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(P){return B.test(P)}var m=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function d(P){return m.test(P)}var R=/^[\t\n\r\x20-\x7E]*$/;function V(P){return R.test(P)}function ae(P){for(var _=0,re=P.length;_<re;_++)if(_e(P.charCodeAt(_)))return!0;return!1}function _e(P){return P=+P,P>=11904&&P<=55215||P>=63744&&P<=64255||P>=65281&&P<=65374}function Fe(P){return P>=127462&&P<=127487||P>=9728&&P<=10175||P>=127744&&P<=128591||P>=128640&&P<=128764||P>=128992&&P<=129003||P>=129280&&P<=129535||P>=129648&&P<=129651||P>=129656&&P<=129666||P>=129680&&P<=129685}var Le=String.fromCharCode(65279);function Re(P){return!!(P&&P.length>0&&P.charCodeAt(0)===65279)}function Ae(P){return btoa(encodeURIComponent(P))}function Se(P,_){for(var re="",Ce=0;Ce<_;Ce++)re+=P;return re}function ue(P,_){return _===void 0&&(_=!1),P?(_&&(P=P.replace(/\\./g,"")),P.toLowerCase()!==P):!1}function q(P){var _=90-65+1;return P=P%(2*_),P<_?String.fromCharCode(97+P):String.fromCharCode(65+P-_)}function L(P){var _=j.getInstance();return _.getGraphemeBreakType(P)}function K(P,_){return P===0?_!==5&&_!==7:P===2&&_===3?!1:P===4||P===2||P===3||(_===4||_===2||_===3)?!0:P===8&&(_===8||_===9||_===11||_===12)||((P===11||P===9)&&(_===9||_===10)||((P===12||P===10)&&_===10||(_===5||_===13||(_===7||(P===1||P===13&&_===14)))))?!1:!(P===6&&_===6)}var j=function(){function P(){this._data=ke()}return P.getInstance=function(){return P._INSTANCE||(P._INSTANCE=new P),P._INSTANCE},P.prototype.getGraphemeBreakType=function(_){if(_<32)return _===10?3:_===13?2:4;if(_<127)return 0;for(var re=this._data,Ce=re.length/3,Pe=1;Pe<=Ce;)if(_<re[3*Pe])Pe=2*Pe;else if(_>re[3*Pe+1])Pe=2*Pe+1;else return re[3*Pe+2];return 0},P._INSTANCE=null,P}();function ke(){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]")}},OLES:function(gt,pe,w){"use strict";var Z=w("U8pU"),fe=w("VTBJ"),he=w("Ff2n"),we=w("q1tI"),ve=w("uciX"),$=w("7ixt"),G=function(T){var E=T.overlay,k=T.prefixCls,I=T.id,v=T.overlayInnerStyle;return we.createElement("div",{className:"".concat(k,"-inner"),id:I,role:"tooltip",style:v},typeof E=="function"?E():E)},Q=G,H=function(T,E){var k=T.overlayClassName,I=T.trigger,v=I===void 0?["hover"]:I,y=T.mouseEnterDelay,A=y===void 0?0:y,F=T.mouseLeaveDelay,me=F===void 0?.1:F,ce=T.overlayStyle,ye=T.prefixCls,Ne=ye===void 0?"rc-tooltip":ye,Ee=T.children,De=T.onVisibleChange,Ke=T.afterVisibleChange,le=T.transitionName,D=T.animation,be=T.placement,ne=be===void 0?"right":be,W=T.align,ie=W===void 0?{}:W,U=T.destroyTooltipOnHide,B=U===void 0?!1:U,N=T.defaultVisible,m=T.getTooltipContainer,d=T.overlayInnerStyle,R=Object(he.a)(T,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),V=Object(we.useRef)(null);Object(we.useImperativeHandle)(E,function(){return V.current});var ae=Object(fe.a)({},R);"visible"in T&&(ae.popupVisible=T.visible);var _e=function(){var Se=T.arrowContent,ue=Se===void 0?null:Se,q=T.overlay,L=T.id;return[we.createElement("div",{className:"".concat(Ne,"-arrow"),key:"arrow"},ue),we.createElement(Q,{key:"content",prefixCls:Ne,id:L,overlay:q,overlayInnerStyle:d})]},Fe=!1,Le=!1;if(typeof B=="boolean")Fe=B;else if(B&&Object(Z.a)(B)==="object"){var Re=B.keepParent;Fe=Re===!0,Le=Re===!1}return we.createElement(ve.a,Object.assign({popupClassName:k,prefixCls:Ne,popup:_e,action:v,builtinPlacements:$.a,popupPlacement:ne,ref:V,popupAlign:ie,getPopupContainer:m,onPopupVisibleChange:De,afterPopupVisibleChange:Ke,popupTransitionName:le,popupAnimation:D,defaultPopupVisible:N,destroyPopupOnHide:Fe,autoDestroy:Le,mouseLeaveDelay:me,popupStyle:ce,mouseEnterDelay:A},ae),Ee)},O=Object(we.forwardRef)(H),x=pe.a=O},Ot1p:function(gt,pe,w){"use strict";var Z=w("2qtc"),fe=w("kLXV"),he=w("rAM+"),we=w("miYZ"),ve=w("tsqr"),$=w("9og8"),G=w("tJVT"),Q=w("jrin"),H=w("WmNS"),O=w.n(H),x=w("q1tI"),b=w.n(x),T=w("VrN/"),E=w.n(T),k=w("bdgK"),I=w("p77/"),v=w("Bd2K"),y=w("ELLl"),A=w("19Vz"),F=w("lZu9"),me=w("+NIl"),ce=w("kSUc"),ye=w("9Bee"),Ne=function(de){var We=de.value,Je=We===void 0?"":We,rt=de.className,Ye=de.showTextOnly,kt=de.showLines,Tt=de.style,lt=Tt===void 0?{}:Tt,Ht=Object(x.useMemo)(function(){return""},[Je]);return b.a.createElement(b.a.Fragment,null,b.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ht}}))},Ee=w("0Owb"),De=w("dejd"),Ke=w("C+DQ"),le=w("1vsH"),D=w("m3rI"),be=[{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 ne(de){var We=de.onActionCallback,Je=de.title,rt=de.icon,Ye=de.actionName,kt=de.className,Tt=kt===void 0?"":kt,lt=de.children;function Ht(){We(Ye)}return b.a.createElement("a",{title:Je,className:Tt,onClick:Ht},b.a.createElement("i",{className:"md-iconfont ".concat(rt)}),lt)}var W=function(de){var We=de.watch,Je=de.showNullButton,rt=de.onActionCallback,Ye=de.fullScreen,kt=de.insertTemp,Tt=de.hidetoolBar,lt=de.uuid,Ht=de.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(le.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(le.D)("_educoder_session"),"&key=").concat(lt,"&api=").concat(encodeURIComponent(D.a.PROXY_SERVER)));var Ft=[].concat(be,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return b.a.createElement("ul",{className:"markdown-toolbar-container"},!Tt&&Ft.map(function(Mt,Pt){return b.a.createElement("li",{key:Pt},Mt.actionName?b.a.createElement(ne,Object(Ee.a)({},Mt,{onActionCallback:rt})):b.a.createElement("span",{className:"v-line"}))}),Je?b.a.createElement("li",null,b.a.createElement(ne,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},b.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&b.a.createElement("li",null,b.a.createElement(ne,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:rt},b.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),b.a.createElement("li",{className:"btn-full-screen"},b.a.createElement(ne,{icon:"".concat(Ye?"icon-shrink":"icon-enlarge"),title:Ye?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},ie=w("M8RZ"),U=w("+L6B"),B=w("2/Rp"),N=w("y8nQ"),m=w("Vl3Y"),d=w("5NDa"),R=w("5rEg"),V={labelCol:{span:4},wrapperCol:{span:20}},ae=function(de){var We=de.callback,Je=de.onCancel;function rt(Ye){We(Ye)}return b.a.createElement(m.a,Object(Ee.a)({},V,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),b.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},b.a.createElement(R.a,null)),b.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},b.a.createElement(R.a,null)),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(B.a,{type:"ghost",onClick:Je},"\u53D6\u6D88")))},_e=w("7ahc"),Fe=w("k1fw"),Le=w("HmJG"),Re=w("BjJ7"),Ae=m.a.useForm,Se={width:280,marginRight:10},ue={labelCol:{span:5},wrapperCol:{span:19}},q=function(de){var We=de.callback,Je=de.onCancel,rt=Ae(),Ye=Object(G.a)(rt,1),kt=Ye[0],Tt=Object(x.useRef)();function lt(Mt){We(Object(Fe.a)(Object(Fe.a)({},Mt),{},{name:Tt.current}))}function Ht(Mt,Pt){kt.setFieldsValue({src:"/api/attachments/".concat(Mt.id,"?type=").concat(Mt.content_type),type:Pt.type})}function Ft(Mt){var Pt=Mt.target.files[0];Tt.current=Pt.name,K(Pt,Ht)}return b.a.createElement(m.a,Object(Ee.a)({form:kt},ue,{className:"upload-image-panel",onFinish:lt}),b.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},b.a.createElement("div",{className:"flex-container"},b.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},b.a.createElement(R.a,{style:Se})),b.a.createElement(L,{onFileChange:Ft}))),b.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},b.a.createElement(R.a,{style:{width:264}})),b.a.createElement(m.a.Item,{style:{textAlign:"right"}},b.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(B.a,{type:"ghost",onClick:Je},"\u53D6\u6D88")))};function L(de){var We=de.onFileChange;return b.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",b.a.createElement("input",{type:"file",onChange:We}))}function K(de,We){if(!de)throw new String("\u6CA1\u6709\u6587\u4EF6");var Je=new FormData;Je.append("editormd-image-file",de),Je.append("file_param_name","editormd-image-file"),Je.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(Ye){We(JSON.parse(Ye.target.responseText),de)},!1),rt.addEventListener("error",function(Ye){console.error(Ye)},!1),rt.open("POST","".concat(Re.a,"/api/attachments.json")),rt.send(Je)}var j=w("giR+"),ke=w("fyUT"),P=w("7Kak"),_=w("9yH6"),re=_.a.Group,Ce={margin:"0 8px"},Pe=function(de){var We=de.callback,Je=de.onCancel;function rt(Ye){We(Ye)}return b.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},b.a.createElement("div",{className:"flex-container"},b.a.createElement("span",{style:Ce},"\u5355\u5143\u683C\u6570\uFF1A"),b.a.createElement("span",{style:Ce},"\u884C\u6570"),b.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},b.a.createElement(ke.a,null)),b.a.createElement("span",{style:Ce},"\u5217\u6570"),b.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},b.a.createElement(ke.a,null))),b.a.createElement("div",{className:"flex-container",style:{marginTop:12}},b.a.createElement("span",{style:Ce},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),b.a.createElement(m.a.Item,{name:"align"},b.a.createElement(re,null,b.a.createElement(_.a,{value:"default"},b.a.createElement("i",{className:"fa fa-align-justify"})),b.a.createElement(_.a,{value:"left"},b.a.createElement("i",{className:"fa fa-align-left"})),b.a.createElement(_.a,{value:"center"},b.a.createElement("i",{className:"fa fa-align-center"})),b.a.createElement(_.a,{value:"right"},b.a.createElement("i",{className:"fa fa-align-right"}))))),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(B.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(B.a,{type:"ghost",onClick:Je},"\u53D6\u6D88")))},Oe=w("ErOA"),He=w("7Cbv"),Ge="link",ut="upload-image",Ze="code-block",it="add-table",Qe="------------",yt={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},ct=w("9VGf"),dt,Me;function et(){}var ht=0,je=1e4,Xe="\u2581",se=`
|
|
**\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 te(de){return/^\d+$/.test(de)?"".concat(de,"px"):de}var oe=navigator.platform.toUpperCase().indexOf("MAC")>=0,S=oe?"Cmd":"Ctrl",M=["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"],X=(dt={},Object(Q.a)(dt,S+"-B","bold"),Object(Q.a)(dt,S+"-I","italic"),dt),Y=(Me={},Object(Q.a)(Me,Ge,"\u6DFB\u52A0\u94FE\u63A5"),Object(Q.a)(Me,Ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Q.a)(Me,ut,"\u6DFB\u52A0\u6587\u4EF6"),Object(Q.a)(Me,it,"\u6DFB\u52A0\u8868\u683C"),Me),Te=pe.a=function(de){var We=de.defaultValue,Je=We===void 0?"":We,rt=de.onChange,Ye=de.width,kt=Ye===void 0?"100%":Ye,Tt=de.height,lt=Tt===void 0?400:Tt,Ht=de.miniToolbar,Ft=Ht===void 0?!1:Ht,Mt=de.isFocus,Pt=Mt===void 0?!1:Mt,Rt=de.watch,wn=de.insertTemp,Qn=de.mode,bt=Qn===void 0?"markdown":Qn,wt=de.id,ot=wt===void 0?"markdown-editor-id":wt,xt=de.showResizeBar,Zt=xt===void 0?!1:xt,rn=de.noStorage,nn=rn===void 0?!1:rn,Ot=de.showNullButton,mt=Ot===void 0?!1:Ot,Dn=de.hidetoolBar,ni=Dn===void 0?!1:Dn,Tn=de.fullScreen,Dt=Tn===void 0?!1:Tn,Mn=de.onBlur,Vn=de.onCMBeforeChange,ii=de.onFullScreen,Be=de.className,at=Be===void 0?"":Be,Nt=de.disablePaste,Xt=Nt===void 0?!1:Nt,$t=de.placeholder,qt=$t===void 0?"":$t,h=de.values,o=h===void 0?"":h,a=Object(x.useState)(null),u=Object(G.a)(a,2),f=u[0],c=u[1],ee=Object(x.useState)(Je),Ue=Object(G.a)(ee,2),qe=Ue[0],ft=Ue[1],ze=Object(x.useState)(Rt),At=Object(G.a)(ze,2),jt=At[0],en=At[1],Xn=Object(x.useState)(Dt),Kn=Object(G.a)(Xn,2),mn=Kn[0],qn=Kn[1],zi=Object(x.useState)(""),_n=Object(G.a)(zi,2),Yn=_n[0],Hn=_n[1],bi=Object(x.useState)(0),ri=Object(G.a)(bi,2),mi=ri[0],hi=ri[1],cr=Object(x.useState)(lt),Gi=Object(G.a)(cr,2),oi=Gi[0],$n=Gi[1],Ri=Object(x.useState)(!1),Oi=Object(G.a)(Ri,2),dr=Oi[0],sn=Oi[1],zt=Object(x.useRef)(Object(He.a)()),En=Object(x.useRef)(!1),Wt=Object(x.useRef)(),cn=Object(x.useRef)(),Kt=Object(x.useRef)(),ci=Object(x.useRef)(),un=Object(x.useRef)(),Pn=function(){var vt=Object($.a)(O.a.mark(function Lt(){var Et,It;return O.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(Oe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:It=Jt.sent,It!=null&&(Et=It.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",f,cn),It.attachments.map(function(Ut){Ut.content_type.indexOf("image")>-1?f.replaceSelection(".concat(Ut.content_type,")")):Ut.content_type.indexOf("video")>-1?f.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ut.content_type.indexOf("pdf")>-1?f.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,'&disposition=inline" target="_blank">').concat(Ut.name,"</a>")):f.replaceSelection("[".concat(Ut.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}));case 4:case"end":return Jt.stop()}},Lt)}));return function(){return vt.apply(this,arguments)}}();Object(x.useEffect)(function(){ft(o),f==null||f.setValue(o)},[o]),Object(x.useEffect)(function(){ii==null||ii(mn)},[mn]),Object(x.useEffect)(function(){if(cn.current){var vt=E.a.fromTextArea(cn.current,{mode:bt,lineNumbers:!Ft,lineWrapping:!0,value:Je,autoCloseTags:!0,autoCloseBrackets:!0});Pt&&vt.focus();function Lt(Et,It){if(Xt){It.preventDefault();return}var Gt=It.clipboardData;if(Gt){var Jt=Gt.types.toString(),Ut=Gt.items;if(Jt==="Files"||Gt.types.indexOf("Files")>-1){if(It.preventDefault(),bt=="stex")return;try{var dn,Nn=Ut[1];((dn=Ut[0])===null||dn===void 0?void 0:dn.kind)==="file"&&(Nn=Ut[0]);var Bt=Nn.getAsFile(),Ci=Bt.name.split(".").pop();K(Bt,function(Vt){if(Vt.id){var vn,ei,ti;(Bt==null||((vn=Bt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Bt==null||((ei=Bt.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Bt==null||((ti=Bt.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Bt.type,'&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):M.includes(Ci)?vt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):vt.replaceSelection("[".concat(Bt.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){ve.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Lt),vt.on("dragleave",function(Et,It){Kt.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(Et,It){Kt.current.classList.add("mouse-hover-md")}),vt.on("drop",function(Et,It){Kt.current.classList.add("mouse-hover-md");var Gt;if(Gt=It.dataTransfer.files,Gt.length>0){It.preventDefault(),It.stopPropagation();for(var Jt=function(Nn){var Bt=Gt[Nn],Ci=Bt.name.split(".").pop();K(Bt,function(Vt){if(Vt.id){var vn,ei,ti;(Bt==null||((vn=Bt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Bt==null||((ei=Bt.type)===null||ei===void 0)?void 0:ei.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,'"></video>')):(Bt==null||((ti=Bt.type)===null||ti===void 0)?void 0:ti.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Bt.type,'&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):M.includes(Ci)?vt.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,'?type=office&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):vt.replaceSelection("[".concat(Bt.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},Ut=0;Ut<Gt.length;Ut++)Jt(Ut)}}),c(vt),function(){vt.off("paste",Lt)}}},[]);var Vi=Object(x.useCallback)(function(){if(Kt.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[oi,Kt,mn]);Object(x.useEffect)(function(){function vt(){var Et=new k.default(function(It){var Gt=Object(he.a)(It),Jt;try{for(Gt.s();!(Jt=Gt.n()).done;){var Ut=Jt.value;(Ut.target.offsetHeight>0||Ut.target.offsetWidth>0)&&(Vi(),f.setSize("100%","100%"),f.refresh())}}catch(dn){Gt.e(dn)}finally{Gt.f()}});return Et.observe(cn.current.parentElement),Et}if(f){var Lt=vt();return function(){Lt.unobserve(cn.current.parentElement)}}},[f,Vi]),Object(x.useEffect)(function(){if(f){for(var vt=[],Lt=function(){var Ut=It[Et];Gt=Object(G.a)(Ut,2);var dn=Gt[0],Nn=Gt[1],Bt=Object(Q.a)({},dn,function(){Xi(Nn)});vt.push(Bt),f.addKeyMap(Bt)},Et=0,It=Object.entries(X);Et<It.length;Et++){var Gt;Lt()}return Wt.current=setInterval(function(){En.current&&Pn()},4e3),function(){clearInterval(Wt.current);var Jt=Object(he.a)(vt),Ut;try{for(Jt.s();!(Ut=Jt.n()).done;){var dn=Ut.value;f.removeKeyMap(dn)}}catch(Nn){Jt.e(Nn)}finally{Jt.f()}}}},[f]),Object(x.useEffect)(function(){Dt!==mn&&qn(Dt)},[Dt]),Object(ct.a)(function(){if(!nn&&mi>0){var vt=new Date().getTime(),Lt=window.sessionStorage.getItem(ot);vt>=mi+je&&(!Lt||Lt!==qe)&&(window.sessionStorage.setItem(ot,qe),sn(!0))}},je),Object(x.useEffect)(function(){en(Rt)},[f,Rt]),Object(x.useEffect)(function(){f&&(Pt&&f.focus())},[f,Pt]),Object(x.useEffect)(function(){if(jt&&f){var vt=f.getScrollerElement();function Lt(Et){var It=Et.target;if(un.current){var Gt=It.scrollTop/It.scrollHeight;un.current.scrollTop=un.current.scrollHeight*Gt}}return vt.addEventListener("scroll",Lt),function(){vt.removeEventListener("scroll",Lt)}}},[f,jt]),Object(x.useEffect)(function(){if(f&&Vn){function vt(Lt,Et){Vn(Lt,Et)}return f.on("beforeChange",vt),function(){f.off("beforeChange",vt)}}},[f,Vn]),Object(x.useEffect)(function(){if(f&&Mn){function vt(){Mn(f.getValue())}return f.on("blur",vt),function(){f.off("blur",vt)}}},[f,Mn]),Object(x.useEffect)(function(){if(f){function vt(Lt){var Et=Lt.getValue();ft(Et),hi(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(Et)}return f.on("change",vt),function(){f.off("change",vt)}}},[f,rt]),Object(x.useEffect)(function(){f&&(Je==null?(f.setValue(""),ft("")):Je!==f.getValue()&&(f.setValue(Je),ft(Je),f.setCursor(f.lineCount(),0)))},[f,Je]);var Xi=Object(x.useCallback)(function(vt){var Lt=f.getCursor(),Et=f.getSelection(),It=Et.split(`
|
|
`);switch(vt){case"bold":return f.replaceSelection("**"+Et+"**"),Et===""&&f.setCursor(Lt.line,Lt.ch+2),f.focus();case"italic":return f.replaceSelection("*"+Et+"*"),Et===""&&f.setCursor(Lt.line,Lt.ch+1),f.focus();case"code":return f.replaceSelection("`"+Et+"`"),Et===""&&f.setCursor(Lt.line,Lt.ch+1),f.focus();case"inline-latex":return f.replaceSelection("`$$"+Et+"$$`"),Et===""&&f.setCursor(Lt.line,Lt.ch+3),f.focus();case"latex":return f.replaceSelection("```latex\n"+Et+"\n```"),f.setCursor(Lt.line+1,Et.length+1),f.focus();case"line-break":return f.replaceSelection(`<br/>
|
|
`),f.focus();case"list-ul":return Et===""?f.replaceSelection("- "+Et):f.replaceSelection(It.map(function(Gt){return Gt===""?"":"- ".concat(Gt)}).join(`
|
|
`)),f.focus();case"list-ol":return Et===""?f.replaceSelection("1. "+Et):f.replaceSelection(It.map(function(Gt,Jt){return Gt===""?"":"".concat(Jt+1,". ").concat(Gt)}).join(`
|
|
`)),f.focus();case"add-null-ch":return Et===""&&f.setCursor(Lt.line,Lt.ch+1),f.replaceSelection(Xe),f.focus();case"inster-template-1":return Et===""&&f.setCursor(Lt.line,Lt.ch),f.replaceSelection(se),f.focus();case"eraser":return f.setValue(""),f.focus();case"trigger-watch":return en(!jt),f.focus();case"trigger-full-screen":return qn(!mn),f.focus();case Ge:Hn(Ge);return;case Ze:Hn(Ze);return;case ut:Hn(ut);return;case it:Hn(it);return;default:throw new Error}},[f,jt,mn]),xi=Object(x.useCallback)(function(vt){Hn("");switch(Yn){case Ge:var Lt=vt.title,Et=vt.link;return f.replaceSelection("[".concat(Lt,"](").concat(Et,")")),f.focus();case Ze:var It=vt.language,Gt=vt.content;return f.replaceSelection(["```"+It,Gt,"```"].join(`
|
|
`)),f.focus();case ut:var Jt=vt.src,Ut=vt.alt,dn=vt.name;return Jt.indexOf("type=image")>-1?f.replaceSelection(".concat(Jt,' "').concat(Ut||"",'" )')):Jt.indexOf("type=application/pdf")>-1?f.replaceSelection('<a href="'.concat(Jt,'&disposition=inline" target="_blank">').concat(dn,"</a>")):f.replaceSelection('<a href="'.concat(Jt,'" target="_blank">').concat(dn,"</a>")),f.focus();case it:for(var Nn=vt.row,Bt=vt.col,Ci=vt.align,Vt=`
|
|
`,vn=0;vn<Nn;vn++){for(var ei=[],ti=[],Hr=0;Hr<Bt;Hr++)vn===1&&ti.push(yt[Ci]),ei.push(" ");vn===1&&(Vt+="| ".concat(ti.join(" | "),` |
|
|
`)),Vt+="| ".concat(ei.join(Bt===1?"":" | "),` |
|
|
`)}return f.replaceSelection(Vt+`
|
|
`),f.focus();default:throw new Error}},[f,Yn]),Fr=Object(x.useMemo)(function(){switch(Yn){case Ge:return b.a.createElement(ae,{callback:xi,onCancel:Wn});case Ze:return b.a.createElement(_e.b,{callback:xi,onCancel:Wn});case ut:return b.a.createElement(q,{callback:xi,onCancel:Wn});case it:return b.a.createElement(Pe,{callback:xi,onCancel:Wn});default:return null}},[Yn]);function Wn(){Hn("")}Object(x.useEffect)(function(){if(ci.current){var vt=ci.current,Lt=!1,Et=0;function It(Ut){Lt=!0,Et=Ut.pageY}function Gt(){Lt=!1}function Jt(Ut){if(Lt){var dn=Ut.pageY-Et;dn<0&&(dn=0),dn>300&&(dn=300);var Nn=lt+dn+"px";$n(Nn)}}return vt.addEventListener("mousedown",It),document.addEventListener("mousemove",Jt),document.addEventListener("mouseup",Gt),function(){vt.removeEventListener("mousedown",It),document.removeEventListener("mousemove",Jt),document.removeEventListener("mouseup",Gt)}}},[f,ci]),Object(x.useEffect)(function(){$n(lt)},[lt]);var fr=te(kt),ai=te(oi),Ki={width:fr,height:ai},Ur=Object(x.useMemo)(function(){if(mi){var vt=new Date(mi),Lt=vt.getHours(),Et=vt.getMinutes(),It=vt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,Et=Et<10?"0"+Et:Et,It=It<10?"0"+It:It,"".concat(Lt,":").concat(Et,":").concat(It)}return 0},[mi]);function Di(){window.sessionStorage.removeItem(ot),sn(!1),hi(0)}function Jo(){sn(!1),hi(0),f.setValue(window.sessionStorage.getItem(ot))}function ho(vt,Lt){var Et=f.getValue();Et=Et.replace(vt,Lt),ft(Et),f==null||f.setValue(Et)}return b.a.createElement(x.Fragment,null,b.a.createElement("div",{className:"markdown-editor-wrapper",ref:Kt},b.a.createElement("div",{className:"markdown-editor-container ".concat(at," ").concat(jt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(mn?"full-screen":""),style:Ki},b.a.createElement(W,{insertTemp:wn,watch:jt,fullScreen:mn,showNullButton:mt,onActionCallback:Xi,hidetoolBar:ni,uuid:zt.current,setOpenPhones:function(){En.current=!0}}),b.a.createElement("div",{className:"markdown-editor-body"},b.a.createElement("div",{className:"codemirror-container"},b.a.createElement("textarea",{ref:cn,placeholder:qt})),jt?b.a.createElement("div",{ref:un,className:"preview-container"},bt==="stex"&&b.a.createElement(Ne,{value:qe}),bt!=="stex"&&b.a.createElement(ye.a,{edit:!0,value:qe,replaces:ho})):null))),Zt?b.a.createElement("a",{ref:ci,className:"editor-resize"}):null,b.a.createElement(ie.a,null,Y[Yn]?b.a.createElement(fe.a,{centered:!0,title:Y[Yn],visible:!0,onCancel:Wn,footer:null},Fr):null))}},QDVR:function(gt,pe,w){"use strict";w.d(pe,"e",function(){return fe}),w.d(pe,"d",function(){return he}),w.d(pe,"c",function(){return G}),w.d(pe,"b",function(){return Q}),w.d(pe,"a",function(){return O});var Z=function(){var x=function(b,T){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,k){E.__proto__=k}||function(E,k){for(var I in k)k.hasOwnProperty(I)&&(E[I]=k[I])},x(b,T)};return function(b,T){x(b,T);function E(){this.constructor=b}b.prototype=T===null?Object.create(T):(E.prototype=T.prototype,new E)}}();function fe(x){var b=[];return x.forEach(function(T){return b.push(T)}),b}function he(x){var b=[];return x.forEach(function(T,E){return b.push(E)}),b}var we=function(){function x(){this._value="",this._pos=0}return x.prototype.reset=function(b){return this._value=b,this._pos=0,this},x.prototype.next=function(){return this._pos+=1,this},x.prototype.hasNext=function(){return this._pos<this._value.length-1},x.prototype.cmp=function(b){var T=b.charCodeAt(0),E=this._value.charCodeAt(this._pos);return T-E},x.prototype.value=function(){return this._value[this._pos]},x}(),ve=function(){function x(b){b===void 0&&(b=!0),this._splitOnBackslash=b}return x.prototype.reset=function(b){return this._value=b.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},x.prototype.hasNext=function(){return this._to<this._value.length},x.prototype.next=function(){this._from=this._to;for(var b=!0;this._to<this._value.length;this._to++){var T=this._value.charCodeAt(this._to);if(T===47||this._splitOnBackslash&&T===92)if(b)this._from++;else break;else b=!1}return this},x.prototype.cmp=function(b){for(var T=0,E=b.length,k=this._from;T<E&&k<this._to;){var I=b.charCodeAt(T)-this._value.charCodeAt(k);if(I!==0)return I;T+=1,k+=1}return E===this._to-this._from?0:T<E?-1:1},x.prototype.value=function(){return this._value.substring(this._from,this._to)},x}(),$=function(){function x(){}return x}(),G=function(){function x(b){this._iter=b}return x.forPaths=function(){return new x(new ve)},x.forStrings=function(){return new x(new we)},x.prototype.clear=function(){this._root=void 0},x.prototype.set=function(b,T){var E=this._iter.reset(b),k;for(this._root||(this._root=new $,this._root.segment=E.value()),k=this._root;;){var I=E.cmp(k.segment);if(I>0)k.left||(k.left=new $,k.left.segment=E.value()),k=k.left;else if(I<0)k.right||(k.right=new $,k.right.segment=E.value()),k=k.right;else if(E.hasNext())E.next(),k.mid||(k.mid=new $,k.mid.segment=E.value()),k=k.mid;else break}var v=k.value;return k.value=T,k.key=b,v},x.prototype.get=function(b){for(var T=this._iter.reset(b),E=this._root;E;){var k=T.cmp(E.segment);if(k>0)E=E.left;else if(k<0)E=E.right;else if(T.hasNext())T.next(),E=E.mid;else break}return E?E.value:void 0},x.prototype.findSubstr=function(b){for(var T=this._iter.reset(b),E=this._root,k=void 0;E;){var I=T.cmp(E.segment);if(I>0)E=E.left;else if(I<0)E=E.right;else if(T.hasNext())T.next(),k=E.value||k,E=E.mid;else break}return E&&E.value||k},x.prototype.forEach=function(b){this._forEach(this._root,b)},x.prototype._forEach=function(b,T){b&&(this._forEach(b.left,T),b.value&&T(b.value,b.key),this._forEach(b.mid,T),this._forEach(b.right,T))},x}(),Q=function(){function x(){this.map=new Map,this.ignoreCase=!1}return x.prototype.set=function(b,T){this.map.set(this.toKey(b),T)},x.prototype.get=function(b){return this.map.get(this.toKey(b))},x.prototype.toKey=function(b){var T=b.toString();return this.ignoreCase&&(T=T.toLowerCase()),T},x}(),H=function(){function x(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return x.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(x.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),x.prototype.get=function(b,T){T===void 0&&(T=0);var E=this._map.get(b);return E?(T!==0&&this.touch(E,T),E.value):void 0},x.prototype.set=function(b,T,E){E===void 0&&(E=0);var k=this._map.get(b);if(k)k.value=T,E!==0&&this.touch(k,E);else{k={key:b,value:T,next:void 0,previous:void 0};switch(E){case 0:this.addItemLast(k);break;case 1:this.addItemFirst(k);break;case 2:this.addItemLast(k);break;default:this.addItemLast(k);break}this._map.set(b,k),this._size++}},x.prototype.delete=function(b){return!!this.remove(b)},x.prototype.remove=function(b){var T=this._map.get(b);return T?(this._map.delete(b),this.removeItem(T),this._size--,T.value):void 0},x.prototype.forEach=function(b,T){for(var E=this._head;E;)T?b.bind(T)(E.value,E.key,this):b(E.value,E.key,this),E=E.next},x.prototype.trimOld=function(b){if(b>=this.size)return;if(b===0){this.clear();return}for(var T=this._head,E=this.size;T&&E>b;)this._map.delete(T.key),T=T.next,E--;this._head=T,this._size=E,T&&(T.previous=void 0)},x.prototype.addItemFirst=function(b){if(!this._head&&!this._tail)this._tail=b;else if(this._head)b.next=this._head,this._head.previous=b;else throw new Error("Invalid list");this._head=b},x.prototype.addItemLast=function(b){if(!this._head&&!this._tail)this._head=b;else if(this._tail)b.previous=this._tail,this._tail.next=b;else throw new Error("Invalid list");this._tail=b},x.prototype.removeItem=function(b){if(b===this._head&&b===this._tail)this._head=void 0,this._tail=void 0;else if(b===this._head){if(!b.next)throw new Error("Invalid list");b.next.previous=void 0,this._head=b.next}else if(b===this._tail){if(!b.previous)throw new Error("Invalid list");b.previous.next=void 0,this._tail=b.previous}else{var T=b.next,E=b.previous;if(!T||!E)throw new Error("Invalid list");T.previous=E,E.next=T}b.next=void 0,b.previous=void 0},x.prototype.touch=function(b,T){if(!this._head||!this._tail)throw new Error("Invalid list");if(T!==1&&T!==2)return;if(T===1){if(b===this._head)return;var E=b.next,k=b.previous;b===this._tail?(k.next=void 0,this._tail=k):(E.previous=k,k.next=E),b.previous=void 0,b.next=this._head,this._head.previous=b,this._head=b}else if(T===2){if(b===this._tail)return;var E=b.next,k=b.previous;b===this._head?(E.previous=void 0,this._head=E):(E.previous=k,k.next=E),b.next=void 0,b.previous=this._tail,this._tail.next=b,this._tail=b}},x.prototype.toJSON=function(){var b=[];return this.forEach(function(T,E){b.push([E,T])}),b},x}(),O=function(x){Z(b,x);function b(T,E){E===void 0&&(E=1);var k=x.call(this)||this;return k._limit=T,k._ratio=Math.min(Math.max(0,E),1),k}return b.prototype.get=function(T){return x.prototype.get.call(this,T,2)},b.prototype.peek=function(T){return x.prototype.get.call(this,T,0)},b.prototype.set=function(T,E){x.prototype.set.call(this,T,E,2),this.checkTrim()},b.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},b}(H)},SJMd:function(gt,pe){/**
|
|
* @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 w,Z,fe,he=!1,we,ve;window.PR_SHOULD_USE_CONTINUATION=!0;var $,G;(function(){var Q=window,H=["break,continue,do,else,for,if,return,while"],O=[H,"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"],x=[O,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],b=[x,"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"],T=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],E=[x,"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"],k="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",I=[x,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],v="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",y=[H,"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"],A=[H,"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"],F=[H,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],me=[b,E,T,I,v,y,A,F],ce=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ye="str",Ne="kwd",Ee="com",De="typ",Ke="lit",le="pun",D="pln",be="tag",ne="dec",W="src",ie="atn",U="atv",B="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(_){for(var re=0,Ce=!1,Pe=!1,Oe=0,He=_.length;Oe<He;++Oe){var Ge=_[Oe];if(Ge.ignoreCase)Pe=!0;else if(/[a-z]/i.test(Ge.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ce=!0,Pe=!1;break}}var ut={b:8,t:9,n:10,v:11,f:12,r:13};function Ze(dt){var Me=dt.charCodeAt(0);if(Me!==92)return Me;var et=dt.charAt(1);return Me=ut[et],Me||("0"<=et&&et<="7"?parseInt(dt.substring(1),8):et==="u"||et==="x"?parseInt(dt.substring(2),16):dt.charCodeAt(1))}function it(dt){if(dt<32)return(dt<16?"\\x0":"\\x")+dt.toString(16);var Me=String.fromCharCode(dt);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function Qe(dt){var Me=dt.substring(1,dt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),et=[],ht=Me[0]==="^",je=["["];ht&&je.push("^");for(var Xe=ht?1:0,se=Me.length;Xe<se;++Xe){var te=Me[Xe];if(/\\[bdsw]/i.test(te))je.push(te);else{var oe=Ze(te),S;Xe+2<se&&Me[Xe+1]==="-"?(S=Ze(Me[Xe+2]),Xe+=2):S=oe,et.push([oe,S]),S<65||oe>122||(S<65||oe>90||et.push([Math.max(65,oe)|32,Math.min(S,90)|32]),S<97||oe>122||et.push([Math.max(97,oe)&~32,Math.min(S,122)&~32]))}}et.sort(function(Te,de){return Te[0]-de[0]||de[1]-Te[1]});for(var M=[],X=[],Xe=0;Xe<et.length;++Xe){var Y=et[Xe];Y[0]<=X[1]+1?X[1]=Math.max(X[1],Y[1]):M.push(X=Y)}for(var Xe=0;Xe<M.length;++Xe){var Y=M[Xe];je.push(it(Y[0])),Y[1]>Y[0]&&(Y[1]+1>Y[0]&&je.push("-"),je.push(it(Y[1])))}return je.push("]"),je.join("")}function yt(dt){for(var Me=dt.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")),et=Me.length,ht=[],je=0,Xe=0;je<et;++je){var se=Me[je];if(se==="(")++Xe;else if(se.charAt(0)==="\\"){var te=+se.substring(1);te&&(te<=Xe?ht[te]=-1:Me[je]=it(te))}}for(var je=1;je<ht.length;++je)ht[je]===-1&&(ht[je]=++re);for(var je=0,Xe=0;je<et;++je){var se=Me[je];if(se==="(")++Xe,ht[Xe]||(Me[je]="(?:");else if(se.charAt(0)==="\\"){var te=+se.substring(1);te&&te<=Xe&&(Me[je]="\\"+ht[te])}}for(var je=0;je<et;++je)Me[je]==="^"&&Me[je+1]!=="^"&&(Me[je]="");if(dt.ignoreCase&&Ce)for(var je=0;je<et;++je){var se=Me[je],oe=se.charAt(0);se.length>=2&&oe==="["?Me[je]=Qe(se):oe!=="\\"&&(Me[je]=se.replace(/[a-zA-Z]/g,function(X){var Y=X.charCodeAt(0);return"["+String.fromCharCode(Y&~32,Y|32)+"]"}))}return Me.join("")}for(var ct=[],Oe=0,He=_.length;Oe<He;++Oe){var Ge=_[Oe];if(Ge.global||Ge.multiline)throw new Error(""+Ge);ct.push("(?:"+yt(Ge)+")")}return new RegExp(ct.join("|"),Pe?"gi":"g")}function d(_,re){var Ce=/(?:^|\s)nocode(?:\s|$)/,Pe=[],Oe=0,He=[],Ge=0;function ut(Ze){var it=Ze.nodeType;if(it==1){if(Ce.test(Ze.className))return;for(var Qe=Ze.firstChild;Qe;Qe=Qe.nextSibling)ut(Qe);var yt=Ze.nodeName.toLowerCase();(yt==="br"||yt==="li")&&(Pe[Ge]=`
|
|
`,He[Ge<<1]=Oe++,He[Ge++<<1|1]=Ze)}else if(it==3||it==4){var ct=Ze.nodeValue;ct.length&&(re?ct=ct.replace(/\r\n?/g,`
|
|
`):ct=ct.replace(/[ \t\r\n]+/g," "),Pe[Ge]=ct,He[Ge<<1]=Oe,Oe+=ct.length,He[Ge++<<1|1]=Ze)}}return ut(_),{sourceCode:Pe.join("").replace(/\n$/,""),spans:He}}function R(_,re,Ce,Pe,Oe){if(!Ce)return;var He={sourceNode:_,pre:1,langExtension:null,numberLines:null,sourceCode:Ce,spans:null,basePos:re,decorations:null};Pe(He),Oe.push.apply(Oe,He.decorations)}var V=/\S/;function ae(_){for(var re=void 0,Ce=_.firstChild;Ce;Ce=Ce.nextSibling){var Pe=Ce.nodeType;re=Pe===1?re?_:Ce:Pe===3&&V.test(Ce.nodeValue)?_:re}return re===_?void 0:re}function _e(_,re){var Ce={},Pe;(function(){for(var Ge=_.concat(re),ut=[],Ze={},it=0,Qe=Ge.length;it<Qe;++it){var yt=Ge[it],ct=yt[3];if(ct)for(var dt=ct.length;--dt>=0;)Ce[ct.charAt(dt)]=yt;var Me=yt[1],et=""+Me;Ze.hasOwnProperty(et)||(ut.push(Me),Ze[et]=null)}ut.push(/[\0-\uffff]/),Pe=m(ut)})();var Oe=re.length,He=function(Ge){for(var ut=Ge.sourceCode,Ze=Ge.basePos,it=Ge.sourceNode,Qe=[Ze,D],yt=0,ct=ut.match(Pe)||[],dt={},Me=0,et=ct.length;Me<et;++Me){var ht=ct[Me],je=dt[ht],Xe=void 0,se;if(typeof je=="string")se=!1;else{var te=Ce[ht.charAt(0)];if(te)Xe=ht.match(te[1]),je=te[0];else{for(var oe=0;oe<Oe;++oe)if(te=re[oe],Xe=ht.match(te[1]),Xe){je=te[0];break}Xe||(je=D)}se=je.length>=5&&je.substring(0,5)==="lang-",se&&!(Xe&&typeof Xe[1]=="string")&&(se=!1,je=W),se||(dt[ht]=je)}var S=yt;if(yt+=ht.length,!se)Qe.push(Ze+S,je);else{var M=Xe[1],X=ht.indexOf(M),Y=X+M.length;Xe[2]&&(Y=ht.length-Xe[2].length,X=Y-M.length);var Te=je.substring(5);R(it,Ze+S,ht.substring(0,X),He,Qe),R(it,Ze+S+X,M,q(Te,M),Qe),R(it,Ze+S+Y,ht.substring(Y),He,Qe)}}Ge.decorations=Qe};return He}function Fe(_){var re=[],Ce=[];_.tripleQuotedStrings?re.push([ye,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_.multiLineStrings?re.push([ye,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):re.push([ye,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_.verbatimStrings&&Ce.push([ye,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Pe=_.hashComments;Pe&&(_.cStyleComments?(Pe>1?re.push([Ee,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):re.push([Ee,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ce.push([ye,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):re.push([Ee,/^#[^\r\n]*/,null,"#"])),_.cStyleComments&&(Ce.push([Ee,/^\/\/[^\r\n]*/,null]),Ce.push([Ee,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Oe=_.regexLiterals;if(Oe){var He=Oe>1?"":`
|
|
\r`,Ge=He?".":"[\\S\\s]",ut="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Ge+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Ge+")*(?:\\x5D|$))+/";Ce.push(["lang-regex",RegExp("^"+N+"("+ut+")")])}var Ze=_.types;Ze&&Ce.push([De,Ze]);var it=(""+_.keywords).replace(/^ | $/g,"");it.length&&Ce.push([Ne,new RegExp("^(?:"+it.replace(/[\s,]+/g,"|")+")\\b"),null]),re.push([D,/^\s+/,null,` \r
|
|
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return _.regexLiterals&&(Qe+="(?!s*/)"),Ce.push([Ke,/^@[a-z_$][a-z_$@0-9]*/i,null],[De,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[D,/^[a-z_$][a-z_$@0-9]*/i,null],[Ke,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[D,/^\\[\s\S]?/,null],[le,new RegExp(Qe),null]),_e(re,Ce)}var Le=Fe({keywords:me,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(_,re,Ce){for(var Pe=/(?:^|\s)nocode(?:\s|$)/,Oe=/\r\n?|\n/,He=_.ownerDocument,Ge=He.createElement("li");_.firstChild;)Ge.appendChild(_.firstChild);var ut=[Ge];function Ze(Me){var et=Me.nodeType;if(et==1&&!Pe.test(Me.className))if(Me.nodeName==="br")it(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var ht=Me.firstChild;ht;ht=ht.nextSibling)Ze(ht);else if((et==3||et==4)&&Ce){var je=Me.nodeValue,Xe=je.match(Oe);if(Xe){var se=je.substring(0,Xe.index);Me.nodeValue=se;var te=je.substring(Xe.index+Xe[0].length);if(te){var oe=Me.parentNode;oe.insertBefore(He.createTextNode(te),Me.nextSibling)}it(Me),se||Me.parentNode.removeChild(Me)}}}function it(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function et(Xe,se){var te=se?Xe.cloneNode(!1):Xe,oe=Xe.parentNode;if(oe){var S=et(oe,1),M=Xe.nextSibling;S.appendChild(te);for(var X=M;X;X=M)M=X.nextSibling,S.appendChild(X)}return te}for(var ht=et(Me.nextSibling,0),je;(je=ht.parentNode)&&je.nodeType===1;)ht=je;ut.push(ht)}for(var Qe=0;Qe<ut.length;++Qe)Ze(ut[Qe]);re===(re|0)&&ut[0].setAttribute("value",re);var yt=He.createElement("ol");yt.className="linenums";for(var ct=Math.max(0,re-1|0)||0,Qe=0,dt=ut.length;Qe<dt;++Qe)Ge=ut[Qe],Ge.className="L"+(Qe+ct)%10,Ge.firstChild||Ge.appendChild(He.createTextNode("\xA0")),yt.appendChild(Ge);_.appendChild(yt)}function Ae(_){var re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);re=re&&+re[1]<=8;var Ce=/\n/g,Pe=_.sourceCode,Oe=Pe.length,He=0,Ge=_.spans,ut=Ge.length,Ze=0,it=_.decorations,Qe=it.length,yt=0;it[Qe]=Oe;var ct,dt;for(dt=ct=0;dt<Qe;)it[dt]!==it[dt+2]?(it[ct++]=it[dt++],it[ct++]=it[dt++]):dt+=2;for(Qe=ct,dt=ct=0;dt<Qe;){for(var Me=it[dt],et=it[dt+1],ht=dt+2;ht+2<=Qe&&it[ht+1]===et;)ht+=2;it[ct++]=Me,it[ct++]=et,dt=ht}Qe=it.length=ct;var je=_.sourceNode,Xe="";je&&(Xe=je.style.display,je.style.display="none");try{for(var se=null;Ze<ut;){var te=Ge[Ze],oe=Ge[Ze+2]||Oe,S=it[yt+2]||Oe,ht=Math.min(oe,S),M=Ge[Ze+1],X;if(M.nodeType!==1&&(X=Pe.substring(He,ht))){re&&(X=X.replace(Ce,"\r")),M.nodeValue=X;var Y=M.ownerDocument,Te=Y.createElement("span");Te.className=it[yt+1];var de=M.parentNode;de.replaceChild(Te,M),Te.appendChild(M),He<oe&&(Ge[Ze+1]=M=Y.createTextNode(Pe.substring(ht,oe)),de.insertBefore(M,Te.nextSibling))}He=ht,He>=oe&&(Ze+=2),He>=S&&(yt+=2)}}finally{je&&(je.style.display=Xe)}}var Se={};function ue(_,re){for(var Ce=re.length;--Ce>=0;){var Pe=re[Ce];Se.hasOwnProperty(Pe)?Q.console&&console.warn("cannot override language handler %s",Pe):Se[Pe]=_}}function q(_,re){return _&&Se.hasOwnProperty(_)||(_=/^\s*</.test(re)?"default-markup":"default-code"),Se[_]}ue(Le,["default-code"]),ue(_e([],[[D,/^[^<?]+/],[ne,/^<!\w[^>]*(?:>|$)/],[Ee,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[le,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ue(_e([[D,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[be,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ie,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[le,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ue(_e([],[[U,/^[\s\S]+/]]),["uq.val"]),ue(Fe({keywords:b,hashComments:!0,cStyleComments:!0,types:ce}),["c","cc","cpp","cxx","cyc","m"]),ue(Fe({keywords:"null,true,false"}),["json"]),ue(Fe({keywords:E,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ce}),["cs"]),ue(Fe({keywords:T,cStyleComments:!0}),["java"]),ue(Fe({keywords:F,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ue(Fe({keywords:y,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ue(Fe({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ue(Fe({keywords:A,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ue(Fe({keywords:I,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ue(Fe({keywords:k,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ue(_e([],[[ye,/^[\s\S]+/]]),["regex"]);function L(_){var re=_.langExtension;try{var Ce=d(_.sourceNode,_.pre),Pe=Ce.sourceCode;_.sourceCode=Pe,_.spans=Ce.spans,_.basePos=0,q(re,Pe)(_),Ae(_)}catch(Oe){Q.console&&console.log(Oe&&Oe.stack||Oe)}}function K(_,re,Ce){var Pe=Ce||!1,Oe=re||null,He=document.createElement("div");He.innerHTML="<pre>"+_+"</pre>",He=He.firstChild,Pe&&Re(He,Pe,!0);var Ge={langExtension:Oe,numberLines:Pe,sourceNode:He,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return L(Ge),He.innerHTML}function j(_,re){var Ce=re||document.body,Pe=Ce.ownerDocument||document;function Oe(te){return Ce.getElementsByTagName(te)}for(var He=[Oe("pre"),Oe("code"),Oe("xmp")],Ge=[],ut=0;ut<He.length;++ut)for(var Ze=0,it=He[ut].length;Ze<it;++Ze)Ge.push(He[ut][Ze]);He=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var yt=0,ct=/\blang(?:uage)?-([\w.]+)(?!\S)/,dt=/\bprettyprint\b/,Me=/\bprettyprinted\b/,et=/pre|xmp/i,ht=/^code$/i,je=/^(?:pre|code|xmp)$/i,Xe={};function se(){for(var te=Q.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;yt<Ge.length&&Qe.now()<te;yt++){for(var oe=Ge[yt],S=Xe,M=oe;M=M.previousSibling;){var X=M.nodeType,Y=(X===7||X===8)&&M.nodeValue;if(Y?!/^\??prettify\b/.test(Y):X!==3||/\S/.test(M.nodeValue))break;if(Y){S={},Y.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Pt,Rt,wn){S[Rt]=wn});break}}var Te=oe.className;if((S!==Xe||dt.test(Te))&&!Me.test(Te)){for(var de=!1,We=oe.parentNode;We;We=We.parentNode){var Je=We.tagName;if(je.test(Je)&&We.className&&dt.test(We.className)){de=!0;break}}if(!de){oe.className+=" prettyprinted";var rt=S.lang;if(!rt){rt=Te.match(ct);var Ye;!rt&&(Ye=ae(oe))&&ht.test(Ye.tagName)&&(rt=Ye.className.match(ct)),rt&&(rt=rt[1])}var kt;if(et.test(oe.tagName))kt=1;else{var Tt=oe.currentStyle,lt=Pe.defaultView,Ht=Tt?Tt.whiteSpace:lt&<.getComputedStyle?lt.getComputedStyle(oe,null).getPropertyValue("white-space"):0;kt=Ht&&Ht.substring(0,3)==="pre"}var Ft=S.linenums;(Ft=Ft==="true"||+Ft)||(Ft=Te.match(/\blinenums\b(?::(\d+))?/),Ft=Ft?Ft[1]&&Ft[1].length?+Ft[1]:!0:!1),Ft&&Re(oe,Ft,kt);var Mt={langExtension:rt,sourceNode:oe,numberLines:Ft,pre:kt,sourceCode:null,basePos:null,spans:null,decorations:null};L(Mt)}}}yt<Ge.length?Q.setTimeout(se,250):typeof _=="function"&&_()}se()}var ke=Q.PR={createSimpleLexer:_e,registerLangHandler:ue,sourceDecorator:Fe,PR_ATTRIB_NAME:ie,PR_ATTRIB_VALUE:U,PR_COMMENT:Ee,PR_DECLARATION:ne,PR_KEYWORD:Ne,PR_LITERAL:Ke,PR_NOCODE:B,PR_PLAIN:D,PR_PUNCTUATION:le,PR_SOURCE:W,PR_STRING:ye,PR_TAG:be,PR_TYPE:De,prettyPrintOne:he?Q.prettyPrintOne=K:$=K,prettyPrint:G=he?Q.prettyPrint=j:G=j},P=Q.define;typeof P=="function"&&P.amd&&P("google-code-prettify",[],function(){return ke})})()},T8No:function(gt,pe,w){"use strict";w.d(pe,"a",function(){return we}),w.d(pe,"b",function(){return T}),w.d(pe,"d",function(){return E}),w.d(pe,"c",function(){return k}),w.d(pe,"e",function(){return I});var Z=w("N0LK"),fe=w("Cg/j"),he=function(){var v=function(y,A){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,me){F.__proto__=me}||function(F,me){for(var ce in me)me.hasOwnProperty(ce)&&(F[ce]=me[ce])},v(y,A)};return function(y,A){v(y,A);function F(){this.constructor=y}y.prototype=A===null?Object.create(A):(F.prototype=A.prototype,new F)}}(),we=function(){function v(){}return v.has=function(y){return $.create(y)},v.equals=function(y,A){return G.create(y,A)},v.regex=function(y,A){return O.create(y,A)},v.not=function(y){return H.create(y)},v.and=function(){for(var y=[],A=0;A<arguments.length;A++)y[A]=arguments[A];return b.create(y)},v.or=function(){for(var y=[],A=0;A<arguments.length;A++)y[A]=arguments[A];return T.create(y)},v.deserialize=function(y,A){return A===void 0&&(A=!1),y?this._deserializeOrExpression(y,A):void 0},v._deserializeOrExpression=function(y,A){var F=this,me=y.split("||");return T.create(me.map(function(ce){return F._deserializeAndExpression(ce,A)}))},v._deserializeAndExpression=function(y,A){var F=this,me=y.split("&&");return b.create(me.map(function(ce){return F._deserializeOne(ce,A)}))},v._deserializeOne=function(y,A){if(y=y.trim(),y.indexOf("!=")>=0){var F=y.split("!=");return Q.create(F[0].trim(),this._deserializeValue(F[1],A))}if(y.indexOf("==")>=0){var F=y.split("==");return G.create(F[0].trim(),this._deserializeValue(F[1],A))}if(y.indexOf("=~")>=0){var F=y.split("=~");return O.create(F[0].trim(),this._deserializeRegexValue(F[1],A))}return/^\!\s*/.test(y)?H.create(y.substr(1).trim()):$.create(y)},v._deserializeValue=function(y,A){if(y=y.trim(),y==="true")return!0;if(y==="false")return!1;var F=/^'([^']*)'$/.exec(y);return F?F[1].trim():y},v._deserializeRegexValue=function(y,A){if(Object(Z.x)(y)){if(A)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var F=y.indexOf("/"),me=y.lastIndexOf("/");if(F===me||F<0){if(A)throw new Error("bad regexp-value '"+y+"', missing /-enclosure");return console.warn("bad regexp-value '"+y+"', missing /-enclosure"),null}var ce=y.slice(F+1,me),ye=y[me+1]==="i"?"i":"";try{return new RegExp(ce,ye)}catch(Ne){if(A)throw new Error("bad regexp-value '"+y+"', parse error: "+Ne);return console.warn("bad regexp-value '"+y+"', parse error: "+Ne),null}},v}();function ve(v,y){var A=v.getType(),F=y.getType();if(A!==F)return A-F;switch(A){case 1:return v.cmp(y);case 2:return v.cmp(y);case 3:return v.cmp(y);case 4:return v.cmp(y);case 6:return v.cmp(y);case 7:return v.cmp(y);case 5:return v.cmp(y);default:throw new Error("Unknown ContextKeyExpr!")}}var $=function(){function v(y){this.key=y}return v.create=function(y){return new v(y)},v.prototype.getType=function(){return 1},v.prototype.cmp=function(y){return this.key<y.key?-1:this.key>y.key?1:0},v.prototype.equals=function(y){return y instanceof v?this.key===y.key:!1},v.prototype.evaluate=function(y){return!!y.getValue(this.key)},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return H.create(this.key)},v}(),G=function(){function v(y,A){this.key=y,this.value=A}return v.create=function(y,A){return typeof A=="boolean"?A?$.create(y):H.create(y):new v(y,A)},v.prototype.getType=function(){return 3},v.prototype.cmp=function(y){return this.key<y.key?-1:this.key>y.key?1:this.value<y.value?-1:this.value>y.value?1:0},v.prototype.equals=function(y){return y instanceof v?this.key===y.key&&this.value===y.value:!1},v.prototype.evaluate=function(y){return y.getValue(this.key)==this.value},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return Q.create(this.key,this.value)},v}(),Q=function(){function v(y,A){this.key=y,this.value=A}return v.create=function(y,A){return typeof A=="boolean"?A?H.create(y):$.create(y):new v(y,A)},v.prototype.getType=function(){return 4},v.prototype.cmp=function(y){return this.key<y.key?-1:this.key>y.key?1:this.value<y.value?-1:this.value>y.value?1:0},v.prototype.equals=function(y){return y instanceof v?this.key===y.key&&this.value===y.value:!1},v.prototype.evaluate=function(y){return y.getValue(this.key)!=this.value},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return G.create(this.key,this.value)},v}(),H=function(){function v(y){this.key=y}return v.create=function(y){return new v(y)},v.prototype.getType=function(){return 2},v.prototype.cmp=function(y){return this.key<y.key?-1:this.key>y.key?1:0},v.prototype.equals=function(y){return y instanceof v?this.key===y.key:!1},v.prototype.evaluate=function(y){return!y.getValue(this.key)},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return $.create(this.key)},v}(),O=function(){function v(y,A){this.key=y,this.regexp=A}return v.create=function(y,A){return new v(y,A)},v.prototype.getType=function(){return 6},v.prototype.cmp=function(y){if(this.key<y.key)return-1;if(this.key>y.key)return 1;var A=this.regexp?this.regexp.source:"",F=y.regexp?y.regexp.source:"";return A<F?-1:A>F?1:0},v.prototype.equals=function(y){if(y instanceof v){var A=this.regexp?this.regexp.source:"",F=y.regexp?y.regexp.source:"";return this.key===y.key&&A===F}return!1},v.prototype.evaluate=function(y){var A=y.getValue(this.key);return this.regexp?this.regexp.test(A):!1},v.prototype.keys=function(){return[this.key]},v.prototype.negate=function(){return x.create(this)},v}(),x=function(){function v(y){this._actual=y}return v.create=function(y){return new v(y)},v.prototype.getType=function(){return 7},v.prototype.cmp=function(y){return this._actual.cmp(y._actual)},v.prototype.equals=function(y){return y instanceof v?this._actual.equals(y._actual):!1},v.prototype.evaluate=function(y){return!this._actual.evaluate(y)},v.prototype.keys=function(){return this._actual.keys()},v.prototype.negate=function(){return this._actual},v}(),b=function(){function v(y){this.expr=y}return v.create=function(y){var A=v._normalizeArr(y);return A.length===0?void 0:A.length===1?A[0]:new v(A)},v.prototype.getType=function(){return 5},v.prototype.cmp=function(y){if(this.expr.length<y.expr.length)return-1;if(this.expr.length>y.expr.length)return 1;for(var A=0,F=this.expr.length;A<F;A++){var me=ve(this.expr[A],y.expr[A]);if(me!==0)return me}return 0},v.prototype.equals=function(y){if(y instanceof v){if(this.expr.length!==y.expr.length)return!1;for(var A=0,F=this.expr.length;A<F;A++)if(!this.expr[A].equals(y.expr[A]))return!1;return!0}return!1},v.prototype.evaluate=function(y){for(var A=0,F=this.expr.length;A<F;A++)if(!this.expr[A].evaluate(y))return!1;return!0},v._normalizeArr=function(y){var A=[];if(y){for(var F=0,me=y.length;F<me;F++){var ce=y[F];if(!ce)continue;if(ce instanceof v){A=A.concat(ce.expr);continue}if(ce instanceof T)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');A.push(ce)}A.sort(ve)}return A},v.prototype.keys=function(){for(var y=[],A=0,F=this.expr;A<F.length;A++){var me=F[A];y.push.apply(y,me.keys())}return y},v.prototype.negate=function(){for(var y=[],A=0,F=this.expr;A<F.length;A++){var me=F[A];y.push(me.negate())}return T.create(y)},v}(),T=function(){function v(y){this.expr=y}return v.create=function(y){var A=v._normalizeArr(y);return A.length===0?void 0:A.length===1?A[0]:new v(A)},v.prototype.getType=function(){return 8},v.prototype.equals=function(y){if(y instanceof v){if(this.expr.length!==y.expr.length)return!1;for(var A=0,F=this.expr.length;A<F;A++)if(!this.expr[A].equals(y.expr[A]))return!1;return!0}return!1},v.prototype.evaluate=function(y){for(var A=0,F=this.expr.length;A<F;A++)if(this.expr[A].evaluate(y))return!0;return!1},v._normalizeArr=function(y){var A=[];if(y){for(var F=0,me=y.length;F<me;F++){var ce=y[F];if(!ce)continue;if(ce instanceof v){A=A.concat(ce.expr);continue}A.push(ce)}A.sort(ve)}return A},v.prototype.keys=function(){for(var y=[],A=0,F=this.expr;A<F.length;A++){var me=F[A];y.push.apply(y,me.keys())}return y},v.prototype.negate=function(){for(var y=[],A=0,F=this.expr;A<F.length;A++){var me=F[A];y.push(me.negate())}for(var ce=function(W){return W instanceof v?W.expr:[W]};y.length>1;){for(var ye=y.shift(),Ne=y.shift(),Ee=[],De=0,Ke=ce(ye);De<Ke.length;De++)for(var le=Ke[De],D=0,be=ce(Ne);D<be.length;D++){var ne=be[D];Ee.push(we.and(le,ne))}y.unshift(we.or.apply(we,Ee))}return y[0]},v}(),E=function(v){he(y,v);function y(A,F){var me=v.call(this,A)||this;return me._defaultValue=F,me}return y.prototype.bindTo=function(A){return A.createKey(this.key,this._defaultValue)},y.prototype.getValue=function(A){return A.getContextKeyValue(this.key)},y.prototype.toNegated=function(){return we.not(this.key)},y}($),k=Object(fe.c)("contextKeyService"),I="setContext"},"VrN/":function(gt,pe,w){(function(Z,fe){gt.exports=fe()})(this,function(){"use strict";var Z=navigator.userAgent,fe=navigator.platform,he=/gecko\/\d/i.test(Z),we=/MSIE \d/.test(Z),ve=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),$=/Edge\/(\d+)/.exec(Z),G=we||ve||$,Q=G&&(we?document.documentMode||6:+($||ve)[1]),H=!$&&/WebKit\//.test(Z),O=H&&/Qt\/\d+\.\d+/.test(Z),x=!$&&/Chrome\//.test(Z),b=/Opera\//.test(Z),T=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),k=/PhantomJS/.test(Z),I=!$&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),v=/Android/.test(Z),y=I||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),A=I||/Mac/.test(fe),F=/\bCrOS\b/.test(Z),me=/win/i.test(fe),ce=b&&Z.match(/Version\/(\d*\.\d*)/);ce&&(ce=Number(ce[1])),ce&&ce>=15&&(b=!1,H=!0);var ye=A&&(O||b&&(ce==null||ce<12.11)),Ne=he||G&&Q>=9;function Ee(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var De=function(e,t){var i=e.className,n=Ee(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function Ke(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function le(e,t){return Ke(e).appendChild(t)}function D(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function be(e,t,i,n){var r=D(e,t,i,n);return r.setAttribute("role","presentation"),r}var ne;document.createRange?ne=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ne=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function W(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ie(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var i=e.className;Ee(t).test(i)||(e.className+=(i?" ":"")+t)}function B(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!Ee(i[n]).test(t)&&(t+=" "+i[n]);return t}var N=function(e){e.select()};I?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(N=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function R(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var p=e.indexOf(" ",s);if(p<0||p>=t)return l+(t-s);l+=p-s,l+=i-l%i,s=p+1}}var V=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function ae(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var _e=50,Fe={toString:function(){return"CodeMirror.Pass"}},Le={scroll:!1},Re={origin:"*mouse"},Ae={origin:"+move"};function Se(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var ue=[""];function q(e){for(;ue.length<=e;)ue.push(L(ue)+" ");return ue[e]}function L(e){return e[e.length-1]}function K(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function j(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ke(){}function P(e,t){var i;return Object.create?i=Object.create(e):(ke.prototype=e,i=new ke),t&&d(t,i),i}var _=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||_.test(e))}function Ce(e,t){return t?t.source.indexOf("\\w")>-1&&re(e)?!0:t.test(e):re(e)}function Pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function He(e){return e.charCodeAt(0)>=768&&Oe.test(e)}function Ge(e,t,i){for(;(i<0?t>0:t<e.length)&&He(e.charAt(t));)t+=i;return t}function ut(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function Ze(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var it=null;function Qe(e,t,i){var n;it=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:it=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:it=r)}return n!=null?n:it}var yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(C){return C<=247?e.charAt(C):1424<=C&&C<=1524?"R":1536<=C&&C<=1785?t.charAt(C-1536):1774<=C&&C<=2220?"r":8192<=C&&C<=8203?"w":C==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,p=/[1n]/;function g(C,z,J){this.level=C,this.from=z,this.to=J}return function(C,z){var J=z=="ltr"?"L":"R";if(C.length==0||z=="ltr"&&!n.test(C))return!1;for(var xe=C.length,ge=[],Ie=0;Ie<xe;++Ie)ge.push(i(C.charCodeAt(Ie)));for(var Ve=0,$e=J;Ve<xe;++Ve){var tt=ge[Ve];tt=="m"?ge[Ve]=$e:$e=tt}for(var st=0,nt=J;st<xe;++st){var pt=ge[st];pt=="1"&&nt=="r"?ge[st]="n":s.test(pt)&&(nt=pt,pt=="r"&&(ge[st]="R"))}for(var St=1,Ct=ge[0];St<xe-1;++St){var _t=ge[St];_t=="+"&&Ct=="1"&&ge[St+1]=="1"?ge[St]="1":_t==","&&Ct==ge[St+1]&&(Ct=="1"||Ct=="n")&&(ge[St]=Ct),Ct=_t}for(var tn=0;tn<xe;++tn){var xn=ge[tn];if(xn==",")ge[tn]="N";else if(xn=="%"){var an=void 0;for(an=tn+1;an<xe&&ge[an]=="%";++an);for(var Gn=tn&&ge[tn-1]=="!"||an<xe&&ge[an]=="1"?"1":"N",Bn=tn;Bn<an;++Bn)ge[Bn]=Gn;tn=an-1}}for(var fn=0,Fn=J;fn<xe;++fn){var kn=ge[fn];Fn=="L"&&kn=="1"?ge[fn]="L":s.test(kn)&&(Fn=kn)}for(var gn=0;gn<xe;++gn)if(r.test(ge[gn])){var pn=void 0;for(pn=gn+1;pn<xe&&r.test(ge[pn]);++pn);for(var ln=(gn?ge[gn-1]:J)=="L",Un=(pn<xe?ge[pn]:J)=="L",ur=ln==Un?ln?"L":"R":J,Mi=gn;Mi<pn;++Mi)ge[Mi]=ur;gn=pn-1}for(var Ln=[],pi,Cn=0;Cn<xe;)if(l.test(ge[Cn])){var Yo=Cn;for(++Cn;Cn<xe&&l.test(ge[Cn]);++Cn);Ln.push(new g(0,Yo,Cn))}else{var yi=Cn,Hi=Ln.length,Wi=z=="rtl"?1:0;for(++Cn;Cn<xe&&ge[Cn]!="L";++Cn);for(var On=yi;On<Cn;)if(p.test(ge[On])){yi<On&&(Ln.splice(Hi,0,new g(1,yi,On)),Hi+=Wi);var hr=On;for(++On;On<Cn&&p.test(ge[On]);++On);Ln.splice(Hi,0,new g(2,hr,On)),Hi+=Wi,yi=On}else++On;yi<Cn&&Ln.splice(Hi,0,new g(1,yi,Cn))}return z=="ltr"&&(Ln[0].level==1&&(pi=C.match(/^\s+/))&&(Ln[0].from=pi[0].length,Ln.unshift(new g(0,0,pi[0].length))),L(Ln).level==1&&(pi=C.match(/\s+$/))&&(L(Ln).to-=pi[0].length,Ln.push(new g(0,xe-pi[0].length,xe)))),z=="rtl"?Ln.reverse():Ln}}();function ct(e,t){var i=e.order;return i==null&&(i=e.order=yt(e.text,t)),i}var dt=[],Me=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||dt).concat(i)}};function et(e,t){return e._handlers&&e._handlers[t]||dt}function ht(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=ae(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function je(e,t){var i=et(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function Xe(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,i||t.type,e,t),X(t)||t.codemirrorIgnore}function se(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)ae(i,t[n])==-1&&i.push(t[n])}function te(e,t){return et(e,t).length>0}function oe(e){e.prototype.on=function(t,i){Me(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function S(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function M(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function X(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Y(e){S(e),M(e)}function Te(e){return e.target||e.srcElement}function de(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),A&&e.ctrlKey&&t==1&&(t=3),t}var We=function(){if(G&&Q<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}(),Je;function rt(e){if(Je==null){var t=D("span","\u200B");le(e,D("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Je=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&Q<8))}var i=Je?D("span","\u200B"):D("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ye;function kt(e){if(Ye!=null)return Ye;var t=le(e,document.createTextNode("A\u062EA")),i=ne(t,0,1).getBoundingClientRect(),n=ne(t,1,2).getBoundingClientRect();return Ke(e),!i||i.left==i.right?!1:Ye=n.right-i.right<3}var Tt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
|
|
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},lt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ht=function(){var e=D("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ft=null;function Mt(e){if(Ft!=null)return Ft;var t=le(e,D("span","x")),i=t.getBoundingClientRect(),n=ne(t,0,1).getBoundingClientRect();return Ft=Math.abs(i.left-n.left)>1}var Pt={},Rt={};function wn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function Qn(e,t){Rt[e]=t}function bt(e){if(typeof e=="string"&&Rt.hasOwnProperty(e))e=Rt[e];else if(e&&typeof e.name=="string"&&Rt.hasOwnProperty(e.name)){var t=Rt[e.name];typeof t=="string"&&(t={name:t}),e=P(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wt(e,t){t=bt(t);var i=Pt[t.name];if(!i)return wt(e,"text/plain");var n=i(e,t);if(ot.hasOwnProperty(t.name)){var r=ot[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var ot={};function xt(e,t){var i=ot.hasOwnProperty(e)?ot[e]:ot[e]={};d(t,i)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function rn(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function nn(e,t,i){return e.startState?e.startState(t,i):!0}var Ot=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Ot.prototype.eol=function(){return this.pos>=this.string.length},Ot.prototype.sol=function(){return this.pos==this.lineStart},Ot.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ot.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ot.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Ot.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ot.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ot.prototype.skipToEnd=function(){this.pos=this.string.length},Ot.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ot.prototype.backUp=function(e){this.pos-=e},Ot.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},Ot.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Ot.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ot.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ot.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ot.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function mt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Dn(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function ni(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function Tn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Dt(e){if(e.parent==null)return null;for(var t=e.parent,i=ae(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Mn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var p=e.lines[l],g=p.height;if(t<g)break;t-=g}return i+l}function Vn(e,t){return t>=e.first&&t<e.first+e.size}function ii(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Be(e,t,i){if(i===void 0&&(i=null),!(this instanceof Be))return new Be(e,t,i);this.line=e,this.ch=t,this.sticky=i}function at(e,t){return e.line-t.line||e.ch-t.ch}function Nt(e,t){return e.sticky==t.sticky&&at(e,t)==0}function Xt(e){return Be(e.line,e.ch)}function $t(e,t){return at(e,t)<0?t:e}function qt(e,t){return at(e,t)<0?e:t}function h(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return Be(e.first,0);var i=e.first+e.size-1;return t.line>i?Be(i,mt(e,i).text.length):a(t,mt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Be(e.line,t):i<0?Be(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var f=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof f?new c(e,Zt(e.mode,t.state),i,t.lookAhead):new c(e,Zt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new f(t,this.maxLookAhead):t};function ee(e,t,i,n){var r=[e.state.modeGen],s={};Kn(e,t.text,e.doc.mode,i,function(C,z){return r.push(C,z)},s,n);for(var l=i.state,p=function(C){i.baseTokens=r;var z=e.state.overlays[C],J=1,xe=0;i.state=!0,Kn(e,t.text,z.mode,i,function(ge,Ie){for(var Ve=J;xe<ge;){var $e=r[J];$e>ge&&r.splice(J,1,ge,r[J+1],$e),J+=2,xe=Math.min(ge,$e)}if(!Ie)return;if(z.opaque)r.splice(Ve,J-Ve,ge,"overlay "+Ie),J=Ve+2;else for(;Ve<J;Ve+=2){var tt=r[Ve+1];r[Ve+1]=(tt?tt+" ":"")+"overlay "+Ie}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)p(g);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ue(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=qe(e,Dt(t)),r=t.text.length>e.options.maxHighlightLength&&Zt(e.doc.mode,n.state),s=ee(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function qe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=mn(e,t,i),l=s>n.first&&mt(n,s-1).stateAfter,p=l?c.fromSaved(n,l,s):new c(n,nn(n.mode),s);return n.iter(s,t,function(g){ft(e,g.text,p);var C=p.line;g.stateAfter=C==t-1||C%5==0||C>=r.viewFrom&&C<r.viewTo?p.save():null,p.nextLine()}),i&&(n.modeFrontier=p.line),p}function ft(e,t,i,n){var r=e.doc.mode,s=new Ot(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&ze(r,i.state);!s.eol();)At(r,s,i.state),s.start=s.pos}function ze(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=rn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function At(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=rn(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function en(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var p=mt(r,t.line),g=qe(e,t.line,i),C=new Ot(p.text,e.options.tabSize,g),z;for(n&&(z=[]);(n||C.pos<t.ch)&&!C.eol();)C.start=C.pos,l=At(s,C,g.state),n&&z.push(new jt(C,l,Zt(r.mode,g.state)));return n?z:new jt(C,l,g.state)}function Xn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Kn(e,t,i,n,r,s,l){var p=i.flattenSpans;p==null&&(p=e.options.flattenSpans);var g=0,C=null,z=new Ot(t,e.options.tabSize,n),J,xe=e.options.addModeClass&&[null];for(t==""&&Xn(ze(i,n.state),s);!z.eol();){if(z.pos>e.options.maxHighlightLength?(p=!1,l&&ft(e,t,n,z.pos),z.pos=t.length,J=null):J=Xn(At(i,z,n.state,xe),s),xe){var ge=xe[0].name;ge&&(J="m-"+(J?ge+" "+J:ge))}if(!p||C!=J){for(;g<z.start;)g=Math.min(z.start,g+5e3),r(g,C);C=J}z.start=z.pos}for(;g<z.pos;){var Ie=Math.min(z.pos,g+5e3);r(Ie,C),g=Ie}}function mn(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),p=t;p>l;--p){if(p<=s.first)return s.first;var g=mt(s,p-1),C=g.stateAfter;if(C&&(!i||p+(C instanceof f?C.lookAhead:0)<=s.modeFrontier))return p;var z=R(g.text,null,e.options.tabSize);(r==null||n>z)&&(r=p-1,n=z)}return r}function qn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=mt(e,n).stateAfter;if(r&&(!(r instanceof f)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var zi=!1,_n=!1;function Yn(){zi=!0}function Hn(){_n=!0}function bi(e,t,i){this.marker=e,this.from=t,this.to=i}function ri(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function mi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function hi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,p=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(p||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new bi(l,s.from,g?null:s.to))}}return n}function Gi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,p=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(p||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new bi(l,g?null:s.from-t,s.to==null?null:s.to-t))}}return n}function oi(e,t){if(t.full)return null;var i=Vn(e,t.from.line)&&mt(e,t.from.line).markedSpans,n=Vn(e,t.to.line)&&mt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=at(t.from,t.to)==0,p=cr(i,r,l),g=Gi(n,s,l),C=t.text.length==1,z=L(t.text).length+(C?r:0);if(p)for(var J=0;J<p.length;++J){var xe=p[J];if(xe.to==null){var ge=ri(g,xe.marker);ge?C&&(xe.to=ge.to==null?null:ge.to+z):xe.to=r}}if(g)for(var Ie=0;Ie<g.length;++Ie){var Ve=g[Ie];if(Ve.to!=null&&(Ve.to+=z),Ve.from==null){var $e=ri(p,Ve.marker);$e||(Ve.from=z,C&&(p||(p=[])).push(Ve))}else Ve.from+=z,C&&(p||(p=[])).push(Ve)}p&&(p=$n(p)),g&&g!=p&&(g=$n(g));var tt=[p];if(!C){var st=t.text.length-2,nt;if(st>0&&p)for(var pt=0;pt<p.length;++pt)p[pt].to==null&&(nt||(nt=[])).push(new bi(p[pt].marker,null,null));for(var St=0;St<st;++St)tt.push(nt);tt.push(g)}return tt}function $n(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ri(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ge){if(ge.markedSpans)for(var Ie=0;Ie<ge.markedSpans.length;++Ie){var Ve=ge.markedSpans[Ie].marker;Ve.readOnly&&(!n||ae(n,Ve)==-1)&&(n||(n=[])).push(Ve)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],p=l.find(0),g=0;g<r.length;++g){var C=r[g];if(at(C.to,p.from)<0||at(C.from,p.to)>0)continue;var z=[g,1],J=at(C.from,p.from),xe=at(C.to,p.to);(J<0||!l.inclusiveLeft&&!J)&&z.push({from:C.from,to:p.from}),(xe>0||!l.inclusiveRight&&!xe)&&z.push({from:p.to,to:C.to}),r.splice.apply(r,z),g+=z.length-3}return r}function Oi(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function dr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function sn(e){return e.inclusiveLeft?-1:0}function zt(e){return e.inclusiveRight?1:0}function En(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=at(n.from,r.from)||sn(e)-sn(t);if(s)return-s;var l=at(n.to,r.to)||zt(e)-zt(t);return l||t.id-e.id}function Wt(e,t){var i=_n&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||En(n,r.marker)<0)&&(n=r.marker);return n}function cn(e){return Wt(e,!0)}function Kt(e){return Wt(e,!1)}function ci(e,t){var i=_n&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||En(n,s.marker)<0)&&(n=s.marker)}return n}function un(e,t,i,n,r){var s=mt(e,t),l=_n&&s.markedSpans;if(l)for(var p=0;p<l.length;++p){var g=l[p];if(!g.marker.collapsed)continue;var C=g.marker.find(0),z=at(C.from,i)||sn(g.marker)-sn(r),J=at(C.to,n)||zt(g.marker)-zt(r);if(z>=0&&J<=0||z<=0&&J>=0)continue;if(z<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?at(C.to,i)>=0:at(C.to,i)>0)||z>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?at(C.from,n)<=0:at(C.from,n)<0))return!0}}function Pn(e){for(var t;t=cn(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function Xi(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function xi(e,t){var i=mt(e,t),n=Pn(i);return i==n?t:Dt(n)}function Fr(e,t){if(t>e.lastLine())return t;var i=mt(e,t),n;if(!Wn(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Dt(i)+1}function Wn(e,t){var i=_n&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&fr(e,t,n))return!0}}function fr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fr(e,n.line,ri(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&fr(e,t,r))return!0}function ai(e){e=Pn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var p=s.children[l];if(p==i)break;t+=p.height}return t}function Ki(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=cn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Kt(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function Ur(e){var t=e.display,i=e.doc;t.maxLine=mt(i,i.first),t.maxLineLength=Ki(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Ki(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Di=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Di.prototype.lineNo=function(){return Dt(this)},oe(Di);function Jo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Oi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&Tn(e,r)}function ho(e){e.parent=null,Oi(e)}var vt={},Lt={};function Et(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Lt:vt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function It(e,t){var i=be("span",null,null,H?"padding-right: .1px":null),n={pre:be("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=Jt,kt(e.display.measure)&&(l=ct(s,e.doc.direction))&&(n.addToken=dn(n.addToken,l)),n.map=[];var p=t!=e.display.externalMeasured&&Dt(s);Bt(s,n,Ue(e,s,p)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=B(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=B(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(rt(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(H){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=B(n.pre.className,n.textClass||"")),n}function Gt(e){var t=D("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,i,n,r,s,l){if(!t)return;var p=e.splitSpaces?Ut(t,e.trailingSpace):t,g=e.cm.state.specialChars,C=!1,z;if(!g.test(t))e.col+=t.length,z=document.createTextNode(p),e.map.push(e.pos,e.pos+t.length,z),G&&Q<9&&(C=!0),e.pos+=t.length;else{z=document.createDocumentFragment();for(var J=0;;){g.lastIndex=J;var xe=g.exec(t),ge=xe?xe.index-J:t.length-J;if(ge){var Ie=document.createTextNode(p.slice(J,J+ge));G&&Q<9?z.appendChild(D("span",[Ie])):z.appendChild(Ie),e.map.push(e.pos,e.pos+ge,Ie),e.col+=ge,e.pos+=ge}if(!xe)break;J+=ge+1;var Ve=void 0;if(xe[0]==" "){var $e=e.cm.options.tabSize,tt=$e-e.col%$e;Ve=z.appendChild(D("span",q(tt),"cm-tab")),Ve.setAttribute("role","presentation"),Ve.setAttribute("cm-text"," "),e.col+=tt}else xe[0]=="\r"||xe[0]==`
|
|
`?(Ve=z.appendChild(D("span",xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ve.setAttribute("cm-text",xe[0]),e.col+=1):(Ve=e.cm.options.specialCharPlaceholder(xe[0]),Ve.setAttribute("cm-text",xe[0]),G&&Q<9?z.appendChild(D("span",[Ve])):z.appendChild(Ve),e.col+=1);e.map.push(e.pos,e.pos+1,Ve),e.pos++}}if(e.trailingSpace=p.charCodeAt(t.length-1)==32,i||n||r||C||s||l){var st=i||"";n&&(st+=n),r&&(st+=r);var nt=D("span",[z],st,s);if(l)for(var pt in l)l.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&nt.setAttribute(pt,l[pt]);return e.content.appendChild(nt)}e.content.appendChild(z)}function Ut(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function dn(e,t){return function(i,n,r,s,l,p,g){r=r?r+" cm-force-border":"cm-force-border";for(var C=i.pos,z=C+n.length;;){for(var J=void 0,xe=0;xe<t.length&&!(J=t[xe],J.to>C&&J.from<=C);xe++);if(J.to>=z)return e(i,n,r,s,l,p,g);e(i,n.slice(0,J.to-C),r,s,null,p,g),s=null,n=n.slice(J.to-C),C=J.to}}}function Nn(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Bt(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),Et(i[l+1],t.cm.options));return}for(var p=r.length,g=0,C=1,z="",J,xe,ge=0,Ie,Ve,$e,tt,st;;){if(ge==g){Ie=Ve=$e=xe="",st=null,tt=null,ge=Infinity;for(var nt=[],pt=void 0,St=0;St<n.length;++St){var Ct=n[St],_t=Ct.marker;if(_t.type=="bookmark"&&Ct.from==g&&_t.widgetNode)nt.push(_t);else if(Ct.from<=g&&(Ct.to==null||Ct.to>g||_t.collapsed&&Ct.to==g&&Ct.from==g)){if(Ct.to!=null&&Ct.to!=g&&ge>Ct.to&&(ge=Ct.to,Ve=""),_t.className&&(Ie+=" "+_t.className),_t.css&&(xe=(xe?xe+";":"")+_t.css),_t.startStyle&&Ct.from==g&&($e+=" "+_t.startStyle),_t.endStyle&&Ct.to==ge&&(pt||(pt=[])).push(_t.endStyle,Ct.to),_t.title&&((st||(st={})).title=_t.title),_t.attributes)for(var tn in _t.attributes)(st||(st={}))[tn]=_t.attributes[tn];_t.collapsed&&(!tt||En(tt.marker,_t)<0)&&(tt=Ct)}else Ct.from>g&&ge>Ct.from&&(ge=Ct.from)}if(pt)for(var xn=0;xn<pt.length;xn+=2)pt[xn+1]==ge&&(Ve+=" "+pt[xn]);if(!tt||tt.from==g)for(var an=0;an<nt.length;++an)Nn(t,0,nt[an]);if(tt&&(tt.from||0)==g){if(Nn(t,(tt.to==null?p+1:tt.to)-g,tt.marker,tt.from==null),tt.to==null)return;tt.to==g&&(tt=!1)}}if(g>=p)break;for(var Gn=Math.min(p,ge);;){if(z){var Bn=g+z.length;if(!tt){var fn=Bn>Gn?z.slice(0,Gn-g):z;t.addToken(t,fn,J?J+Ie:Ie,$e,g+fn.length==ge?Ve:"",xe,st)}if(Bn>=Gn){z=z.slice(Gn-g),g=Gn;break}g=Bn,$e=""}z=r.slice(s,s=i[C++]),J=Et(i[C++],t.cm.options)}}}function Ci(e,t,i){this.line=t,this.rest=Xi(t),this.size=this.rest?Dt(L(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Wn(e,t)}function Vt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Ci(e.doc,mt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var vn=null;function ei(e){vn?vn.ops.push(e):e.ownsGroup=vn={ops:[e],delayedCallbacks:[]}}function ti(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function Hr(e,t){var i=e.ownsGroup;if(!i)return;try{ti(i)}finally{vn=null,t(i)}}var pr=null;function Sn(e,t){var i=et(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;vn?r=vn.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Ds,0));for(var s=function(p){r.push(function(){return i[p].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Ds(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Zo(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?qo(e,t,i,n):s=="class"?co(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=D("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&Q<8&&(e.node.style.zIndex=2)),e.node}function _s(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=mr(t);t.background=n.insertBefore(D("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):It(e,t)}function Ps(e,t){var i=t.text.className,n=Qo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,co(e,t)):i&&(t.text.className=i)}function co(e,t){_s(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function qo(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=D("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),p=t.gutter=D("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(p),l.insertBefore(p,t.text),t.line.gutterClass&&(p.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=p.appendChild(D("div",ii(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var C=e.display.gutterSpecs[g].className,z=s.hasOwnProperty(C)&&s[C];z&&p.appendChild(D("div",[z],"CodeMirror-gutter-elt","left: "+n.gutterLeft[C]+"px; width: "+n.gutterWidth[C]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=Ee("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ea(e,t,i)}function Is(e,t,i,n){var r=Qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),co(e,t),qo(e,t,i,n),ea(e,t,n),t.node}function ea(e,t,i){if(ta(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)ta(e,t.rest[n],t,i,!1)}function ta(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,p=t.widgets;l<p.length;++l){var g=p[l],C=D("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||C.setAttribute("cm-ignore-events","true"),js(g,C,i,n),e.display.input.setUneditable(C),r&&g.above?s.insertBefore(C,i.gutter||i.text):s.appendChild(C),Sn(g,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!W(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),le(t.display.measure,D("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function gi(e,t){for(var i=Te(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function na(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=le(e.measure,D("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function di(e){return _e-e.display.nativeBarWidth}function _i(e){return e.display.scroller.clientWidth-di(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-di(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&_i(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),p=0;p<l.length-1;p++){var g=l[p],C=l[p+1];Math.abs(g.bottom-C.bottom)>2&&s.push((g.bottom+C.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ia(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(Dt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fs(e,t){t=Pn(t);var i=Dt(t),n=e.display.externalMeasured=new Ci(e.doc,t,i);n.lineN=i;var r=n.built=It(e,n);return n.text=r.pre,le(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return fi(e,Yi(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Yi(e,t){var i=Dt(t),n=mo(e,i);n&&!n.text?n=null:n&&n.changes&&(Zo(e,n,i,Co(e)),e.curOp.forceUpdate=!0),n||(n=Fs(e,t));var r=ia(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function fi(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Hs(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var oa={left:0,right:0,top:0,bottom:0};function aa(e,t,i){for(var n,r,s,l,p,g,C=0;C<e.length;C+=3)if(p=e[C],g=e[C+1],t<p?(r=0,s=1,l="left"):t<g?(r=t-p,s=r+1):(C==e.length-3||t==g&&e[C+3]>t)&&(s=g-p,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[C+2],p==g&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;C&&e[C-2]==e[C-3]&&e[C-1].insertLeft;)n=e[(C-=3)+2],l="left";if(i=="right"&&r==g-p)for(;C<e.length-3&&e[C+3]==e[C+4]&&!e[C+5].insertLeft;)n=e[(C+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:p,coverEnd:g}}function Us(e,t){var i=oa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=aa(t.map,i,n),s=r.node,l=r.start,p=r.end,g=r.collapse,C;if(s.nodeType==3){for(var z=0;z<4;z++){for(;l&&He(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+p<r.coverEnd&&He(t.line.text.charAt(r.coverStart+p));)++p;if(G&&Q<9&&l==0&&p==r.coverEnd-r.coverStart?C=s.parentNode.getBoundingClientRect():C=Us(ne(s,l,p).getClientRects(),n),C.left||C.right||l==0)break;p=l,l=l-1,g="right"}G&&Q<11&&(C=Ws(e.display.measure,C))}else{l>0&&(g=n="right");var J;e.options.lineWrapping&&(J=s.getClientRects()).length>1?C=J[n=="right"?J.length-1:0]:C=s.getBoundingClientRect()}if(G&&Q<9&&!l&&(!C||!C.left&&!C.right)){var xe=s.parentNode.getClientRects()[0];xe?C={left:xe.left,right:xe.left+Ji(e.display),top:xe.top,bottom:xe.bottom}:C=oa}for(var ge=C.top-t.rect.top,Ie=C.bottom-t.rect.top,Ve=(ge+Ie)/2,$e=t.view.measure.heights,tt=0;tt<$e.length-1&&!(Ve<$e[tt]);tt++);var st=tt?$e[tt-1]:0,nt=$e[tt],pt={left:(g=="right"?C.right:C.left)-t.rect.left,right:(g=="left"?C.left:C.right)-t.rect.left,top:st,bottom:nt};return!C.left&&!C.right&&(pt.bogus=!0),e.options.singleCursorHeightPerLine||(pt.rtop=ge,pt.rbottom=Ie),pt}function Ws(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Mt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function sa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function la(e){e.display.externalMeasure=null,Ke(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)sa(e.display.view[t])}function vr(e){la(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ua(){return x&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return x&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function go(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function zr(e,t,i,n,r){if(!r){var s=go(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=ai(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var p=e.display.lineSpace.getBoundingClientRect();l+=p.top+(n=="window"?0:ha());var g=p.left+(n=="window"?0:ua());i.left+=g,i.right+=g}return i.top+=l,i.bottom+=l,i}function ca(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ua(),r-=ha();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function vo(e,t,i,n,r){return n||(n=mt(e.doc,t.line)),zr(e,n,ra(e,n,t.ch,r),i)}function si(e,t,i,n,r,s){n=n||mt(e.doc,t.line),r||(r=Yi(e,n));function l(Ie,Ve){var $e=fi(e,r,Ie,Ve?"right":"left",s);return Ve?$e.left=$e.right:$e.right=$e.left,zr(e,n,$e,i)}var p=ct(n,e.doc.direction),g=t.ch,C=t.sticky;if(g>=n.text.length?(g=n.text.length,C="before"):g<=0&&(g=0,C="after"),!p)return l(C=="before"?g-1:g,C=="before");function z(Ie,Ve,$e){var tt=p[Ve],st=tt.level==1;return l($e?Ie-1:Ie,st!=$e)}var J=Qe(p,g,C),xe=it,ge=z(g,J,C=="before");return xe!=null&&(ge.other=z(g,xe,C!="before")),ge}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Ji(e.display)*t.ch);var n=mt(e.doc,t.line),r=ai(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=Be(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function bo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=Mn(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,mt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=mt(n,r);;){var p=zs(e,l,r,t,i),g=ci(l,p.ch+(p.xRel>0||p.outside>0?1:0));if(!g)return p;var C=g.find(1);if(C.line==r)return C;l=mt(n,r=C.line)}}function fa(e,t,i,n){n-=go(t);var r=t.text.length,s=ut(function(l){return fi(e,i,l-1).bottom<=n},r,0);return r=ut(function(l){return fi(e,i,l).top>n},s,r),{begin:s,end:r}}function pa(e,t,i,n){i||(i=Yi(e,t));var r=zr(e,t,fi(e,i,n),"line").top;return fa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=ai(t);var s=Yi(e,t),l=go(t),p=0,g=t.text.length,C=!0,z=ct(t,e.doc.direction);if(z){var J=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,z,n,r);C=J.level!=1,p=C?J.from:J.to-1,g=C?J.to:J.from-1}var xe=null,ge=null,Ie=ut(function(St){var Ct=fi(e,s,St);return Ct.top+=l,Ct.bottom+=l,xo(Ct,n,r,!1)?(Ct.top<=r&&Ct.left<=n&&(xe=St,ge=Ct),!0):!1},p,g),Ve,$e,tt=!1;if(ge){var st=n-ge.left<ge.right-n,nt=st==C;Ie=xe+(nt?0:1),$e=nt?"after":"before",Ve=st?ge.left:ge.right}else{!C&&(Ie==g||Ie==p)&&Ie++,$e=Ie==0?"after":Ie==t.text.length?"before":fi(e,s,Ie-(C?1:0)).bottom+l<=r==C?"after":"before";var pt=si(e,Be(i,Ie,$e),"line",t,s);Ve=pt.left,tt=r<pt.top?-1:r>=pt.bottom?1:0}return Ie=Ge(t.text,Ie,1),yo(i,Ie,$e,tt,n-Ve)}function Gs(e,t,i,n,r,s,l){var p=ut(function(J){var xe=r[J],ge=xe.level!=1;return xo(si(e,Be(i,ge?xe.to:xe.from,ge?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[p];if(p>0){var C=g.level!=1,z=si(e,Be(i,C?g.from:g.to,C?"after":"before"),"line",t,n);xo(z,s,l,!0)&&z.top>l&&(g=r[p-1])}return g}function Vs(e,t,i,n,r,s,l){var p=fa(e,t,n,l),g=p.begin,C=p.end;/\s/.test(t.text.charAt(C-1))&&C--;for(var z=null,J=null,xe=0;xe<r.length;xe++){var ge=r[xe];if(ge.from>=C||ge.to<=g)continue;var Ie=ge.level!=1,Ve=fi(e,n,Ie?Math.min(C,ge.to)-1:Math.max(g,ge.from)).right,$e=Ve<s?s-Ve+1e9:Ve-s;(!z||J>$e)&&(z=ge,J=$e)}return z||(z=r[r.length-1]),z.from<g&&(z={from:g,to:z.to,level:z.level}),z.to>C&&(z={from:z.from,to:C,level:z.level}),z}var Pi;function $i(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(D("br"));Pi.appendChild(document.createTextNode("x"))}le(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Ke(e.measure),i||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),i=D("pre",[t],"CodeMirror-line-like");le(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var p=e.display.gutterSpecs[l].className;i[p]=s.offsetLeft+s.clientLeft+r,n[p]=s.clientWidth}return{fixedPos:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=$i(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(r){if(Wn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function Eo(e){var t=e.doc,i=ma(e);t.iter(function(n){var r=i(n);r!=n.height&&Tn(n,r)})}function Ni(e,t,i,n){var r=e.display;if(!i&&Te(t).getAttribute("cm-not-content")=="true")return null;var s,l,p=r.lineSpace.getBoundingClientRect();try{s=t.clientX-p.left,l=t.clientY-p.top}catch(J){return null}var g=bo(e,s,l),C;if(n&&g.xRel>0&&(C=mt(e.doc,g.line).text).length==g.ch){var z=R(C,C.length,e.options.tabSize)-C.length;g=Be(g.line,Math.max(0,Math.round((s-na(e.display).left)/Ji(e.display))-z))}return g}function Ii(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function In(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)_n&&xi(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)_n&&Fr(e.doc,i+n)>r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(e);else if(t<=r.viewFrom){var s=Gr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ei(e)}else if(i>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var p=Gr(e,t,t,-1),g=Gr(e,i,i+n,1);p&&g?(r.view=r.view.slice(0,p.index).concat(Vt(e,p.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):Ei(e)}var C=r.externalMeasured;C&&(i<C.lineN?C.lineN+=n:t<C.lineN+C.size&&(r.externalMeasured=null))}function wi(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);ae(l,i)==-1&&l.push(i)}function Ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,i,n){var r=Ii(e,t),s,l=e.display.view;if(!_n||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var p=e.display.viewFrom,g=0;g<r;g++)p+=l[g].size;if(p!=t){if(n>0){if(r==l.length-1)return null;s=p+l[r].size-t,r++}else s=p-t;t+=s,i+=s}for(;xi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Vt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Vt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ii(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Vt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ga(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function va(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var p=i.sel.ranges[l];if(p.from().line>=e.display.viewTo||p.to().line<e.display.viewFrom)continue;var g=p.empty();(g||e.options.showCursorWhenSelecting)&&ya(e,p.head,r),g||Ks(e,p,s)}return n}function ya(e,t,i){var n=si(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(D("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(D("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=na(e.display),p=l.left,g=Math.max(n.sizerWidth,_i(e)-n.sizer.offsetLeft)-l.right,C=r.direction=="ltr";function z(nt,pt,St,Ct){pt<0&&(pt=0),pt=Math.round(pt),Ct=Math.round(Ct),s.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+nt+`px;
|
|
top: `+pt+"px; width: "+(St==null?g-nt:St)+`px;
|
|
height: `+(Ct-pt)+"px"))}function J(nt,pt,St){var Ct=mt(r,nt),_t=Ct.text.length,tn,xn;function an(fn,Fn){return vo(e,Be(nt,fn),"div",Ct,Fn)}function Gn(fn,Fn,kn){var gn=pa(e,Ct,null,fn),pn=Fn=="ltr"==(kn=="after")?"left":"right",ln=kn=="after"?gn.begin:gn.end-(/\s/.test(Ct.text.charAt(gn.end-1))?2:1);return an(ln,pn)[pn]}var Bn=ct(Ct,r.direction);return Ze(Bn,pt||0,St==null?_t:St,function(fn,Fn,kn,gn){var pn=kn=="ltr",ln=an(fn,pn?"left":"right"),Un=an(Fn-1,pn?"right":"left"),ur=pt==null&&fn==0,Mi=St==null&&Fn==_t,Ln=gn==0,pi=!Bn||gn==Bn.length-1;if(Un.top-ln.top<=3){var Cn=(C?ur:Mi)&&Ln,Yo=(C?Mi:ur)&&pi,yi=Cn?p:(pn?ln:Un).left,Hi=Yo?g:(pn?Un:ln).right;z(yi,ln.top,Hi-yi,ln.bottom)}else{var Wi,On,hr,$o;pn?(Wi=C&&ur&&Ln?p:ln.left,On=C?g:Gn(fn,kn,"before"),hr=C?p:Gn(Fn,kn,"after"),$o=C&&Mi&&pi?g:Un.right):(Wi=C?Gn(fn,kn,"before"):p,On=!C&&ur&&Ln?g:ln.right,hr=!C&&Mi&&pi?p:Un.left,$o=C?Gn(Fn,kn,"after"):g),z(Wi,ln.top,On-Wi,ln.bottom),ln.bottom<Un.top&&z(p,ln.bottom,null,Un.top),z(hr,Un.top,$o-hr,Un.bottom)}(!tn||Vr(ln,tn)<0)&&(tn=ln),Vr(Un,tn)<0&&(tn=Un),(!xn||Vr(ln,xn)<0)&&(xn=ln),Vr(Un,xn)<0&&(xn=Un)}),{start:tn,end:xn}}var xe=t.from(),ge=t.to();if(xe.line==ge.line)J(xe.line,xe.ch,ge.ch);else{var Ie=mt(r,xe.line),Ve=mt(r,ge.line),$e=Pn(Ie)==Pn(Ve),tt=J(xe.line,xe.ch,$e?Ie.text.length+1:null).end,st=J(ge.line,$e?0:null,ge.ch).start;$e&&(tt.top<st.top-2?(z(tt.right,tt.top,null,tt.bottom),z(p,st.top,st.left,st.bottom)):z(tt.right,tt.top,st.left-tt.right,tt.bottom)),tt.bottom<st.top&&z(p,tt.bottom,null,st.top)}i.appendChild(s)}function So(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),H&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,De(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Xr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,p=0;if(r.hidden)continue;if(G&&Q<8){var g=r.node.offsetTop+r.node.offsetHeight;l=g-i,i=g}else{var C=r.node.getBoundingClientRect();l=C.bottom-C.top,!s&&r.text.firstChild&&(p=r.text.firstChild.getBoundingClientRect().right-C.left-1)}var z=r.line.height-l;if((z>.005||z<-.005)&&(Tn(r.line,l),Ca(r.line),r.rest))for(var J=0;J<r.rest.length;J++)Ca(r.rest[J]);if(p>e.display.sizerWidth){var xe=Math.ceil(p/Ji(e.display));xe>e.display.maxLineLength&&(e.display.maxLineLength=xe,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Kr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Mn(t,n),l=Mn(t,r);if(i&&i.ensure){var p=i.ensure.from.line,g=i.ensure.to.line;p<s?(s=p,l=Mn(t,ai(mt(t,p))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=Mn(t,ai(mt(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Xe(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!k){var s=D("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+di(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Be(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Be(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,p=si(e,t),g=!i||i==t?p:si(e,i);r={left:Math.min(p.left,g.left),top:Math.min(p.top,g.top)-n,right:Math.max(p.left,g.left),bottom:Math.max(p.bottom,g.bottom)+n};var C=To(e,r),z=e.doc.scrollTop,J=e.doc.scrollLeft;if(C.scrollTop!=null&&(xr(e,C.scrollTop),Math.abs(e.doc.scrollTop-z)>1&&(l=!0)),C.scrollLeft!=null&&(ji(e,C.scrollLeft),Math.abs(e.doc.scrollLeft-J)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=To(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&ji(e,i.scrollLeft)}function To(e,t){var i=e.display,n=$i(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var p=e.doc.height+fo(i),g=t.top<n,C=t.bottom>p-n;if(t.top<r)l.scrollTop=g?0:t.top;else if(t.bottom>r+s){var z=Math.min(t.top,(C?p:t.bottom)-s);z!=r&&(l.scrollTop=z)}var J=e.options.fixedGutter?0:i.gutters.offsetWidth,xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-J,ge=_i(e)-i.gutters.offsetWidth,Ie=t.right-t.left>ge;return Ie&&(t.right=t.left+ge),t.left<10?l.scrollLeft=0:t.left<xe?l.scrollLeft=Math.max(0,t.left+J-(Ie?0:10)):t.right>ge+xe-3&&(l.scrollLeft=t.right+(Ie?0:10)-ge),l}function Ao(e,t){if(t==null)return;Yr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){Yr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Yr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Yr(e),e.curOp.scrollToPos=t}function Yr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=da(e,t.from),n=da(e,t.to);wa(e,i,n,t.margin)}}function wa(e,t,i,n){var r=To(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;he||Mo(e,{top:t}),Ea(e,t,!0),he&&Mo(e),Er(e,100)}function Ea(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ji(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,La(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+fo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+di(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Bi=function(e,t,i){this.cm=i;var n=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Me(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Me(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&Q<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bi.prototype.zeroWidthHack=function(){var e=A&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},Bi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Bi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function qi(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Xr(e),Sa(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Bi,null:wr};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&De(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ji(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Fi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},ei(e.curOp)}function Ui(e){var t=e.curOp;t&&Hr(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&Ur(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Lo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Xr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+di(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-_i(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ji(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==ie();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Oo(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&ba(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Aa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ji(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var p=0;p<s.length;++p)s[p].lines.length||je(s[p],"hide");if(l)for(var g=0;g<l.length;++g)l[g].lines.length&&je(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function zn(e,t){if(e.curOp)return t();Fi(e);try{return t()}finally{Ui(e)}}function yn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Fi(e);try{return t.apply(e,arguments)}finally{Ui(e)}}}function Rn(e){return function(){if(this.curOp)return e.apply(this,arguments);Fi(this);try{return e.apply(this,arguments)}finally{Ui(this)}}}function bn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Fi(t);try{return e.apply(this,arguments)}finally{Ui(t)}}}function Er(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=qe(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,p=s.text.length>e.options.maxHighlightLength?Zt(t.mode,n.state):null,g=ee(e,s,n,!0);p&&(n.state=p),s.styles=g.styles;var C=s.styleClasses,z=g.classes;z?s.styleClasses=z:C&&(s.styleClasses=null);for(var J=!l||l.length!=s.styles.length||C!=z&&(!C||!z||C.bgClass!=z.bgClass||C.textClass!=z.textClass),xe=0;!J&&xe<l.length;++xe)J=l[xe]!=s.styles[xe];J&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ft(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&zn(e,function(){for(var s=0;s<r.length;s++)wi(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Kr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=_i(e),this.force=i,this.dims=Co(e),this.events=[]};$r.prototype.signal=function(e,t){te(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=di(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=di(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=ie();if(!t||!W(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&W(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==ie())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&W(document.body,e.anchorNode)&&W(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Lo(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ei(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ga(e)==0)return!1;Ma(e)&&(Ei(e),t.dims=Co(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),_n&&(s=xi(e.doc,s),l=Fr(e.doc,l));var p=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=ai(mt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=ga(e);if(!p&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var C=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(C),Ke(i.cursorDiv),Ke(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Aa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==_i(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fo(e.display)-po(e),i.top)}),t.visible=Kr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Kr(e.display,e.doc,i));if(!Lo(e,t))break;Xr(e);var r=Cr(e);yr(e),qi(e,r),Oo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Mo(e,t){var i=new $r(e,t);if(Lo(e,i)){Xr(e),Aa(e,i);var n=Cr(e);yr(e),qi(e,n),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function p(Ie){var Ve=Ie.nextSibling;return H&&A&&e.display.currentWheelTarget==Ie?Ie.style.display="none":Ie.parentNode.removeChild(Ie),Ve}for(var g=n.view,C=n.viewFrom,z=0;z<g.length;z++){var J=g[z];if(!J.hidden)if(!J.node||J.node.parentNode!=s){var xe=Is(e,J,C,i);s.insertBefore(xe,l)}else{for(;l!=J.node;)l=p(l);var ge=r&&t!=null&&t<=C&&J.lineNumber;J.changes&&(ae(J.changes,"gutter")>-1&&(ge=!1),Zo(e,J,C,i)),ge&&(Ke(J.lineNumber),J.lineNumber.appendChild(document.createTextNode(ii(e.options,C)))),l=J.node.nextSibling}C+=J.size}for(;l;)l=p(l)}function Ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+di(e)+"px"}function La(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=wo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var p=i[l].alignable;if(p)for(var g=0;g<p.length;g++)p[g].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Ma(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=ii(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(D("div",[D("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Ro(e.display),!0}return!1}function Do(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ra(e){var t=e.gutters,i=e.gutterSpecs;Ke(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,p=t.appendChild(D("div",null,"CodeMirror-gutter "+s));l&&(p.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=p,p.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ro(e)}function Sr(e){Ra(e.display),In(e),La(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=D("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=D("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=be("div",null,"CodeMirror-code"),r.selectionDiv=D("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=D("div",null,"CodeMirror-cursors"),r.measure=D("div",null,"CodeMirror-measure"),r.lineMeasure=D("div",null,"CodeMirror-measure"),r.lineSpace=be("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=be("div",[r.lineSpace],"CodeMirror-lines");r.mover=D("div",[s],null,"position: relative"),r.sizer=D("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=D("div",null,null,"position: absolute; height: "+_e+"px; width: 1px;"),r.gutters=D("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=D("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=D("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),G&&Q<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!H&&!(he&&y)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Do(n.gutters,n.lineNumbers),Ra(r),i.init(r)}var Jr=0,Jn=null;G?Jn=-.53:he?Jn=15:x?Jn=-.7:T&&(Jn=-1/3);function Oa(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Oa(e);return t.x*=Jn,t.y*=Jn,t}function Da(e,t){var i=Oa(t),n=i.x,r=i.y,s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&p||r&&g))return;if(r&&A&&H){e:for(var C=t.target,z=s.view;C!=l;C=C.parentNode)for(var J=0;J<z.length;J++)if(z[J].node==C){e.display.currentWheelTarget=C;break e}}if(n&&!he&&!b&&Jn!=null){r&&g&&xr(e,Math.max(0,l.scrollTop+r*Jn)),ji(e,Math.max(0,l.scrollLeft+n*Jn)),(!r||r&&g)&&S(t),s.wheelStartX=null;return}if(r&&Jn!=null){var xe=r*Jn,ge=e.doc.scrollTop,Ie=ge+s.wrapper.clientHeight;xe<0?ge=Math.max(0,ge+xe-50):Ie=Math.min(e.doc.height,Ie+xe+50),Mo(e,{top:ge,bottom:Ie})}Jr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ve=l.scrollLeft-s.wheelStartX,$e=l.scrollTop-s.wheelStartY,tt=$e&&s.wheelDY&&$e/s.wheelDY||Ve&&s.wheelDX&&Ve/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!tt)return;Jn=(Jn*Jr+tt)/(Jr+1),++Jr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Zn=function(e,t){this.ranges=e,this.primIndex=t};Zn.prototype.primary=function(){return this.ranges[this.primIndex]},Zn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Nt(i.anchor,n.anchor)||!Nt(i.head,n.head))return!1}return!0},Zn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Yt(Xt(this.ranges[t].anchor),Xt(this.ranges[t].head));return new Zn(e,this.primIndex)},Zn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Zn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(at(t,n.from())>=0&&at(e,n.to())<=0)return i}return-1};var Yt=function(e,t){this.anchor=e,this.head=t};Yt.prototype.from=function(){return qt(this.anchor,this.head)},Yt.prototype.to=function(){return $t(this.anchor,this.head)},Yt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function li(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(xe,ge){return at(xe.from(),ge.from())}),i=ae(t,r);for(var s=1;s<t.length;s++){var l=t[s],p=t[s-1],g=at(p.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var C=qt(p.from(),l.from()),z=$t(p.to(),l.to()),J=p.empty()?l.from()==l.head:p.from()==p.head;s<=i&&--i,t.splice(--s,2,new Yt(J?z:C,J?C:z))}}return new Zn(t,i)}function Si(e,t){return new Zn([new Yt(e,t||e)],0)}function ki(e){return e.text?Be(e.from.line+e.text.length-1,L(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function _a(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return ki(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=ki(t).ch-t.to.ch),Be(i,n)}function _o(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Yt(_a(r.anchor,t),_a(r.head,t)))}return li(e.cm,i,e.sel.primIndex)}function Pa(e,t,i){return e.line==t.line?Be(i.line,e.ch-t.ch+i.ch):Be(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=Be(e.first,0),s=r,l=0;l<t.length;l++){var p=t[l],g=Pa(p.from,r,s),C=Pa(ki(p),r,s);if(r=p.to,s=C,i=="around"){var z=e.sel.ranges[l],J=at(z.head,z.anchor)<0;n[l]=new Yt(J?C:g,J?g:C)}else n[l]=new Yt(g,g)}return new Zn(n,e.sel.primIndex)}function Po(e){e.doc.mode=wt(e.options,e.doc.modeOption),kr(e)}function kr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Er(e,100),e.state.modeGen++,e.curOp&&In(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&L(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,i,n){function r(st){return i?i[st]:null}function s(st,nt,pt){Jo(st,nt,pt,n),Sn(st,"change",st,t)}function l(st,nt){for(var pt=[],St=st;St<nt;++St)pt.push(new Di(C[St],r(St),n));return pt}var p=t.from,g=t.to,C=t.text,z=mt(e,p.line),J=mt(e,g.line),xe=L(C),ge=r(C.length-1),Ie=g.line-p.line;if(t.full)e.insert(0,l(0,C.length)),e.remove(C.length,e.size-C.length);else if(Na(e,t)){var Ve=l(0,C.length-1);s(J,J.text,ge),Ie&&e.remove(p.line,Ie),Ve.length&&e.insert(p.line,Ve)}else if(z==J)if(C.length==1)s(z,z.text.slice(0,p.ch)+xe+z.text.slice(g.ch),ge);else{var $e=l(1,C.length-1);$e.push(new Di(xe+z.text.slice(g.ch),ge,n)),s(z,z.text.slice(0,p.ch)+C[0],r(0)),e.insert(p.line+1,$e)}else if(C.length==1)s(z,z.text.slice(0,p.ch)+C[0]+J.text.slice(g.ch),r(0)),e.remove(p.line+1,Ie);else{s(z,z.text.slice(0,p.ch)+C[0],r(0)),s(J,xe+J.text.slice(g.ch),ge);var tt=l(1,C.length-1);Ie>1&&e.remove(p.line+1,Ie-1),e.insert(p.line+1,tt)}Sn(e,"change",e,t)}function Ti(e,t,i){function n(r,s,l){if(r.linked)for(var p=0;p<r.linked.length;++p){var g=r.linked[p];if(g.doc==s)continue;var C=l&&g.sharedHist;if(i&&!C)continue;t(g.doc,C),n(g.doc,r,C)}}n(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Eo(e),Po(e),ja(e),e.options.lineWrapping||Ur(e),e.options.mode=t.modeOption,In(e)}function ja(e){(e.doc.direction=="rtl"?U:De)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){zn(e,function(){ja(e),In(e)})}function Zr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Io(e,t){var i={from:Xt(t.from),to:ki(t),text:Dn(e,t.from,t.to)};return Ua(e,i,t.from.line,t.to.line+1),Ti(e,function(n){return Ua(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=L(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(e.done),L(e.done);if(e.done.length&&!L(e.done).ranges)return L(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),L(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,p;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))p=L(l.changes),at(t.from,t.to)==0&&at(t.from,p.to)==0?p.to=ki(t):l.changes.push(Io(e,t));else{var g=L(r.done);for((!g||!g.ranges)&&Qr(e.sel,r.done),l={changes:[Io(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,p||je(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,L(r.done),t))?r.done[r.done.length-1]=t:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function Qr(e,t){var i=L(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ua(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Ha(e,t){var i=yl(e,t),n=oi(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var p=0;p<l.length;++p){for(var g=l[p],C=0;C<s.length;++C)if(s[C].marker==g.marker)continue e;s.push(g)}}else l&&(i[r]=l)}return i}function er(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Zn.prototype.deepCopy.call(s):s);continue}var l=s.changes,p=[];n.push({changes:p});for(var g=0;g<l.length;++g){var C=l[g],z=void 0;if(p.push({from:C.from,to:C.to,text:C.text}),t)for(var J in C)(z=J.match(/^spans_(\d+)$/))&&(ae(t,Number(z[1]))>-1&&(L(p)[J]=C[J],delete C[J]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=at(t,r)<0;s!=at(i,r)<0?(r=t,t=i):s!=at(t,i)<0&&(t=i)}return new Yt(r,t)}else return new Yt(i||t,t)}function qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),An(e,new Zn([jo(e.sel.primary(),t,i,r)],0),n)}function Wa(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=jo(e.sel.ranges[s],t[s],null,r);var l=li(e.cm,n,e.sel.primIndex);An(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,An(e,li(e.cm,r,e.sel.primIndex),n)}function za(e,t,i,n){An(e,Si(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Yt(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return je(e,"beforeSelectionChange",e,n),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?li(e.cm,n.ranges,n.ranges.length-1):t}function Ga(e,t,i){var n=e.history.done,r=L(n);r&&r.ranges?(n[n.length-1]=t,eo(e,t,i)):An(e,t,i)}function An(e,t,i){eo(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function eo(e,t,i){(te(e,"beforeSelectionChange")||e.cm&&te(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Ka(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qi(e.cm)}function Va(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,se(e.cm)),Sn(e,"cursorActivity",e)}function Xa(e){Va(e,Ka(e,e.sel,null,!1))}function Ka(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],p=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],g=to(e,l.anchor,p&&p.anchor,i,n),C=to(e,l.head,p&&p.head,i,n);(r||g!=l.anchor||C!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Yt(g,C))}return r?li(e.cm,r,t.primIndex):t}function tr(e,t,i,n,r){var s=mt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var p=s.markedSpans[l],g=p.marker,C="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,z="selectRight"in g?!g.selectRight:g.inclusiveRight;if((p.from==null||(C?p.from<=t.ch:p.from<t.ch))&&(p.to==null||(z?p.to>=t.ch:p.to>t.ch))){if(r&&(je(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var J=g.find(n<0?1:-1),xe=void 0;if((n<0?z:C)&&(J=Ya(e,J,-n,J&&J.line==t.line?s:null)),J&&J.line==t.line&&(xe=at(J,i))&&(n<0?xe<0:xe>0))return tr(e,J,t,n,r)}var ge=g.find(n<0?-1:1);return(n<0?C:z)&&(ge=Ya(e,ge,n,ge.line==t.line?s:null)),ge?tr(e,ge,t,n,r):null}}return t}function to(e,t,i,n,r){var s=n||1,l=tr(e,t,i,s,r)||!r&&tr(e,t,i,s,!0)||tr(e,t,i,-s,r)||!r&&tr(e,t,i,-s,!0);return l||(e.cantEdit=!0,Be(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Be(t.line-1)):null:i>0&&t.ch==(n||mt(e,t.line)).text.length?t.line<e.first+e.size-1?Be(t.line+1,0):null:new Be(t.line,t.ch+i)}function $a(e){e.setSelection(Be(e.firstLine(),0),Be(e.lastLine()),Le)}function Ja(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,p){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),p!==void 0&&(n.origin=p)}),je(e,"beforeChange",e,n),e.cm&&je(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function nr(e,t,i){if(e.cm){if(!e.cm.curOp)return yn(e.cm,nr)(e,t,i);if(e.cm.state.suppressEdits)return}if((te(e,"beforeChange")||e.cm&&te(e.cm,"beforeChange"))&&(t=Ja(e,t,!0),!t))return;var n=zi&&!i&&Ri(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Za(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Za(e,t)}function Za(e,t){if(t.text.length==1&&t.text[0]==""&&at(t.from,t.to)==0)return;var i=_o(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,oi(e,t));var n=[];Ti(e,function(r,s){!s&&ae(n,r.history)==-1&&(ts(r.history,t),n.push(r.history)),Tr(r,t,null,oi(r,t))})}function no(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,p=t=="undo"?r.done:r.undone,g=t=="undo"?r.undone:r.done,C=0;C<p.length&&!(s=p[C],i?s.ranges&&!s.equals(e.sel):!s.ranges);C++);if(C==p.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=p.pop(),s.ranges){if(Qr(s,g),i&&!s.equals(e.sel)){An(e,s,{clearRedo:!1});return}l=s}else if(n){p.push(s);return}else break;var z=[];Qr(l,g),g.push({changes:z,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var J=te(e,"beforeChange")||e.cm&&te(e.cm,"beforeChange"),xe=function(Ve){var $e=s.changes[Ve];if($e.origin=t,J&&!Ja(e,$e,!1))return p.length=0,{};z.push(Io(e,$e));var tt=Ve?_o(e,$e):L(p);Tr(e,$e,tt,Ha(e,$e)),!Ve&&e.cm&&e.cm.scrollIntoView({from:$e.from,to:ki($e)});var st=[];Ti(e,function(nt,pt){!pt&&ae(st,nt.history)==-1&&(ts(nt.history,$e),st.push(nt.history)),Tr(nt,$e,null,Ha(nt,$e))})},ge=s.changes.length-1;ge>=0;--ge){var Ie=xe(ge);if(Ie)return Ie.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Zn(K(e.sel.ranges,function(r){return new Yt(Be(r.anchor.line+t,r.anchor.ch),Be(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){In(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wi(e.cm,n,"gutter")}}function Tr(e,t,i,n){if(e.cm&&!e.cm.curOp)return yn(e.cm,Tr)(e,t,i,n);if(t.to.line<e.first){Qa(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);Qa(e,r),t={from:Be(e.first,0),to:Be(t.to.line+r,t.to.ch),text:[L(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Be(s,mt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Dn(e,t.from,t.to),i||(i=_o(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,Le),e.cantEdit&&to(e,Be(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,p=!1,g=s.line;e.options.lineWrapping||(g=Dt(Pn(mt(n,s.line))),n.iter(g,l.line+1,function(ge){if(ge==r.maxLine)return p=!0,!0})),n.sel.contains(t.from,t.to)>-1&&se(e),No(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(ge){var Ie=Ki(ge);Ie>r.maxLineLength&&(r.maxLine=ge,r.maxLineLength=Ie,r.maxLineChanged=!0,p=!1)}),p&&(e.curOp.updateMaxLine=!0)),qn(n,s.line),Er(e,400);var C=t.text.length-(l.line-s.line)-1;t.full?In(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?wi(e,s.line,"text"):In(e,s.line,l.line+1,C);var z=te(e,"changes"),J=te(e,"change");if(J||z){var xe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};J&&Sn(e,"change",e,xe),z&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(xe)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),at(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:r})}function qa(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var p=0;p<s.ranges.length;p++)qa(s.ranges[p].anchor,t,i,n),qa(s.ranges[p].head,t,i,n);continue}for(var g=0;g<s.changes.length;++g){var C=s.changes[g];if(i<C.from.line)C.from=Be(C.from.line+n,C.from.ch),C.to=Be(C.to.line+n,C.to.ch);else if(t<=C.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;es(e.done,i,n,r),es(e.undone,i,n,r)}function Ar(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=mt(e,h(e,t)):r=Dt(t),r==null?null:(n(s,r)&&e.cm&&wi(e.cm,r,i),s)}function Lr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Lr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,ho(r),Sn(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Mr(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Mr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Lr))){var p=[];this.collapse(p),this.children=[new Lr(p)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,p=l;p<r.lines.length;){var g=new Lr(r.lines.slice(p,p+=25));r.height-=g.height,this.children.splice(++n,0,g),g.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Mr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=ae(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Mr(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Rr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Rr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Dt(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);Tn(i,Math.max(0,i.height-s)),e&&(zn(e,function(){ns(e,i,-s),wi(e,n,"widget")}),Sn(e,"lineWidgetCleared",e,this,n))},Rr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Wn(this.doc,n)||Tn(n,n.height+r),i&&zn(i,function(){i.curOp.forceUpdate=!0,ns(i,n,r),Sn(i,"lineWidgetChanged",i,e,Dt(n))})},oe(Rr);function ns(e,t,i){ai(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ao(e,i)}function Cl(e,t,i,n){var r=new Rr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Ar(e,t,"widget",function(l){var p=l.widgets||(l.widgets=[]);if(r.insertAt==null?p.push(r):p.splice(Math.min(p.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Wn(e,l)){var g=ai(l)<e.scrollTop;Tn(l,l.height+gr(r)),g&&Ao(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Sn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Dt(t)),r}var is=0,Ai=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++is};Ai.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Fi(e),te(this,"clear")){var i=this.find();i&&Sn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],p=ri(l.markedSpans,this);e&&!this.collapsed?wi(e,Dt(l),"text"):e&&(p.to!=null&&(r=Dt(l)),p.from!=null&&(n=Dt(l))),l.markedSpans=mi(l.markedSpans,p),p.from==null&&this.collapsed&&!Wn(this.doc,l)&&e&&Tn(l,$i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var C=Pn(this.lines[g]),z=Ki(C);z>e.display.maxLineLength&&(e.display.maxLine=C,e.display.maxLineLength=z,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&In(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&Sn(e,"markerCleared",e,this,n,r),t&&Ui(e),this.parent&&this.parent.clear()},Ai.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=ri(s.markedSpans,this);if(l.from!=null&&(i=Be(t?s:Dt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Be(t?s:Dt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ai.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;zn(n,function(){var r=t.line,s=Dt(t.line),l=mo(n,s);if(l&&(sa(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Wn(i.doc,r)&&i.height!=null){var p=i.height;i.height=null;var g=gr(i)-p;g&&Tn(r,r.height+g)}Sn(n,"markerChanged",n,e)})},Ai.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ai.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},oe(Ai);function rr(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return yn(e.cm,rr)(e,t,i,n,r);var s=new Ai(e,r),l=at(t,i);if(n&&d(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=be("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(un(e,t.line,t,i,s)||t.line!=i.line&&un(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Hn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var p=t.line,g=e.cm,C;if(e.iter(p,i.line+1,function(J){g&&s.collapsed&&!g.options.lineWrapping&&Pn(J)==g.display.maxLine&&(C=!0),s.collapsed&&p!=t.line&&Tn(J,0),hi(J,new bi(s,p==t.line?t.ch:null,p==i.line?i.ch:null)),++p}),s.collapsed&&e.iter(t.line,i.line+1,function(J){Wn(e,J)&&Tn(J,0)}),s.clearOnEnter&&Me(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),g){if(C&&(g.curOp.updateMaxLine=!0),s.collapsed)In(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var z=t.line;z<=i.line;z++)wi(g,z,"text");s.atomic&&Xa(g.doc),Sn(g,"markerAdded",g,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Sn(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},oe(Or);function wl(e,t,i,n,r){n=d(n),n.shared=!1;var s=[rr(e,t,i,n,r)],l=s[0],p=n.widgetNode;return Ti(e,function(g){p&&(n.widgetNode=p.cloneNode(!0)),s.push(rr(g,o(g,t),o(g,i),n,r));for(var C=0;C<g.linked.length;++C)if(g.linked[C].isParent)return;l=L(s)}),new Or(s,l)}function rs(e){return e.findMarks(Be(e.first,0),e.clipPos(Be(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(at(s,l)){var p=rr(e,s,l,n.primary,n.primary.type);n.markers.push(p),p.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ti(r.primary.doc,function(g){return s.push(g)});for(var l=0;l<r.markers.length;l++){var p=r.markers[l];ae(s,p.doc)==-1&&(p.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,jn=function(e,t,i,n,r){if(!(this instanceof jn))return new jn(e,t,i,n,r);i==null&&(i=0),Mr.call(this,[new Lr([new Di("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Be(i,0);this.sel=Si(s),this.history=new Zr(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),No(this,{from:s,to:s,text:e}),An(this,Si(s),Le)};jn.prototype=P(Mr.prototype,{constructor:jn,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ni(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bn(function(e){var t=Be(this.first,0),i=this.first+this.size-1;nr(this,{from:t,to:Be(i,mt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),An(this,Si(t),Le)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ir(this,e,t,i,n)},getRange:function(e,t,i){var n=Dn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Vn(this,e))return mt(this,e)},getLineNumber:function(e){return Dt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=mt(this,e)),Pn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bn(function(e,t,i){za(this,o(this,typeof e=="number"?Be(e,t||0):e),null,i)}),setSelection:bn(function(e,t,i){za(this,o(this,e),o(this,t||e),i)}),extendSelection:bn(function(e,t,i){qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:bn(function(e,t){Wa(this,u(this,e),t)}),extendSelectionsBy:bn(function(e,t){var i=K(this.sel.ranges,e);Wa(this,u(this,i),t)}),setSelections:bn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Yt(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),An(this,li(this.cm,n,t),i)}),addSelection:bn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Yt(o(this,e),o(this,t||e))),An(this,li(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Dn(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Dn(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:bn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var p=t&&t!="end"&&dl(this,n,t),g=n.length-1;g>=0;g--)nr(this,n[g]);p?Ga(this,p):this.cm&&Qi(this.cm)}),undo:bn(function(){no(this,"undo")}),redo:bn(function(){no(this,"redo")}),undoSelection:bn(function(){no(this,"undo",!0)}),redoSelection:bn(function(){no(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Zr(this.history.maxGeneration),Ti(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Zr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:bn(function(e,t,i){return Ar(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Pe(r)&&(n.gutterMarkers=null),!0})}),clearGutter:bn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ar(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Pe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Vn(this,e))return null;if(t=e,e=mt(this,e),!e)return null}else if(t=Dt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:bn(function(e,t,i){return Ar(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(Ee(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:bn(function(e,t,i){return Ar(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(Ee(i));if(!l)return!1;var p=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||p==s.length?"":" ")+s.slice(p)||null}else return!1;return!0})}),addLineWidget:bn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return rr(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),rr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=mt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var p=0;p<l.length;p++){var g=l[p];!(g.to!=null&&r==e.line&&e.ch>=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,Be(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new jn(ni(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new jn(ni(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],El(n,rs(this)),n},unlinkDoc:function(e){if(e instanceof on&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(rs(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(r){return n.push(r.id)},!0),e.history=new Zr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Tt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:bn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),jn.prototype.eachLine=jn.prototype.iter;var os=0;function Tl(e){var t=this;if(as(t),Xe(t,e)||gi(t.display,e))return;S(e),G&&(os=+new Date);var i=Ni(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,p=function(){++l==r&&yn(t,function(){i=o(t.doc,i);var ge={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ie){return Ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,ge),Ga(t.doc,Si(o(t.doc,i),o(t.doc,ki(ge))))})()},g=function(ge,Ie){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,ge.type)==-1){p();return}var Ve=new FileReader;Ve.onerror=function(){return p()},Ve.onload=function(){var $e=Ve.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test($e)){p();return}s[Ie]=$e,p()},Ve.readAsText(ge)},C=0;C<n.length;C++)g(n[C],C);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var z=e.dataTransfer.getData("Text");if(z){var J;if(t.state.draggingText&&!t.state.draggingText.copy&&(J=t.listSelections()),eo(t.doc,Si(i,i)),J)for(var xe=0;xe<J.length;++xe)ir(t.doc,"",J[xe].anchor,J[xe].head,"drag");t.replaceSelection(z,"around","paste"),t.display.input.focus()}}catch(ge){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-os<100)){Y(t);return}if(Xe(e,t)||gi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!T){var i=D("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),b&&i.parentNode.removeChild(i)}}function Ll(e,t){var i=Ni(e,t);if(!i)return;var n=document.createDocumentFragment();ya(e,i,n),e.display.dragCursor||(e.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),le(e.display.dragCursor,n)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var ls=!1;function Ml(){if(ls)return;Rl(),ls=!0}function Rl(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ol)},100))}),Me(window,"blur",function(){return ss(Zi)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Li={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Dr=0;Dr<10;Dr++)Li[Dr+48]=Li[Dr+96]=String(Dr);for(var io=65;io<=90;io++)Li[io]=String.fromCharCode(io);for(var _r=1;_r<=12;_r++)Li[_r+111]=Li[_r+63235]="F"+_r;var vi={};vi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},vi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},vi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},vi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},vi.default=A?vi.macDefault:vi.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var p=t[l];if(/^(cmd|meta|m)$/i.test(p))s=!0;else if(/^a(lt)?$/i.test(p))i=!0;else if(/^(c|ctrl|control)$/i.test(p))n=!0;else if(/^s(hift)?$/i.test(p))r=!0;else throw new Error("Unrecognized modifier name: "+p)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function _l(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=K(i.split(" "),Dl),s=0;s<r.length;s++){var l=void 0,p=void 0;s==r.length-1?(p=r.join(" "),l=n):(p=r.slice(0,s+1).join(" "),l="...");var g=t[p];if(!g)t[p]=l;else if(g!=l)throw new Error("Inconsistent bindings for "+p)}delete e[i]}for(var C in t)e[C]=t[C];return e}function or(e,t,i,n){t=ro(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return or(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],i,n);if(l)return l}}}function us(e){var t=typeof e=="string"?e:Li[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ye?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ye?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(b&&e.keyCode==34&&e.char)return!1;var i=Li[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function ro(e){return typeof e=="string"?vi[e]:e}function ar(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&at(s.from,L(n).to)<=0;){var l=n.pop();if(at(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}zn(e,function(){for(var p=n.length-1;p>=0;p--)ir(e.doc,"",n[p].from,n[p].to,"+delete");Qi(e)})}function Fo(e,t,i){var n=Ge(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Uo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new Be(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ct(i,t.doc.direction);if(s){var l=r<0?L(s):s[0],p=r<0==(l.level==1),g=p?"after":"before",C;if(l.level>0||t.doc.direction=="rtl"){var z=Yi(t,i);C=r<0?i.text.length-1:0;var J=fi(t,z,C).top;C=ut(function(xe){return fi(t,z,xe).top==J},r<0==(l.level==1)?l.from:l.to-1,C),g=="before"&&(C=Fo(i,C,1))}else C=r<0?l.to:l.from;return new Be(n,C,g)}}return new Be(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=ct(t,e.doc.direction);if(!r)return Uo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=Qe(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Uo(t,i,n);var p=function(tt,st){return Fo(t,tt instanceof Be?tt.ch:tt,st)},g,C=function(tt){return e.options.lineWrapping?(g=g||Yi(e,t),pa(e,t,g,tt)):{begin:0,end:t.text.length}},z=C(i.sticky=="before"?p(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var J=l.level==1==n<0,xe=p(i,J?1:-1);if(xe!=null&&(J?xe<=l.to&&xe<=z.end:xe>=l.from&&xe>=z.begin)){var ge=J?"before":"after";return new Be(i.line,xe,ge)}}var Ie=function(tt,st,nt){for(var pt=function(tn,xn){return xn?new Be(i.line,p(tn,1),"before"):new Be(i.line,tn,"after")};tt>=0&&tt<r.length;tt+=st){var St=r[tt],Ct=st>0==(St.level!=1),_t=Ct?nt.begin:p(nt.end,-1);if(St.from<=_t&&_t<St.to)return pt(_t,Ct);if(_t=Ct?St.from:p(St.to,-1),nt.begin<=_t&&_t<nt.end)return pt(_t,Ct)}},Ve=Ie(s+n,n,z);if(Ve)return Ve;var $e=n>0?z.end:p(z.begin,-1);return $e!=null&&!(n>0&&$e==t.text.length)&&(Ve=Ie(n>0?0:r.length-1,n,C($e)),Ve)?Ve:null}var Pr={selectAll:$a,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Le)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=mt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Be(t.head.line+1,0)}:{from:t.head,to:Be(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:Be(t.from().line,0),to:o(e.doc,Be(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:Be(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ar(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Be(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Be(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?fs(e,t.head):n},Ae)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=R(e.getLine(s.line),s.ch,n);t.push(q(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return zn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=mt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Be(r.line,r.ch-1)),r.ch>0)r=new Be(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Be(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=mt(e.doc,r.line-1).text;l&&(r=new Be(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Be(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Yt(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return zn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var i=mt(e.doc,t),n=Pn(i);return n!=i&&(t=Dt(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=mt(e.doc,t),n=Vi(i);return n!=i&&(t=Dt(n)),Ho(!0,e,i,t,-1)}function fs(e,t){var i=ds(e,t.line),n=mt(e.doc,i.line),r=ct(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return Be(i.line,l?0:s,i.sticky)}return i}function oo(e,t,i){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Fe}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=or(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,i,e)||or(t,e.options.keyMap,i,e)}var jl=new V;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,r+" "+t,i,n))return!0}return ps(e,t,i,n)}function ps(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Sn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(S(i),So(e)),!!r}function ms(e,t){var i=cs(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return oo(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return oo(e,n)}):Nr(e,i,t,function(n){return oo(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return oo(e,n,!0)})}var Wo=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ie(),Xe(t,e))return;G&&Q<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=ms(t,e);b&&(Wo=n?i:null,!n&&i==88&&!Ht&&(A?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),he&&!A&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(De(t,"CodeMirror-crosshair"),ht(document,"keyup",i),ht(document,"mouseover",i))}Me(document,"keyup",i),Me(document,"mouseover",i)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(gi(t.display,e)||Xe(t,e)||e.ctrlKey&&!e.altKey||A&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(b&&i==Wo){Wo=null,S(e);return}if(b&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Ul=400,zo=function(e,t,i){this.time=e,this.pos=t,this.button=i};zo.prototype.compare=function(e,t,i){return this.time+Ul>e&&at(t,this.pos)==0&&i==this.button};var Ir,jr;function Hl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new zo(i,e,t),Ir=null,"double"):(Ir=new zo(i,e,t),jr=null,"single")}function bs(e){var t=this,i=t.display;if(Xe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,gi(i,e)){H||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=de(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):Te(e)==i.scroller&&S(e):r==2?(n&&qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ne?t.display.input.onContextMenu(e):xa(t))}function Wl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),p=l(e,i)!=Fe}finally{e.state.suppressEdits=!1}return p})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=F?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=A?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(A?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){G?setTimeout(m(ba,e),0):e.curOp.focus=ie();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&We&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(at((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(at(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=yn(e,function(C){H&&(r.scroller.draggable=!1),e.state.draggingText=!1,ht(r.wrapper.ownerDocument,"mouseup",l),ht(r.wrapper.ownerDocument,"mousemove",p),ht(r.scroller,"dragstart",g),ht(r.scroller,"drop",l),s||(S(C),n.addNew||qr(e.doc,i,null,null,n.extend),H&&!T||G&&Q==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),p=function(C){s=s||Math.abs(t.clientX-C.clientX)+Math.abs(t.clientY-C.clientY)>=10},g=function(){return s=!0};H&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Me(r.wrapper.ownerDocument,"mouseup",l),Me(r.wrapper.ownerDocument,"mousemove",p),Me(r.scroller,"dragstart",g),Me(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Yt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Yt(Be(t.line,0),o(e.doc,Be(t.line+1,0)));var n=i(e,t);return new Yt(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;S(t);var l,p,g=s.sel,C=g.ranges;if(n.addNew&&!n.extend?(p=s.sel.contains(i),p>-1?l=C[p]:l=new Yt(i,i)):(l=s.sel.primary(),p=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Yt(i,i)),i=Ni(e,t,!0,!0),p=-1;else{var z=xs(e,i,n.unit);n.extend?l=jo(l,z.anchor,z.head,n.extend):l=z}n.addNew?p==-1?(p=C.length,An(s,li(e,C.concat([l]),p),{scroll:!1,origin:"*mouse"})):C.length>1&&C[p].empty()&&n.unit=="char"&&!n.extend?(An(s,li(e,C.slice(0,p).concat(C.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Bo(s,p,l,Re):(p=0,An(s,new Zn([l],0),Re),g=s.sel);var J=i;function xe(nt){if(at(J,nt)==0)return;if(J=nt,n.unit=="rectangle"){for(var pt=[],St=e.options.tabSize,Ct=R(mt(s,i.line).text,i.ch,St),_t=R(mt(s,nt.line).text,nt.ch,St),tn=Math.min(Ct,_t),xn=Math.max(Ct,_t),an=Math.min(i.line,nt.line),Gn=Math.min(e.lastLine(),Math.max(i.line,nt.line));an<=Gn;an++){var Bn=mt(s,an).text,fn=Se(Bn,tn,St);tn==xn?pt.push(new Yt(Be(an,fn),Be(an,fn))):Bn.length>fn&&pt.push(new Yt(Be(an,fn),Be(an,Se(Bn,xn,St))))}pt.length||pt.push(new Yt(i,i)),An(s,li(e,g.ranges.slice(0,p).concat(pt),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Fn=l,kn=xs(e,nt,n.unit),gn=Fn.anchor,pn;at(kn.anchor,gn)>0?(pn=kn.head,gn=qt(Fn.from(),kn.anchor)):(pn=kn.anchor,gn=$t(Fn.to(),kn.head));var ln=g.ranges.slice(0);ln[p]=Kl(e,new Yt(o(s,gn),pn)),An(s,li(e,ln,p),Re)}}var ge=r.wrapper.getBoundingClientRect(),Ie=0;function Ve(nt){var pt=++Ie,St=Ni(e,nt,!0,n.unit=="rectangle");if(!St)return;if(at(St,J)!=0){e.curOp.focus=ie(),xe(St);var Ct=Kr(r,s);(St.line>=Ct.to||St.line<Ct.from)&&setTimeout(yn(e,function(){Ie==pt&&Ve(nt)}),150)}else{var _t=nt.clientY<ge.top?-20:nt.clientY>ge.bottom?20:0;_t&&setTimeout(yn(e,function(){if(Ie!=pt)return;r.scroller.scrollTop+=_t,Ve(nt)}),50)}}function $e(nt){e.state.selectingText=!1,Ie=Infinity,nt&&(S(nt),r.input.focus()),ht(r.wrapper.ownerDocument,"mousemove",tt),ht(r.wrapper.ownerDocument,"mouseup",st),s.history.lastSelOrigin=null}var tt=yn(e,function(nt){nt.buttons===0||!de(nt)?$e(nt):Ve(nt)}),st=yn(e,$e);e.state.selectingText=st,Me(r.wrapper.ownerDocument,"mousemove",tt),Me(r.wrapper.ownerDocument,"mouseup",st)}function Kl(e,t){var i=t.anchor,n=t.head,r=mt(e.doc,i.line);if(at(i,n)==0&&i.sticky==n.sticky)return t;var s=ct(r);if(!s)return t;var l=Qe(s,i.ch,i.sticky),p=s[l];if(p.from!=i.ch&&p.to!=i.ch)return t;var g=l+(p.from==i.ch==(p.level!=1)?0:1);if(g==0||g==s.length)return t;var C;if(n.line!=i.line)C=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var z=Qe(s,n.ch,n.sticky),J=z-l||(n.ch-i.ch)*(p.level==1?-1:1);z==g-1||z==g?C=J<0:C=J>0}var xe=s[g+(C?-1:0)],ge=C==(xe.level==1),Ie=ge?xe.from:xe.to,Ve=ge?"after":"before";return i.ch==Ie&&i.sticky==Ve?t:new Yt(new Be(i.line,Ie,Ve),n)}function Cs(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(xe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&S(t);var l=e.display,p=l.lineDiv.getBoundingClientRect();if(s>p.bottom||!te(e,i))return X(t);s-=p.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var C=l.gutters.childNodes[g];if(C&&C.getBoundingClientRect().right>=r){var z=Mn(e.doc,s),J=e.display.gutterSpecs[g];return je(e,i,e,z,J.className,t),X(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function ws(e,t){if(gi(e.display,t)||Yl(e,t))return;if(Xe(e,t,"contextmenu"))return;Ne||e.display.input.onContextMenu(t)}function Yl(e,t){return te(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var sr={toString:function(){return"CodeMirror.Init"}},Ss={},ao={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(p,g,C){C!=sr&&s(p,g,C)}:s)}e.defineOption=i,e.Init=sr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),In(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(g){for(var C=0;;){var z=g.text.indexOf(r,C);if(z==-1)break;C=z+r.length,s.push(Be(l,z))}l++});for(var p=s.length-1;p>=0;p--)ir(n.doc,r,s[p],Be(s[p].line,s[p].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=sr&&n.refresh()}),i("specialCharPlaceholder",Gt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",y?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!me),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),p=s!=sr&&ro(s);p&&p.detach&&p.detach(n,l),l.attach&&l.attach(n,p||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Sr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?wo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qi(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),qi(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Do(n.options.gutters,r),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(Zi(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,kr,!0),i("addModeClass",!1,kr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=sr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Me:ht;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(De(e.display.wrapper,"CodeMirror-wrap"),Ur(e)),Eo(e),In(e),vr(e),setTimeout(function(){return qi(e)},100)}function on(e,t){var i=this;if(!(this instanceof on))return new on(e,t);this.options=t=t?d(t):{},d(Ss,t,!1);var n=t.value;typeof n=="string"?n=new jn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new on.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new V,keySeq:null,specialChars:null},t.autofocus&&!y&&s.input.focus(),G&&Q<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ml(),Fi(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!y||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):Zi(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Ma(this),t.finishInit&&t.finishInit(this);for(var p=0;p<Vo.length;++p)Vo[p](this);Ui(this),H&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}on.defaults=Ss,on.optionHandlers=ao;function Ql(e){var t=e.display;Me(t.scroller,"mousedown",yn(e,bs)),G&&Q<11?Me(t.scroller,"dblclick",yn(e,function(g){if(Xe(e,g))return;var C=Ni(e,g);if(!C||Go(e,g)||gi(e.display,g))return;S(g);var z=e.findWordAt(C);qr(e.doc,z.anchor,z.head)})):Me(t.scroller,"dblclick",function(g){return Xe(e,g)||S(g)}),Me(t.scroller,"contextmenu",function(g){return ws(e,g)}),Me(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||ws(e,g)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(g){if(g.touches.length!=1)return!1;var C=g.touches[0];return C.radiusX<=1&&C.radiusY<=1}function l(g,C){if(C.left==null)return!0;var z=C.left-g.left,J=C.top-g.top;return z*z+J*J>20*20}Me(t.scroller,"touchstart",function(g){if(!Xe(e,g)&&!s(g)&&!Go(e,g)){t.input.ensurePolled(),clearTimeout(i);var C=+new Date;t.activeTouch={start:C,moved:!1,prev:C-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(g){var C=t.activeTouch;if(C&&!gi(t,g)&&C.left!=null&&!C.moved&&new Date-C.start<300){var z=e.coordsChar(t.activeTouch,"page"),J;!C.prev||l(C,C.prev)?J=new Yt(z,z):!C.prev.prev||l(C,C.prev.prev)?J=e.findWordAt(z):J=new Yt(Be(z.line,0),o(e.doc,Be(z.line+1,0))),e.setSelection(J.anchor,J.head),e.focus(),S(g)}r()}),Me(t.scroller,"touchcancel",r),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(g){return Da(e,g)}),Me(t.scroller,"DOMMouseScroll",function(g){return Da(e,g)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){Xe(e,g)||Y(g)},over:function(g){Xe(e,g)||(Ll(e,g),Y(g))},start:function(g){return Al(e,g)},drop:yn(e,Tl),leave:function(g){Xe(e,g)||as(e)}};var p=t.input.getField();Me(p,"keyup",function(g){return vs.call(e,g)}),Me(p,"keydown",yn(e,gs)),Me(p,"keypress",yn(e,ys)),Me(p,"focus",function(g){return ko(e,g)}),Me(p,"blur",function(g){return Zi(e,g)})}var Vo=[];on.defineInitHook=function(e){return Vo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=qe(e,t).state:i="prev");var l=e.options.tabSize,p=mt(r,t),g=R(p.text,null,l);p.stateAfter&&(p.stateAfter=null);var C=p.text.match(/^\s*/)[0],z;if(!n&&!/\S/.test(p.text))z=0,i="not";else if(i=="smart"&&(z=r.mode.indent(s,p.text.slice(C.length),p.text),z==Fe||z>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?z=R(mt(r,t-1).text,null,l):z=0:i=="add"?z=g+e.options.indentUnit:i=="subtract"?z=g-e.options.indentUnit:typeof i=="number"&&(z=g+i),z=Math.max(0,z);var J="",xe=0;if(e.options.indentWithTabs)for(var ge=Math.floor(z/l);ge;--ge)xe+=l,J+=" ";if(xe<z&&(J+=q(z-xe)),J!=C)return ir(r,J,Be(t,0),Be(t,C.length),"+input"),p.stateAfter=null,!0;for(var Ie=0;Ie<r.sel.ranges.length;Ie++){var Ve=r.sel.ranges[Ie];if(Ve.head.line==t&&Ve.head.ch<C.length){var $e=Be(t,C.length);Bo(r,Ie,new Yt($e,$e));break}}}var ui=null;function so(e){ui=e}function Xo(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,p=r=="paste"||e.state.pasteIncoming>l,g=Tt(t),C=null;if(p&&n.ranges.length>1)if(ui&&ui.text.join(`
|
|
`)==t){if(n.ranges.length%ui.text.length==0){C=[];for(var z=0;z<ui.text.length;z++)C.push(s.splitLines(ui.text[z]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(C=K(g,function(tt){return[tt]}));for(var J=e.curOp.updateInput,xe=n.ranges.length-1;xe>=0;xe--){var ge=n.ranges[xe],Ie=ge.from(),Ve=ge.to();ge.empty()&&(i&&i>0?Ie=Be(Ie.line,Ie.ch-i):e.state.overwrite&&!p?Ve=Be(Ve.line,Math.min(mt(s,Ve.line).text.length,Ve.ch+L(g).length)):p&&ui&&ui.lineWise&&ui.text.join(`
|
|
`)==g.join(`
|
|
`)&&(Ie=Ve=Be(Ie.line,0)));var $e={from:Ie,to:Ve,text:C?C[xe%C.length]:g,origin:r||(p?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,$e),Sn(e,"inputRead",e,$e)}t&&!p&&Ts(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=J),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&zn(t,function(){return Xo(t,i,0,null,"paste")}),!0}function Ts(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var p=0;p<s.electricChars.length;p++)if(t.indexOf(s.electricChars.charAt(p))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(mt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Sn(e,"electricInput",e,r.head.line)}}function As(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:Be(r,0),head:Be(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Ls(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=D("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=D("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return H?e.style.width="1000px":e.setAttribute("wrap","off"),I&&(e.style.border="1px solid black"),Ls(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&yn(this,t[n])(this,r,l),je(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](ro(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:Rn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");j(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,In(this)}),removeOverlay:Rn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,In(this);return}}}),indentLine:Rn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Vn(this.doc,n)&&Br(this,n,r,s)}),indentSelection:Rn(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var p=r[l];if(p.empty())p.head.line>s&&(Br(this,p.head.line,n,!0),s=p.head.line,l==this.doc.sel.primIndex&&Qi(this));else{var g=p.from(),C=p.to(),z=Math.max(s,g.line);s=Math.min(this.lastLine(),C.line-(C.ch?0:1))+1;for(var J=z;J<s;++J)Br(this,J,n);var xe=this.doc.sel.ranges;g.ch==0&&r.length==xe.length&&xe[l].from().ch>0&&Bo(this.doc,l,new Yt(g,xe[l].to()),Le)}}}),getTokenAt:function(n,r){return en(this,n,r)},getLineTokens:function(n,r){return en(this,Be(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ue(this,mt(this.doc,n.line)),s=0,l=(r.length-1)/2,p=n.ch,g;if(p==0)g=r[2];else for(;;){var C=s+l>>1;if((C?r[C*2-1]:0)>=p)l=C;else if(r[C*2+1]<p)s=C+1;else{g=r[C*2+2];break}}var z=g?g.indexOf("overlay "):-1;return z<0?g:z==0?null:g.slice(0,z-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],p=this.getModeAt(n);if(typeof p[r]=="string")l[p[r]]&&s.push(l[p[r]]);else if(p[r])for(var g=0;g<p[r].length;g++){var C=l[p[r][g]];C&&s.push(C)}else p.helperType&&l[p.helperType]?s.push(l[p.helperType]):l[p.name]&&s.push(l[p.name]);for(var z=0;z<l._global.length;z++){var J=l._global[z];J.pred(p,this)&&ae(s,J.val)==-1&&s.push(J.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),qe(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),si(this,s,r||"page")},charCoords:function(n,r){return vo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=ca(this,n,r||"page"),bo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=ca(this,{top:n,left:0},r||"page").top,Mn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,p;if(typeof n=="number"){var g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,l=!0),p=mt(this.doc,n)}else p=n;return zr(this,p,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-ai(p):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,p){var g=this.display;n=si(this,o(this.doc,n));var C=n.bottom,z=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")C=n.top;else if(l=="above"||l=="near"){var J=Math.max(g.wrapper.clientHeight,this.doc.height),xe=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>J)&&n.top>r.offsetHeight?C=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=J&&(C=n.bottom),z+r.offsetWidth>xe&&(z=xe-r.offsetWidth)}r.style.top=C+"px",r.style.left=r.style.right="",p=="right"?(z=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(p=="left"?z=0:p=="middle"&&(z=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=z+"px"),s&&Js(this,{left:z,top:C,right:z+r.offsetWidth,bottom:C+r.offsetHeight})},triggerOnKeyDown:Rn(gs),triggerOnKeyPress:Rn(ys),triggerOnKeyUp:vs,triggerOnMouseDown:Rn(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Rn(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var p=1;r<0&&(p=-1,r=-r);for(var g=o(this.doc,n),C=0;C<r&&!(g=Ko(this.doc,g,p,s,l),g.hitSide);++C);return g},moveH:Rn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Ko(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},Ae)}),deleteH:Rn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(p){var g=Ko(l,p.head,n,r,!1);return n<0?{from:g,to:p.head}:{from:p.head,to:g}})}),findPosV:function(n,r,s,l){var p=1,g=l;r<0&&(p=-1,r=-r);for(var C=o(this.doc,n),z=0;z<r;++z){var J=si(this,C,"div");if(g==null?g=J.left:J.left=g,C=Rs(this,J,p,s),C.hitSide)break}return C},moveV:Rn(function(n,r){var s=this,l=this.doc,p=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(z){if(g)return n<0?z.from():z.to();var J=si(s,z.head,"div");z.goalColumn!=null&&(J.left=z.goalColumn),p.push(J.left);var xe=Rs(s,J,n,r);return r=="page"&&z==l.sel.primary()&&Ao(s,vo(s,xe,"div").top-J.top),xe},Ae),p.length)for(var C=0;C<l.sel.ranges.length;C++)l.sel.ranges[C].goalColumn=p[C]}),findWordAt:function(n){var r=this.doc,s=mt(r,n.line).text,l=n.ch,p=n.ch;if(s){var g=this.getHelper(n,"wordChars");(n.sticky=="before"||p==s.length)&&l?--l:++p;for(var C=s.charAt(l),z=Ce(C,g)?function(J){return Ce(J,g)}:/\s/.test(C)?function(J){return/\s/.test(J)}:function(J){return!/\s/.test(J)&&!Ce(J)};l>0&&z(s.charAt(l-1));)--l;for(;p<s.length&&z(s.charAt(p));)++p}return new Yt(Be(n.line,l),Be(n.line,p))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):De(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ie()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Rn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-di(this)-this.display.barHeight,width:n.scrollWidth-di(this)-this.display.barWidth,clientHeight:po(this),clientWidth:_i(this)}},scrollIntoView:Rn(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:Be(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):wa(this,n.from,n.to,n.margin)}),setSize:Rn(function(n,r){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&la(this);var p=this.display.viewFrom;this.doc.iter(p,this.display.viewTo,function(g){if(g.widgets){for(var C=0;C<g.widgets.length;C++)if(g.widgets[C].noHScroll){wi(s,p,"widget");break}}++p}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(n){return zn(this,n)},startOperation:function(){return Fi(this)},endOperation:function(){return Ui(this)},refresh:Rn(function(){var n=this.display.cachedTextHeight;In(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Ro(this.display),(n==null||Math.abs(n-$i(this.display))>.5||this.options.lineWrapping)&&Eo(this),je(this,"refresh",this)}),swapDoc:Rn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Sn(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},oe(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function Ko(e,t,i,n,r){var s=t,l=i,p=mt(e,t.line),g=r&&e.direction=="rtl"?-i:i;function C(){var st=t.line+g;return st<e.first||st>=e.first+e.size?!1:(t=new Be(st,t.ch,t.sticky),p=mt(e,st))}function z(st){var nt;if(n=="codepoint"){var pt=p.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(pt)?nt=null:nt=new Be(t.line,Math.max(0,Math.min(p.text.length,t.ch+i*(pt>=55296&&pt<56320?2:1))),-i)}else r?nt=Pl(e.cm,p,t,i):nt=Uo(p,t,i);if(nt==null)if(!st&&C())t=Ho(r,e.cm,p,t.line,g);else return!1;else t=nt;return!0}if(n=="char"||n=="codepoint")z();else if(n=="column")z(!0);else if(n=="word"||n=="group")for(var J=null,xe=n=="group",ge=e.cm&&e.cm.getHelper(t,"wordChars"),Ie=!0;!(i<0&&!z(!Ie));Ie=!1){var Ve=p.text.charAt(t.ch)||`
|
|
`,$e=Ce(Ve,ge)?"w":xe&&Ve==`
|
|
`?"n":!xe||/\s/.test(Ve)?null:"p";if(xe&&!Ie&&!$e&&($e="s"),J&&J!=$e){i<0&&(i=1,z(),t.sticky="after");break}if($e&&(J=$e),i>0&&!z(!Ie))break}var tt=to(e,t,s,l,!0);return Nt(s,tt)&&(tt.hitSide=!0),tt}function Rs(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var p=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(p-.5*$i(e.display),3);l=(i>0?t.bottom:t.top)+i*g}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var C;!(C=bo(e,s,l),!C.outside);){if(i<0?l<=0:l>=r.height){C.hitSide=!0;break}l+=i*5}return C}var Qt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Ls(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(p){for(var g=p.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}Me(r,"paste",function(p){if(!s(p)||Xe(n,p)||ks(p,n))return;Q<=11&&setTimeout(yn(n,function(){return t.updateFromDOM()}),20)}),Me(r,"compositionstart",function(p){t.composing={data:p.data,done:!1}}),Me(r,"compositionupdate",function(p){t.composing||(t.composing={data:p.data,done:!1})}),Me(r,"compositionend",function(p){t.composing&&(p.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(r,"touchstart",function(){return i.forceCompositionEnd()}),Me(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(p){if(!s(p)||Xe(n,p))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),p.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=As(n);so({lineWise:!0,text:g.text}),p.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,Le),n.replaceSelection("",null,"cut")})}else return;if(p.clipboardData){p.clipboardData.clearData();var C=ui.text.join(`
|
|
`);if(p.clipboardData.setData("Text",C),p.clipboardData.getData("Text")==C){p.preventDefault();return}}var z=Ms(),J=z.firstChild;n.display.lineSpace.insertBefore(z,n.display.lineSpace.firstChild),J.value=ui.text.join(`
|
|
`);var xe=document.activeElement;N(J),setTimeout(function(){n.display.lineSpace.removeChild(z),xe.focus(),xe==r&&i.showPrimarySelection()},50)}Me(r,"copy",l),Me(r,"cut",l)},Qt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=lo(t,e.anchorNode,e.anchorOffset),l=lo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&at(qt(s,l),n)==0&&at($t(s,l),r)==0)return;var p=t.display.view,g=n.line>=t.display.viewFrom&&Os(t,n)||{node:p[0].measure.map[2],offset:0},C=r.line<t.display.viewTo&&Os(t,r);if(!C){var z=p[p.length-1].measure,J=z.maps?z.maps[z.maps.length-1]:z.map;C={node:J[J.length-1],offset:J[J.length-2]-J[J.length-3]}}if(!g||!C){e.removeAllRanges();return}var xe=e.rangeCount&&e.getRangeAt(0),ge;try{ge=ne(g.node,g.offset,C.offset,C.node)}catch(Ie){}ge&&(!he&&t.state.focused?(e.collapse(g.node,g.offset),ge.collapsed||(e.removeAllRanges(),e.addRange(ge))):(e.removeAllRanges(),e.addRange(ge)),xe&&e.anchorNode==null?e.addRange(xe):he&&this.startGracePeriod()),this.rememberSelection()},Qt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Qt.prototype.showMultipleSelections=function(e){le(this.cm.display.cursorDiv,e.cursors),le(this.cm.display.selectionDiv,e.selection)},Qt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return W(this.div,t)},Qt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qt.prototype.blur=function(){this.div.blur()},Qt.prototype.getField=function(){return this.div},Qt.prototype.supportsTouch=function(){return!0},Qt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():zn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Qt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(v&&x&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=lo(t,e.anchorNode,e.anchorOffset),n=lo(t,e.focusNode,e.focusOffset);i&&n&&zn(t,function(){An(t.doc,Si(i,n),Le),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Qt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=Be(n.line-1,mt(e.doc,n.line-1).length)),r.ch==mt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Be(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,p;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=Dt(t.view[0].line),p=t.view[0].node):(l=Dt(t.view[s].line),p=t.view[s-1].node.nextSibling);var g=Ii(e,r.line),C,z;if(g==t.view.length-1?(C=t.viewTo-1,z=t.lineDiv.lastChild):(C=Dt(t.view[g+1].line)-1,z=t.view[g+1].node.previousSibling),!p)return!1;for(var J=e.doc.splitLines(tu(e,p,z,l,C)),xe=Dn(e.doc,Be(l,0),Be(C,mt(e.doc,C).text.length));J.length>1&&xe.length>1;)if(L(J)==L(xe))J.pop(),xe.pop(),C--;else if(J[0]==xe[0])J.shift(),xe.shift(),l++;else break;for(var ge=0,Ie=0,Ve=J[0],$e=xe[0],tt=Math.min(Ve.length,$e.length);ge<tt&&Ve.charCodeAt(ge)==$e.charCodeAt(ge);)++ge;for(var st=L(J),nt=L(xe),pt=Math.min(st.length-(J.length==1?ge:0),nt.length-(xe.length==1?ge:0));Ie<pt&&st.charCodeAt(st.length-Ie-1)==nt.charCodeAt(nt.length-Ie-1);)++Ie;if(J.length==1&&xe.length==1&&l==n.line)for(;ge&&ge>n.ch&&st.charCodeAt(st.length-Ie-1)==nt.charCodeAt(nt.length-Ie-1);)ge--,Ie++;J[J.length-1]=st.slice(0,st.length-Ie).replace(/^\u200b+/,""),J[0]=J[0].slice(ge).replace(/\u200b+$/,"");var St=Be(l,ge),Ct=Be(C,xe.length?L(xe).length-Ie:0);if(J.length>1||J[0]||at(St,Ct))return ir(e.doc,J,St,Ct,"+input"),!0},Qt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qt.prototype.reset=function(){this.forceCompositionEnd()},Qt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Qt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&zn(this.cm,function(){return In(e.cm)})},Qt.prototype.setUneditable=function(e){e.contentEditable="false"},Qt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||yn(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qt.prototype.onContextMenu=function(){},Qt.prototype.resetPosition=function(){},Qt.prototype.needsContentAttribute=!0;function Os(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=mt(e.doc,t.line),r=ia(i,n,t.line),s=ct(n,e.doc.direction),l="left";if(s){var p=Qe(s,t.ch);l=p%2?"right":"left"}var g=aa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,p=e.doc.lineSeparator(),g=!1;function C(ge){return function(Ie){return Ie.id==ge}}function z(){l&&(s+=p,g&&(s+=p),l=g=!1)}function J(ge){ge&&(z(),s+=ge)}function xe(ge){if(ge.nodeType==1){var Ie=ge.getAttribute("cm-text");if(Ie){J(Ie);return}var Ve=ge.getAttribute("cm-marker"),$e;if(Ve){var tt=e.findMarks(Be(n,0),Be(r+1,0),C(+Ve));tt.length&&($e=tt[0].find(0))&&J(Dn(e.doc,$e.from,$e.to).join(p));return}if(ge.getAttribute("contenteditable")=="false")return;var st=/^(pre|div|p|li|table|br)$/i.test(ge.nodeName);if(!/^br$/i.test(ge.nodeName)&&ge.textContent.length==0)return;st&&z();for(var nt=0;nt<ge.childNodes.length;nt++)xe(ge.childNodes[nt]);/^(pre|p)$/i.test(ge.nodeName)&&(g=!0),st&&(l=!0)}else ge.nodeType==3&&J(ge.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(xe(t),t==i);)t=t.nextSibling,g=!1;return s}function lo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return lr(e.clipPos(Be(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!W(n,t))return lr(Be(Dt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?L(e.rest):e.line;return lr(Be(Dt(s),s.text.length),r)}var l=t.nodeType==3?t:null,p=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));p.parentNode!=n;)p=p.parentNode;var g=e.measure,C=g.maps;function z($e,tt,st){for(var nt=-1;nt<(C?C.length:0);nt++)for(var pt=nt<0?g.map:C[nt],St=0;St<pt.length;St+=3){var Ct=pt[St+2];if(Ct==$e||Ct==tt){var _t=Dt(nt<0?e.line:e.rest[nt]),tn=pt[St]+st;return(st<0||Ct!=$e)&&(tn=pt[St+(st?1:0)]),Be(_t,tn)}}}var J=z(l,p,i);if(J)return lr(J,r);for(var xe=p.nextSibling,ge=l?l.nodeValue.length-i:0;xe;xe=xe.nextSibling){if(J=z(xe,xe.firstChild,0),J)return lr(Be(J.line,J.ch-ge),r);ge+=xe.textContent.length}for(var Ie=p.previousSibling,Ve=i;Ie;Ie=Ie.previousSibling){if(J=z(Ie,Ie.firstChild,-1),J)return lr(Be(J.line,J.ch+Ve),r);Ve+=Ie.textContent.length}}var hn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};hn.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),I&&(r.style.width="0px"),Me(r,"input",function(){G&&Q>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Me(r,"paste",function(l){if(Xe(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Xe(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var p=As(n);so({lineWise:!0,text:p.text}),l.type=="cut"?n.setSelections(p.ranges,null,Le):(i.prevInput="",r.value=p.text.join(`
|
|
`),N(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Me(r,"cut",s),Me(r,"copy",s),Me(e.scroller,"paste",function(l){if(gi(e,l)||Xe(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var p=new Event("paste");p.clipboardData=l.clipboardData,r.dispatchEvent(p)}),Me(e.lineSpace,"selectstart",function(l){gi(e,l)||S(l)}),Me(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},hn.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},hn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},hn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=va(e);if(e.options.moveInputWithCursor){var r=si(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},hn.prototype.showSelection=function(e){var t=this.cm,i=t.display;le(i.cursorDiv,e.cursors),le(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},hn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&N(this.textarea),G&&Q>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",G&&Q>=9&&(this.hasSelection=null))},hn.prototype.getField=function(){return this.textarea},hn.prototype.supportsTouch=function(){return!1},hn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!y||ie()!=this.textarea))try{this.textarea.focus()}catch(e){}},hn.prototype.blur=function(){this.textarea.blur()},hn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},hn.prototype.receivedFocus=function(){this.slowPoll()},hn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},hn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},hn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||lt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(G&&Q>=9&&this.hasSelection===r||A&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,p=Math.min(n.length,r.length);l<p&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return zn(t,function(){Xo(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},hn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},hn.prototype.onKeyPress=function(){G&&Q>=9&&(this.hasSelection=null),this.fastPoll()},hn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Ni(i,e),l=n.scroller.scrollTop;if(!s||b)return;var p=i.options.resetSelectionOnContextMenu;p&&i.doc.sel.contains(s)==-1&&yn(i,An)(i.doc,Si(s),Le);var g=r.style.cssText,C=t.wrapper.style.cssText,z=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-z.top-5)+"px; left: "+(e.clientX-z.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var J;H&&(J=window.scrollY),n.input.focus(),H&&window.scrollTo(null,J),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ge,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function xe(){if(r.selectionStart!=null){var Ve=i.somethingSelected(),$e="\u200B"+(Ve?r.value:"");r.value="\u21DA",r.value=$e,t.prevInput=Ve?"":"\u200B",r.selectionStart=1,r.selectionEnd=$e.length,n.selForContextMenu=i.doc.sel}}function ge(){if(t.contextMenuPending!=ge)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=C,r.style.cssText=g,G&&Q<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!G||G&&Q<9)&&xe();var Ve=0,$e=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?yn(i,$a)(i):Ve++<10?n.detectingSelectAll=setTimeout($e,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout($e,200)}}if(G&&Q>=9&&xe(),Ne){Y(e);var Ie=function(){ht(window,"mouseup",Ie),setTimeout(ge,20)};Me(window,"mouseup",Ie)}else setTimeout(ge,50)},hn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},hn.prototype.setUneditable=function(){},hn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?d(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ie();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=p.getValue()}var r;if(e.form&&(Me(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var p=on(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return p}function ru(e){e.off=ht,e.on=Me,e.wheelEventPixels=cl,e.Doc=jn,e.splitLines=Tt,e.countColumn=R,e.findColumn=Se,e.isWordChar=re,e.Pass=Fe,e.signal=je,e.Line=Di,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=Be,e.cmpPos=at,e.modes=Pt,e.mimeModes=Rt,e.resolveMode=bt,e.getMode=wt,e.modeExtensions=ot,e.extendMode=xt,e.copyState=Zt,e.startState=nn,e.innerMode=rn,e.commands=Pr,e.keyMap=vi,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=_l,e.StringStream=Ot,e.SharedTextMarker=Or,e.TextMarker=Ai,e.LineWidget=Rr,e.e_preventDefault=S,e.e_stopPropagation=M,e.e_stop=Y,e.addClass=U,e.contains=W,e.rmClass=De,e.keyNames=Li}$l(on),ql(on);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in jn.prototype)jn.prototype.hasOwnProperty(uo)&&ae(ou,uo)<0&&(on.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(jn.prototype[uo]));return oe(jn),on.inputStyles={textarea:hn,contenteditable:Qt},on.defineMode=function(e){!on.defaults.mode&&e!="null"&&(on.defaults.mode=e),wn.apply(this,arguments)},on.defineMIME=Qn,on.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),on.defineMIME("text/plain","null"),on.defineExtension=function(e,t){on.prototype[e]=t},on.defineDocExtension=function(e,t){jn.prototype[e]=t},on.fromTextArea=iu,ru(on),on.version="5.58.2",on})},Y1PL:function(gt,pe,w){"use strict";w.r(pe),w.d(pe,"ResizableTextArea",function(){return ae});var Z=w("wx14"),fe=w("1OyB"),he=w("vuIU"),we=w("Ji7U"),ve=w("LK+K"),$=w("q1tI"),G=w("VTBJ"),Q=w("rePB"),H=w("Zm9Q"),O=w("Kwbf"),x=w("c+Xe"),b=w("m+aA"),T=w("bdgK"),E=new Map;function k(Le){Le.forEach(function(Re){var Ae,Se=Re.target;(Ae=E.get(Se))===null||Ae===void 0||Ae.forEach(function(ue){return ue(Se)})})}var I=new T.default(k),v=null,y=null;function A(Le,Re){E.has(Le)||(E.set(Le,new Set),I.observe(Le)),E.get(Le).add(Re)}function F(Le,Re){E.has(Le)&&(E.get(Le).delete(Re),E.get(Le).size||(I.unobserve(Le),E.delete(Le)))}var me=function(Le){Object(we.a)(Ae,Le);var Re=Object(ve.a)(Ae);function Ae(){return Object(fe.a)(this,Ae),Re.apply(this,arguments)}return Object(he.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}($.Component),ce=$.createContext(null);function ye(Le){var Re=Le.children,Ae=Le.onBatchResize,Se=$.useRef(0),ue=$.useRef([]),q=$.useContext(ce),L=$.useCallback(function(K,j,ke){Se.current+=1;var P=Se.current;ue.current.push({size:K,element:j,data:ke}),Promise.resolve().then(function(){P===Se.current&&(Ae==null||Ae(ue.current),ue.current=[])}),q==null||q(K,j,ke)},[Ae,q]);return $.createElement(ce.Provider,{value:L},Re)}function Ne(Le){var Re=Le.children,Ae=Le.disabled,Se=$.useRef(null),ue=$.useRef(null),q=$.useContext(ce),L=$.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=$.isValidElement(Re)&&Object(x.c)(Re),j=K?Re.ref:null,ke=$.useMemo(function(){return Object(x.a)(j,Se)},[j,Se]),P=$.useRef(Le);P.current=Le;var _=$.useCallback(function(re){var Ce=P.current,Pe=Ce.onResize,Oe=Ce.data,He=re.getBoundingClientRect(),Ge=He.width,ut=He.height,Ze=re.offsetWidth,it=re.offsetHeight,Qe=Math.floor(Ge),yt=Math.floor(ut);if(L.current.width!==Qe||L.current.height!==yt||L.current.offsetWidth!==Ze||L.current.offsetHeight!==it){var ct={width:Qe,height:yt,offsetWidth:Ze,offsetHeight:it};L.current=ct;var dt=Ze===Math.round(Ge)?Ge:Ze,Me=it===Math.round(ut)?ut:it,et=Object(G.a)(Object(G.a)({},ct),{},{offsetWidth:dt,offsetHeight:Me});q==null||q(et,re,Oe),Pe&&Promise.resolve().then(function(){Pe(et,re)})}},[]);return $.useEffect(function(){var re=Object(b.a)(Se.current)||Object(b.a)(ue.current);return re&&!Ae&&A(re,_),function(){return F(re,_)}},[Se.current,Ae]),$.createElement(me,{ref:ue},K?$.cloneElement(Re,{ref:ke}):Re)}var Ee="rc-observer-key";function De(Le){var Re=Le.children,Ae=Object(H.a)(Re);return Ae.map(function(Se,ue){var q=(Se==null?void 0:Se.key)||"".concat(Ee,"-").concat(ue);return $.createElement(Ne,Object(Z.a)({},Le,{key:q}),Se)})}De.Collection=ye;var Ke=De,le=w("bT9E"),D=w("TSYQ"),be=w.n(D),ne=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,W=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],ie={},U;function B(Le){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Le.getAttribute("id")||Le.getAttribute("data-reactid")||Le.getAttribute("name");if(Re&&ie[Ae])return ie[Ae];var Se=window.getComputedStyle(Le),ue=Se.getPropertyValue("box-sizing")||Se.getPropertyValue("-moz-box-sizing")||Se.getPropertyValue("-webkit-box-sizing"),q=parseFloat(Se.getPropertyValue("padding-bottom"))+parseFloat(Se.getPropertyValue("padding-top")),L=parseFloat(Se.getPropertyValue("border-bottom-width"))+parseFloat(Se.getPropertyValue("border-top-width")),K=W.map(function(ke){return"".concat(ke,":").concat(Se.getPropertyValue(ke))}).join(";"),j={sizingStyle:K,paddingSize:q,borderSize:L,boxSizing:ue};return Re&&Ae&&(ie[Ae]=j),j}function N(Le){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),Le.getAttribute("wrap")?U.setAttribute("wrap",Le.getAttribute("wrap")):U.removeAttribute("wrap");var ue=B(Le,Re),q=ue.paddingSize,L=ue.borderSize,K=ue.boxSizing,j=ue.sizingStyle;U.setAttribute("style","".concat(j,";").concat(ne)),U.value=Le.value||Le.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,P=Number.MAX_SAFE_INTEGER,_=U.scrollHeight,re;if(K==="border-box"?_+=L:K==="content-box"&&(_-=q),Ae!==null||Se!==null){U.value=" ";var Ce=U.scrollHeight-q;Ae!==null&&(ke=Ce*Ae,K==="border-box"&&(ke=ke+q+L),_=Math.max(ke,_)),Se!==null&&(P=Ce*Se,K==="border-box"&&(P=P+q+L),re=_>P?"":"hidden",_=Math.min(P,_))}return{height:_,minHeight:ke,maxHeight:P,overflowY:re,resize:"none"}}var m=w("Gytx"),d=w.n(m),R;(function(Le){Le[Le.NONE=0]="NONE",Le[Le.RESIZING=1]="RESIZING",Le[Le.RESIZED=2]="RESIZED"})(R||(R={}));var V=function(Le){Object(we.a)(Ae,Le);var Re=Object(ve.a)(Ae);function Ae(Se){var ue;return Object(fe.a)(this,Ae),ue=Re.call(this,Se),ue.nextFrameActionId=void 0,ue.resizeFrameId=void 0,ue.textArea=void 0,ue.saveTextArea=function(q){ue.textArea=q},ue.handleResize=function(q){var L=ue.state.resizeStatus,K=ue.props,j=K.autoSize,ke=K.onResize;if(L!==R.NONE)return;typeof ke=="function"&&ke(q),j&&ue.resizeOnNextFrame()},ue.resizeOnNextFrame=function(){cancelAnimationFrame(ue.nextFrameActionId),ue.nextFrameActionId=requestAnimationFrame(ue.resizeTextarea)},ue.resizeTextarea=function(){var q=ue.props.autoSize;if(!q||!ue.textArea)return;var L=q.minRows,K=q.maxRows,j=N(ue.textArea,!1,L,K);ue.setState({textareaStyles:j,resizeStatus:R.RESIZING},function(){cancelAnimationFrame(ue.resizeFrameId),ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:R.RESIZED},function(){ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:R.NONE}),ue.fixFirefoxAutoScroll()})})})})},ue.renderTextArea=function(){var q=ue.props,L=q.prefixCls,K=L===void 0?"rc-textarea":L,j=q.autoSize,ke=q.onResize,P=q.className,_=q.disabled,re=ue.state,Ce=re.textareaStyles,Pe=re.resizeStatus,Oe=Object(le.a)(ue.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),He=be()(K,P,Object(Q.a)({},"".concat(K,"-disabled"),_));"value"in Oe&&(Oe.value=Oe.value||"");var Ge=Object(G.a)(Object(G.a)(Object(G.a)({},ue.props.style),Ce),Pe===R.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return $.createElement(Ke,{onResize:ue.handleResize,disabled:!(j||ke)},$.createElement("textarea",Object(Z.a)({},Oe,{className:He,style:Ge,ref:ue.saveTextArea})))},ue.state={textareaStyles:{},resizeStatus:R.NONE},ue}return Object(he.a)(Ae,[{key:"componentDidUpdate",value:function(ue){(ue.value!==this.props.value||!d()(ue.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ue=this.textArea.selectionStart,q=this.textArea.selectionEnd;this.textArea.setSelectionRange(ue,q)}}catch(L){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}($.Component),ae=V,_e=function(Le){Object(we.a)(Ae,Le);var Re=Object(ve.a)(Ae);function Ae(Se){var ue;Object(fe.a)(this,Ae),ue=Re.call(this,Se),ue.resizableTextArea=void 0,ue.focus=function(){ue.resizableTextArea.textArea.focus()},ue.saveTextArea=function(L){ue.resizableTextArea=L},ue.handleChange=function(L){var K=ue.props.onChange;ue.setValue(L.target.value,function(){ue.resizableTextArea.resizeTextarea()}),K&&K(L)},ue.handleKeyDown=function(L){var K=ue.props,j=K.onPressEnter,ke=K.onKeyDown;L.keyCode===13&&j&&j(L),ke&&ke(L)};var q=typeof Se.value=="undefined"||Se.value===null?Se.defaultValue:Se.value;return ue.state={value:q},ue}return Object(he.a)(Ae,[{key:"setValue",value:function(ue,q){"value"in this.props||this.setState({value:ue},q)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return $.createElement(ae,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ue){return"value"in ue?{value:ue.value}:null}}]),Ae}($.Component),Fe=pe.default=_e},ZW9T:function(gt,pe,w){"use strict";w.d(pe,"a",function(){return Ke});var Z=w("k1fw"),fe=w("oBTY"),he=w("9og8"),we=w("miYZ"),ve=w("tsqr"),$=w("rAM+"),G=w("tJVT"),Q=w("PpiC"),H=w("WmNS"),O=w.n(H),x=w("q1tI"),b=w.n(x),T=w("bdgK");function E(le,D,be,ne,W){var ie=D.getWordUntilPosition(be),U={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:ie.startColumn,endColumn:ie.endColumn},B=ne.map(function(N){return{label:N,kind:le.languages.CompletionItemKind.Keyword,insertText:N,insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:U}});return W.map(function(N){B.push(Object(Z.a)(Object(Z.a)({},N),{},{range:U}))}),B}var k=function(le){var D={label:"ifelse",kind:le.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet},be=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];le.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(U,B){var N=E(le,U,B,be,[D]);return{suggestions:N}}});var ne=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];le.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(U,B){var N=[{label:"print",kind:le.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet}],m=E(le,U,B,ne,N);return{suggestions:m}}});var W=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];le.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(U,B){var N=[D,{label:"main",kind:le.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:le.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:le.languages.CompletionItemInsertTextRule.InsertAsSnippet}],m=E(le,U,B,W,N);return{suggestions:m}}})},I="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=w("fjLI"),y=w("LvDl"),A=w("+ua5");function F(le){return/^\d+$/.test(le)?"".concat(le,"px"):le}function me(){}var ce=!1,ye={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale"};function Ne(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],D=le;if(Array.isArray(le)){for(var be=0;be<le.length;be++){var ne=ye[le[be]];if(ne)return ne}return D[0]}return ye[D]||D}var Ee=null,De=pe.b=function(le){var D=le.width,be=D===void 0?"100%":D,ne=le.height,W=ne===void 0?"100%":ne,ie=le.value,U=le.language,B=U===void 0?"javascript":U,N=le.style,m=N===void 0?{}:N,d=le.options,R=d===void 0?{}:d,V=le.overrideServices,ae=V===void 0?{}:V,_e=le.theme,Fe=_e===void 0?"vs-dark":_e,Le=le.onEditBlur,Re=le.onSave,Ae=le.autoHeight,Se=Ae===void 0?!1:Ae,ue=le.forbidCopy,q=ue===void 0?!1:ue,L=le.onChange,K=L===void 0?me:L,j=le.editorDidMount,ke=j===void 0?me:j,P=le.onFocus,_=P===void 0?me:P,re=le.onBreakPoint,Ce=re===void 0?me:re,Pe=le.breakPointValue,Oe=Pe===void 0?[]:Pe,He=le.filename,Ge=He===void 0?"educoder.txt":He,ut=le.errorLine,Ze=le.errorContent,it=Ze===void 0?"":Ze,Qe=le.highlightLine,yt=le.openBreakPoint,ct=yt===void 0?!1:yt,dt=Object(Q.a)(le,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Me=Object(x.useRef)(),et=Object(x.useRef)({}),ht=Object(x.useRef)(),je=Object(x.useRef)(),Xe=Object(x.useRef)([]),se=Object(x.useRef)(!1),te=Object(x.useRef)(),oe=Object(x.useState)(!1),S=Object(G.a)(oe,2),M=S[0],X=S[1];function Y(){var wt;return Me.current&&(wt=new T.default(function(ot){var xt=Object($.a)(ot),Zt;try{for(xt.s();!(Zt=xt.n()).done;){var rn=Zt.value;(rn.target.offsetHeight>0||rn.target.offsetWidth>0)&&et.current.instance.layout()}}catch(nn){xt.e(nn)}finally{xt.f()}}),wt.observe(Me.current)),wt}function Te(){ve.b.warn({content:decodeURIComponent(I),key:"monaco-editor-tip"})}var de=function(){var ot=et.current.instance;if(ie!=null&&ot&&M){var xt=ot.getModel();xt&&ie!==xt.getValue()&&(ce=!0,xt.setValue(ie),ot.layout(),ce=!1)}};Object(x.useEffect)(function(){try{var wt,ot=et.current.instance;je.current&&clearTimeout(je.current),je.current=setTimeout(function(){de()},500),ot==null||((wt=ot.updateOptions)===null||wt===void 0)||wt.call(ot,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ie.split(/\r\n|\r|\n/g).length))+3,5)})}catch(xt){debugger}},[ie,M,et.current]),Object(x.useEffect)(function(){try{if(ut&&et.current&&et.current.instance){var wt=et.current.instance;wt.changeViewZones(function(xt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=it,xt.addZone({afterLineNumber:ut||11,heightInLines:3,domNode:Zt})});var ot={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};wt.addOverlayWidget(ot),wt.revealPositionInCenter({lineNumber:20,column:1})}}catch(xt){debugger}},[ut,et.current,M]),Object(x.useEffect)(function(){var wt;if((wt=et.current)!==null&&wt!==void 0&&wt.instance&&M&&ct){var ot=et.current.instance,xt=ot.getModel();if(!xt)return;var Zt=function(){var at=[],Nt=[],Xt=xt.getAllDecorations(),$t=Object($.a)(Xt),qt;try{for($t.s();!(qt=$t.n()).done;){var h=qt.value;if(h.options.className==="highlighted-line"){var o;at.push(h==null||((o=h.range)===null||o===void 0)?void 0:o.startLineNumber),Nt.push(h==null?void 0:h.id)}}}catch(u){$t.e(u)}finally{$t.f()}xt.deltaDecorations(Nt,[]);var a=xt.getLineCount();!!Qe&&Qe<=a&&(ot.deltaDecorations([],[{range:new Ee.Range(Qe,1,Qe,xt.getLineMaxColumn(Qe)),options:{isWholeLine:!0,className:"highlighted-line"}}]),ot.revealLineInCenter(Qe))};Zt();var rn=function(){var at=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Nt=[],Xt=[],$t=xt.getAllDecorations(),qt=Object($.a)($t),h;try{for(qt.s();!(h=qt.n()).done;){var o=h.value;if(o.options.linesDecorationsClassName==="breakpoints"){var a;Nt.push(o==null||((a=o.range)===null||a===void 0)?void 0:a.startLineNumber),Xt.push(o==null?void 0:o.id)}}}catch(u){qt.e(u)}finally{qt.f()}if(at)return{lines:Nt,ids:Xt};Ce(Nt)},nn=function(){var Be=Object(he.a)(O.a.mark(function at(Nt){var Xt;return O.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Xt={range:new Ee.Range(Nt,1,Nt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},qt.next=3,xt.deltaDecorations([],[Xt]);case 3:rn();case 4:case"end":return qt.stop()}},at)}));return function(Nt){return Be.apply(this,arguments)}}(),Ot=function(){var Be=Object(he.a)(O.a.mark(function at(Nt){var Xt,$t,qt,h,o;return O.a.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:Xt=[],$t=ot.getLineDecorations(Nt),qt=Object($.a)($t);try{for(qt.s();!(h=qt.n()).done;)o=h.value,o.options.linesDecorationsClassName==="breakpoints"&&Xt.push(o.id)}catch(f){qt.e(f)}finally{qt.f()}return u.next=6,xt.deltaDecorations(Xt,[]);case 6:rn();case 7:case"end":return u.stop()}},at)}));return function(Nt){return Be.apply(this,arguments)}}(),mt=function(at){var Nt=ot.getLineDecorations(at),Xt=Object($.a)(Nt),$t;try{for(Xt.s();!($t=Xt.n()).done;){var qt=$t.value;if(qt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(h){Xt.e(h)}finally{Xt.f()}return!1};if(!Object(y.isEqual)(Oe,rn(!0).lines)){xt.deltaDecorations(rn(!0).ids,[]);var Dn=Oe.map(function(Be){return{range:new Ee.Range(Be,1,Be,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});xt.deltaDecorations([],Dn)}var ni=ot.onDidChangeModelContent(function(Be){var at=ot.getPosition();if(at){var Nt=at.lineNumber;xt.getLineContent(Nt).trim()===""?Ot(Nt):mt(Nt)&&(Ot(Nt),nn(Nt))}}),Tn=ot.onMouseDown(function(Be){var at,Nt,Xt;if(Be.target.detail&&(at=Be.target)!==null&&at!==void 0&&(Nt=at.element)!==null&&Nt!==void 0&&(Xt=Nt.className)!==null&&Xt!==void 0&&Xt.includes("line-numbers")){var $t=Be.target.position.lineNumber;if(xt.getLineContent($t).trim()==="")return;mt($t)?Ot($t):nn($t)}}),Dt=function(at){var Nt={range:new Ee.Range(at,1,at,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=ot.deltaDecorations(Xe.current,[Nt])},Mn=function(){Xe.current=ot.deltaDecorations(Xe.current,[])},Vn=ot.onMouseMove(function(Be){var at,Nt,Xt;if(Mn(),Be.target.detail&&(at=Be.target)!==null&&at!==void 0&&(Nt=at.element)!==null&&Nt!==void 0&&(Xt=Nt.className)!==null&&Xt!==void 0&&Xt.includes("line-numbers")){var $t=Be.target.position.lineNumber;if(xt.getLineContent($t).trim()==="")return;Dt($t)}}),ii=ot.onMouseLeave(function(){Mn()});return function(){ni.dispose(),Tn.dispose(),Vn.dispose(),ii.dispose()}}},[et.current,M,Oe,Qe,ct]);function We(){var wt=et.current.instance;if(wt){var ot=wt.getSelection(),xt=et.current.pastePos||{},Zt=new Ee.Range(xt.startLineNumber||ot.endLineNumber,xt.startColumn||ot.endColumn,xt.endLineNumber||ot.endLineNumber,xt.endColumn||ot.endColumn);setTimeout(function(){wt.executeEdits("",[{range:Zt,text:""}])},300)}}function Je(wt){(window.navigator.platform.match("Mac")?wt.metaKey:wt.ctrlKey)&&wt.keyCode==83&&(wt.preventDefault(),Re())}var rt=function(){if(Se&&et.current.instance){var ot=et.current.instance.getContentHeight();Qn(ot<W?W:ot)}else Qn(W)};function Ye(wt){var ot=document.createEvent("MouseEvents");ot.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),wt.dispatchEvent(ot)}var kt=function(ot){var xt=ot.keyCode,Zt=ot.ctrlKey,rn=ot.metaKey,nn=ot.target,Ot=ot.type;return(Ot==="paste"||(xt===67||xt===86)&&(rn||Zt))&&nn.nodeName==="TEXTAREA"&&(Te(),ot.preventDefault()),!1};function Tt(wt,ot){var xt=window.URL||window.webkitURL||window,Zt=new Blob([ot]),rn=document.createElementNS("http://www.w3.org/1999/xhtml","a");rn.href=xt.createObjectURL(Zt),rn.download=wt,Ye(rn)}Object(x.useEffect)(function(){rt()},[rt]),Object(x.useEffect)(function(){Me.current&&!M&&w.e(27).then(w.t.bind(null,"M/lh",7)).then(function(wt){try{Ee=wt,et.current.instance=Ee.editor.create(Me.current,{value:ie,language:Ne(B),theme:Fe,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ae);var ot=et.current.instance,xt=v.c._menuItems,Zt=Object(fe.a)(xt).find(function(nn){return nn[0]._debugName=="EditorContext"});if(ke(ot,Ee),setTimeout(function(){rt(),et.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Tt(Ge||"educoder.txt",ot.getValue())}}),ot.getDomNode().addEventListener("input",function(){ht.current.autoFormat&&ot.getAction("editor.action.formatDocument").run()})},500),et.current.subscription=ot.onDidChangeModelContent(function(nn){debugger;se.current?clearTimeout(te.current):(rt(),K(ot.getValue(),nn)),te.current=setTimeout(function(){se.current=!1},500)}),window.Monaco||k(Ee,Ne(B)),q&&(Me.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",kt),window.removeEventListener("paste",kt),window.addEventListener("keydown",kt),window.addEventListener("paste",kt)),window.Monaco=Ee,Le&&ot.onDidBlurEditorWidget(function(){Le(ot.getValue())}),_&&ot.onDidFocusEditorText(function(){_(ot.getValue())}),q)try{window.addEventListener("paste",We)}catch(nn){}var rn=Y();return X(!0),function(){var nn=et.current.instance;nn.dispose();var Ot=nn.getModel();Ot&&Ot.dispose(),et.current.subscription&&et.current.subscription.dispose(),q&&window.removeEventListener("paste",We),rn.unobserve(Me.current)}}catch(nn){debugger}})},[]),Object(x.useEffect)(function(){var wt=et.current.instance;if(wt&&M)return document.addEventListener("keydown",Je,!1),function(){document.removeEventListener("keydown",Je)}},[Re,M]),Object(x.useEffect)(function(){var wt=et.current.instance;if(wt&&M){var ot=Ne(B);Ee.editor.setModelLanguage(wt.getModel(),ot)}},[B,M]),Object(x.useEffect)(function(){var wt=et.current.instance;wt&&M&&Ee.editor.setTheme(Fe)},[Fe,M]),Object(x.useEffect)(function(){var wt=et.current.instance;ht.current=R,wt&&M&&(wt.updateOptions(Object(Z.a)({},R)),setTimeout(function(){wt.getModel().updateOptions(Object(Z.a)({},R))},200))},[JSON.stringify(R),M]),Object(x.useEffect)(function(){var wt=et.current.instance;wt&&M&&wt.layout()},[be,W,M]);var lt=Object(x.useState)(F(be)),Ht=Object(G.a)(lt,2),Ft=Ht[0],Mt=Ht[1],Pt=Object(x.useState)(F(W)),Rt=Object(G.a)(Pt,2),wn=Rt[0],Qn=Rt[1],bt=Object(Z.a)(Object(Z.a)({},m),{},{width:Ft,height:wn});return b.a.createElement("div",{className:"my-monaco-editor",ref:Me,style:bt})};function Ke(le){var D=le.width,be=D===void 0?"100%":D,ne=le.height,W=ne===void 0?"100%":ne,ie=le.original,U=le.modified,B=le.language,N=le.options,m=N===void 0?{}:N,d=Object(x.useRef)(),R=Object(x.useState)(null),V=Object(G.a)(R,2),ae=V[0],_e=V[1];function Fe(Se){var ue;return d.current&&(ue=new T.default(function(q){var L=Object($.a)(q),K;try{for(L.s();!(K=L.n()).done;){var j=K.value;(j.target.offsetHeight>0||j.target.offsetWidth>0)&&Se.layout()}}catch(ke){L.e(ke)}finally{L.f()}}),ue.observe(d.current)),ue}Object(x.useEffect)(function(){return d.current&&w.e(27).then(w.t.bind(null,"M/lh",7)).then(function(Se){Ee=Se;var ue=Ee.editor.createDiffEditor(d.current,Object(Z.a)(Object(Z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},m),{},{wordWrap:!0}));_e(ue);var q=Fe(ue);return function(){ue.dispose();var L=ue.getModel();L&&L.dispose(),q.unobserve(d.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(x.useEffect)(function(){ae&&ae.setModel({original:Ee.editor.createModel(ie,B),modified:Ee.editor.createModel(U,B)})},[ie,U,B,ae]);var Le=F(be),Re=F(W),Ae={width:Le,height:Re};return b.a.createElement("div",{className:"my-diff-editor",ref:d,style:Ae})}},ZpRC:function(gt,pe,w){"use strict";function Z(x){return typeof x=="object"&&x!=null&&x.nodeType===1}function fe(x,b){return(!b||x!=="hidden")&&x!=="visible"&&x!=="clip"}function he(x,b){if(x.clientHeight<x.scrollHeight||x.clientWidth<x.scrollWidth){var T=getComputedStyle(x,null);return fe(T.overflowY,b)||fe(T.overflowX,b)||function(E){var k=function(I){if(!I.ownerDocument||!I.ownerDocument.defaultView)return null;try{return I.ownerDocument.defaultView.frameElement}catch(v){return null}}(E);return!!k&&(k.clientHeight<E.scrollHeight||k.clientWidth<E.scrollWidth)}(x)}return!1}function we(x,b,T,E,k,I,v,y){return I<x&&v>b||I>x&&v<b?0:I<=x&&y<=T||v>=b&&y>=T?I-x-E:v>b&&y<T||I<x&&y>T?v-b+k:0}var ve=function(x,b){var T=window,E=b.scrollMode,k=b.block,I=b.inline,v=b.boundary,y=b.skipOverflowHiddenElements,A=typeof v=="function"?v:function(Ce){return Ce!==v};if(!Z(x))throw new TypeError("Invalid target");for(var F=document.scrollingElement||document.documentElement,me=[],ce=x;Z(ce)&&A(ce);){if((ce=ce.parentElement)===F){me.push(ce);break}ce!=null&&ce===document.body&&he(ce)&&!he(document.documentElement)||ce!=null&&he(ce,y)&&me.push(ce)}for(var ye=T.visualViewport?T.visualViewport.width:innerWidth,Ne=T.visualViewport?T.visualViewport.height:innerHeight,Ee=window.scrollX||pageXOffset,De=window.scrollY||pageYOffset,Ke=x.getBoundingClientRect(),le=Ke.height,D=Ke.width,be=Ke.top,ne=Ke.right,W=Ke.bottom,ie=Ke.left,U=k==="start"||k==="nearest"?be:k==="end"?W:be+le/2,B=I==="center"?ie+D/2:I==="end"?ne:ie,N=[],m=0;m<me.length;m++){var d=me[m],R=d.getBoundingClientRect(),V=R.height,ae=R.width,_e=R.top,Fe=R.right,Le=R.bottom,Re=R.left;if(E==="if-needed"&&be>=0&&ie>=0&&W<=Ne&&ne<=ye&&be>=_e&&W<=Le&&ie>=Re&&ne<=Fe)return N;var Ae=getComputedStyle(d),Se=parseInt(Ae.borderLeftWidth,10),ue=parseInt(Ae.borderTopWidth,10),q=parseInt(Ae.borderRightWidth,10),L=parseInt(Ae.borderBottomWidth,10),K=0,j=0,ke="offsetWidth"in d?d.offsetWidth-d.clientWidth-Se-q:0,P="offsetHeight"in d?d.offsetHeight-d.clientHeight-ue-L:0;if(F===d)K=k==="start"?U:k==="end"?U-Ne:k==="nearest"?we(De,De+Ne,Ne,ue,L,De+U,De+U+le,le):U-Ne/2,j=I==="start"?B:I==="center"?B-ye/2:I==="end"?B-ye:we(Ee,Ee+ye,ye,Se,q,Ee+B,Ee+B+D,D),K=Math.max(0,K+De),j=Math.max(0,j+Ee);else{K=k==="start"?U-_e-ue:k==="end"?U-Le+L+P:k==="nearest"?we(_e,Le,V,ue,L+P,U,U+le,le):U-(_e+V/2)+P/2,j=I==="start"?B-Re-Se:I==="center"?B-(Re+ae/2)+ke/2:I==="end"?B-Fe+q+ke:we(Re,Fe,ae,Se,q+ke,B,B+D,D);var _=d.scrollLeft,re=d.scrollTop;U+=re-(K=Math.max(0,Math.min(re+K,d.scrollHeight-V+P))),B+=_-(j=Math.max(0,Math.min(_+j,d.scrollWidth-ae+ke)))}N.push({el:d,top:K,left:j})}return N};function $(x){return x===Object(x)&&Object.keys(x).length!==0}function G(x,b){b===void 0&&(b="auto");var T="scrollBehavior"in document.body.style;x.forEach(function(E){var k=E.el,I=E.top,v=E.left;k.scroll&&T?k.scroll({top:I,left:v,behavior:b}):(k.scrollTop=I,k.scrollLeft=v)})}function Q(x){return x===!1?{block:"end",inline:"nearest"}:$(x)?x:{block:"start",inline:"nearest"}}function H(x,b){var T=!x.ownerDocument.documentElement.contains(x);if($(b)&&typeof b.behavior=="function")return b.behavior(T?[]:ve(x,b));if(T)return;var E=Q(b);return G(ve(x,E),E.behavior)}var O=pe.a=H},Zss7:function(gt,pe,w){var Z;(function(fe){var he=/^\s+/,we=/\s+$/,ve=0,$=fe.round,G=fe.min,Q=fe.max,H=fe.random;function O(L,K){if(L=L||"",K=K||{},L instanceof O)return L;if(!(this instanceof O))return new O(L,K);var j=x(L);this._originalInput=L,this._r=j.r,this._g=j.g,this._b=j.b,this._a=j.a,this._roundA=$(100*this._a)/100,this._format=K.format||j.format,this._gradientType=K.gradientType,this._r<1&&(this._r=$(this._r)),this._g<1&&(this._g=$(this._g)),this._b<1&&(this._b=$(this._b)),this._ok=j.ok,this._tc_id=ve++}O.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var L=this.toRgb();return(L.r*299+L.g*587+L.b*114)/1e3},getLuminance:function(){var L=this.toRgb(),K,j,ke,P,_,re;return K=L.r/255,j=L.g/255,ke=L.b/255,K<=.03928?P=K/12.92:P=fe.pow((K+.055)/1.055,2.4),j<=.03928?_=j/12.92:_=fe.pow((j+.055)/1.055,2.4),ke<=.03928?re=ke/12.92:re=fe.pow((ke+.055)/1.055,2.4),.2126*P+.7152*_+.0722*re},setAlpha:function(L){return this._a=N(L),this._roundA=$(100*this._a)/100,this},toHsv:function(){var L=k(this._r,this._g,this._b);return{h:L.h*360,s:L.s,v:L.v,a:this._a}},toHsvString:function(){var L=k(this._r,this._g,this._b),K=$(L.h*360),j=$(L.s*100),ke=$(L.v*100);return this._a==1?"hsv("+K+", "+j+"%, "+ke+"%)":"hsva("+K+", "+j+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var L=T(this._r,this._g,this._b);return{h:L.h*360,s:L.s,l:L.l,a:this._a}},toHslString:function(){var L=T(this._r,this._g,this._b),K=$(L.h*360),j=$(L.s*100),ke=$(L.l*100);return this._a==1?"hsl("+K+", "+j+"%, "+ke+"%)":"hsla("+K+", "+j+"%, "+ke+"%, "+this._roundA+")"},toHex:function(L){return v(this._r,this._g,this._b,L)},toHexString:function(L){return"#"+this.toHex(L)},toHex8:function(L){return y(this._r,this._g,this._b,this._a,L)},toHex8String:function(L){return"#"+this.toHex8(L)},toRgb:function(){return{r:$(this._r),g:$(this._g),b:$(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+$(this._r)+", "+$(this._g)+", "+$(this._b)+")":"rgba("+$(this._r)+", "+$(this._g)+", "+$(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:$(m(this._r,255)*100)+"%",g:$(m(this._g,255)*100)+"%",b:$(m(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+$(m(this._r,255)*100)+"%, "+$(m(this._g,255)*100)+"%, "+$(m(this._b,255)*100)+"%)":"rgba("+$(m(this._r,255)*100)+"%, "+$(m(this._g,255)*100)+"%, "+$(m(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(L){var K="#"+A(this._r,this._g,this._b,this._a),j=K,ke=this._gradientType?"GradientType = 1, ":"";if(L){var P=O(L);j="#"+A(P._r,P._g,P._b,P._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+K+",endColorstr="+j+")"},toString:function(L){var K=!!L;L=L||this._format;var j=!1,ke=this._a<1&&this._a>=0,P=!K&&ke&&(L==="hex"||L==="hex6"||L==="hex3"||L==="hex4"||L==="hex8"||L==="name");return P?L==="name"&&this._a===0?this.toName():this.toRgbString():(L==="rgb"&&(j=this.toRgbString()),L==="prgb"&&(j=this.toPercentageRgbString()),(L==="hex"||L==="hex6")&&(j=this.toHexString()),L==="hex3"&&(j=this.toHexString(!0)),L==="hex4"&&(j=this.toHex8String(!0)),L==="hex8"&&(j=this.toHex8String()),L==="name"&&(j=this.toName()),L==="hsl"&&(j=this.toHslString()),L==="hsv"&&(j=this.toHsvString()),j||this.toHexString())},clone:function(){return O(this.toString())},_applyModification:function(L,K){var j=L.apply(null,[this].concat([].slice.call(K)));return this._r=j._r,this._g=j._g,this._b=j._b,this.setAlpha(j._a),this},lighten:function(){return this._applyModification(ye,arguments)},brighten:function(){return this._applyModification(Ne,arguments)},darken:function(){return this._applyModification(Ee,arguments)},desaturate:function(){return this._applyModification(F,arguments)},saturate:function(){return this._applyModification(me,arguments)},greyscale:function(){return this._applyModification(ce,arguments)},spin:function(){return this._applyModification(De,arguments)},_applyCombination:function(L,K){return L.apply(null,[this].concat([].slice.call(K)))},analogous:function(){return this._applyCombination(ne,arguments)},complement:function(){return this._applyCombination(Ke,arguments)},monochromatic:function(){return this._applyCombination(W,arguments)},splitcomplement:function(){return this._applyCombination(be,arguments)},triad:function(){return this._applyCombination(le,arguments)},tetrad:function(){return this._applyCombination(D,arguments)}},O.fromRatio=function(L,K){if(typeof L=="object"){var j={};for(var ke in L)L.hasOwnProperty(ke)&&(ke==="a"?j[ke]=L[ke]:j[ke]=Fe(L[ke]));L=j}return O(L,K)};function x(L){var K={r:0,g:0,b:0},j=1,ke=null,P=null,_=null,re=!1,Ce=!1;return typeof L=="string"&&(L=ue(L)),typeof L=="object"&&(Se(L.r)&&Se(L.g)&&Se(L.b)?(K=b(L.r,L.g,L.b),re=!0,Ce=String(L.r).substr(-1)==="%"?"prgb":"rgb"):Se(L.h)&&Se(L.s)&&Se(L.v)?(ke=Fe(L.s),P=Fe(L.v),K=I(L.h,ke,P),re=!0,Ce="hsv"):Se(L.h)&&Se(L.s)&&Se(L.l)&&(ke=Fe(L.s),_=Fe(L.l),K=E(L.h,ke,_),re=!0,Ce="hsl"),L.hasOwnProperty("a")&&(j=L.a)),j=N(j),{ok:re,format:L.format||Ce,r:G(255,Q(K.r,0)),g:G(255,Q(K.g,0)),b:G(255,Q(K.b,0)),a:j}}function b(L,K,j){return{r:m(L,255)*255,g:m(K,255)*255,b:m(j,255)*255}}function T(L,K,j){L=m(L,255),K=m(K,255),j=m(j,255);var ke=Q(L,K,j),P=G(L,K,j),_,re,Ce=(ke+P)/2;if(ke==P)_=re=0;else{var Pe=ke-P;re=Ce>.5?Pe/(2-ke-P):Pe/(ke+P);switch(ke){case L:_=(K-j)/Pe+(K<j?6:0);break;case K:_=(j-L)/Pe+2;break;case j:_=(L-K)/Pe+4;break}_/=6}return{h:_,s:re,l:Ce}}function E(L,K,j){var ke,P,_;L=m(L,360),K=m(K,100),j=m(j,100);function re(Oe,He,Ge){return Ge<0&&(Ge+=1),Ge>1&&(Ge-=1),Ge<1/6?Oe+(He-Oe)*6*Ge:Ge<1/2?He:Ge<2/3?Oe+(He-Oe)*(2/3-Ge)*6:Oe}if(K===0)ke=P=_=j;else{var Ce=j<.5?j*(1+K):j+K-j*K,Pe=2*j-Ce;ke=re(Pe,Ce,L+1/3),P=re(Pe,Ce,L),_=re(Pe,Ce,L-1/3)}return{r:ke*255,g:P*255,b:_*255}}function k(L,K,j){L=m(L,255),K=m(K,255),j=m(j,255);var ke=Q(L,K,j),P=G(L,K,j),_,re,Ce=ke,Pe=ke-P;if(re=ke===0?0:Pe/ke,ke==P)_=0;else{switch(ke){case L:_=(K-j)/Pe+(K<j?6:0);break;case K:_=(j-L)/Pe+2;break;case j:_=(L-K)/Pe+4;break}_/=6}return{h:_,s:re,v:Ce}}function I(L,K,j){L=m(L,360)*6,K=m(K,100),j=m(j,100);var ke=fe.floor(L),P=L-ke,_=j*(1-K),re=j*(1-P*K),Ce=j*(1-(1-P)*K),Pe=ke%6,Oe=[j,re,_,_,Ce,j][Pe],He=[Ce,j,j,re,_,_][Pe],Ge=[_,_,Ce,j,j,re][Pe];return{r:Oe*255,g:He*255,b:Ge*255}}function v(L,K,j,ke){var P=[_e($(L).toString(16)),_e($(K).toString(16)),_e($(j).toString(16))];return ke&&P[0].charAt(0)==P[0].charAt(1)&&P[1].charAt(0)==P[1].charAt(1)&&P[2].charAt(0)==P[2].charAt(1)?P[0].charAt(0)+P[1].charAt(0)+P[2].charAt(0):P.join("")}function y(L,K,j,ke,P){var _=[_e($(L).toString(16)),_e($(K).toString(16)),_e($(j).toString(16)),_e(Le(ke))];return P&&_[0].charAt(0)==_[0].charAt(1)&&_[1].charAt(0)==_[1].charAt(1)&&_[2].charAt(0)==_[2].charAt(1)&&_[3].charAt(0)==_[3].charAt(1)?_[0].charAt(0)+_[1].charAt(0)+_[2].charAt(0)+_[3].charAt(0):_.join("")}function A(L,K,j,ke){var P=[_e(Le(ke)),_e($(L).toString(16)),_e($(K).toString(16)),_e($(j).toString(16))];return P.join("")}O.equals=function(L,K){return!L||!K?!1:O(L).toRgbString()==O(K).toRgbString()},O.random=function(){return O.fromRatio({r:H(),g:H(),b:H()})};function F(L,K){K=K===0?0:K||10;var j=O(L).toHsl();return j.s-=K/100,j.s=d(j.s),O(j)}function me(L,K){K=K===0?0:K||10;var j=O(L).toHsl();return j.s+=K/100,j.s=d(j.s),O(j)}function ce(L){return O(L).desaturate(100)}function ye(L,K){K=K===0?0:K||10;var j=O(L).toHsl();return j.l+=K/100,j.l=d(j.l),O(j)}function Ne(L,K){K=K===0?0:K||10;var j=O(L).toRgb();return j.r=Q(0,G(255,j.r-$(255*-(K/100)))),j.g=Q(0,G(255,j.g-$(255*-(K/100)))),j.b=Q(0,G(255,j.b-$(255*-(K/100)))),O(j)}function Ee(L,K){K=K===0?0:K||10;var j=O(L).toHsl();return j.l-=K/100,j.l=d(j.l),O(j)}function De(L,K){var j=O(L).toHsl(),ke=(j.h+K)%360;return j.h=ke<0?360+ke:ke,O(j)}function Ke(L){var K=O(L).toHsl();return K.h=(K.h+180)%360,O(K)}function le(L){var K=O(L).toHsl(),j=K.h;return[O(L),O({h:(j+120)%360,s:K.s,l:K.l}),O({h:(j+240)%360,s:K.s,l:K.l})]}function D(L){var K=O(L).toHsl(),j=K.h;return[O(L),O({h:(j+90)%360,s:K.s,l:K.l}),O({h:(j+180)%360,s:K.s,l:K.l}),O({h:(j+270)%360,s:K.s,l:K.l})]}function be(L){var K=O(L).toHsl(),j=K.h;return[O(L),O({h:(j+72)%360,s:K.s,l:K.l}),O({h:(j+216)%360,s:K.s,l:K.l})]}function ne(L,K,j){K=K||6,j=j||30;var ke=O(L).toHsl(),P=360/j,_=[O(L)];for(ke.h=(ke.h-(P*K>>1)+720)%360;--K;)ke.h=(ke.h+P)%360,_.push(O(ke));return _}function W(L,K){K=K||6;for(var j=O(L).toHsv(),ke=j.h,P=j.s,_=j.v,re=[],Ce=1/K;K--;)re.push(O({h:ke,s:P,v:_})),_=(_+Ce)%1;return re}O.mix=function(L,K,j){j=j===0?0:j||50;var ke=O(L).toRgb(),P=O(K).toRgb(),_=j/100,re={r:(P.r-ke.r)*_+ke.r,g:(P.g-ke.g)*_+ke.g,b:(P.b-ke.b)*_+ke.b,a:(P.a-ke.a)*_+ke.a};return O(re)},O.readability=function(L,K){var j=O(L),ke=O(K);return(fe.max(j.getLuminance(),ke.getLuminance())+.05)/(fe.min(j.getLuminance(),ke.getLuminance())+.05)},O.isReadable=function(L,K,j){var ke=O.readability(L,K),P,_;_=!1,P=q(j);switch(P.level+P.size){case"AAsmall":case"AAAlarge":_=ke>=4.5;break;case"AAlarge":_=ke>=3;break;case"AAAsmall":_=ke>=7;break}return _},O.mostReadable=function(L,K,j){var ke=null,P=0,_,re,Ce,Pe;j=j||{},re=j.includeFallbackColors,Ce=j.level,Pe=j.size;for(var Oe=0;Oe<K.length;Oe++)_=O.readability(L,K[Oe]),_>P&&(P=_,ke=O(K[Oe]));return O.isReadable(L,ke,{level:Ce,size:Pe})||!re?ke:(j.includeFallbackColors=!1,O.mostReadable(L,["#fff","#000"],j))};var ie=O.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=O.hexNames=B(ie);function B(L){var K={};for(var j in L)L.hasOwnProperty(j)&&(K[L[j]]=j);return K}function N(L){return L=parseFloat(L),(isNaN(L)||L<0||L>1)&&(L=1),L}function m(L,K){V(L)&&(L="100%");var j=ae(L);return L=G(K,Q(0,parseFloat(L))),j&&(L=parseInt(L*K,10)/100),fe.abs(L-K)<1e-6?1:L%K/parseFloat(K)}function d(L){return G(1,Q(0,L))}function R(L){return parseInt(L,16)}function V(L){return typeof L=="string"&&L.indexOf(".")!=-1&&parseFloat(L)===1}function ae(L){return typeof L=="string"&&L.indexOf("%")!=-1}function _e(L){return L.length==1?"0"+L:""+L}function Fe(L){return L<=1&&(L=L*100+"%"),L}function Le(L){return fe.round(parseFloat(L)*255).toString(16)}function Re(L){return R(L)/255}var Ae=function(){var L="[-\\+]?\\d+%?",K="[-\\+]?\\d*\\.\\d+%?",j="(?:"+K+")|(?:"+L+")",ke="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",P="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?";return{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+P),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+P),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+P),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Se(L){return!!Ae.CSS_UNIT.exec(L)}function ue(L){L=L.replace(he,"").replace(we,"").toLowerCase();var K=!1;if(ie[L])L=ie[L],K=!0;else if(L=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var j;return(j=Ae.rgb.exec(L))?{r:j[1],g:j[2],b:j[3]}:(j=Ae.rgba.exec(L))?{r:j[1],g:j[2],b:j[3],a:j[4]}:(j=Ae.hsl.exec(L))?{h:j[1],s:j[2],l:j[3]}:(j=Ae.hsla.exec(L))?{h:j[1],s:j[2],l:j[3],a:j[4]}:(j=Ae.hsv.exec(L))?{h:j[1],s:j[2],v:j[3]}:(j=Ae.hsva.exec(L))?{h:j[1],s:j[2],v:j[3],a:j[4]}:(j=Ae.hex8.exec(L))?{r:R(j[1]),g:R(j[2]),b:R(j[3]),a:Re(j[4]),format:K?"name":"hex8"}:(j=Ae.hex6.exec(L))?{r:R(j[1]),g:R(j[2]),b:R(j[3]),format:K?"name":"hex"}:(j=Ae.hex4.exec(L))?{r:R(j[1]+""+j[1]),g:R(j[2]+""+j[2]),b:R(j[3]+""+j[3]),a:Re(j[4]+""+j[4]),format:K?"name":"hex8"}:(j=Ae.hex3.exec(L))?{r:R(j[1]+""+j[1]),g:R(j[2]+""+j[2]),b:R(j[3]+""+j[3]),format:K?"name":"hex"}:!1}function q(L){var K,j;return L=L||{level:"AA",size:"small"},K=(L.level||"AA").toUpperCase(),j=(L.size||"small").toLowerCase(),K!=="AA"&&K!=="AAA"&&(K="AA"),j!=="small"&&j!=="large"&&(j="small"),{level:K,size:j}}gt.exports?gt.exports=O:!(Z=function(){return O}.call(pe,w,pe,gt),Z!==void 0&&(gt.exports=Z))})(Math)},bT9E:function(gt,pe,w){"use strict";w.d(pe,"a",function(){return fe});var Z=w("VTBJ");function fe(he,we){var ve=Object(Z.a)({},he);return Array.isArray(we)&&we.forEach(function($){delete ve[$]}),ve}},c5Ni:function(gt,pe,w){},dejd:function(gt,pe,w){},dmUQ:function(gt,pe,w){"use strict";var Z=w("Ff2n"),fe=w("rePB"),he=w("1OyB"),we=w("vuIU"),ve=w("Ji7U"),$=w("md7G"),G=w("foSv"),Q=w("q1tI"),H=w.n(Q),O=w("TSYQ"),x=w.n(O),b=w("4IlW");function T(le,D){var be=Object.keys(le);if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(le);D&&(ne=ne.filter(function(W){return Object.getOwnPropertyDescriptor(le,W).enumerable})),be.push.apply(be,ne)}return be}function E(le){for(var D=1;D<arguments.length;D++){var be=arguments[D]!=null?arguments[D]:{};D%2?T(Object(be),!0).forEach(function(ne){Object(fe.a)(le,ne,be[ne])}):Object.getOwnPropertyDescriptors?Object.defineProperties(le,Object.getOwnPropertyDescriptors(be)):T(Object(be)).forEach(function(ne){Object.defineProperty(le,ne,Object.getOwnPropertyDescriptor(be,ne))})}return le}function k(le){var D=I();return function(){var ne=Object(G.a)(le),W;if(D){var ie=Object(G.a)(this).constructor;W=Reflect.construct(ne,arguments,ie)}else W=ne.apply(this,arguments);return Object($.a)(this,W)}}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(le){return!1}}function v(){}function y(le){le.preventDefault()}var A=function(D){return D.replace(/[^\w.-]+/g,"")},F=200,me=600,ce=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ye=function(D){return D!=null},Ne=function(D,be){return be===D||typeof be=="number"&&typeof D=="number"&&isNaN(be)&&isNaN(D)},Ee=function(le){Object(ve.a)(be,le);var D=k(be);function be(ne){var W;Object(he.a)(this,be),W=D.call(this,ne),W.onKeyDown=function(B){var N=W.props,m=N.onKeyDown,d=N.onPressEnter;if(B.keyCode===b.a.UP){var R=W.getRatio(B);W.up(B,R,null),W.stop()}else if(B.keyCode===b.a.DOWN){var V=W.getRatio(B);W.down(B,V,null),W.stop()}else B.keyCode===b.a.ENTER&&d&&d(B);if(W.recordCursorPosition(),W.lastKeyCode=B.keyCode,m){for(var ae=arguments.length,_e=new Array(ae>1?ae-1:0),Fe=1;Fe<ae;Fe++)_e[Fe-1]=arguments[Fe];m.apply(void 0,[B].concat(_e))}},W.onKeyUp=function(B){var N=W.props.onKeyUp;if(W.stop(),W.recordCursorPosition(),N){for(var m=arguments.length,d=new Array(m>1?m-1:0),R=1;R<m;R++)d[R-1]=arguments[R];N.apply(void 0,[B].concat(d))}},W.onChange=function(B){var N=W.props.onChange;W.state.focused&&(W.inputting=!0),W.rawInput=W.props.parser(W.getValueFromEvent(B)),W.setState({inputValue:W.rawInput}),N(W.toNumber(W.rawInput))},W.onMouseUp=function(){var B=W.props.onMouseUp;W.recordCursorPosition(),B&&B.apply(void 0,arguments)},W.onFocus=function(){var B;W.setState({focused:!0}),(B=W.props).onFocus.apply(B,arguments)},W.onBlur=function(){var B=W.props.onBlur;W.inputting=!1,W.setState({focused:!1});var N=W.getCurrentValidValue(W.state.inputValue),m=W.setValue(N,v);if(B){var d=W.input.value,R=W.getInputDisplayValue({focus:!1,value:m});W.input.value=R&&Number(R),B.apply(void 0,arguments),W.input.value=d}},W.getRatio=function(B){var N=1;return B.metaKey||B.ctrlKey?N=.1:B.shiftKey&&(N=10),N},W.getFullNum=function(B){return isNaN(B)?B:/e/i.test(String(B))?Number(B).toFixed(18).replace(/\.?0+$/,""):B},W.getPrecision=function(B){if(ye(W.props.precision))return W.props.precision;var N=String(B);if(N.indexOf("e-")>=0)return parseInt(N.slice(N.indexOf("e-")+2),10);var m=0;return N.indexOf(".")>=0&&(m=N.length-N.indexOf(".")-1),m},W.getInputDisplayValue=function(B){var N=B||W.state,m=N.focused,d=N.inputValue,R=N.value,V;m?V=d:V=W.toPrecisionAsStep(R),V==null&&(V="");var ae=W.formatWrapper(V);return ye(W.props.decimalSeparator)&&(ae=ae.toString().replace(".",W.props.decimalSeparator)),ae},W.recordCursorPosition=function(){try{W.cursorStart=W.input.selectionStart,W.cursorEnd=W.input.selectionEnd,W.currentValue=W.input.value,W.cursorBefore=W.input.value.substring(0,W.cursorStart),W.cursorAfter=W.input.value.substring(W.cursorEnd)}catch(B){}},W.restoreByAfter=function(B){if(B===void 0)return!1;var N=W.input.value,m=N.lastIndexOf(B);if(m===-1)return!1;var d=W.cursorBefore.length;return W.lastKeyCode===b.a.DELETE&&W.cursorBefore.charAt(d-1)===B[0]?(W.fixCaret(d,d),!0):m+B.length===N.length?(W.fixCaret(m,m),!0):!1},W.partRestoreByAfter=function(B){return B===void 0?!1:Array.prototype.some.call(B,function(N,m){var d=B.substring(m);return W.restoreByAfter(d)})},W.isNotCompleteNumber=function(B){return isNaN(B)||B===""||B===null||B&&B.toString().indexOf(".")===B.toString().length-1},W.stop=function(){W.autoStepTimer&&clearTimeout(W.autoStepTimer)},W.down=function(B,N,m){W.pressingUpOrDown=!0,W.step("down",B,N,m)},W.up=function(B,N,m){W.pressingUpOrDown=!0,W.step("up",B,N,m)},W.saveInput=function(B){W.input=B};var ie=ne.value;ie===void 0&&(ie=ne.defaultValue),W.state={focused:ne.autoFocus};var U=W.getValidValue(W.toNumber(ie));return W.state=E(E({},W.state),{},{inputValue:W.toPrecisionAsStep(U),value:U}),W}return Object(we.a)(be,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(W){var ie=this.props,U=ie.value,B=ie.onChange,N=ie.max,m=ie.min,d=this.state.focused;if(W){if(!Ne(W.value,U)||!Ne(W.max,N)||!Ne(W.min,m)){var R=d?U:this.getValidValue(U),V;this.pressingUpOrDown?V=R:this.inputting?V=this.rawInput:V=this.toPrecisionAsStep(R),this.setState({value:R,inputValue:V})}var ae="value"in this.props?U:this.state.value;"max"in this.props&&W.max!==N&&typeof ae=="number"&&ae>N&&B&&B(N),"min"in this.props&&W.min!==m&&typeof ae=="number"&&ae<m&&B&&B(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var _e=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===b.a.BACKSPACE?_e=this.cursorStart-1:this.lastKeyCode===b.a.DELETE&&(_e=this.cursorStart):_e=this.input.value.length,this.fixCaret(_e,_e)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case b.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case b.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Fe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(W){var ie=W;return ie===""?ie="":this.isNotCompleteNumber(parseFloat(ie))?ie=this.state.value:ie=this.getValidValue(ie),this.toNumber(ie)}},{key:"getValueFromEvent",value:function(W){var ie=W.target.value.trim().replace(/。/g,".");return ye(this.props.decimalSeparator)&&(ie=ie.replace(this.props.decimalSeparator,".")),ie}},{key:"getValidValue",value:function(W){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,B=parseFloat(W);return isNaN(B)?W:(B<ie&&(B=ie),B>U&&(B=U),B)}},{key:"setValue",value:function(W,ie){var U=this.props.precision,B=this.isNotCompleteNumber(parseFloat(W))?null:parseFloat(W),N=this.state.value,m=N===void 0?null:N,d=this.state.inputValue,R=d===void 0?null:d,V=typeof B=="number"?B.toFixed(U):"".concat(B),ae=B!==m||V!=="".concat(R);return"value"in this.props?(R=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:R},ie)):this.setState({value:B,inputValue:this.toPrecisionAsStep(W)},ie),ae&&this.props.onChange(B),B}},{key:"getMaxPrecision",value:function(W){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,B=U.precision,N=U.step;if(ye(B))return B;var m=this.getPrecision(ie),d=this.getPrecision(N),R=this.getPrecision(W);return W?Math.max(R,m+d):m+d}},{key:"getPrecisionFactor",value:function(W){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(W,ie);return Math.pow(10,U)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(W){return this.props.formatter?this.props.formatter(W):W}},{key:"toPrecisionAsStep",value:function(W){if(this.isNotCompleteNumber(W)||W==="")return W;var ie=Math.abs(this.getMaxPrecision(W));return isNaN(ie)?W.toString():Number(W).toFixed(ie)}},{key:"toNumber",value:function(W){var ie=this.props.precision,U=this.state.focused,B=W&&W.length>16&&U;return this.isNotCompleteNumber(W)||B?W:ye(ie)?Math.round(W*Math.pow(10,ie))/Math.pow(10,ie):Number(W)}},{key:"upStep",value:function(W,ie){var U=this.props.step,B=this.getPrecisionFactor(W,ie),N=Math.abs(this.getMaxPrecision(W,ie)),m=((B*W+B*U*ie)/B).toFixed(N);return this.toNumber(m)}},{key:"downStep",value:function(W,ie){var U=this.props.step,B=this.getPrecisionFactor(W,ie),N=Math.abs(this.getMaxPrecision(W,ie)),m=((B*W-B*U*ie)/B).toFixed(N);return this.toNumber(m)}},{key:"step",value:function(W,ie){var U=this,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=arguments.length>3?arguments[3]:void 0;this.stop(),ie&&(ie.persist(),ie.preventDefault());var m=this.props;if(m.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var R=this["".concat(W,"Step")](d,B),V=R>m.max||R<m.min;if(R>m.max?R=m.max:R<m.min&&(R=m.min),this.setValue(R,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),V)return;this.autoStepTimer=setTimeout(function(){U[W](ie,B,!0)},N?F:me)}},{key:"fixCaret",value:function(W,ie){if(W===void 0||ie===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,B=this.input.selectionEnd;(W!==U||ie!==B)&&this.input.setSelectionRange(W,ie)}catch(N){}}},{key:"render",value:function(){var W,ie=this.props,U=ie.prefixCls,B=ie.disabled,N=ie.readOnly,m=ie.useTouch,d=ie.autoComplete,R=ie.upHandler,V=ie.downHandler,ae=ie.className,_e=ie.max,Fe=ie.min,Le=ie.style,Re=ie.title,Ae=ie.onMouseEnter,Se=ie.onMouseLeave,ue=ie.onMouseOver,q=ie.onMouseOut,L=ie.required,K=ie.onClick,j=ie.tabIndex,ke=ie.type,P=ie.placeholder,_=ie.id,re=ie.inputMode,Ce=ie.pattern,Pe=ie.step,Oe=ie.maxLength,He=ie.autoFocus,Ge=ie.name,ut=ie.onPaste,Ze=ie.onInput,it=Object(Z.a)(ie,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Qe=this.state,yt=Qe.value,ct=Qe.focused,dt=x()(U,(W={},Object(fe.a)(W,ae,!!ae),Object(fe.a)(W,"".concat(U,"-disabled"),B),Object(fe.a)(W,"".concat(U,"-focused"),ct),W)),Me={};Object.keys(it).forEach(function(Y){(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(Me[Y]=it[Y])});var et=!N&&!B,ht=this.getInputDisplayValue(null),je=(yt||yt===0)&&(isNaN(yt)||Number(yt)>=_e),Xe=(yt||yt===0)&&(isNaN(yt)||Number(yt)<=Fe),se=je||B||N,te=Xe||B||N,oe=x()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(fe.a)({},"".concat(U,"-handler-up-disabled"),se)),S=x()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(fe.a)({},"".concat(U,"-handler-down-disabled"),te)),M=m?{onTouchStart:se?v:this.up,onTouchEnd:this.stop}:{onMouseDown:se?v:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},X=m?{onTouchStart:te?v:this.down,onTouchEnd:this.stop}:{onMouseDown:te?v:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return H.a.createElement("div",{className:dt,style:Le,title:Re,onMouseEnter:Ae,onMouseLeave:Se,onMouseOver:ue,onMouseOut:q,onFocus:function(){return null},onBlur:function(){return null}},H.a.createElement("div",{className:"".concat(U,"-handler-wrap")},H.a.createElement("span",Object.assign({unselectable:"on"},M,{role:"button","aria-label":"Increase Value","aria-disabled":se,className:oe}),R||H.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:y})),H.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Decrease Value","aria-disabled":te,className:S}),V||H.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:y}))),H.a.createElement("div",{className:"".concat(U,"-input-wrap")},H.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":_e,"aria-valuenow":yt,required:L,type:ke,placeholder:P,onPaste:ut,onClick:K,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:j,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:et?this.onKeyDown:v,onKeyUp:et?this.onKeyUp:v,autoFocus:He,maxLength:Oe,readOnly:N,disabled:B,max:_e,min:Fe,step:Pe,name:Ge,title:Re,id:_,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ht),pattern:Ce,inputMode:re,onInput:Ze},Me))))}}]),be}(H.a.Component);Ee.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ce,min:-ce,step:1,style:{},onChange:v,onKeyDown:v,onPressEnter:v,onFocus:v,onBlur:v,parser:A,required:!1,autoComplete:"off"};var De=Ee,Ke=pe.a=De},fjLI:function(gt,pe,w){"use strict";w.d(pe,"e",function(){return O}),w.d(pe,"a",function(){return x}),w.d(pe,"c",function(){return b}),w.d(pe,"d",function(){return E}),w.d(pe,"b",function(){return k});var Z=w("8HAY"),fe=w("Cg/j"),he=w("T8No"),we=w("nnTU"),ve=w("MI8n"),$=function(){var I=function(v,y){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,F){A.__proto__=F}||function(A,F){for(var me in F)F.hasOwnProperty(me)&&(A[me]=F[me])},I(v,y)};return function(v,y){I(v,y);function A(){this.constructor=v}v.prototype=y===null?Object.create(y):(A.prototype=y.prototype,new A)}}(),G=function(I,v,y,A){var F=arguments.length,me=F<3?v:A===null?A=Object.getOwnPropertyDescriptor(v,y):A,ce;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")me=Reflect.decorate(I,v,y,A);else for(var ye=I.length-1;ye>=0;ye--)(ce=I[ye])&&(me=(F<3?ce(me):F>3?ce(v,y,me):ce(v,y))||me);return F>3&&me&&Object.defineProperty(v,y,me),me},Q=function(I,v){return function(y,A){v(y,A,I)}},H=function(){for(var I=0,v=0,y=arguments.length;v<y;v++)I+=arguments[v].length;for(var A=Array(I),F=0,v=0;v<y;v++)for(var me=arguments[v],ce=0,ye=me.length;ce<ye;ce++,F++)A[F]=me[ce];return A};function O(I){return I.command!==void 0}var x=Object(fe.c)("menuService"),b=new(function(){function I(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new ve.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return I.prototype.addCommand=function(v){var y=this;return this._commands.set(v.id,v),this._onDidChangeMenu.fire(0),{dispose:function(){y._commands.delete(v.id)&&y._onDidChangeMenu.fire(0)}}},I.prototype.getCommand=function(v){return this._commands.get(v)},I.prototype.getCommands=function(){var v=new Map;return this._commands.forEach(function(y,A){return v.set(A,y)}),v},I.prototype.appendMenuItem=function(v,y){var A=this,F=this._menuItems.get(v);return F?F.push(y):(F=[y],this._menuItems.set(v,F)),this._onDidChangeMenu.fire(v),{dispose:function(){var me=F.indexOf(y);me>=0&&(F.splice(me,1),A._onDidChangeMenu.fire(v))}}},I.prototype.getMenuItems=function(v){var y=(this._menuItems.get(v)||[]).slice(0);return v===0&&this._appendImplicitItems(y),y},I.prototype._appendImplicitItems=function(v){for(var y=new Set,A=v.filter(function(Ee){return O(Ee)}),F=0,me=A;F<me.length;F++){var ce=me[F],ye=ce.command,Ne=ce.alt;y.add(ye.id),Ne&&y.add(Ne.id)}this._commands.forEach(function(Ee,De){y.has(De)||v.push({command:Ee})})},I}()),T=function(I){$(v,I);function v(y,A,F){var me=I.call(this,y,A)||this;return me._commandService=F,me}return v.prototype.run=function(){for(var y,A=[],F=0;F<arguments.length;F++)A[F]=arguments[F];return(y=this._commandService).executeCommand.apply(y,H([this.id],A))},v=G([Q(2,we.b)],v),v}(Z.a),E=function(I){$(v,I);function v(y){var A=this;return typeof y.title=="string"?A=I.call(this,"",y.title,"submenu")||this:A=I.call(this,"",y.title.value,"submenu")||this,A.item=y,A}return v}(Z.a),k=function(I){$(v,I);function v(y,A,F,me,ce){var ye=this;return typeof y.title=="string"?ye=I.call(this,y.id,y.title,ce)||this:ye=I.call(this,y.id,y.title.value,ce)||this,ye._cssClass=void 0,ye._enabled=!y.precondition||me.contextMatchesRules(y.precondition),ye._checked=Boolean(y.toggled&&me.contextMatchesRules(y.toggled)),ye._options=F||{},ye.item=y,ye.alt=A?new v(A,void 0,ye._options,me,ce):void 0,ye}return v.prototype.dispose=function(){this.alt&&this.alt.dispose(),I.prototype.dispose.call(this)},v.prototype.run=function(){for(var y=[],A=0;A<arguments.length;A++)y[A]=arguments[A];var F=[];return this._options.arg&&(F=H(F,[this._options.arg])),this._options.shouldForwardArgs&&(F=H(F,y)),I.prototype.run.apply(this,F)},v=G([Q(3,he.c),Q(4,we.b)],v),v}(T)},gkVt:function(gt,pe,w){"use strict";w.r(pe);var Z=w("DZo9"),fe=w("8z0m"),he=w("+L6B"),we=w("2/Rp"),ve=w("miYZ"),$=w("tsqr"),G=w("9og8"),Q=w("tJVT"),H=w("WmNS"),O=w.n(H),x=w("q1tI"),b=w.n(x),T=w("5NDa"),E=w("5rEg"),k=w("Ot1p"),I=w("ErOA");function v(le){var D=le.setIscreate,be=le.init,ne=le.UpdateItem,W=Object(x.useState)(""),ie=Object(Q.a)(W,2),U=ie[0],B=ie[1],N=Object(x.useState)(""),m=Object(Q.a)(N,2),d=m[0],R=m[1];Object(x.useEffect)(function(){if(!ne)return;B(ne&&ne.name),R(ne&&ne.description)},[ne]);function V(){return ae.apply(this,arguments)}function ae(){return ae=Object(G.a)(O.a.mark(function Le(){var Re;return O.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:if(U){Se.next=3;break}return $.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),Se.abrupt("return");case 3:if(d){Se.next=6;break}return $.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),Se.abrupt("return");case 6:if(!ne){Se.next=9;break}return _e(),Se.abrupt("return");case 9:return Se.next=11,Object(I.a)("/api/hpc_courses.json",{method:"post",body:{name:U,description:d,container_type:window.location.pathname.split("/")[1]}});case 11:Re=Se.sent,Re&&($.b.info("\u521B\u5EFA\u6210\u529F"),D(!1),be("add"));case 13:case"end":return Se.stop()}},Le)})),ae.apply(this,arguments)}function _e(){return Fe.apply(this,arguments)}function Fe(){return Fe=Object(G.a)(O.a.mark(function Le(){var Re;return O.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.next=2,Object(I.a)("/api/hpc_courses/".concat(ne.id,".json"),{method:"put",body:{name:U,description:d,container_type:window.location.pathname.split("/")[1]}});case 2:Re=Se.sent,Re&&($.b.info("\u7F16\u8F91\u6210\u529F"),D(!1),be(""));case 4:case"end":return Se.stop()}},Le)})),Fe.apply(this,arguments)}return b.a.createElement("div",null,b.a.createElement(E.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:U,maxLength:60,addonAfter:String(U.length)+"/60",onChange:function(Re){return B(Re.target.value)}}),b.a.createElement(k.a,{id:"courseContentMD",defaultValue:d,onChange:function(Re){return R(Re)}}),b.a.createElement("div",{className:"clearfix mt30 mb30"},b.a.createElement(we.a,{type:"primary",onClick:function(){return V()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),b.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return D(!1)}},"\u53D6\u6D88")))}var y=v,A=w("9Bee");function F(le){var D=le.CourseItem,be=le.userId,ne=le.init,W=le.ItemUpdate,ie=le.setSee,U=le.UserInfo;function B(){return N.apply(this,arguments)}function N(){return N=Object(G.a)(O.a.mark(function d(){var R;return O.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Object(I.a)("/api/hpc_courses/".concat(D.id,".json"),{method:"delete"});case 2:R=ae.sent,R&&($.b.info("\u5220\u9664\u6210\u529F"),ne("delete"),ie(!1));case 4:case"end":return ae.stop()}},d)})),N.apply(this,arguments)}function m(){W(D)}return b.a.createElement("div",null,be===299635||be===301458||U!=null&&U.admin||U!=null&&U.business?b.a.createElement("div",{style:{textAlign:"right"}},b.a.createElement(we.a,{onClick:function(){return m()}},"\u7F16\u8F91"),b.a.createElement(we.a,{onClick:function(){return B()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,b.a.createElement("h1",null,D==null?void 0:D.name),b.a.createElement(A.a,{value:D==null?void 0:D.description}))}var me=F,ce=w("9ivq"),ye=w("m3rI"),Ne=w("Ty5D"),Ee=w("9kvl");function De(le){var D,be,ne,W,ie,U,B,N,m,d=le.user,R=le.dispatch,V=Object(x.useState)(1),ae=Object(Q.a)(V,2),_e=ae[0],Fe=ae[1],Le=Object(x.useState)(100),Re=Object(Q.a)(Le,2),Ae=Re[0],Se=Re[1],ue=Object(x.useState)([]),q=Object(Q.a)(ue,2),L=q[0],K=q[1],j=Object(x.useState)(!1),ke=Object(Q.a)(j,2),P=ke[0],_=ke[1],re=Object(x.useState)(!1),Ce=Object(Q.a)(re,2),Pe=Ce[0],Oe=Ce[1],He=Object(x.useState)(""),Ge=Object(Q.a)(He,2),ut=Ge[0],Ze=Ge[1],it=Object(x.useState)(""),Qe=Object(Q.a)(it,2),yt=Qe[0],ct=Qe[1],dt=Object(x.useState)(""),Me=Object(Q.a)(dt,2),et=Me[0],ht=Me[1],je=Object(Ne.i)(),Xe=je.itemname,se=Object(x.useState)(""),te=Object(Q.a)(se,2),oe=te[0],S=te[1];Object(x.useEffect)(function(){R({type:"globalSetting/headerToggle",payload:!1}),_e&&M("")},[_e]);function M(Je){return X.apply(this,arguments)}function X(){return X=Object(G.a)(O.a.mark(function Je(rt){var Ye,kt,Tt,lt,Ht;return O.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(I.a)("/api/hpc_courses.json",{method:"get",params:{page:_e,per_page:Ae,container_type:window.location.pathname.split("/")[1]}});case 2:if(Ye=Mt.sent,!Ye){Mt.next=24;break}if(kt=Ye.data.hpc_courses.length,K(Ye.data.hpc_courses),ht(Ye.data.file_url),ct(""),kt){Mt.next=10;break}return Mt.abrupt("return");case 10:if(oe){Mt.next=14;break}Xe?(Ht=0,Ye==null||((Tt=Ye.data)===null||Tt===void 0||((lt=Tt.hpc_courses)===null||lt===void 0))||lt.map(function(Pt,Rt){var wn;(Xe==null?void 0:Xe.toLocaleLowerCase())===(Pt==null||((wn=Pt.name)===null||wn===void 0)?void 0:wn.toLocaleLowerCase())&&(Ht=Rt)}),Ze(Ye.data.hpc_courses[Ht]),Oe(!0),S(Ye.data.hpc_courses[Ht].id),(Xe==null?void 0:Xe.toLocaleLowerCase())==="resources"&&(Ze(Ye.data.hpc_courses.filter(function(Pt){return Pt.id===15})[0]),Oe(!0),S(15))):(Ze(Ye.data.hpc_courses[0]),Oe(!0),S(Ye.data.hpc_courses[0].id)),Mt.next=24;break;case 14:if(!(rt==="delete")){Mt.next=23;break}if(!(kt===0)){Mt.next=18;break}return Oe(!1),Mt.abrupt("return");case 18:Ze(Ye.data.hpc_courses[0]),Oe(!0),S(Ye.data.hpc_courses[0].id),Mt.next=24;break;case 23:rt==="add"?(Ze(Ye.data.hpc_courses[kt-1]),Oe(!0),S(Ye.data.hpc_courses[kt-1].id)):(Ze(Ye.data.hpc_courses.filter(function(Pt){return Pt.id===oe})[0]),Oe(!0),S(oe));case 24:case"end":return Mt.stop()}},Je)})),X.apply(this,arguments)}function Y(Je){_(!1),Oe(!0),Ze(Je),S(Je.id)}function Te(Je){ct(Je),_(!0),Oe(!1)}function de(){ct(""),_(!0),Oe(!1)}var We={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(rt){var Ye=rt.file.status;Ye!=="uploading",Ye==="done"?($.b.success("".concat(rt.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),M("")):Ye==="error"&&$.b.error("".concat(rt.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(rt){var Ye=rt.size/1024/1024<150;return Ye||$.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Ye}};return b.a.createElement("div",{style:{marginBottom:"40px"}},b.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(ye.a.IMG_SERVER+"/".concat(et),")")}}),b.a.createElement("img",{style:{width:"100%"},src:ye.a.IMG_SERVER+"/".concat(et)}),b.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},b.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},L&&L.map(function(Je,rt){return b.a.createElement("p",{key:rt,onClick:function(){return Y(Je)},className:oe===Je.id?"menuitemselect":"menuitem task-hide"},Je.name)}),(d==null||((D=d.userInfo)===null||D===void 0)?void 0:D.user_id)===299635||(d==null||((be=d.userInfo)===null||be===void 0)?void 0:be.user_id)===301458||d!=null&&(ne=d.userInfo)!==null&&ne!==void 0&&ne.admin||d!=null&&(W=d.userInfo)!==null&&W!==void 0&&W.business?b.a.createElement("p",{onClick:function(){return de()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},b.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),b.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},P?b.a.createElement(y,{UpdateItem:yt,setIscreate:_,init:M}):null,Pe?b.a.createElement(me,{UserInfo:d==null?void 0:d.userInfo,setSee:Oe,userId:d==null||((ie=d.userInfo)===null||ie===void 0)?void 0:ie.user_id,ItemUpdate:Te,CourseItem:ut,init:M}):null)),(d==null||((U=d.userInfo)===null||U===void 0)?void 0:U.user_id)===299635||(d==null||((B=d.userInfo)===null||B===void 0)?void 0:B.user_id)===301458||d!=null&&(N=d.userInfo)!==null&&N!==void 0&&N.admin||d!=null&&(m=d.userInfo)!==null&&m!==void 0&&m.business?b.a.createElement(fe.a,We,b.a.createElement(we.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Ke=pe.default=Object(Ee.a)(function(le){var D=le.user;return{user:D}})(De)},h78n:function(gt,pe,w){"use strict";w.d(pe,"a",function(){return W});var Z=w("q1tI"),fe=w.n(Z),he=w("TSYQ"),we=w.n(he),ve={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},$=function(B){var N=B.map(function(){return Object(Z.useRef)()}),m=Object(Z.useRef)();return Object(Z.useEffect)(function(){var d=Date.now(),R=!1;Object.keys(N).forEach(function(V){var ae=N[V].current;if(!ae)return;R=!0;var _e=ae.style;_e.transitionDuration=".3s, .3s, .3s, .06s",m.current&&d-m.current<100&&(_e.transitionDuration="0s, 0s")}),R&&(m.current=Date.now())}),[N]};function G(){return G=Object.assign||function(U){for(var B=1;B<arguments.length;B++){var N=arguments[B];for(var m in N)Object.prototype.hasOwnProperty.call(N,m)&&(U[m]=N[m])}return U},G.apply(this,arguments)}function Q(U,B){return T(U)||b(U,B)||O(U,B)||H()}function H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O(U,B){if(!U)return;if(typeof U=="string")return x(U,B);var N=Object.prototype.toString.call(U).slice(8,-1);if(N==="Object"&&U.constructor&&(N=U.constructor.name),N==="Map"||N==="Set")return Array.from(U);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return x(U,B)}function x(U,B){(B==null||B>U.length)&&(B=U.length);for(var N=0,m=new Array(B);N<B;N++)m[N]=U[N];return m}function b(U,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var N=[],m=!0,d=!1,R=void 0;try{for(var V=U[Symbol.iterator](),ae;!(m=(ae=V.next()).done)&&!(N.push(ae.value),B&&N.length===B);m=!0);}catch(_e){d=!0,R=_e}finally{try{!m&&V.return!=null&&V.return()}finally{if(d)throw R}}return N}function T(U){if(Array.isArray(U))return U}function E(U,B){if(U==null)return{};var N=k(U,B),m,d;if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(U);for(d=0;d<R.length;d++){if(m=R[d],B.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,m))continue;N[m]=U[m]}}return N}function k(U,B){if(U==null)return{};var N={},m=Object.keys(U),d,R;for(R=0;R<m.length;R++){if(d=m[R],B.indexOf(d)>=0)continue;N[d]=U[d]}return N}var I=function(B){var N=B.className,m=B.percent,d=B.prefixCls,R=B.strokeColor,V=B.strokeLinecap,ae=B.strokeWidth,_e=B.style,Fe=B.trailColor,Le=B.trailWidth,Re=B.transition,Ae=E(B,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ae.gapPosition;var Se=Array.isArray(m)?m:[m],ue=Array.isArray(R)?R:[R],q=$(Se),L=Q(q,1),K=L[0],j=ae/2,ke=100-ae/2,P="M ".concat(V==="round"?j:0,",").concat(j,`
|
|
L `).concat(V==="round"?ke:100,",").concat(j),_="0 0 100 ".concat(ae),re=0;return fe.a.createElement("svg",G({className:we()("".concat(d,"-line"),N),viewBox:_,preserveAspectRatio:"none",style:_e},Ae),fe.a.createElement("path",{className:"".concat(d,"-line-trail"),d:P,strokeLinecap:V,stroke:Fe,strokeWidth:Le||ae,fillOpacity:"0"}),Se.map(function(Ce,Pe){var Oe={strokeDasharray:"".concat(Ce,"px, 100px"),strokeDashoffset:"-".concat(re,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},He=ue[Pe]||ue[ue.length-1];return re+=Ce,fe.a.createElement("path",{key:Pe,className:"".concat(d,"-line-path"),d:P,strokeLinecap:V,stroke:He,strokeWidth:ae,fillOpacity:"0",ref:K[Pe],style:Oe})}))};I.defaultProps=ve;var v=I;function y(){return y=Object.assign||function(U){for(var B=1;B<arguments.length;B++){var N=arguments[B];for(var m in N)Object.prototype.hasOwnProperty.call(N,m)&&(U[m]=N[m])}return U},y.apply(this,arguments)}function A(U,B){return Ne(U)||ye(U,B)||me(U,B)||F()}function F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function me(U,B){if(!U)return;if(typeof U=="string")return ce(U,B);var N=Object.prototype.toString.call(U).slice(8,-1);if(N==="Object"&&U.constructor&&(N=U.constructor.name),N==="Map"||N==="Set")return Array.from(U);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return ce(U,B)}function ce(U,B){(B==null||B>U.length)&&(B=U.length);for(var N=0,m=new Array(B);N<B;N++)m[N]=U[N];return m}function ye(U,B){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var N=[],m=!0,d=!1,R=void 0;try{for(var V=U[Symbol.iterator](),ae;!(m=(ae=V.next()).done)&&!(N.push(ae.value),B&&N.length===B);m=!0);}catch(_e){d=!0,R=_e}finally{try{!m&&V.return!=null&&V.return()}finally{if(d)throw R}}return N}function Ne(U){if(Array.isArray(U))return U}function Ee(U,B){if(U==null)return{};var N=De(U,B),m,d;if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(U);for(d=0;d<R.length;d++){if(m=R[d],B.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,m))continue;N[m]=U[m]}}return N}function De(U,B){if(U==null)return{};var N={},m=Object.keys(U),d,R;for(R=0;R<m.length;R++){if(d=m[R],B.indexOf(d)>=0)continue;N[d]=U[d]}return N}var Ke=0;function le(U){return+U.replace("%","")}function D(U){return Array.isArray(U)?U:[U]}function be(U,B,N,m){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,R=arguments.length>5?arguments[5]:void 0,V=50-m/2,ae=0,_e=-V,Fe=0,Le=-2*V;switch(R){case"left":ae=-V,_e=0,Fe=2*V,Le=0;break;case"right":ae=V,_e=0,Fe=-2*V,Le=0;break;case"bottom":_e=V,Le=2*V;break;default:}var Re="M 50,50 m ".concat(ae,",").concat(_e,`
|
|
a `).concat(V,",").concat(V," 0 1 1 ").concat(Fe,",").concat(-Le,`
|
|
a `).concat(V,",").concat(V," 0 1 1 ").concat(-Fe,",").concat(Le),Ae=Math.PI*2*V,Se={stroke:N,strokeDasharray:"".concat(B/100*(Ae-d),"px ").concat(Ae,"px"),strokeDashoffset:"-".concat(d/2+U/100*(Ae-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Se}}var ne=function(B){var N=B.prefixCls,m=B.strokeWidth,d=B.trailWidth,R=B.gapDegree,V=B.gapPosition,ae=B.trailColor,_e=B.strokeLinecap,Fe=B.style,Le=B.className,Re=B.strokeColor,Ae=B.percent,Se=Ee(B,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ue=Object(Z.useMemo)(function(){return Ke+=1,Ke},[]),q=be(0,100,ae,m,R,V),L=q.pathString,K=q.pathStyle,j=D(Ae),ke=D(Re),P=ke.find(function(Oe){return Object.prototype.toString.call(Oe)==="[object Object]"}),_=$(j),re=A(_,1),Ce=re[0],Pe=function(){var He=0;return j.map(function(Ge,ut){var Ze=ke[ut]||ke[ke.length-1],it=Object.prototype.toString.call(Ze)==="[object Object]"?"url(#".concat(N,"-gradient-").concat(ue,")"):"",Qe=be(He,Ge,Ze,m,R,V);return He+=Ge,fe.a.createElement("path",{key:ut,className:"".concat(N,"-circle-path"),d:Qe.pathString,stroke:it,strokeLinecap:_e,strokeWidth:m,opacity:Ge===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:Ce[ut]})})};return fe.a.createElement("svg",y({className:we()("".concat(N,"-circle"),Le),viewBox:"0 0 100 100",style:Fe},Se),P&&fe.a.createElement("defs",null,fe.a.createElement("linearGradient",{id:"".concat(N,"-gradient-").concat(ue),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(P).sort(function(Oe,He){return le(Oe)-le(He)}).map(function(Oe,He){return fe.a.createElement("stop",{key:He,offset:Oe,stopColor:P[Oe]})}))),fe.a.createElement("path",{className:"".concat(N,"-circle-trail"),d:L,stroke:ae,strokeLinecap:_e,strokeWidth:d||m,fillOpacity:"0",style:K}),Pe().reverse())};ne.defaultProps=ve;var W=ne,ie={Line:v,Circle:W}},kSUc:function(gt,pe,w){},lZu9:function(gt,pe,w){(function(Z){Z(w("VrN/"),w("1eCo"),w("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(fe,he){var we=Z.getMode(fe,"text/html"),ve=we.name=="null";function $(m){if(Z.findModeByName){var d=Z.findModeByName(m);d&&(m=d.mime||d.mimes[0])}var R=Z.getMode(fe,m);return R.name=="null"?null:R}he.highlightFormatting===void 0&&(he.highlightFormatting=!1),he.maxBlockquoteDepth===void 0&&(he.maxBlockquoteDepth=0),he.taskLists===void 0&&(he.taskLists=!1),he.strikethrough===void 0&&(he.strikethrough=!1),he.emoji===void 0&&(he.emoji=!1),he.fencedCodeBlockHighlighting===void 0&&(he.fencedCodeBlockHighlighting=!0),he.fencedCodeBlockDefaultMode===void 0&&(he.fencedCodeBlockDefaultMode="text/plain"),he.xml===void 0&&(he.xml=!0),he.tokenTypeOverrides===void 0&&(he.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Q in G)G.hasOwnProperty(Q)&&he.tokenTypeOverrides[Q]&&(G[Q]=he.tokenTypeOverrides[Q]);var H=/^([*\-_])(?:\s*\1){2,}\s*$/,O=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,b=he.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ {0,3}(?:\={1,}|-{2,})\s*$/,E=/^[^#!\[\]*_\\<>` "'(~:]+/,k=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,I=/^\s*\[[^\]]+?\]:.*$/,v=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,y=" ";function A(m,d,R){return d.f=d.inline=R,R(m,d)}function F(m,d,R){return d.f=d.block=R,R(m,d)}function me(m){return!m||!/\S/.test(m.string)}function ce(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==Ne){var d=ve;if(!d){var R=Z.innerMode(we,m.htmlState);d=R.mode.name=="xml"&&R.state.tagStart===null&&!R.state.context&&R.state.tokenize.isInText}d&&(m.f=le,m.block=ye,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function ye(m,d){var R=m.column()===d.indentation,V=me(d.prevLine.stream),ae=d.indentedCode,_e=d.prevLine.hr,Fe=d.list!==!1,Le=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Re=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Fe)){for(d.list=null;Re<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Re-d.listStack[d.listStack.length-1])}var Ae=!V&&!_e&&!d.prevLine.header&&(!Fe||!ae)&&!d.prevLine.fencedCodeEnd,Se=(d.list===!1||_e||V)&&d.indentation<=Le&&m.match(H),ue=null;if(d.indentationDiff>=4&&(ae||d.prevLine.fencedCodeEnd||d.prevLine.header||V))return m.skipToEnd(),d.indentedCode=!0,G.code;if(m.eatSpace())return null;if(R&&d.indentation<=Le&&(ue=m.match(b))&&ue[1].length<=6)return d.quote=0,d.header=ue[1].length,d.thisLine.header=!0,he.highlightFormatting&&(d.formatting="header"),d.f=d.inline,De(d);if(d.indentation<=Le&&m.eat(">"))return d.quote=R?1:d.quote+1,he.highlightFormatting&&(d.formatting="quote"),m.eatSpace(),De(d);if(!Se&&!d.setext&&R&&d.indentation<=Le&&(ue=m.match(O))){var q=ue[1]?"ol":"ul";return d.indentation=Re+m.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,he.taskLists&&m.match(x,!1)&&(d.taskList=!0),d.f=d.inline,he.highlightFormatting&&(d.formatting=["list","list-"+q]),De(d)}else{if(R&&d.indentation<=Le&&(ue=m.match(k,!0)))return d.quote=0,d.fencedEndRE=new RegExp(ue[1]+"+ *$"),d.localMode=he.fencedCodeBlockHighlighting&&$(ue[2]||he.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=Z.startState(d.localMode)),d.f=d.block=Ee,he.highlightFormatting&&(d.formatting="code-block"),d.code=-1,De(d);if(d.setext||(!Ae||!Fe)&&!d.quote&&d.list===!1&&!d.code&&!Se&&!I.test(m.string)&&(ue=m.lookAhead(1))&&(ue=ue.match(T)))return d.setext?(d.header=d.setext,d.setext=0,m.skipToEnd(),he.highlightFormatting&&(d.formatting="header")):(d.header=ue[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,De(d);if(Se)return m.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,G.hr;if(m.peek()==="[")return A(m,d,ie)}return A(m,d,d.inline)}function Ne(m,d){var R=we.token(m,d.htmlState);if(!ve){var V=Z.innerMode(we,d.htmlState);(V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText||d.md_inside&&m.current().indexOf(">")>-1)&&(d.f=le,d.block=ye,d.htmlState=null)}return R}function Ee(m,d){var R=d.listStack[d.listStack.length-1]||0,V=d.indentation<R,ae=R+3;if(d.fencedEndRE&&d.indentation<=ae&&(V||m.match(d.fencedEndRE))){he.highlightFormatting&&(d.formatting="code-block");var _e;return V||(_e=De(d)),d.localMode=d.localState=null,d.block=ye,d.f=le,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,V?F(m,d,d.block):_e}else return d.localMode?d.localMode.token(m,d.localState):(m.skipToEnd(),G.code)}function De(m){var d=[];if(m.formatting){d.push(G.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var R=0;R<m.formatting.length;R++)d.push(G.formatting+"-"+m.formatting[R]),m.formatting[R]==="header"&&d.push(G.formatting+"-"+m.formatting[R]+"-"+m.header),m.formatting[R]==="quote"&&(!he.maxBlockquoteDepth||he.maxBlockquoteDepth>=m.quote?d.push(G.formatting+"-"+m.formatting[R]+"-"+m.quote):d.push("error"))}if(m.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(m.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(m.linkHref?d.push(G.linkHref,"url"):(m.strong&&d.push(G.strong),m.em&&d.push(G.em),m.strikethrough&&d.push(G.strikethrough),m.emoji&&d.push(G.emoji),m.linkText&&d.push(G.linkText),m.code&&d.push(G.code),m.image&&d.push(G.image),m.imageAltText&&d.push(G.imageAltText,"link"),m.imageMarker&&d.push(G.imageMarker)),m.header&&d.push(G.header,G.header+"-"+m.header),m.quote&&(d.push(G.quote),!he.maxBlockquoteDepth||he.maxBlockquoteDepth>=m.quote?d.push(G.quote+"-"+m.quote):d.push(G.quote+"-"+he.maxBlockquoteDepth)),m.list!==!1){var V=(m.listStack.length-1)%3;V?V===1?d.push(G.list2):d.push(G.list3):d.push(G.list1)}return m.trailingSpaceNewLine?d.push("trailing-space-new-line"):m.trailingSpace&&d.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Ke(m,d){return m.match(E,!0)?De(d):void 0}function le(m,d){var R=d.text(m,d);if(typeof R!="undefined")return R;if(d.list)return d.list=null,De(d);if(d.taskList){var V=m.match(x,!0)[1]===" ";return V?d.taskOpen=!0:d.taskClosed=!0,he.highlightFormatting&&(d.formatting="task"),d.taskList=!1,De(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&m.match(/^#+$/,!0))return he.highlightFormatting&&(d.formatting="header"),De(d);var ae=m.next();if(d.linkTitle){d.linkTitle=!1;var _e=ae;ae==="("&&(_e=")"),_e=(_e+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+_e+"\\\\]+|\\\\\\\\|\\\\.)"+_e;if(m.match(new RegExp(Fe),!0))return G.linkHref}if(ae==="`"){var Le=d.formatting;he.highlightFormatting&&(d.formatting="code"),m.eatWhile("`");var Re=m.current().length;if(d.code==0&&(!d.quote||Re==1))return d.code=Re,De(d);if(Re==d.code){var Ae=De(d);return d.code=0,Ae}else return d.formatting=Le,De(d)}else if(d.code)return De(d);if(ae==="\\"&&(m.next(),he.highlightFormatting)){var Se=De(d),ue=G.formatting+"-escape";return Se?Se+" "+ue:ue}if(ae==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,he.highlightFormatting&&(d.formatting="image"),De(d);if(ae==="["&&d.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,he.highlightFormatting&&(d.formatting="image"),De(d);if(ae==="]"&&d.imageAltText){he.highlightFormatting&&(d.formatting="image");var Se=De(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=be,Se}if(ae==="["&&!d.image)return d.linkText&&m.match(/^.*?\]/)||(d.linkText=!0,he.highlightFormatting&&(d.formatting="link")),De(d);if(ae==="]"&&d.linkText){he.highlightFormatting&&(d.formatting="link");var Se=De(d);return d.linkText=!1,d.inline=d.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?be:le,Se}if(ae==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=D,he.highlightFormatting&&(d.formatting="link");var Se=De(d);return Se?Se+=" ":Se="",Se+G.linkInline}if(ae==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=D,he.highlightFormatting&&(d.formatting="link");var Se=De(d);return Se?Se+=" ":Se="",Se+G.linkEmail}if(he.xml&&ae==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var q=m.string.indexOf(">",m.pos);if(q!=-1){var L=m.string.substring(m.start,q);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(L)&&(d.md_inside=!0)}return m.backUp(1),d.htmlState=Z.startState(we),F(m,d,Ne)}if(he.xml&&ae==="<"&&m.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var K=1,j=m.pos==1?" ":m.string.charAt(m.pos-2);K<3&&m.eat(ae);)K++;var ke=m.peek()||" ",P=!/\s/.test(ke)&&(!v.test(ke)||/\s/.test(j)||v.test(j)),_=!/\s/.test(j)&&(!v.test(j)||/\s/.test(ke)||v.test(ke)),re=null,Ce=null;if(K%2&&(!d.em&&P&&(ae==="*"||!_||v.test(j))?re=!0:d.em==ae&&_&&(ae==="*"||!P||v.test(ke))&&(re=!1)),K>1&&(!d.strong&&P&&(ae==="*"||!_||v.test(j))?Ce=!0:d.strong==ae&&_&&(ae==="*"||!P||v.test(ke))&&(Ce=!1)),Ce!=null||re!=null){he.highlightFormatting&&(d.formatting=re==null?"strong":Ce==null?"em":"strong em"),re===!0&&(d.em=ae),Ce===!0&&(d.strong=ae);var Ae=De(d);return re===!1&&(d.em=!1),Ce===!1&&(d.strong=!1),Ae}}else if(ae===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return De(d);m.backUp(1)}if(he.strikethrough){if(ae==="~"&&m.eatWhile(ae)){if(d.strikethrough){he.highlightFormatting&&(d.formatting="strikethrough");var Ae=De(d);return d.strikethrough=!1,Ae}else if(m.match(/^[^\s]/,!1))return d.strikethrough=!0,he.highlightFormatting&&(d.formatting="strikethrough"),De(d)}else if(ae===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return De(d);m.backUp(2)}}if(he.emoji&&ae===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,he.highlightFormatting&&(d.formatting="emoji");var Pe=De(d);return d.emoji=!1,Pe}return ae===" "&&(m.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),De(d)}function D(m,d){var R=m.next();if(R===">"){d.f=d.inline=le,he.highlightFormatting&&(d.formatting="link");var V=De(d);return V?V+=" ":V="",V+G.linkInline}return m.match(/^[^>]+/,!0),G.linkInline}function be(m,d){if(m.eatSpace())return null;var R=m.next();return R==="("||R==="["?(d.f=d.inline=W(R==="("?")":"]"),he.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,De(d)):"error"}var ne={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(m){return function(d,R){var V=d.next();if(V===m){R.f=R.inline=le,he.highlightFormatting&&(R.formatting="link-string");var ae=De(R);return R.linkHref=!1,ae}return d.match(ne[m]),R.linkHref=!0,De(R)}}function ie(m,d){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=U,m.next(),he.highlightFormatting&&(d.formatting="link"),d.linkText=!0,De(d)):A(m,d,le)}function U(m,d){if(m.match(/^\]:/,!0)){d.f=d.inline=B,he.highlightFormatting&&(d.formatting="link");var R=De(d);return d.linkText=!1,R}return m.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function B(m,d){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?d.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=le,G.linkHref+" url")}var N={startState:function(){return{f:ye,prevLine:{stream:null},thisLine:{stream:null},block:ye,htmlState:null,indentation:0,inline:le,text:Ke,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&Z.copyState(we,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?Z.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,d){if(d.formatting=!1,m!=d.thisLine.stream){if(d.header=0,d.hr=!1,m.match(/^\s*$/,!0))return ce(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:m},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Ne)){var R=m.match(/^\s*/,!0)[0].replace(/\t/g,y).length;if(d.indentation=R,d.indentationDiff=null,R>0)return null}}return d.f(m,d)},innerMode:function(m){return m.block==Ne?{state:m.htmlState,mode:we}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:N}},indent:function(m,d,R){return m.block==Ne&&we.indent?we.indent(m.htmlState,d,R):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,d,R):Z.Pass},blankLine:ce,getType:De,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return N},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},nnTU:function(gt,pe,w){"use strict";w.d(pe,"b",function(){return Q}),w.d(pe,"a",function(){return H});var Z=w("pmY6"),fe=w("746U"),he=w("Cg/j"),we=w("MI8n"),ve=w("24hK"),$=w("QDVR"),G=function(){for(var O=0,x=0,b=arguments.length;x<b;x++)O+=arguments[x].length;for(var T=Array(O),E=0,x=0;x<b;x++)for(var k=arguments[x],I=0,v=k.length;I<v;I++,E++)T[E]=k[I];return T},Q=Object(he.c)("commandService"),H=new(function(){function O(){this._commands=new Map,this._onDidRegisterCommand=new we.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return O.prototype.registerCommand=function(x,b){var T=this;if(!x)throw new Error("invalid command");if(typeof x=="string"){if(!b)throw new Error("invalid command");return this.registerCommand({id:x,handler:b})}if(x.description){for(var E=[],k=0,I=x.description.args;k<I.length;k++){var v=I[k];E.push(v.constraint)}var y=x.handler;x.handler=function(ye){for(var Ne=[],Ee=1;Ee<arguments.length;Ee++)Ne[Ee-1]=arguments[Ee];return Object(fe.m)(Ne,E),y.apply(void 0,G([ye],Ne))}}var A=x.id,F=this._commands.get(A);F||(F=new ve.a,this._commands.set(A,F));var me=F.unshift(x),ce=Object(Z.h)(function(){me();var ye=T._commands.get(A);(ye==null?void 0:ye.isEmpty())&&T._commands.delete(A)});return this._onDidRegisterCommand.fire(A),ce},O.prototype.registerCommandAlias=function(x,b){return H.registerCommand(x,function(T){for(var E,k=[],I=1;I<arguments.length;I++)k[I-1]=arguments[I];return(E=T.get(Q)).executeCommand.apply(E,G([b],k))})},O.prototype.getCommand=function(x){var b=this._commands.get(x);return!b||b.isEmpty()?void 0:b.iterator().next().value},O.prototype.getCommands=function(){for(var x=new Map,b=0,T=Object($.d)(this._commands);b<T.length;b++){var E=T[b],k=this.getCommand(E);k&&x.set(E,k)}return x},O}())},osHv:function(gt,pe,w){(function(Z){Z(w("VrN/"))})(function(Z){"use strict";var fe=Z.Pos;function he(v,y){return v.line-y.line||v.ch-y.ch}var we="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ve=we+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",$=new RegExp("<(/?)(["+we+"]["+ve+"]*)","g");function G(v,y,A,F){this.line=y,this.ch=A,this.cm=v,this.text=v.getLine(y),this.min=F?Math.max(F.from,v.firstLine()):v.firstLine(),this.max=F?Math.min(F.to-1,v.lastLine()):v.lastLine()}function Q(v,y){var A=v.cm.getTokenTypeAt(fe(v.line,y));return A&&/\btag\b/.test(A)}function H(v){return v.line>=v.max?void 0:(v.ch=0,v.text=v.cm.getLine(++v.line),!0)}function O(v){return v.line<=v.min?void 0:(v.text=v.cm.getLine(--v.line),v.ch=v.text.length,!0)}function x(v){for(;;){var y=v.text.indexOf(">",v.ch);if(y==-1){if(H(v))continue;return}if(!Q(v,y+1)){v.ch=y+1;continue}var A=v.text.lastIndexOf("/",y),F=A>-1&&!/\S/.test(v.text.slice(A+1,y));return v.ch=y+1,F?"selfClose":"regular"}}function b(v){for(;;){var y=v.ch?v.text.lastIndexOf("<",v.ch-1):-1;if(y==-1){if(O(v))continue;return}if(!Q(v,y+1)){v.ch=y;continue}$.lastIndex=y,v.ch=y;var A=$.exec(v.text);if(A&&A.index==y)return A}}function T(v){for(;;){$.lastIndex=v.ch;var y=$.exec(v.text);if(!y){if(H(v))continue;return}if(!Q(v,y.index+1)){v.ch=y.index+1;continue}return v.ch=y.index+y[0].length,y}}function E(v){for(;;){var y=v.ch?v.text.lastIndexOf(">",v.ch-1):-1;if(y==-1){if(O(v))continue;return}if(!Q(v,y+1)){v.ch=y;continue}var A=v.text.lastIndexOf("/",y),F=A>-1&&!/\S/.test(v.text.slice(A+1,y));return v.ch=y+1,F?"selfClose":"regular"}}function k(v,y){for(var A=[];;){var F=T(v),me,ce=v.line,ye=v.ch-(F?F[0].length:0);if(!F||!(me=x(v)))return;if(me=="selfClose")continue;if(F[1]){for(var Ne=A.length-1;Ne>=0;--Ne)if(A[Ne]==F[2]){A.length=Ne;break}if(Ne<0&&(!y||y==F[2]))return{tag:F[2],from:fe(ce,ye),to:fe(v.line,v.ch)}}else A.push(F[2])}}function I(v,y){for(var A=[];;){var F=E(v);if(!F)return;if(F=="selfClose"){b(v);continue}var me=v.line,ce=v.ch,ye=b(v);if(!ye)return;if(ye[1])A.push(ye[2]);else{for(var Ne=A.length-1;Ne>=0;--Ne)if(A[Ne]==ye[2]){A.length=Ne;break}if(Ne<0&&(!y||y==ye[2]))return{tag:ye[2],from:fe(v.line,v.ch),to:fe(me,ce)}}}}Z.registerHelper("fold","xml",function(v,y){for(var A=new G(v,y.line,0);;){var F=T(A);if(!F||A.line!=y.line)return;var me=x(A);if(!me)return;if(!F[1]&&me!="selfClose"){var ce=fe(A.line,A.ch),ye=k(A,F[2]);return ye&&he(ye.from,ce)>0?{from:ce,to:ye.from}:null}}}),Z.findMatchingTag=function(v,y,A){var F=new G(v,y.line,y.ch,A);if(F.text.indexOf(">")==-1&&F.text.indexOf("<")==-1)return;var me=x(F),ce=me&&fe(F.line,F.ch),ye=me&&b(F);if(!me||!ye||he(F,y)>0)return;var Ne={from:fe(F.line,F.ch),to:ce,tag:ye[2]};return me=="selfClose"?{open:Ne,close:null,at:"open"}:ye[1]?{open:I(F,ye[2]),close:Ne,at:"close"}:(F=new G(v,ce.line,ce.ch,A),{open:Ne,close:k(F,ye[2]),at:"open"})},Z.findEnclosingTag=function(v,y,A,F){for(var me=new G(v,y.line,y.ch,A);;){var ce=I(me,F);if(!ce)break;var ye=new G(v,y.line,y.ch,A),Ne=k(ye,ce.tag);if(Ne)return{open:ce,close:Ne}}},Z.scanForClosingTag=function(v,y,A,F){var me=new G(v,y.line,y.ch,F?{from:0,to:F}:null);return k(me,A)}})},p5ED:function(gt,pe,w){"use strict";var Z=w("+L6B"),fe=w("2/Rp"),he=w("5Dmo"),we=w("3S7+"),ve=w("k1fw"),$=w("9og8"),G=w("tJVT"),Q=w("WmNS"),H=w.n(Q),O=w("q1tI"),x=w.n(O),b=w("vHTk"),T=w.n(b),E=w("yEEn"),k=w("ZW9T"),I=w("1vsH"),v=w("V0Rq"),y=w("m3rI");pe.a=function(A){var F,me,ce,ye,Ne,Ee,De=A.editOffice,Ke=De===void 0?"view":De,le=A.name,D=A.data,be=A.theme,ne=A.type,W=A.filename,ie=A.monacoEditor,U=A.className,B=A.style,N=A.close,m=A.onClose,d=A.hasMask,R=A.disabledDownload,V=A.onImgDimensions,ae=A.otherData,_e=Object(O.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Fe=Object(G.a)(_e,2),Le=Fe[0],Re=Fe[1],Ae=Object(O.useState)(""),Se=Object(G.a)(Ae,2),ue=Se[0],q=Se[1],L=Object(O.useState)(),K=Object(G.a)(L,2),j=K[0],ke=K[1],P=window.ENV==="build"?"/react/build":"",_=location.host.startsWith("localhost")?y.a.PROXY_SERVER:y.a.API_SERVER,re,Ce=1024*1024,Pe=10*Ce,Oe=Object(O.useRef)();(F=D)!==null&&F!==void 0&&F.startsWith("/api")&&ne!=="txt"&&(D=y.a.API_SERVER+D),ne==="office"&&(re=Object(I.P)(D).filesize,re>Pe&&(ne="other")),W&&(ie.filename=W),Object(O.useEffect)(function(){var Ze,it,Qe=(Ze=document.cookie)===null||Ze===void 0||((it=Ze.replace(/\s/g,""))===null||it===void 0)?void 0:it.split(";");Qe==null||Qe.map(function(yt){var ct=yt.split("=");ct[0]==="_educoder_session"&&q(ct[1])})},[]),Object(O.useEffect)(function(){ne==="office"&&He()},[ne,D]);var He=function(){var Ze=Object($.a)(H.a.mark(function it(){var Qe,yt,ct;return H.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return console.log("data:",D),Qe=D,D.startsWith("http")||(Qe=location.origin+Qe),yt=new URL(Qe).pathname.split("/").pop(),Me.next=6,Object(v.U)({attachment_id:yt});case 6:ct=Me.sent,ke(ct);case 8:case"end":return Me.stop()}},it)}));return function(){return Ze.apply(this,arguments)}}(),Ge=function(){if(D.startsWith("http")||D.startsWith("blob:")){ut();return}Object(I.x)(W||"educoder",D,W)},ut=function(){Object(I.v)(W||"educoder",decodeURIComponent(D))};return x.a.createElement("div",{style:Object(ve.a)({},B||{}),className:"".concat(d&&T.a.bgBlack," ").concat(ne?T.a.wrp:"hide")},N&&x.a.createElement("div",{className:T.a.close,ref:Oe},!!V&&x.a.createElement(we.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Oe.current}},x.a.createElement("span",{onClick:function(){m(),V()}},x.a.createElement("i",{className:"icon-yulanpizhu"}))),!R&&x.a.createElement(we.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Oe.current}},x.a.createElement("span",{onClick:ut},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(we.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Oe.current}},x.a.createElement("span",{className:"",onClick:m},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(T.a[U]," ").concat(U," ").concat(T.a.monaco," ").concat(ne==="txt"?"show":"hide")},ne==="txt"&&x.a.createElement(k.b,ie)),ne==="audio"&&x.a.createElement("audio",{src:"".concat(((me=D)===null||me===void 0?void 0:me.indexOf("http://"))>-1||((ce=D)===null||ce===void 0?void 0:ce.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(D),autoPlay:!0}),ne==="video"&&x.a.createElement(x.a.Fragment,null,((ye=D)===null||ye===void 0?void 0:ye.indexOf("http"))>-1?x.a.createElement("video",{controls:!0,src:"".concat(D),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(D),autoPlay:!0})),ne==="office"&&j&&x.a.createElement("iframe",{src:"".concat(P,"/office.html?key=").concat(j.key,"&url=").concat(_+j.url,"&callbackUrl=").concat(_+j.callbackUrl,"&fileType=").concat(j.fileType,"&title=").concat(j.title,"&model=").concat(Ke,"&officeServer=").concat(y.a.OFFICE_SERVER,"&disabledDownload=").concat(!!R)}),(ne==="xlsx"||ne==="doc"||ne==="pptx"||ne==="docx")&&x.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(ae.key,"&url=").concat(y.a.API_SERVER+ae.url,"&callbackUrl=").concat(y.a.API_SERVER+ae.callbackUrl,"&fileType=").concat(ae.fileType,"&title=").concat(ae.title,"&model=").concat(ae.model)}),ne==="html"&&x.a.createElement("iframe",{src:D+"&disposition=inline"}),ne==="pdf"&&x.a.createElement("embed",{className:T.a.embed,src:D}),ne==="image"&&x.a.createElement("img",{src:"".concat(((Ne=D)===null||Ne===void 0?void 0:Ne.indexOf("http://"))>-1||((Ee=D)===null||Ee===void 0?void 0:Ee.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(D)}),ne==="other"&&x.a.createElement("div",null,x.a.createElement(fe.a,{type:"primary",size:"large",onClick:Ge},x.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),ne==="download"&&x.a.createElement(fe.a,{type:"primary",size:"large",onClick:Ge},x.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(gt,pe,w){},pmY6:function(gt,pe,w){"use strict";w.d(pe,"g",function(){return ve}),w.d(pe,"f",function(){return $}),w.d(pe,"e",function(){return G}),w.d(pe,"h",function(){return Q}),w.d(pe,"b",function(){return H}),w.d(pe,"a",function(){return O}),w.d(pe,"d",function(){return x}),w.d(pe,"c",function(){return b});var Z=!1,fe="__is_disposable_tracked__";function he(T){if(!Z)return;if(T&&T!==O.None)try{T[fe]=!0}catch(E){}}function we(T){if(!Z)return T;var E=new Error("Potentially leaked disposable").stack;return setTimeout(function(){T[fe]||console.log(E)},3e3),T}function ve(T){return typeof T.dispose=="function"&&T.dispose.length===0}function $(T){return Array.isArray(T)?(T.forEach(function(E){E&&(he(E),E.dispose())}),[]):T?(he(T),T.dispose(),T):void 0}function G(){for(var T=[],E=0;E<arguments.length;E++)T[E]=arguments[E];return T.forEach(he),we({dispose:function(){return $(T)}})}function Q(T){var E=we({dispose:function(){he(E),T()}});return E}var H=function(){function T(){this._toDispose=new Set,this._isDisposed=!1}return T.prototype.dispose=function(){if(this._isDisposed)return;he(this),this._isDisposed=!0,this.clear()},T.prototype.clear=function(){this._toDispose.forEach(function(E){return E.dispose()}),this._toDispose.clear()},T.prototype.add=function(E){if(!E)return E;if(E===this)throw new Error("Cannot register a disposable on itself!");return he(E),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(E),E},T}(),O=function(){function T(){this._store=new H,we(this)}return T.prototype.dispose=function(){he(this),this._store.dispose()},T.prototype._register=function(E){if(E===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(E)},T.None=Object.freeze({dispose:function(){}}),T}(),x=function(){function T(){this._isDisposed=!1,we(this)}return Object.defineProperty(T.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(E){if(this._isDisposed||E===this._value)return;this._value&&this._value.dispose(),E&&he(E),this._value=E},enumerable:!0,configurable:!0}),T.prototype.clear=function(){this.value=void 0},T.prototype.dispose=function(){this._isDisposed=!0,he(this),this._value&&this._value.dispose(),this._value=void 0},T}(),b=function(){function T(E){this.object=E}return T.prototype.dispose=function(){},T}()},"rAM+":function(gt,pe,w){"use strict";w.d(pe,"a",function(){return fe});var Z=w("Qw5x");function fe(he,we){var ve;if(typeof Symbol=="undefined"||he[Symbol.iterator]==null){if(Array.isArray(he)||(ve=Object(Z.a)(he))||we&&he&&typeof he.length=="number"){ve&&(he=ve);var $=0,G=function(){};return{s:G,n:function(){return $>=he.length?{done:!0}:{done:!1,value:he[$++]}},e:function(b){throw b},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Q=!0,H=!1,O;return{s:function(){ve=he[Symbol.iterator]()},n:function(){var b=ve.next();return Q=b.done,b},e:function(b){H=!0,O=b},f:function(){try{!Q&&ve.return!=null&&ve.return()}finally{if(H)throw O}}}}},rUJ1:function(gt,pe){const w=/[&<>"']/,Z=/[&<>"']/g,fe=/[<>"']|&(?!#?\w+;)/,he=/[<>"']|&(?!#?\w+;)/g,we={"&":"&","<":"<",">":">",'"':""","'":"'"},ve=Ee=>we[Ee];function $(Ee,De){if(De){if(w.test(Ee))return Ee.replace(Z,ve)}else if(fe.test(Ee))return Ee.replace(he,ve);return Ee}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q(Ee){return Ee.replace(G,(De,Ke)=>(Ke=Ke.toLowerCase(),Ke==="colon"?":":Ke.charAt(0)==="#"?Ke.charAt(1)==="x"?String.fromCharCode(parseInt(Ke.substring(2),16)):String.fromCharCode(+Ke.substring(1)):""))}const H=/(^|[^\[])\^/g;function O(Ee,De){Ee=Ee.source||Ee,De=De||"";const Ke={replace:(le,D)=>(D=D.source||D,D=D.replace(H,"$1"),Ee=Ee.replace(le,D),Ke),getRegex:()=>new RegExp(Ee,De)};return Ke}const x=/[^\w:]/g,b=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(Ee,De,Ke){if(Ee){let le;try{le=decodeURIComponent(Q(Ke)).replace(x,"").toLowerCase()}catch(D){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}De&&!b.test(Ke)&&(Ke=y(De,Ke));try{Ke=encodeURI(Ke).replace(/%25/g,"%")}catch(le){return null}return Ke}const E={},k=/^[^:]+:\/*[^/]*$/,I=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(Ee,De){E[" "+Ee]||(k.test(Ee)?E[" "+Ee]=Ee+"/":E[" "+Ee]=ce(Ee,"/",!0)),Ee=E[" "+Ee];const Ke=Ee.indexOf(":")===-1;return De.substring(0,2)==="//"?Ke?De:Ee.replace(I,"$1")+De:De.charAt(0)==="/"?Ke?De:Ee.replace(v,"$1")+De:Ee+De}const A={exec:function(){}};function F(Ee){let De=1,Ke,le;for(;De<arguments.length;De++){Ke=arguments[De];for(le in Ke)Object.prototype.hasOwnProperty.call(Ke,le)&&(Ee[le]=Ke[le])}return Ee}function me(Ee,De){const Ke=Ee.replace(/\|/g,(be,ne,W)=>{let ie=!1,U=ne;for(;--U>=0&&W[U]==="\\";)ie=!ie;return ie?"|":" |"}),le=Ke.split(/ \|/);let D=0;if(le.length>De)le.splice(De);else for(;le.length<De;)le.push("");for(;D<le.length;D++)le[D]=le[D].trim().replace(/\\\|/g,"|");return le}function ce(Ee,De,Ke){const le=Ee.length;if(le===0)return"";let D=0;for(;D<le;){const be=Ee.charAt(le-D-1);if(be===De&&!Ke)D++;else if(be!==De&&Ke)D++;else break}return Ee.substr(0,le-D)}function ye(Ee,De){if(Ee.indexOf(De[1])===-1)return-1;const Ke=Ee.length;let le=0,D=0;for(;D<Ke;D++)if(Ee[D]==="\\")D++;else if(Ee[D]===De[0])le++;else if(Ee[D]===De[1]&&(le--,le<0))return D;return-1}function Ne(Ee){Ee&&Ee.sanitize&&!Ee.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}gt.exports={escape:$,unescape:Q,edit:O,cleanUrl:T,resolveUrl:y,noopTest:A,merge:F,splitCells:me,rtrim:ce,findClosingBracket:ye,checkSanitizeDeprecation:Ne}},vHTk:function(gt,pe,w){gt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|