(window.webpackJsonp=window.webpackJsonp||[]).push([[164,5,6,7],{"+NIl":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(J,P){"use strict";function X(h,l){h.cmdState.push(l)}function j(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function U(h){var l=h.cmdState.pop();l&&l.closeBracket()}function K(h){for(var l=h.cmdState,f=l.length-1;f>=0;f--){var o=l[f];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function G(h,l,f){return function(){this.name=h,this.bracketNo=0,this.style=l,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=G("importmodule","tag",["string","builtin"]),r.documentclass=G("documentclass","tag",["","atom"]),r.usepackage=G("usepackage","tag",["atom"]),r.begin=G("begin","tag",["atom"]),r.end=G("end","tag",["atom"]),r.label=G("label","tag",["atom"]),r.ref=G("ref","tag",["atom"]),r.eqref=G("eqref","tag",["atom"]),r.cite=G("cite","tag",["atom"]),r.bibitem=G("bibitem","tag",["atom"]),r.Bibitem=G("Bibitem","tag",["atom"]),r.RBibitem=G("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(h,l){h.f=l}function v(h,l){var f;if(h.match(/^\\[a-zA-Z@]+/)){var o=h.current().slice(1);return f=r.hasOwnProperty(o)?r[o]:r.DEFAULT,f=new f,X(l,f),R(l,p),f.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return R(l,function(s,a){return m(s,a,"\\]")}),"keyword";if(h.match("\\("))return R(l,function(s,a){return m(s,a,"\\)")}),"keyword";if(h.match("$$"))return R(l,function(s,a){return m(s,a,"$$")}),"keyword";if(h.match("$"))return R(l,function(s,a){return m(s,a,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(f=j(l),f)f.closeBracket(u),R(l,p);else return"error";return"bracket"}else return u=="{"||u=="["?(f=r.DEFAULT,f=new f,X(l,f),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),f=K(l),f.name=="begin"&&(f.argument=h.current()),f.styleIdentifier())}function m(h,l,f){if(h.eatSpace())return null;if(f&&h.match(f))return R(l,v),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=h.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(h.skipToEnd(),"comment"):"error"}function p(h,l){var f=h.peek(),o;return f=="{"||f=="["?(o=j(l),o.openBracket(f),h.eat(f),R(l,v),"bracket"):/[ \t\r]/.test(f)?(h.eat(f),null):(R(l,v),U(l),v(h,l))}return{startState:function(){var h=P.inMathMode?function(l,f){return m(l,f)}:v;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,l){return l.f(h,l)},blankLine:function(h){h.f=v,h.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(rt,_e,Z){},"/cxE":function(rt,_e,Z){"use strict";Z.d(_e,"f",function(){return P}),Z.d(_e,"g",function(){return X}),Z.d(_e,"h",function(){return j}),Z.d(_e,"e",function(){return K}),Z.d(_e,"b",function(){return G}),Z.d(_e,"c",function(){return r}),Z.d(_e,"d",function(){return R}),Z.d(_e,"a",function(){return v});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+` `+m.stack):m},0)}}emit(m){this.listeners.forEach(p=>{p(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const J=new ie;function P(m){K(m)||J.onUnexpectedError(m);return}function X(m){K(m)||J.onUnexpectedExternalError(m);return}function j(m){if(m instanceof Error){let{name:p,message:h}=m;const l=m.stacktrace||m.stack;return{$isError:!0,name:p,message:h,stack:l}}return m}const U="Canceled";function K(m){return m instanceof Error&&m.name===U&&m.message===U}function G(){const m=new Error(U);return m.name=m.message,m}function r(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function R(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class v extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(G,r,R){var v=R&&R!=ie.Init;if(r&&!v)G.on("blur",j),G.on("change",U),G.on("swapDoc",U),ie.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){X(G)}),U(G);else if(!r&&v){G.off("blur",j),G.off("change",U),G.off("swapDoc",U),ie.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),J(G);var m=G.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}r&&!G.hasFocus()&&j(G)});function J(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){J(G);var r=G.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=G.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),r.appendChild(R),G.display.lineSpace.insertBefore(r,G.display.lineSpace.firstChild)}function X(G){setTimeout(function(){var r=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?r=!R.value:G.lineCount()==1&&(r=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),r?P(G):J(G)},20)}function j(G){K(G)&&P(G)}function U(G){var r=G.getWrapperElement(),R=K(G);r.className=r.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(G):J(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(X,j){var U=X.indentUnit,K={},G=j.htmlMode?J:P;for(var r in G)K[r]=G[r];for(var r in j)K[r]=j[r];var R,v;function m(d,S){function y(F){return S.tokenize=F,F(d,S)}var b=d.next();if(b=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?y(l("atom","]]>")):null:d.match("--")?y(l("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),y(f(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),S.tokenize=l("meta","?>"),"meta"):(R=d.eat("/")?"closeTag":"openTag",S.tokenize=p,"tag bracket");if(b=="&"){var B;return d.eat("#")?d.eat("x")?B=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):B=d.eatWhile(/[\d]/)&&d.eat(";"):B=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),B?"atom":"error"}else return d.eatWhile(/[^&<]/),null}m.isInText=!0;function p(d,S){var y=d.next();if(y==">"||y=="/"&&d.eat(">"))return S.tokenize=m,R=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return R="equals",null;if(y=="<"){S.tokenize=m,S.state=a,S.tagName=S.tagStart=null;var b=S.tokenize(d,S);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=h(y),S.stringStartCol=d.column(),S.tokenize(d,S)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(d){var S=function(y,b){for(;!y.eol();)if(y.next()==d){b.tokenize=p;break}return"string"};return S.isInAttribute=!0,S}function l(d,S){return function(y,b){for(;!y.eol();){if(y.match(S)){b.tokenize=m;break}y.next()}return d}}function f(d){return function(S,y){for(var b;(b=S.next())!=null;){if(b=="<")return y.tokenize=f(d+1),y.tokenize(S,y);if(b==">")if(d==1){y.tokenize=m;break}else return y.tokenize=f(d-1),y.tokenize(S,y)}return"meta"}}function o(d,S,y){this.prev=d.context,this.tagName=S,this.indent=d.indented,this.startOfLine=y,(K.doNotIndent.hasOwnProperty(S)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function u(d){d.context&&(d.context=d.context.prev)}function s(d,S){for(var y;;){if(!d.context)return;if(y=d.context.tagName,!K.contextGrabbers.hasOwnProperty(y)||!K.contextGrabbers[y].hasOwnProperty(S))return;u(d)}}function a(d,S,y){return d=="openTag"?(y.tagStart=S.column(),O):d=="closeTag"?E:a}function O(d,S,y){return d=="word"?(y.tagName=S.current(),v="tag",L):K.allowMissingTagName&&d=="endTag"?(v="tag bracket",L(d,S,y)):(v="error",O)}function E(d,S,y){if(d=="word"){var b=S.current();return y.context&&y.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(y.context.tagName)&&u(y),y.context&&y.context.tagName==b||K.matchClosing===!1?(v="tag",w):(v="tag error",D)}else return K.allowMissingTagName&&d=="endTag"?(v="tag bracket",w(d,S,y)):(v="error",D)}function w(d,S,y){return d!="endTag"?(v="error",w):(u(y),a)}function D(d,S,y){return v="error",w(d,S,y)}function L(d,S,y){if(d=="word")return v="attribute",A;if(d=="endTag"||d=="selfcloseTag"){var b=y.tagName,B=y.tagStart;return y.tagName=y.tagStart=null,d=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?s(y,b):(s(y,b),y.context=new o(y,b,B==y.indented)),a}return v="error",L}function A(d,S,y){return d=="equals"?C:(K.allowMissing||(v="error"),L(d,S,y))}function C(d,S,y){return d=="string"?x:d=="word"&&K.allowUnquoted?(v="string",L):(v="error",L(d,S,y))}function x(d,S,y){return d=="string"?x:L(d,S,y)}return{startState:function(d){var S={tokenize:m,state:a,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(S.baseIndent=d),S},token:function(d,S){if(!S.tagName&&d.sol()&&(S.indented=d.indentation()),d.eatSpace())return null;R=null;var y=S.tokenize(d,S);return(y||R)&&y!="comment"&&(v=null,S.state=S.state(R||y,d,S),v&&(y=v=="error"?y+" error":v)),y},indent:function(d,S,y){var b=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+U;if(b&&b.noIndent)return ie.Pass;if(d.tokenize!=p&&d.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(d.tagName)return K.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+U*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(d){d.state==C&&(d.state=L)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var S=[],y=d.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});class ie{constructor(P){this.element=P,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class J{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let P=this._first;for(;P!==ie.Undefined;){const X=P.next;P.prev=ie.Undefined,P.next=ie.Undefined,P=X}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(P){return this._insert(P,!1)}push(P){return this._insert(P,!0)}_insert(P,X){const j=new ie(P);if(this._first===ie.Undefined)this._first=j,this._last=j;else if(X){const K=this._last;this._last=j,j.prev=K,K.next=j}else{const K=this._first;this._first=j,j.next=K,K.prev=j}this._size+=1;let U=!1;return()=>{U||(U=!0,this._remove(j))}}shift(){if(this._first===ie.Undefined)return;{const P=this._first.element;return this._remove(this._first),P}}pop(){if(this._last===ie.Undefined)return;{const P=this._last.element;return this._remove(this._last),P}}_remove(P){if(P.prev!==ie.Undefined&&P.next!==ie.Undefined){const X=P.prev;X.next=P.next,P.next.prev=X}else P.prev===ie.Undefined&&P.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):P.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):P.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let P=this._first;for(;P!==ie.Undefined;)yield P.element,P=P.next}}},"3/fG":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});function ie(P,X){let j;return X.length===0?j=P:j=P.replace(/\{(\d+)\}/g,function(U,K){const G=K[0];return typeof X[G]!="undefined"?X[G]:U}),j}function J(P,X,...j){return ie(X,j)}},"500L":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return E});var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("2qtc"),X=Z("kLXV"),j=Z("9og8"),U=Z("k1fw"),K=Z("miYZ"),G=Z("tsqr"),r=Z("oBTY"),R=Z("tJVT"),v=Z("DZo9"),m=Z("8z0m"),p=Z("WmNS"),h=Z.n(p),l=Z("q1tI"),f=Z.n(l),o=Z("m3rI"),u=Z("wzkS"),s=Z("y5JW"),a=Z("LtfV"),O=m.a.Dragger;function E(w){var D=[];return w&&w.length>0&&(D=w.map(function(L){return{uid:L.id,id:L.id,name:L.title+s.c+L.filesize,url:L.url,filesize:L.filesize,status:"done",response:{id:L.id}}})),D}_e.b=function(w){var D=w.value,L=w.onChange,A=w.action,C=w.className,x=w.maxSize,d=x===void 0?150:x,S=w.title,y=S===void 0?"\u4E0A\u4F20\u9644\u4EF6":S,b=w.showRemoveModal,B=b===void 0?!1:b,F=w.accept,_=F===void 0?"":F,M=w.additionalText,I=w.isDragger,g=w.number,H=g===void 0?1e3:g,$=w.aloneClear,ne=$===void 0?!1:$,oe=Object(l.useState)(!1),Oe=Object(R.a)(oe,2),ye=Oe[0],Te=Oe[1],Re=Object(l.useState)(D||[]),Le=Object(R.a)(Re,2),ce=Le[0],he=Le[1];Object(l.useEffect)(function(){D&&(he(Object(r.a)(D)),H===(D==null?void 0:D.length)&&Te(!0))},[D]);var re=function(){setTimeout(function(){ce.pop(),he(Object(r.a)(ce))},500)},fe={multiple:!0,disabled:ye,accept:_,withCredentials:!0,fileList:ce,beforeUpload:function(Ne,Se){var Pe=Ne.size/1024/1024;return ce.concat(Se).length>H?(ce.pop(),he(Object(r.a)(ce)),G.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(H,"\u4E2A\u6587\u4EF6")),ne?Promise.reject():(re(),!1)):!0},action:A||"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:function(Ne){var Se,Pe,je=Object(r.a)(Ne.fileList);if(Ne.file.status==="done"&&((Se=Ne.file)===null||Se===void 0||((Pe=Se.response)===null||Pe===void 0)?void 0:Pe.status)===-1){var le,ve;G.b.error((le=Ne.file)===null||le===void 0||((ve=le.response)===null||ve===void 0)?void 0:ve.message);return}je.length>=H?Te(!0):Te(!1),he(Object(r.a)(je)),je=je.map(function(we){var Ie;if(we!=null&&(Ie=we.response)!==null&&Ie!==void 0&&Ie.id){var We;we.url="/api/attachments/".concat(we==null||((We=we.response)===null||We===void 0)?void 0:We.id)}return we.name.indexOf(s.c)===-1&&(we.name="".concat(we.name).concat(s.c).concat(Object(s.a)(we.size))),Object(U.a)({},we)}),console.log("info:",Ne),L(je)},onRemove:function(){var De=Object(j.a)(h.a.mark(function Se(Pe){var je;return h.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:if(je=function(){var we=Object(j.a)(h.a.mark(function Ie(){var We,Ve;return h.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:if(We=Pe.response?Pe.response.id:Pe.id,!We){$e.next=8;break}return $e.next=4,Object(u.d)(Pe.response?Pe.response.id:Pe.uid);case 4:return Ve=$e.sent,$e.abrupt("return",Ve);case 8:return $e.abrupt("return",!0);case 9:case"end":return $e.stop()}},Ie)}));return function(){return we.apply(this,arguments)}}(),!B){ve.next=5;break}return ve.abrupt("return",new Promise(function(we,Ie){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:f.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var We=Object(j.a)(h.a.mark(function Ze(){var $e;return h.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Qe.next=2,je();case 2:$e=Qe.sent,G.b.success("\u5220\u9664\u6210\u529F"),we(!0);case 5:case"end":return Qe.stop()}},Ze)}));function Ve(){return We.apply(this,arguments)}return Ve}(),onCancel:function(){return we(!1)}})}));case 5:return ve.next=7,je();case 7:return ve.abrupt("return",ve.sent);case 8:case"end":return ve.stop()}},Se)}));function Ne(Se){return De.apply(this,arguments)}return Ne}()};function se(De){De.preventDefault(),De.stopPropagation()}return f.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&f.a.createElement(O,fe,f.a.createElement("p",{className:"ant-upload-drag-icon"},f.a.createElement(a.a,null)),f.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",f.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",d,"MB)"," "),M),!I&&f.a.createElement(m.a,fe,f.a.createElement(J.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:f.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:ye},y),f.a.createElement("span",{onClick:se,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",d,"MB)"," ")))}},"55Ip":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return s});var ie=Z("Ty5D"),J=Z("dI71"),P=Z("q1tI"),X=Z.n(P),j=Z("YS25"),U=Z("17x9"),K=Z.n(U),G=Z("wx14"),r=Z("zLVn"),R=Z("9R94"),v=function(C){Object(J.a)(x,C);function x(){for(var S,y=arguments.length,b=new Array(y),B=0;B$&&($=g.line_indent_level));var ne={mode:H,parent:g,last_token:g?g.last_token:new p(s.START_BLOCK,""),last_word:g?g.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:g?g.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},M.prototype._reset=function(g){var H=g.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var $=new f(g,this._options);return this._tokens=$.tokenize(),g},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=` `,H&&h.lineBreak.test(H||"")&&($=H.match(h.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return g=this._output.get_code($),g},M.prototype.handle_token=function(g,H){g.type===s.START_EXPR?this.handle_start_expr(g):g.type===s.END_EXPR?this.handle_end_expr(g):g.type===s.START_BLOCK?this.handle_start_block(g):g.type===s.END_BLOCK?this.handle_end_block(g):g.type===s.WORD?this.handle_word(g):g.type===s.RESERVED?this.handle_word(g):g.type===s.SEMICOLON?this.handle_semicolon(g):g.type===s.STRING?this.handle_string(g):g.type===s.EQUALS?this.handle_equals(g):g.type===s.OPERATOR?this.handle_operator(g):g.type===s.COMMA?this.handle_comma(g):g.type===s.BLOCK_COMMENT?this.handle_block_comment(g,H):g.type===s.COMMENT?this.handle_comment(g,H):g.type===s.DOT?this.handle_dot(g):g.type===s.EOF?this.handle_eof(g):g.type===s.UNKNOWN?this.handle_unknown(g,H):this.handle_unknown(g,H)},M.prototype.handle_whitespace_and_comments=function(g,H){var $=g.newlines,ne=this._options.keep_array_indentation&&b(this._flags.mode);if(g.comments_before)for(var oe=g.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,H),this.handle_token(oe,H),oe=g.comments_before.next();if(ne)for(var Oe=0;Oe<$;Oe+=1)this.print_newline(Oe>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ye=1;ye<$;ye+=1)this.print_newline(!0,H)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(g,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&g.newlines||H,ne=a(this._flags.last_token.text,u)||a(g.text,u);if(ne){var oe=a(this._flags.last_token.text,u)&&a(this._options.operator_position,x)||a(g.text,u);$=$&&oe}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,I))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(g,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&w($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(g)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(g){this._output.just_added_newline()&&(this._options.keep_array_indentation&&g.newlines&&(g.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(g.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},M.prototype.print_token=function(g){if(this._output.raw){this._output.add_raw_token(g);return}if(this._options.comma_first&&g.previous&&g.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(g),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(g),this._output.non_breaking_space=!0,this._output.add_token(g.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.set_mode=function(g){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,g),this._flags=this.create_flags(this._previous_flags,g),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(g){var H=!1;return H=H||D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD,H=H||w(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&D(this._flags.last_token,I)&&!g.newlines,H=H||w(this._flags.last_token,"else")&&!(w(g,"if")&&!g.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(g.text==="--"||g.text==="++")&&this._last_last_text!=="function"&&g.type!==s.WORD&&g.type!==s.RESERVED,H=H||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),H?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(g,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g,D(g,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g);var H=d.Expression;if(g.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(g),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=d.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=d.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=d.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&g.whitespace_before===""?this._output.space_before_token=!1:(a(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var ne=this._tokens.peek(-4);D($,["async","function"])||$.text==="*"&&D(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(ne.text==="{"||ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(g);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&a(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(g,g.newlines),this.print_token(g),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(g){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(g,g.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(g),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(g){this.handle_whitespace_and_comments(g);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):$&&(a($.text,[":",","])&&a(H.type,[s.STRING,s.WORD,s.RESERVED])||a(H.text,["get","set","..."])&&a($.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a($.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):a(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!H.comments_before&&H.text==="}",oe=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Oe=0,ye=null;this._flags.inline_frame=!0;do if(Oe+=1,ye=this._tokens.peek(Oe-1),ye.newlines){this._flags.inline_frame=!1;break}while(ye.type!==s.EOF&&!(ye.type===s.END_BLOCK&&ye.opened===g))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(oe||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,L)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(g),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(g),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(g){for(this.handle_whitespace_and_comments(g);this._flags.mode===d.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(g)},M.prototype.handle_word=function(g){if(g.type===s.RESERVED){if(a(g.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)g.type=s.WORD;else if(g.text==="import"&&a(this._tokens.peek().text,["(","."]))g.type=s.WORD;else if(a(g.text,["as","from"])&&!this._flags.import_block)g.type=s.WORD;else if(this._flags.mode===d.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(g.type=s.WORD)}}if(this.start_of_statement(g)?D(this._flags.last_token,["var","let","const"])&&g.type===s.WORD&&(this._flags.declaration_statement=!0):g.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(g),this.print_newline()):this.handle_whitespace_and_comments(g),this._flags.do_block&&!this._flags.do_while)if(w(g,"while")){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(g,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(g,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(g),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g)),w(g,"function")){(a(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(a(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!g.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,I)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(g),this._flags.last_word=g.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":D(g,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(a(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&a(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),D(g,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),D(g,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&g.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?D(this._flags.last_token,L)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(g,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!D(g,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(g,"if")&&w(g.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(g,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);g.previous&&(g.previous.type===s.WORD||g.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(g),this._flags.last_word=g.text,g.type===s.RESERVED&&(g.text==="do"?this._flags.do_block=!0:g.text==="if"?this._flags.if_block=!0:g.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(g,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(g){this.start_of_statement(g)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(g);for(var H=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&w(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(g)},M.prototype.handle_string=function(g){g.text.startsWith("`")&&g.newlines===0&&g.whitespace_before===""&&(g.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(g)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(g),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(g):g.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(g.previous.text==="]"||g.previous.text===")")&&g.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(g)},M.prototype.handle_equals=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0},M.prototype.handle_comma=function(g){this.handle_whitespace_and_comments(g,!0),this.print_token(g),this._output.space_before_token=!0,this._flags.declaration_statement?(B(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(g)},M.prototype.handle_operator=function(g){var H=g.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=a(g.text,["-","+"])&&(a(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||a(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(g)){var ne=!H;this.handle_whitespace_and_comments(g,ne)}if(g.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(g);return}if(g.text==="::"){this.print_token(g);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(g),g.text===":"&&this._flags.in_case){this.print_token(g),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,Oe=!0,ye=!1;if(g.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ye=!0):g.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&a(g.text,u)){var Te=g.text===":",Re=Te&&ye,Le=Te&&!ye;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Le,this.print_token(g),(!Te||Re)&&this.allow_wrap_or_preserved_newline(g),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Te||Re?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(g):this._output.space_before_token=!1,this.print_token(g),this._output.space_before_token=!0;return;case C.preserve_newline:Le||this.allow_wrap_or_preserved_newline(g),oe=!(this._output.just_added_newline()||Le),this._output.space_before_token=oe,this.print_token(g),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(g),oe=!1;var ce=this._tokens.peek();Oe=ce&&a(ce.type,[s.WORD,s.RESERVED])}else if(g.text==="...")this.allow_wrap_or_preserved_newline(g),oe=this._flags.last_token.type===s.START_BLOCK,Oe=!1;else if(a(g.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(g),oe=!1,Oe=!1,g.newlines&&(g.text==="--"||g.text==="++"||g.text==="~")){var he=D(this._flags.last_token,L)&&g.newlines;he&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(he,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(oe=!0),this._flags.last_token.type===s.RESERVED?oe=!0:this._flags.last_token.type===s.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(g.text==="--"||g.text==="++")):this._flags.last_token.type===s.OPERATOR&&(oe=a(g.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(g.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Oe=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(g),this._output.space_before_token=Oe},M.prototype.handle_block_comment=function(g,H){if(this._output.raw){this._output.add_raw_token(g),g.directives&&g.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(g.directives){this.print_newline(!1,H),this.print_token(g),g.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(g.text)&&!g.newlines){this._output.space_before_token=!0,this.print_token(g),this._output.space_before_token=!0;return}else this.print_block_commment(g,H)},M.prototype.print_block_commment=function(g,H){var $=y(g.text),ne,oe=!1,Oe=!1,ye=g.whitespace_before,Te=ye.length;if(this.print_newline(!1,H),this.print_token_line_indentation(g),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),oe=F($,"*"),Oe=_($,ye),oe&&(this._flags.alignment=1),ne=0;ne<$.length;ne++)oe?(this.print_token_line_indentation(g),this._output.add_token(O($[ne]))):Oe&&$[ne]?(this.print_token_line_indentation(g),this._output.add_token($[ne].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token($[ne])),this.print_newline(!1,H);this._flags.alignment=0}},M.prototype.handle_comment=function(g,H){g.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(g),this.print_newline(!1,H)},M.prototype.handle_dot=function(g){this.start_of_statement(g)||this.handle_whitespace_and_comments(g,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,L)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(g,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(g)},M.prototype.handle_unknown=function(g,H){this.print_token(g),g.text[g.text.length-1]===` `&&this.print_newline(!1,H)},M.prototype.handle_eof=function(g){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(g)},r.exports.Beautifier=M},function(r){function R(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}R.prototype.clone_empty=function(){var p=new R(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},R.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},R.prototype.has_match=function(p){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(p))return!0;return!1},R.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(` `);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(` `);return p!==` `&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},function(r){function R(v,m,p,h){this.type=v,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=R},function(r,R){var v="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])*";R.identifier=new RegExp(l+f,"g"),R.identifierStart=new RegExp(l),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+h+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r |`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(r,R,v){var m=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function h(l){m.call(this,l,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var C=new RegExp(A),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+d.join("|")+")$"),y,b=function(F,_){p.call(this,F,_),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new o(this._input),I=new u(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(f.identifier).matching(f.identifierMatch),number:M.matching(E),punct:M.matching(C),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(//),include:M.starting_with(/#include/).until_after(f.lineBreak),shebang:M.starting_with(/#!/).until_after(f.lineBreak),xml:M.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new p,b.prototype._is_comment=function(F){return F.type===a.COMMENT||F.type===a.BLOCK_COMMENT||F.type===a.UNKNOWN},b.prototype._is_opening=function(F){return F.type===a.START_BLOCK||F.type===a.START_EXPR},b.prototype._is_closing=function(F,_){return(F.type===a.END_BLOCK||F.type===a.END_EXPR)&&_&&(F.text==="]"&&_.text==="["||F.text===")"&&_.text==="("||F.text==="}"&&_.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,_){var M=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(a.EOF,""):(M=M||this._read_non_javascript(I),M=M||this._read_string(I),M=M||this._read_word(F),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,F),M=M||this._read_xml(I,F),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},b.prototype._read_word=function(F){var _;if(_=this.__patterns.identifier.read(),_!=="")return _=_.replace(f.allLineBreaks,` `),!(F.type===a.DOT||F.type===a.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(_)?(_==="in"||_==="of")&&(F.type===a.WORD||F.type===a.STRING)?this._create_token(a.OPERATOR,_):this._create_token(a.RESERVED,_):this._create_token(a.WORD,_);if(_=this.__patterns.number.read(),_!=="")return this._create_token(a.WORD,_)},b.prototype._read_singles=function(F){var _=null;return F==="("||F==="["?_=this._create_token(a.START_EXPR,F):F===")"||F==="]"?_=this._create_token(a.END_EXPR,F):F==="{"?_=this._create_token(a.START_BLOCK,F):F==="}"?_=this._create_token(a.END_BLOCK,F):F===";"?_=this._create_token(a.SEMICOLON,F):F==="."&&D.test(this._input.peek(1))?_=this._create_token(a.DOT,F):F===","&&(_=this._create_token(a.COMMA,F)),_&&this._input.next(),_},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(a.EQUALS,F):F==="?."?this._create_token(a.DOT,F):this._create_token(a.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var _="";if(F==="#"){if(this._is_first_token()&&(_=this.__patterns.shebang.read(),_))return this._create_token(a.UNKNOWN,_.trim()+` `);if(_=this.__patterns.include.read(),_)return this._create_token(a.UNKNOWN,_.trim()+` `);F=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(w)){do F=this._input.next(),M+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(a.WORD,M)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(_=this.__patterns.html_comment_start.read(),_){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)_+=this._input.next();return y=!0,this._create_token(a.COMMENT,_)}}else if(y&&F==="-"&&(_=this.__patterns.html_comment_end.read(),_))return y=!1,this._create_token(a.COMMENT,_);return null},b.prototype._read_comment=function(F){var _=null;if(F==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=O.get_directives(M);I&&I.ignore==="start"&&(M+=O.readIgnored(this._input)),M=M.replace(f.allLineBreaks,` `),_=this._create_token(a.BLOCK_COMMENT,M),_.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),_=this._create_token(a.COMMENT,M))}return _},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var _=this._input.next();return this.has_char_escapes=!1,F==="`"?_+=this._read_string_recursive("`",!0,"${"):_+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(_=B(_)),this._input.peek()===F&&(_+=this._input.next()),_=_.replace(f.allLineBreaks,` `),this._create_token(a.STRING,_)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===a.RESERVED&&s(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===a.END_EXPR&&F.text===")"&&F.opened.previous.type===a.RESERVED&&s(F.opened.previous.text,["if","while","for"])||s(F.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},b.prototype._read_regexp=function(F,_){if(F==="/"&&this._allow_regexp_or_xml(_)){for(var M=this._input.next(),I=!1,g=!1;this._input.hasNext()&&(I||g||this._input.peek()!==F)&&!this._input.testChar(f.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?g=!0:this._input.peek()==="]"&&(g=!1)),this._input.next();return this._input.peek()===F&&(M+=this._input.next(),M+=this._input.read(f.identifier)),this._create_token(a.STRING,M)}return null},b.prototype._read_xml=function(F,_){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(_)){var M="",I=this.__patterns.xml.read_match();if(I){for(var g=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=g.indexOf("{")===0,$=0;I;){var ne=!!I[1],oe=I[2],Oe=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!Oe&&(oe===g||H&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--$:++$),M+=I[0],$<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(f.allLineBreaks,` `),this._create_token(a.STRING,M)}}return null};function B(F){for(var _="",M=0,I=new m(F),g=null;I.hasNext();)if(g=I.match(/([\s]|[^\\]|\\\\)+/g),g&&(_+=g[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")g=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")g=I.match(/u([0-9A-Fa-f]{4})/g);else{_+="\\",I.hasNext()&&(_+=I.next());continue}if(!g)return F;if(M=parseInt(g[1],16),M>126&&M<=255&&g[0].indexOf("x")===0)return F;if(M>=0&&M<32){_+="\\"+g[0];continue}else M===34||M===39||M===92?_+="\\"+String.fromCharCode(M):_+=String.fromCharCode(M)}return _}b.prototype._read_string_recursive=function(F,_,M){var I,g;F==="'"?g=this.__patterns.single_quote:F==='"'?g=this.__patterns.double_quote:F==="`"?g=this.__patterns.template_text:F==="}"&&(g=this.__patterns.template_expression);for(var H=g.read(),$="";this._input.hasNext();){if($=this._input.next(),$===F||!_&&f.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===` `&&this._input.next(),$+=this._input.next()):M&&(M==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),M===$&&(F==="`"?$+=this._read_string_recursive("}",_,"`"):$+=this._read_string_recursive("`",_,"${"),this._input.hasNext()&&($+=this._input.next())));$+=g.read(),H+=$}return H},r.exports.Tokenizer=b,r.exports.TOKEN=a,r.exports.positionable_operators=L.slice(),r.exports.line_starters=x.slice()},function(r){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},function(r,R,v){var m=v(8).InputScanner,p=v(3).Token,h=v(10).TokenStream,l=v(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(u,s){this._input=new m(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new p(f.START,""),a=null,O=[],E=new h;s.type!==f.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)E.add(u),u=this._get_next_token(s,a);E.isEmpty()||(u.comments_before=E,E=new h),u.parent=a,this._is_opening(u)?(O.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=O.pop(),u.parent=a),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(u,s){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(f.RAW,a):this._create_token(f.EOF,"")},o.prototype._is_comment=function(u){return!1},o.prototype._is_opening=function(u){return!1},o.prototype._is_closing=function(u,s){return!1},o.prototype._create_token=function(u,s){var a=new p(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=o,r.exports.TOKEN=f},function(r){function R(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&v/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(l){var f=this._create();return f._disabled[l]=!0,f._update(),f},h.prototype.read_options=function(l){var f=this._create();for(var o in p)f._disabled[o]=l.templating.indexOf(o)===-1;return f._update(),f},h.prototype.exclude=function(l){var f=this._create();return f._excluded[l]=!0,f._update(),f},h.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),l+=f,f=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},h.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},h.prototype._read_template=function(){var l="",f=this._input.peek();if(f==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(l=l||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},r.exports.TemplatablePattern=h}],U={};function K(r){var R=U[r];if(R!==void 0)return R.exports;var v=U[r]={exports:{}};return j[r](v,v.exports,K),v.exports}var G=K(0);P=G})();var X=P;!(ie=[],J=function(){return{js_beautify:X}}.apply(_e,ie),J!==void 0&&(rt.exports=J))})()},"7/Dv":function(rt,_e,Z){rt.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"746U":function(rt,_e,Z){"use strict";Z.d(_e,"f",function(){return ie}),Z.d(_e,"l",function(){return J}),Z.d(_e,"k",function(){return P}),Z.d(_e,"j",function(){return X}),Z.d(_e,"g",function(){return j}),Z.d(_e,"m",function(){return U}),Z.d(_e,"h",function(){return K}),Z.d(_e,"n",function(){return G}),Z.d(_e,"c",function(){return r}),Z.d(_e,"a",function(){return R}),Z.d(_e,"i",function(){return v}),Z.d(_e,"o",function(){return m}),Z.d(_e,"e",function(){return l}),Z.d(_e,"d",function(){return f}),Z.d(_e,"p",function(){return o}),Z.d(_e,"b",function(){return u});function ie(s){return Array.isArray(s)}function J(s){return typeof s=="string"}function P(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function X(s){return typeof s=="number"&&!isNaN(s)}function j(s){return s===!0||s===!1}function U(s){return typeof s=="undefined"}function K(s){return!G(s)}function G(s){return U(s)||s===null}function r(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function R(s){if(G(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function v(s){return typeof s=="function"}function m(s,a){const O=Math.min(s.length,a.length);for(let E=0;Efunction(){const D=Array.prototype.slice.call(arguments,0);return a(w,D)};let E={};for(const w of s)E[w]=O(w);return E}function o(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(rt,_e,Z){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),J=new Uint8Array(16);function P(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(J)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function j(p){return typeof p=="string"&&X.test(p)}for(var U=j,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function r(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(K[p[h+0]]+K[p[h+1]]+K[p[h+2]]+K[p[h+3]]+"-"+K[p[h+4]]+K[p[h+5]]+"-"+K[p[h+6]]+K[p[h+7]]+"-"+K[p[h+8]]+K[p[h+9]]+"-"+K[p[h+10]]+K[p[h+11]]+K[p[h+12]]+K[p[h+13]]+K[p[h+14]]+K[p[h+15]]).toLowerCase();if(!U(l))throw TypeError("Stringified UUID is invalid");return l}var R=r;function v(p,h,l){p=p||{};var f=p.random||(p.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,h){l=l||0;for(var o=0;o<16;++o)h[l+o]=f[o];return h}return R(f)}var m=_e.a=v},"7ahc":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return O});var ie=Z("k1fw"),J=Z("0Owb"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("y8nQ"),U=Z("Vl3Y"),K=Z("tJVT"),G=Z("OaEy"),r=Z("2fM7"),R=Z("q1tI"),v=Z.n(R),m=Z("VrN/"),p=Z.n(m),h=Z("p77/"),l=Z.n(h),f=Z("c5Ni"),o=Z.n(f),u=r.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};_e.b=function(E){var w=E.callback,D=E.onCancel,L=Object(R.useState)("python"),A=Object(K.a)(L,2),C=A[0],x=A[1];function d(y){x(a[y][1])}function S(y){w(y)}return v.a.createElement(U.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:d},Object.keys(a).map(function(y){return v.a.createElement(u,{key:y,value:y},a[y][0])}))),v.a.createElement(U.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(O,{mode:C})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function O(E){var w=E.value,D=E.onChange,L=E.mode,A=E.options,C=A===void 0?{}:A,x=Object(R.useRef)(),d=Object(R.useState)(),S=Object(K.a)(d,2),y=S[0],b=S[1];return Object(R.useEffect)(function(){if(y){function B(F){var _=F.getValue();D&&D(_)}return y.on("change",B),function(){y.off("change",B)}}},[y,D]),Object(R.useEffect)(function(){y&&y.setOption("mode",L)},[y,L]),Object(R.useEffect)(function(){y&&((w!==y.getValue()||w==="")&&setTimeout(function(){y.setValue(w||" ")},300))},[y,w]),Object(R.useEffect)(function(){if(x.current&&!y){var B=p.a.fromTextArea(x.current,Object(ie.a)({mode:L,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));b(B)}},[x.current,y]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:x}))}},"8EBN":function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.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 J=0;J-1&&X.substring(K+1,X.length);if(G)return ie.findModeByExtension(G)},ie.findModeByName=function(X){X=X.toLowerCase();for(var j=0;j=W.length?ee.slice(W.length):ee}).join(` `)}var o=[],u=["
    "],s=new h.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){o.length=0,u=["
      "]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(Y,T,k,W){if(T>=Y.length||Y[T].level<=k)return T;var ee=Y[T];W.push("
    • "+ee.text+""),T++;var V=[];return T=w(Y,T,ee.level,V),V.length>0&&(W.push("
        "),V.forEach(function(Ee){W.push(Ee)}),W.push("
      ")),W.push("
    • "),T=w(Y,T,k,W),T}function D(){return w(o,0,0,u),u.push("
    "),u.join("")}var L={heading:function(T){var k=a.exec(T);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(T){var k=this.rules.block.fences.exec(T);if(k){var W=k[0],ee=f(W,k[3]||""),V=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(V)>=0){var Ee=x(),Ke=ee;ee=Ee,d[Ee]={type:"block",expression:Ke}}return{type:"code",raw:W,lang:V,text:ee}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,x=function(){return"__special_katext_id_".concat(C++,"__")},d={};function S(){return d}function y(){C=0,d={}}function b(Y){return Y=Y.replace(A,function(T,k){var W=x();return d[W]={type:"inline",expression:k},W}),Y}var B=s.listitem;s.listitem=function(Y){return B(b(Y))};var F=s.paragraph;s.paragraph=function(Y){return F(b(Y))};var _=s.tablecell;s.tablecell=function(Y,T){return _(b(Y),T)},s.code=function(Y,T,k){var W=(T||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"

    ".concat(Y,"

    "):'
    ').concat(k?Y:Object(l.escape)(Y,!0),`
    `):'
    '+(k?Y:Object(l.escape)(Y,!0))+"
    "},s.heading=function(Y,T,k){var W=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:W,level:T,text:Y}),"'+Y+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:L,renderer:s});var M=h.a,I=Z("SJMd"),g=Z("ulZh"),H=Z.n(g),$=Z("m3rI"),ne=Z("Oy/b"),oe=Z("p5ED"),Oe=Z("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var ye=function(Y,T){return(ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,T)};function Te(Y,T){function k(){this.constructor=Y}ye(Y,T),Y.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function Re(Y,T,k,W){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(W.next(pt))}catch(Ye){V(Ye)}}function Ke(pt){try{et(W.throw(pt))}catch(Ye){V(Ye)}}function et(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Ee,Ke)}et((W=W.apply(Y,T||[])).next())})}function Le(Y,T){var k,W,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,W&&(ee=2&Ye[0]?W.return:Ye[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ye[1])).done)return ee;switch(W=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Ee.label++,{value:Ye[1],done:!1};case 5:Ee.label++,W=Ye[1],Ye=[0];continue;case 7:Ye=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Ee=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]',"select"),this.addActionButton(W,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(V){var Ee=document.createElement("div");Ee.className=""+k.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",V.typeName),Ee.innerHTML=V.icon,Ee.addEventListener("click",function(){k.markerToolbarButtonClicked(Ee,V)}),k.buttons.push(Ee),k.markerButtons.push(Ee)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'',"render"),this.addActionButton(ee,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},Y.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k0&&this.buttonClickListeners.forEach(function(W){return W("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(T,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(T){var k=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===T});k&&this.setActiveButton(k)},Y.prototype.setCurrentMarker=function(T){var k=this;this.currentMarker=T,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){k.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},Y}(),je=function(){function Y(T,k,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=k,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Se("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 Se("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Se("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Se("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Se("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 Se("toolbox-panel-row_colors",` background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new Se("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px; padding: `+k+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Se("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},Y.prototype.show=function(T){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(T){var k,W,ee=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(V){var Ee;V.uiStyleSettings=ee.uiStyleSettings;var Ke=document.createElement("div");Ke.className=ee.toolboxButtonStyleClass.name+" "+((Ee=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:ee.toolboxButtonStyleColorsClass.name),Ke.innerHTML=V.icon,Ke.title=V.title,Ke.addEventListener("click",function(){ee.panelButtonClick(V)}),ee.panelButtons.push(Ke),ee.buttonRow.appendChild(Ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(T){var k=this,W=-1;if(T!==this.activePanel){W=this.panels.indexOf(T),this.panelRow.innerHTML="";var ee=T.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(V,Ee){var Ke,et;V.className=k.toolboxButtonStyleClass.name+" "+(Ee===W?""+((Ke=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:k.toolboxActiveButtonStyleColorsClass.name):""+((et=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&et!==void 0?et:k.toolboxButtonStyleColorsClass.name))})},Y}(),le=function(Y,T){this.title=Y,this.icon=T},ve=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=W,Ee.currentColor=ee,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var V=k.getColorBox(ee);W.appendChild(V),k.colorBoxes.push(V)}),W},T.prototype.getColorBox=function(k){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-ee,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=V-2+"px",Ee.style.height=V-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(V+2)/2+"px",Ee.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){W.setCurrentColor(k,Ee)});var Ke=document.createElement("div");return Ke.style.display="inline-block",Ke.style.width=V-2+"px",Ke.style.height=V-2+"px",Ke.style.backgroundColor=k,Ke.style.borderRadius=V/2+"px",k==="transparent"&&(Ke.style.fill=this.uiStyleSettings.toolboxAccentColor,Ke.innerHTML=` `),Ee.appendChild(Ke),Ee},T.prototype.setCurrentColor=function(k,W){var ee=this;this.currentColor=k,this.colorBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},T}(le),we=function(){function Y(T,k,W){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=k,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(T){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(T,k){},Y.prototype.dblClick=function(T,k){},Y.prototype.manipulate=function(T){},Y.prototype.pointerUp=function(T){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},Y.prototype.scale=function(T,k){},Y.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},Y.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),Ie=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},Y}(),We=function(){function Y(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},Y}(),Ve=function(){function Y(){}return Y.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},Y.toSVGMatrix=function(T,k){return T.a=k.a,T.b=k.b,T.c=k.c,T.d=k.d,T.e=k.e,T.f=k.f,T},Y}(),Ze=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return Te(T,Y),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var W=he.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(k);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},T.prototype.manipulate=function(k){var W=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(k)},T.prototype.resize=function(k){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,V=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+k.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+k.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+k.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),Ee>=0?(this.top=V,this.height=Ee):(this.top=V+Ee,this.height=-Ee),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var W=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},T.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},T.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM(),ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},T.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var W=this.container.getCTM();W=W.inverse();var ee=he.createPoint(k.x,k.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},T.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var k=he.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=he.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=he.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ie,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},T.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()},T.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,W=-k/2,ee=W,V=(this.width+this.CB_DISTANCE)/2-k/2,Ee=(this.height+this.CB_DISTANCE)/2-k/2,Ke=this.height+this.CB_DISTANCE-k/2,et=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,V,ee),this.positionGrip(this.controlGrips.topRight.visual,et,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,Ee),this.positionGrip(this.controlGrips.centerRight.visual,et,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Ke),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ke),this.positionGrip(this.controlGrips.bottomRight.visual,et,Ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,ee-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W);var ee=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:ee.x*k,y:ee.y*W});this.left=V.x,this.top=V.y,this.width=this.width*k,this.height=this.height*W,this.adjustControlBox()},T}(we),$e=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual)},T.prototype.createVisual=function(){this.visual=he.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.setSize()},T.prototype.setSize=function(){Y.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){Y.prototype.pointerUp.call(this,k),this.setSize()},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},T.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){var W=k;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize()},T.title="Rectangle marker",T}(Ze),st=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=W,Ee.currentWidth=ee,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentWidth(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.innerText=ee.toString(),Ee.style.marginRight="5px",V.appendChild(Ee);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.display="flex",Ke.style.alignItems="center";var et=document.createElement("hr");et.style.minWidth="20px",et.style.border="0px",et.style.borderTop=ee+"px solid "+k.uiStyleSettings.toolboxColor,et.style.flexGrow="2",Ke.appendChild(et),V.appendChild(Ke),k.widthBoxes.push(V)}),W},T.prototype.setCurrentWidth=function(k,W){var ee=this;this.currentWidth=k,this.widthBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(le),Qe=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.styles=[],Ee.styleBoxes=[],Ee.styles=W,Ee.currentStyle=ee,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.styles.length-5+"%",V.style.borderColor=ee===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentStyle(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var Ke=` `;Ee.innerHTML=Ke,V.appendChild(Ee),k.styleBoxes.push(V)}),W},T.prototype.setCurrentStyle=function(k,W){var ee=this;this.currentStyle=k,this.styleBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(le),nt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="FrameMarker",T.title="Frame marker",T.icon='',T}($e),Fe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ot=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!!Y.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(k){var W=this.state;Y.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},T.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var k=new We;return k.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(k.visual),k},T.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},T.prototype.positionGrip=function(k,W,ee){var V=k.transform.baseVal.getItem(0);V.setTranslate(W,ee),k.transform.baseVal.replaceItem(V,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.x1=this.x1*k,this.y1=this.y1*W,this.x2=this.x2*k,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},T}(we),tt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='',T}(ot),Be=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=W,Ee.currentFont=ee,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/k.fonts.length-5+"%",V.style.borderColor=ee===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentFont(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=ee,Ee.style.overflow="hidden";var Ke=document.createElement("div");Ke.style.whiteSpace="nowrap",Ke.style.overflow="hidden",Ke.style.textOverflow="ellipsis",Ke.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(Ke),V.appendChild(Ee),k.fontBoxes.push(V)}),W},T.prototype.setCurrentFont=function(k,W){var ee=this;this.currentFont=k,this.fontBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(le),He=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=ee.defaultColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Te(T,Y),T.prototype.ownsTarget=function(k){if(Y.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===k&&(W=!0)}),W},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},T.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){k.textElement.appendChild(he.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var k=this.textElement.getBBox(),W=1;if(k.width>0&&k.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/k.width,V=(1*this.height-this.height*this.padding*2/100)/k.height;W=Math.min(ee,V)}return W},T.prototype.getTextPosition=function(k){var W=this.textElement.getBBox(),ee=0,V=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*k)/2,V=this.height/2-W.height*k/2),{x:ee,y:V}},T.prototype.sizeText=function(){var k=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=k.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},T.prototype.manipulate=function(k){Y.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(k){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,k),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&W>.9;)W-=.1,k.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),V={x:ee.width*k,y:ee.height*k};W.x-=V.x/2,W.y-=V.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},T.prototype.dblClick=function(k,W){Y.prototype.dblClick.call(this,k,W),this.showTextEditor()},T.prototype.setColor=function(k){this.textElement&&he.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},T.prototype.setFont=function(k){this.textElement&&he.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){var W=k;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),Y.prototype.restoreState.call(this,k),this.setSize()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.icon='',T}(Ze),Ae=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=ee.defaultColor,V.lineWidth=ee.defaultStrokeWidth,V.pixelRatio=ee.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new ve("Color",ee.defaultColorSet,ee.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var k=he.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):Y.prototype.pointerDown.call(this,k,W)},T.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){Y.prototype.resize.call(this,k),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,k)},T.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)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],V=W[1],Ee=W[2],Ke=W[3],et=!1,pt=0;pt0&&(et=!0,ptKe&&(Ke=pt),Ye>Ee&&(Ee=Ye));if(et){this.left=ee/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(Ee-ee)/this.pixelRatio,this.height=(Ke-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Ee-ee,_t.height=Ke-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(ee,V,Ee-ee,Ke-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},T.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){this.createVisual(),Y.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(k,W){Y.prototype.scale.call(this,k,W),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.icon='',T}(Ze),me=function(Y){function T(k,W,ee){var V=Y.call(this,k,ee||'')||this;return V.typeBoxes=[],V.currentType=W,V.setCurrentType=V.setCurrentType.bind(V),V}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(Ke){var et="both";switch(Ke){case 0:et="both";break;case 1:et="start";break;case 2:et="end";break;case 3:et="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=et===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){k.setCurrentType(et,pt)}),W.appendChild(pt),et==="both"||et==="start"){var Ye=document.createElement("div");Ye.style.display="flex",Ye.style.alignItems="center",Ye.style.minHeight="20px",Ye.innerHTML=` `,Ye.style.marginLeft="5px",pt.appendChild(Ye)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),pt.appendChild(_t),et==="both"||et==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.innerHTML=` `,$t.style.marginRight="5px",pt.appendChild($t)}V.typeBoxes.push(pt)},V=this,Ee=0;Ee<4;Ee++)ee(Ee);return W},T.prototype.setCurrentType=function(k,W){var ee=this;this.currentType=k,this.typeBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(le),xe=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new me("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},T.prototype.getArrowPoints=function(k,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return k-ee/2+","+(W+V/2)+" "+k+","+(W-V/2)+" "+(k+ee/2)+","+(W+V/2)},T.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},T.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='',T}(tt),ae=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.fillColor=ee.defaultFillColor,V.strokeWidth=0,V.fillPanel=new ve("Color",ee.defaultColorSet,ee.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="CoverMarker",T.title="Cover marker",T.icon='',T}($e),ue=function(Y){function T(k,W,ee,V){var Ee=Y.call(this,k,V||'')||this;return Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=W,Ee.currentOpacity=ee,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return Te(T,Y),T.prototype.getUi=function(){var k=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=ee===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){k.setCurrentOpacity(ee,V)}),W.appendChild(V);var Ee=document.createElement("div");Ee.innerText=100*ee+"%",V.appendChild(Ee),k.opacityBoxes.push(V)}),W},T.prototype.setCurrentOpacity=function(k,W){var ee=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(le),de=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=ee.defaultHighlightColor,V.strokeWidth=0,V.opacity=ee.defaultHighlightOpacity,V.fillPanel=new ve("Color",ee.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ue("Opacity",ee.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Te(T,Y),T.prototype.setOpacity=function(k){this.opacity=k,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="HighlightMarker",T.title="Highlight marker",T.icon='',T}(ae),ge='',Ce=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=ee.defaultStrokeColor,V.bgColor=ee.defaultFillColor,V.fontFamily=ee.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new ve("Text color",ee.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new ve("Fill color",ee.defaultColorSet,V.bgColor,ge),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new We,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Te(T,Y),T.prototype.ownsTarget=function(k){return Y.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},T.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(k,W){this.state==="new"&&Y.prototype.pointerDown.call(this,k,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,k,W)},T.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,k);else{var W=this.state==="creating";Y.prototype.pointerUp.call(this,k),this.setTipPoints(W),this.positionTip()}},T.prototype.manipulate=function(k){if(this.tipMoving){var W=this.unrotatePoint(k);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,k)},T.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",k]]),he.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},T.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},T.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var W=Math.min(this.height/2,15),ee=this.height/5;k&&(this.tipPosition={x:W+ee/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.icon='',T}(tt),lt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokePanel.colors=ee.defaultColorSet,V.fillColor="transparent",V}return Te(T,Y),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Y.prototype.getState.call(this);return k.typeName=T.typeName,k},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.icon='',T}(Ue),mt=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),ft=function(Y){function T(k,W,ee){var V=Y.call(this,k,W,ee)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=ee.defaultColor,V.strokeWidth=ee.defaultStrokeWidth,V.strokeDasharray=ee.defaultStrokeDasharray,V.strokePanel=new ve("Line color",ee.defaultColorSet,ee.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new st("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new Qe("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Te(T,Y),T.prototype.ownsTarget=function(k){return!(!Y.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(k,W){Y.prototype.pointerDown.call(this,k,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},T.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Y.prototype.manipulate.call(this,k)},T.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Y.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},T.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},T.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},T.prototype.scale=function(k,W){this.curveX=this.curveX*k,this.curveY=this.curveY*W,Y.prototype.scale.call(this,k,W)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return k.typeName=T.typeName,k},T.prototype.restoreState=function(k){Y.prototype.restoreState.call(this,k);var W=k;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.icon='',T}(ot),wt=function(){function Y(T,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=k}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),St=function(Y){function T(k,W,ee){var V=Y.call(this,k,!1)||this;return V.dataUrl=W,V.state=ee,V}return Te(T,Y),T}(wt),ct=function(Y){function T(k,W,ee){ee===void 0&&(ee=!1);var V=Y.call(this,k,ee)||this;return V.marker=W,V}return Te(T,Y),T}(wt),Bt=function(){function Y(){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 Y.prototype.addEventListener=function(T,k){this[T].push(k)},Y.prototype.removeEventListener=function(T,k){var W=this[T].indexOf(k);W>-1&&this[T].splice(W,1)},Y}(),Lt=function(){function Y(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new mt,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 Bt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Y.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.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(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,lt,Ue,de,Ce,ze,ae,tt,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,Ue,de,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[nt,Ae,xe,He,de]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var k=this;this._availableMarkerTypes.splice(0),T.forEach(function(W){if(typeof W=="string"){var ee=k.ALL_MARKER_TYPES.find(function(V){return V.typeName===W});ee!==void 0&&k._availableMarkerTypes.push(ee)}else k._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new wt(T))})},Y.prototype.render=function(){return Re(this,void 0,void 0,function(){var T;return Le(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(T=new fe).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Y.prototype.close=function(T){var k=this;if(T===void 0&&(T=!1),this.isOpen){var W=!1;T||this.eventListeners.beforeclose.forEach(function(ee){var V=new wt(k,!0);ee(V),V.defaultPrevented&&(W=!0)}),W||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ee){return ee(new wt(k))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var T,k=[],W=0;Wthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,W=k',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.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")},Y.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"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.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 T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Pe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},Y.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())},Y.prototype.toolbarButtonClicked=function(T,k){if(T==="marker"&&k!==void 0)this.createNewMarker(k);else if(T==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var V=new ct(T,T._currentMarker,!0);ee(V),V.defaultPrevented&&(k=!0)}),!k){var W=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ee){return ee(new ct(T,W))})}}},Y.prototype.clear=function(){var T=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var Ke=new ct(T,void 0,!0);Ee(Ke),Ke.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var W=function(Ee){var Ke=ee.markers[Ee];ee.setCurrentMarker(ee.markers[Ee]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(et){return et(new ct(T,Ke))})},ee=this,V=this.markers.length-1;V>=0;V--)W(V);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var T;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=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},Y.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)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===k.width&&W.height===k.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),ee1&&this.panTo({x:T.clientX,y:T.clientY}))},Y.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.markerImage.getBoundingClientRect();return{x:(T-W.left)/this.zoomLevel,y:(k-W.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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()},Y.prototype.addLicenseKey=function(T){re.addKey(T)},Y.prototype.addEventListener=function(T,k){this.eventListeners.addEventListener(T,k)},Y.prototype.removeEventListener=function(T,k){this.eventListeners.removeEventListener(T,k)},Y.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new wt(T))}))},Y.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new wt(T))}))},Y.instanceCounter=0,Y}();/* ********************************** 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 qt=function(Y,T){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,W){k.__proto__=W}||function(k,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(k[ee]=W[ee])})(Y,T)};function Zt(Y,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function k(){this.constructor=Y}qt(Y,T),Y.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}function It(Y,T,k,W){return new(k||(k=Promise))(function(ee,V){function Ee(pt){try{et(W.next(pt))}catch(Ye){V(Ye)}}function Ke(pt){try{et(W.throw(pt))}catch(Ye){V(Ye)}}function et(pt){var Ye;pt.done?ee(pt.value):(Ye=pt.value,Ye instanceof k?Ye:new k(function(_t){_t(Ye)})).then(Ee,Ke)}et((W=W.apply(Y,T||[])).next())})}function Cr(Y,T){var k,W,ee,V,Ee={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return V={next:Ke(0),throw:Ke(1),return:Ke(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ke(et){return function(pt){return function(Ye){if(k)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(k=1,W&&(ee=2&Ye[0]?W.return:Ye[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,Ye[1])).done)return ee;switch(W=0,ee&&(Ye=[2&Ye[0],ee.value]),Ye[0]){case 0:case 1:ee=Ye;break;case 4:return Ee.label++,{value:Ye[1],done:!1};case 5:Ee.label++,W=Ye[1],Ye=[0];continue;case 7:Ye=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(ee=Ee.trys,(ee=ee.length>0&&ee[ee.length-1])||Ye[0]!==6&&Ye[0]!==2)){Ee=0;continue}if(Ye[0]===3&&(!ee||Ye[1]>ee[0]&&Ye[1]0&&k>0){var W=new Br(T,k),ee=W.ratio>=1?20:W.getHorizontalLength(20),V=W.ratio<1?20:W.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var Ke=yt.createDefs();Ee.appendChild(Ke);var et=yt.createElement("clipPath",[["id","text-bg-clip"]]);Ke.appendChild(et);var pt=yt.createPath(yt.getHollowRectanglePath((24-ee)/2,(24-V)/2,ee,V,(24-ee)/2+2,(24-V)/2+2,ee-4,V-4));Ee.appendChild(pt);var Ye=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ye.appendChild(yt.createTSpan(T+":"+k)),Ee.appendChild(Ye);var _t=Ye.getBBox();yt.setAttributes(Ye,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return et.appendChild(jt),yt.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.outerHTML}return''},Y}(),Jt=function(Y){function T(k,W,ee){var V=Y.call(this,k,W)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=ee,V}return Zt(T,Y),T.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=k.className,W.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},T.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},T.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},T.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},T.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},T.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},T}(Pt),Ot=function(){function Y(T,k){this.GRIP_SIZE=10,this.color=T,this.fillColor=k,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},Y.prototype.setCenter=function(T,k){this.visual.childNodes.forEach(function(W){return yt.setAttributes(W,[["cx",T.toString()],["cy",k.toString()]])})},Y}(),lr=function(){function Y(T,k,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=k,this.margin=W,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(T){this._aspectRatio=T,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.gridContainer&&yt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(T){this._zoomFactor=T,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Y.prototype.open=function(){var T=this;this.cropShadeElement=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;kthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),yt.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var W=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(V,Ee){var Ke=k.y+W*(Ee+1);yt.setAttributes(V,[["x1",""+k.x],["y1",""+Ke],["x2",""+(k.x+k.width)],["y2",""+Ke]])});var ee=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,Ee){var Ke=k.x+ee*(Ee+1);yt.setAttributes(V,[["x1",""+Ke],["y1",""+k.y],["x2",""+Ke],["y2",""+(k.y+k.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Y.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)},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.container.getBoundingClientRect();return{x:T-W.left+this.margin,y:k-W.top+this.margin}},Y.prototype.onPointerDown=function(T){this.container.setPointerCapture(T.pointerId),this.previousPoint=this.clientToLocalCoordinates(T.clientX,T.clientY),this.cropRectElement===T.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(T.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(T.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(T.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(T.target)&&(this.activeGrip=this.bottomRightGrip)},Y.prototype.onPointerMove=function(T){if(this.isMoving)this.move(this.clientToLocalCoordinates(T.clientX,T.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(k)}T.preventDefault()},Y.prototype.onPointerUp=function(T){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(T.pointerId)},Y.prototype.move=function(T){var k=T.x-this.previousPoint.x,W=T.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},Y.prototype.resize=function(T){var k=Object.assign({},this.cropRect),W=T.x-this.previousPoint.x,ee=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+Wthis.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-k.width),k.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=ee,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=ee}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=T,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Y.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var T=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=T-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},Y.prototype.getRescaledRect=function(T,k,W,ee,V,Ee){var Ke=W/T,et=ee/k;return{x:(V.x-Ee)*Ke+Ee,y:(V.y-Ee)*et+Ee,width:V.width*Ke,height:V.height*et}},Y.prototype.scaleCanvas=function(T,k){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,k,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=k,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},Y}(),Ir=function(){function Y(T){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=T,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(Y.prototype,"angle",{get:function(){return this._angle},set:function(T){this._angle=T,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Y.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},Y.prototype.onPointerDown=function(T){this.controlContainer.setPointerCapture(T.pointerId),this.isDragging=!0,this.previousPoint={x:T.clientX,y:T.clientY}},Y.prototype.onPointerMove=function(T){this.isDragging&&(this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.previousPoint.x=T.clientX)},Y.prototype.onPointerUp=function(T){this.isDragging&&this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(T.pointerId)},Y.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var T=this.angleLabelText.getBBox();yt.setAttributes(this.angleLabelElement,[["x",((this.width-T.width)/2).toString()],["y",(this.height/2).toString()]])}},Y.prototype.positionScaleShape=function(){if(this.scaleShape){var T=this.scaleShape.transform.baseVal.getItem(0);T.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(T,0)}},Y.prototype.getVisual=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("xmlns","http://www.w3.org/2000/svg"),T.setAttribute("width",this.width+"px"),T.setAttribute("height",this.height+"px"),T.setAttribute("viewBox","0 0 "+this.width+" "+this.height),T.style.flexShrink="0",document.body.appendChild(T);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;k+="h4v"+-ee+"h1v"+ee}k+="v1H0Z",this.scaleShape=yt.createPath(k);var V=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(V),T.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=yt.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},Y}(),Xr=function(){function Y(){this.naturalSize=!1,this.imageType="image/png"}return Y.prototype.rasterize=function(T,k,W,ee,V,Ee,Ke){var et=this;return new Promise(function(pt){var Ye=document.createElement("canvas");Ye.width=T.width.baseVal.value-2*ee,Ye.height=T.height.baseVal.value-2*ee;var _t=1,jt=1;et.naturalSize===!0?(_t=k.naturalWidth/(T.width.baseVal.value-2*ee)/Ee,jt=k.naturalHeight/(T.height.baseVal.value-2*ee)/Ke,Ye.width=k.naturalWidth/Ee,Ye.height=k.naturalHeight/Ke):et.width!==void 0&&et.height!==void 0&&(_t=et.width/W.width,jt=et.height/W.height,Ye.width*=_t,Ye.height*=jt);var $t=Ye.getContext("2d");$t.translate(Ye.width/2,Ye.height/2),$t.rotate(V*Math.PI/180),$t.scale(Ee,Ke),$t.translate(-Ye.width/2,-Ye.height/2),$t.drawImage(k,0,0,Ye.width,Ye.height);var jr=document.createElement("canvas");jr.width=W.width*_t,jr.height=W.height*jt,jr.getContext("2d").putImageData($t.getImageData((W.x-ee)*_t,(W.y-ee)*jt,W.width*_t,W.height*jt),0,0),pt(jr.toDataURL(et.imageType,et.imageQuality))})},Y}(),Je=function(){function Y(T){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=Y.instanceCounter++,this.styles=new Lr(this.instanceNo),this.target=T,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(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(T){this._zoomToCropEnabled=T,T?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"gridLines",{get:function(){return this._gridLines},set:function(T){this._gridLines=T,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(T){this._rotationAngle=T,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"aspectRatio",{get:function(){var T;return(T=this._aspectRatio)!==null&&T!==void 0?T:this.aspectRatios[0]},set:function(T){this._aspectRatio=T},enumerable:!1,configurable:!0}),Y.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},Y.prototype.show=function(){this.showUI(),this.open()},Y.prototype.close=function(T){T===void 0&&(T=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),T||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Y.prototype.addRenderEventListener=function(T){this.renderEventListeners.push(T)},Y.prototype.removeRenderEventListener=function(T){this.renderEventListeners.indexOf(T)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(T),1)},Y.prototype.addCloseEventListener=function(T){this.closeEventListeners.push(T)},Y.prototype.removeCloseEventListener=function(T){this.closeEventListeners.indexOf(T)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(T),1)},Y.prototype.setupResizeObserver=function(){var T=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.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))},Y.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var T=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=k+2*this.CANVAS_MARGINT+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},Y.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Y.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new Ft,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new cr;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var W=[];this.aspectRatios.forEach(function(jt){var $t=new Pt(Vt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return T.ratioButtonClicked(jt)},W.push($t)}),this.aspectRatioButton=new Jt(Vt.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Pt('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){T.isGridVisible=!T.isGridVisible,ee.isActive=T.isGridVisible},k.addButton(ee);var V=new Pt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,V.isActive=T.zoomToCropEnabled},k.addButton(V),!Kr.isLicensed){var Ee=new dt;this.topToolbar.addElementBlock(Ee);var Ke=document.createElement("div");Ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var et=document.createElement("a");et.style.color="currentColor",et.href="https://markerjs.com/products/cropro",et.target="_blank",et.innerHTML='',Ke.appendChild(et),Ee.addElement(Ke)}var pt=new cr;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var Ye=new Pt('',"OK");Ye.onClick=this.startRenderAndClose,pt.addButton(Ye),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ye.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Pt('',"Close");_t.onClick=this.close,pt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Y.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new Ft,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new cr;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var W=new Pt('',"Rotate left");W.onClick=this.rotateLeftButtonClicked,k.addButton(W);var ee=new Pt('',"Rotate right");ee.onClick=this.rotateRightButtonClicked,k.addButton(ee);var V=new dt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Ir("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(pt){T.rotateBy(pt),T.straightener.angle=T.rotationAngle},V.addElement(this.straightener.getUI());var Ee=new cr;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var Ke=new Pt('',"Flip horizontal");Ke.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(Ke);var et=new Pt('',"Flip vertical");et.onClick=this.flipVerticallyButtonClicked,Ee.addButton(et)},Y.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Y.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Y.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Y.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Y.prototype.restoreState=function(T){if(T){var k=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},Y.prototype.clientToLocalCoordinates=function(T,k){var W=this.cropImage.getBoundingClientRect();return{x:T-W.left,y:k-W.top}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var T=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=T+"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()},Y.prototype.rotateLeftButtonClicked=function(){var T=this.rotationAngle-90;this.rotationAngle%90!=0&&(T+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(T)},Y.prototype.rotateRightButtonClicked=function(){var T=this.rotationAngle+90;this.rotationAngle%90!=0&&(T-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(T)},Y.prototype.rotateTo=function(T){T=(T=T>180?T-360:T)<=-180?T+360:T,this.rotationAngle=T,this.applyRotation()},Y.prototype.rotateBy=function(T){this.rotateTo((this.rotationAngle+T)%360)},Y.prototype.applyRotation=function(){var T=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=T},Y.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Y.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Y.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Y.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,function(){var T,k;return Cr(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return T=W.sent(),k=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(T,k)}),this.close(!0),[2]}})})},Y.prototype.render=function(){return It(this,void 0,void 0,function(){var T;return Cr(this,function(k){switch(k.label){case 0:return(T=new Xr).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),yt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,T.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,T.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},Y.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 T=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xt("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*T)+`px; height: `+(this.toolbarHeight-2*T)+`px; padding: `+T+`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 bt("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new bt("."+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*T)+`px; padding: `+T+`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; `))},Y.instanceCounter=0,Y}(),Ct=Z("8hTe"),mn=Z.n(Ct),gn=/]*>/g;function vn(Y){var T=document.createElement("div");return T.innerHTML=Y,T.childNodes.length===0?"":T.childNodes[0].nodeValue}var yn=_e.a=function(Y){var T=Y.value,k=T===void 0?"":T,W=Y.edit,ee=W===void 0?!1:W,V=Y.className,Ee=Y.showTextOnly,Ke=Y.showLines,et=Y.replaces,pt=Y.zoomImg,Ye=Y.hasMask,_t=Y.style,jt=_t===void 0?{}:_t,$t=Y.stylesPrev,jr=$t===void 0?{}:$t,Er=String(k),xr=Object(R.useRef)(),Zr=Object(R.useRef)(),Dn=Object(R.useState)(""),dr=Object(K.a)(Dn,2),zr=dr[0],un=dr[1],hn=Object(R.useState)("office"),Hr=Object(K.a)(hn,2),kn=Hr[0],bn=Hr[1],zn=function(){var Ht=new Je(Zr.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return xr.current.style.display="none",fr.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar}});case 3:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show()},Vn=function(){var Ht=new Lt(Zr.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var yr=Object(U.a)(r.a.mark(function kt(ar){var Kt;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(xr.current.style.display="none",!Zr.current){fr.next=6;break}return fr.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ar.dataUrl}});case 4:Kt=fr.sent,Kt!=null&&Kt.id&&et(Zr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return fr.stop()}},kt)}));return function(kt){return yr.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Qr=Object(R.useMemo)(function(){xr.current&&(xr.current.style.zIndex=-1);try{var nr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Er=Er.replace(nr,"("+$.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+$.a.API_SERVER+"/api/attachments/").replace(yr,'"'+$.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(nn){}var kt=M(Er),ar=S();if(Er.match(/\[TOC\]/)&&(kt=kt.replace("

    [TOC]

    ",D()),O()),kt=kt.replace(/(__special_katext_id_\d+__)/g,function(nn,fr){var Ar=ar[fr],Yn=Ar.type,xn=Ar.expression;return Object(ne.renderToString)(vn(xn)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),kt=kt.replace(/▁/g,"\u2581\u2581\u2581"),y(),Ee){var Kt=document.createElement("div");return Kt.innerHTML=kt,Kt.innerText}return setTimeout(function(){return ci()},500),kt},[Er]),$r=Object(R.useRef)();E.WebkitLineClamp=Ke,Ke&&(jt=Object(j.a)(Object(j.a)({},jt),E));function _n(nr){var Ht=nr.target;if(Ht.tagName.toUpperCase()==="IMG"){if(pt){var yr=Ht.getAttribute("src");un(yr),bn("image")}}else if(Ht.tagName.toUpperCase()==="A"){var kt=Ht.getAttribute("href");if(kt.indexOf("office")>-1)nr.preventDefault(),un(kt),bn("office");else if(kt.indexOf("application/pdf")>-1)nr.preventDefault(),un(kt),bn("pdf");else if(kt.indexOf("text/html")>-1)nr.preventDefault(),un(kt),bn("html");else if(kt.startsWith("#")){nr.preventDefault();var ar=document.getElementById(kt.replace("#",""));ar&&ar.scrollIntoView(!0)}}}var ci=function(){var Ht,yr=(Ht=$r.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");yr==null||yr.forEach(function(kt){if(kt.oncontextmenu=function(){return!1},kt.src.indexOf(".m3u8")>-1&&!kt.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ar=new H.a;ar.loadSource(kt.src),ar.attachMedia(kt)}}})};Object(R.useEffect)(function(){if($r.current&&Qr&&(Qr.match(gn)&&window.PR.prettyPrint()),$r.current)return $r.current.addEventListener("click",_n),function(){$r.current.removeEventListener("click",_n),y(),O()}},[Qr,$r.current,_n]);var En=function(Ht){if(!ee)return;Ht.target.nodeName==="IMG"?(xr.current.style.zIndex=1,xr.current.style.display="flex",xr.current.style.width=Ht.target.clientWidth+"px",xr.current.style.height=Ht.target.clientHeight+"px",xr.current.style.top=Ht.target.offsetTop+"px",xr.current.style.left=Ht.target.offsetLeft+"px",Zr.current.src=Ht.target.getAttribute("src")):xr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:$r,style:Object(j.a)({},jt),className:"".concat(V||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Qr}}),v.a.createElement("div",{ref:xr,className:mn.a.button},v.a.createElement(J.a,null,v.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),v.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:Zr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(oe.a,{close:!0,data:zr,type:zr!=null&&zr.length?kn:"",style:Object(j.a)({},jr),onClose:function(){return un("")}}))}},"9VGf":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return P});var ie=Z("q1tI"),J=Z.n(ie);function P(X,j){var U=Object(ie.useRef)();Object(ie.useEffect)(function(){U.current=X}),Object(ie.useEffect)(function(){function K(){U.current()}if(j!==null){var G=setInterval(K,j);return function(){return clearInterval(G)}}},[j])}},BU3w:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return U});var ie=Z("MNnm"),J="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function X(K){var G,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var R=document.createElement("style");if((G=r.csp)===null||G===void 0?void 0:G.nonce){var v;R.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}R.innerHTML=K;var m=P(r),p=m.firstChild;return r.prepend&&m.prepend?m.prepend(R):r.prepend&&p?m.insertBefore(R,p):m.appendChild(R),R}var j=new Map;function U(K,G){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(r);if(!j.has(R)){var v=X("",r),m=v.parentNode;j.set(R,m),m.removeChild(v)}var p=Array.from(j.get(R).children).find(function(u){return u.tagName==="STYLE"&&u[J]===G});if(p){var h,l;if(((h=r.csp)===null||h===void 0?void 0:h.nonce)&&p.nonce!==((l=r.csp)===null||l===void 0?void 0:l.nonce)){var f;p.nonce=(f=r.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==K&&(p.innerHTML=K),p}var o=X(K,r);return o[J]=G,o}},Bd2K:function(rt,_e,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(r,R,v){if(v!=ie.Init&&v&&r.removeKeyMap("autoCloseTags"),!R)return;var m={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(m["'/'"]=function(p){return U(p)}),(typeof R!="object"||R.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),r.addKeyMap(m)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(r){if(r.getOption("disableInput"))return ie.Pass;for(var R=r.listSelections(),v=[],m=r.getOption("autoCloseTags"),p=0;ph.ch&&(s=s.slice(0,s.length-l.end+h.ch));var w=s.toLowerCase();if(!s||l.type=="string"&&(l.end!=h.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&u.close||l.string.indexOf("/")==h.ch-l.start-1||O&&K(O,w)>-1||G(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(o)||[],s,h,!0))return ie.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,s)>-1){v[p]={text:"/>",newPos:ie.Pos(h.line,h.ch+2)};continue}var L=E&&K(E,w)>-1;v[p]={indent:L,text:">"+(L?` `:"")+"",newPos:L?ie.Pos(h.line+1,0):ie.Pos(h.line,h.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,p=R.length-1;p>=0;p--){var C=v[p];r.replaceRange(C.text,R[p].head,R[p].anchor,"+insert");var x=r.listSelections().slice(0);x[p]={head:C.newPos,anchor:C.newPos},r.setSelections(x),!A&&C.indent&&(r.indentLine(C.newPos.line,null,!0),r.indentLine(C.newPos.line+1,null,!0))}}function j(r,R){for(var v=r.listSelections(),m=[],p=R?"/":""&&(O+=">"),m[f]=O}if(r.replaceSelections(m),v=r.listSelections(),!l)for(var f=0;f=0&&R[o]==v;o--)++f;m=l.to;for(var o=1;o0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],v=0;vU,ie.serviceIds.set(U,K),K}function j(U){return function(K,G,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(U,K,r,!0)}}},DlQD:function(rt,_e,Z){(function(ie,J){rt.exports=J()})(this,function(){"use strict";function ie(Ae,me){for(var xe=0;xeAe.length)&&(me=Ae.length);for(var xe=0,ae=new Array(me);xe=Ae.length?{done:!0}:{done:!1,value:Ae[ae++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return xe=Ae[Symbol.iterator](),xe.next.bind(xe)}function U(Ae,me){return me={exports:{}},Ae(me,me.exports),me.exports}var K=U(function(Ae){function me(){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 xe(ae){Ae.exports.defaults=ae}Ae.exports={defaults:me(),getDefaults:me,changeDefaults:xe}}),G=K.defaults,r=K.getDefaults,R=K.changeDefaults,v=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(me){return l[me]};function o(Ae,me){if(me){if(v.test(Ae))return Ae.replace(m,f)}else if(p.test(Ae))return Ae.replace(h,f);return Ae}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ae){return Ae.replace(u,function(me,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var a=/(^|[^\[])\^/g;function O(Ae,me){Ae=Ae.source||Ae,me=me||"";var xe={replace:function(ue,de){return de=de.source||de,de=de.replace(a,"$1"),Ae=Ae.replace(ue,de),xe},getRegex:function(){return new RegExp(Ae,me)}};return xe}var E=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ae,me,xe){if(Ae){var ae;try{ae=decodeURIComponent(s(xe)).replace(E,"").toLowerCase()}catch(ue){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}me&&!w.test(xe)&&(xe=d(me,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(ue){return null}return xe}var L={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Ae,me){L[" "+Ae]||(A.test(Ae)?L[" "+Ae]=Ae+"/":L[" "+Ae]=B(Ae,"/",!0)),Ae=L[" "+Ae];var xe=Ae.indexOf(":")===-1;return me.substring(0,2)==="//"?xe?me:Ae.replace(C,"$1")+me:me.charAt(0)==="/"?xe?me:Ae.replace(x,"$1")+me:Ae+me}var S={exec:function(){}};function y(Ae){for(var me=1,xe,ae;me=0&&Ce[ze]==="\\";)Ue=!Ue;return Ue?"|":" |"}),ae=xe.split(/ \|/),ue=0;if(ae.length>me)ae.splice(me);else for(;ae.length=ae.length?ue.slice(ae.length):ue}).join(` `)}var ye=function(){function Ae(xe){this.options=xe||I}var me=Ae.prototype;return me.space=function(ae){var ue=this.rules.block.newline.exec(ae);if(ue)return ue[0].length>1?{type:"space",raw:ue[0]}:{raw:` `}},me.code=function(ae,ue){var de=this.rules.block.code.exec(ae);if(de){var ge=ue[ue.length-1];if(ge&&ge.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var Ce=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:g(Ce,` `)}}},me.fences=function(ae){var ue=this.rules.block.fences.exec(ae);if(ue){var de=ue[0],ge=Oe(de,ue[3]||"");return{type:"code",raw:de,lang:ue[2]?ue[2].trim():ue[2],text:ge}}},me.heading=function(ae){var ue=this.rules.block.heading.exec(ae);if(ue)return{type:"heading",raw:ue[0],depth:ue[1].length,text:ue[2]}},me.nptable=function(ae){var ue=this.rules.block.nptable.exec(ae);if(ue){var de={type:"table",header:H(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(` `):[],raw:ue[0]};if(de.header.length===de.align.length){var ge=de.align.length,Ce;for(Ce=0;Ce ?/gm,"");return{type:"blockquote",raw:ue[0],text:de}}},me.list=function(ae){var ue=this.rules.block.list.exec(ae);if(ue){for(var de=ue[0],ge=ue[2],Ce=ge.length>1,Ue=ge[ge.length-1]===")",ze={type:"list",raw:de,ordered:Ce,start:Ce?+ge.slice(0,-1):"",loose:!1,items:[]},lt=ue[0].match(this.rules.block.item),mt=!1,ft,wt,St,ct,Bt,Lt,qt,Zt=lt.length,It=0;It1||this.options.smartLists&&St!==ge)&&(ct=lt.slice(It+1).join(` `),ze.raw=ze.raw.substring(0,ze.raw.length-ct.length),It=Zt-1)),Bt=mt||/\n\n(?!\s*$)/.test(ft),It!==Zt-1&&(mt=ft.charAt(ft.length-1)===` `,Bt||(Bt=mt)),Bt&&(ze.loose=!0),Lt=/^\[[ xX]\] /.test(ft),qt=void 0,Lt&&(qt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:de,task:Lt,checked:qt,loose:Bt,text:ft});return ze}},me.html=function(ae){var ue=this.rules.block.html.exec(ae);if(ue)return{type:this.options.sanitize?"paragraph":"html",raw:ue[0],pre:!this.options.sanitizer&&(ue[1]==="pre"||ue[1]==="script"||ue[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):$(ue[0]):ue[0]}},me.def=function(ae){var ue=this.rules.block.def.exec(ae);if(ue){ue[3]&&(ue[3]=ue[3].substring(1,ue[3].length-1));var de=ue[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ue[0],href:ue[2],title:ue[3]}}},me.table=function(ae){var ue=this.rules.block.table.exec(ae);if(ue){var de={type:"table",header:H(ue[1].replace(/^ *| *\| *$/g,"")),align:ue[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ue[3]?ue[3].replace(/\n$/,"").split(` `):[]};if(de.header.length===de.align.length){de.raw=ue[0];var ge=de.align.length,Ce;for(Ce=0;Ce/i.test(ge[0])&&(ue=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:ue,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]}},me.link=function(ae){var ue=this.rules.inline.link.exec(ae);if(ue){var de=ne(ue[2],"()");if(de>-1){var ge=ue[0].indexOf("!")===0?5:4,Ce=ge+ue[1].length+de;ue[2]=ue[2].substring(0,de),ue[0]=ue[0].substring(0,Ce).trim(),ue[3]=""}var Ue=ue[2],ze="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);lt?(Ue=lt[1],ze=lt[3]):ze=""}else ze=ue[3]?ue[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=oe(ue,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},ue[0]);return mt}},me.reflink=function(ae,ue){var de;if((de=this.rules.inline.reflink.exec(ae))||(de=this.rules.inline.nolink.exec(ae))){var ge=(de[2]||de[1]).replace(/\s+/g," ");if(ge=ue[ge.toLowerCase()],!ge||!ge.href){var Ce=de[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Ue=oe(de,ge,de[0]);return Ue}},me.strong=function(ae,ue,de){de===void 0&&(de="");var ge=this.rules.inline.strong.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ue=ue.slice(-1*ae.length);var Ce=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Ue;(ge=Ce.exec(ue))!=null;)if(Ue=this.rules.inline.strong.middle.exec(ue.slice(0,ge.index+3)),Ue)return{type:"strong",raw:ae.slice(0,Ue[0].length),text:ae.slice(2,Ue[0].length-2)}}},me.em=function(ae,ue,de){de===void 0&&(de="");var ge=this.rules.inline.em.start.exec(ae);if(ge&&(!ge[1]||ge[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ue=ue.slice(-1*ae.length);var Ce=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Ue;(ge=Ce.exec(ue))!=null;)if(Ue=this.rules.inline.em.middle.exec(ue.slice(0,ge.index+2)),Ue)return{type:"em",raw:ae.slice(0,Ue[0].length),text:ae.slice(1,Ue[0].length-1)}}},me.codespan=function(ae){var ue=this.rules.inline.code.exec(ae);if(ue){var de=ue[2].replace(/\n/g," "),ge=/[^ ]/.test(de),Ce=de.startsWith(" ")&&de.endsWith(" ");return ge&&Ce&&(de=de.substring(1,de.length-1)),de=$(de,!0),{type:"codespan",raw:ue[0],text:de}}},me.br=function(ae){var ue=this.rules.inline.br.exec(ae);if(ue)return{type:"br",raw:ue[0]}},me.del=function(ae){var ue=this.rules.inline.del.exec(ae);if(ue)return{type:"del",raw:ue[0],text:ue[1]}},me.autolink=function(ae,ue){var de=this.rules.inline.autolink.exec(ae);if(de){var ge,Ce;return de[2]==="@"?(ge=$(this.options.mangle?ue(de[1]):de[1]),Ce="mailto:"+ge):(ge=$(de[1]),Ce=ge),{type:"link",raw:de[0],text:ge,href:Ce,tokens:[{type:"text",raw:ge,text:ge}]}}},me.url=function(ae,ue){var de;if(de=this.rules.inline.url.exec(ae)){var ge,Ce;if(de[2]==="@")ge=$(this.options.mangle?ue(de[0]):de[0]),Ce="mailto:"+ge;else{var Ue;do Ue=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Ue!==de[0]);ge=$(de[0]),de[1]==="www."?Ce="http://"+ge:Ce=ge}return{type:"link",raw:de[0],text:ge,href:Ce,tokens:[{type:"text",raw:ge,text:ge}]}}},me.inlineText=function(ae,ue,de){var ge=this.rules.inline.text.exec(ae);if(ge){var Ce;return ue?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):$(ge[0]):ge[0]:Ce=$(this.options.smartypants?de(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Ce}}},Ae}(),Te=M.noopTest,Re=M.edit,Le=M.merge,ce={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Re(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Re(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Re(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce._comment=//,ce.html=Re(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Re(ce._paragraph).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.blockquote=Re(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Le({},ce),ce.gfm=Le({},ce.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ce.gfm.nptable=Re(ce.gfm.nptable).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.gfm.table=Re(ce.gfm.table).replace("hr",ce.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",ce._tag).getRegex(),ce.pedantic=Le({},ce.normal,{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Te,paragraph:Re(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Re(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Re(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Re(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Re(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Re(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Re(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Re(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Re(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Re(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Re(he._blockSkip,"g").getRegex(),he.overlapSkip=Re(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Re(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Re(he.tag).replace("comment",ce._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Re(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Re(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Re(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Le({},he),he.pedantic=Le({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Le({},he.normal,{escape:Re(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ae="x"+ae.toString(16)),me+="&#"+ae+";";return me}var Pe=function(){function Ae(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||fe,this.options.tokenizer=this.options.tokenizer||new ye,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:se.normal,inline:De.normal};this.options.pedantic?(ae.block=se.pedantic,ae.inline=De.pedantic):this.options.gfm&&(ae.block=se.gfm,this.options.breaks?ae.inline=De.breaks:ae.inline=De.gfm),this.tokenizer.rules=ae}Ae.lex=function(ae,ue){var de=new Ae(ue);return de.lex(ae)};var me=Ae.prototype;return me.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ae,ue,de){ue===void 0&&(ue=[]),de===void 0&&(de=!0),ae=ae.replace(/^ +$/gm,"");for(var ge,Ce,Ue,ze;ae;){if(ge=this.tokenizer.space(ae)){ae=ae.substring(ge.raw.length),ge.type&&ue.push(ge);continue}if(ge=this.tokenizer.code(ae,ue)){ae=ae.substring(ge.raw.length),ge.type?ue.push(ge):(ze=ue[ue.length-1],ze.raw+=` `+ge.raw,ze.text+=` `+ge.text);continue}if(ge=this.tokenizer.fences(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.heading(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.nptable(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.hr(ae)){ae=ae.substring(ge.raw.length),ue.push(ge);continue}if(ge=this.tokenizer.blockquote(ae)){ae=ae.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],de),ue.push(ge);continue}if(ge=this.tokenizer.list(ae)){for(ae=ae.substring(ge.raw.length),Ue=ge.items.length,Ce=0;Ce0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)mt.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ue=this.tokenizer.escape(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.tag(ae,de,ge)){ae=ae.substring(Ue.raw.length),de=Ue.inLink,ge=Ue.inRawBlock,ue.push(Ue);continue}if(Ue=this.tokenizer.link(ae)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),ue.push(Ue);continue}if(Ue=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,ge)),ue.push(Ue);continue}if(Ue=this.tokenizer.strong(ae,ze,Ce)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.em(ae,ze,Ce)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.codespan(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.br(ae)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.del(ae)){ae=ae.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],de,ge),ue.push(Ue);continue}if(Ue=this.tokenizer.autolink(ae,Se)){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(!de&&(Ue=this.tokenizer.url(ae,Se))){ae=ae.substring(Ue.raw.length),ue.push(Ue);continue}if(Ue=this.tokenizer.inlineText(ae,ge,Ne)){ae=ae.substring(Ue.raw.length),Ce=Ue.raw.slice(-1),ue.push(Ue);continue}if(ae){var ft="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ue},J(Ae,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ae}(),je=K.defaults,le=M.cleanUrl,ve=M.escape,we=function(){function Ae(xe){this.options=xe||je}var me=Ae.prototype;return me.code=function(ae,ue,de){var ge=(ue||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(ae,ge);Ce!=null&&Ce!==ae&&(de=!0,ae=Ce)}return ge?'
    '+(de?ae:ve(ae,!0))+`
    `:"
    "+(de?ae:ve(ae,!0))+`
    `},me.blockquote=function(ae){return`
    `+ae+`
    `},me.html=function(ae){return ae},me.heading=function(ae,ue,de,ge){return this.options.headerIds?"'+ae+" `:""+ae+" `},me.hr=function(){return this.options.xhtml?`
    `:`
    `},me.list=function(ae,ue,de){var ge=ue?"ol":"ul",Ce=ue&&de!==1?' start="'+de+'"':"";return"<"+ge+Ce+`> `+ae+" `},me.listitem=function(ae){return"
  • "+ae+`
  • `},me.checkbox=function(ae){return" "},me.paragraph=function(ae){return"

    "+ae+`

    `},me.table=function(ae,ue){return ue&&(ue=""+ue+""),` `+ae+` `+ue+`
    `},me.tablerow=function(ae){return` `+ae+` `},me.tablecell=function(ae,ue){var de=ue.header?"th":"td",ge=ue.align?"<"+de+' align="'+ue.align+'">':"<"+de+">";return ge+ae+" `},me.strong=function(ae){return""+ae+""},me.em=function(ae){return""+ae+""},me.codespan=function(ae){return""+ae+""},me.br=function(){return this.options.xhtml?"
    ":"
    "},me.del=function(ae){return""+ae+""},me.link=function(ae,ue,de){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge='",ge},me.image=function(ae,ue,de){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return de;var ge=''+de+'":">",ge},me.text=function(ae){return ae},Ae}(),Ie=function(){function Ae(){}var me=Ae.prototype;return me.strong=function(ae){return ae},me.em=function(ae){return ae},me.codespan=function(ae){return ae},me.del=function(ae){return ae},me.html=function(ae){return ae},me.text=function(ae){return ae},me.link=function(ae,ue,de){return""+de},me.image=function(ae,ue,de){return""+de},me.br=function(){return""},Ae}(),We=function(){function Ae(){this.seen={}}var me=Ae.prototype;return me.slug=function(ae){var ue=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ue)){var de=ue;do this.seen[de]++,ue=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ue))}return this.seen[ue]=0,ue},Ae}(),Ve=K.defaults,Ze=M.unescape,$e=function(){function Ae(xe){this.options=xe||Ve,this.options.renderer=this.options.renderer||new we,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ie,this.slugger=new We}Ae.parse=function(ae,ue){var de=new Ae(ue);return de.parse(ae)};var me=Ae.prototype;return me.parse=function(ae,ue){ue===void 0&&(ue=!0);var de="",ge,Ce,Ue,ze,lt,mt,ft,wt,St,ct,Bt,Lt,qt,Zt,It,Cr,Kr,yt,Lr=ae.length;for(ge=0;ge0&&It.tokens[0].type==="text"?(It.tokens[0].text=yt+" "+It.tokens[0].text,It.tokens[0].tokens&&It.tokens[0].tokens.length>0&&It.tokens[0].tokens[0].type==="text"&&(It.tokens[0].tokens[0].text=yt+" "+It.tokens[0].tokens[0].text)):It.tokens.unshift({type:"text",text:yt}):Zt+=yt),Zt+=this.parse(It.tokens,qt),St+=this.renderer.listitem(Zt,Kr,Cr);de+=this.renderer.list(St,Bt,Lt);continue}case"html":{de+=this.renderer.html(ct.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(ct.tokens));continue}case"text":{for(St=ct.tokens?this.parseInline(ct.tokens):ct.text;ge+1An error occurred:

    "+nt(Ue.message+"",!0)+"
    ";throw Ue}}Be.options=Be.setOptions=function(Ae){return st(Be.defaults,Ae),ot(Be.defaults),Be},Be.getDefaults=Fe,Be.defaults=tt,Be.use=function(Ae){var me=st({},Ae);if(Ae.renderer&&function(){var ae=Be.defaults.renderer||new we,ue=function(Ce){var Ue=ae[Ce];ae[Ce]=function(){for(var ze=arguments.length,lt=new Array(ze),mt=0;mt`,triples:"",explode:"[]{}"},P=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(l,f,o){o&&o!=ie.Init&&(l.removeKeyMap(j),l.state.closeBrackets=null),f&&(U(X(f,"pairs")),l.state.closeBrackets=f,l.addKeyMap(j))});function X(l,f){return f=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[f]!=null?l[f]:J[f]}var j={Backspace:r,Enter:R};function U(l){for(var f=0;f=0;s--){var O=u[s].head;l.replaceRange("",P(O.line,O.ch-1),P(O.line,O.ch+1),"+delete")}}function R(l){var f=G(l),o=f&&X(f,"explode");if(!o||l.getOption("disableInput"))return ie.Pass;for(var u=l.listSelections(),s=0;s0;return{anchor:new P(l.anchor.line,l.anchor.ch+(f?-1:1)),head:new P(l.head.line,l.head.ch+(f?1:-1))}}function m(l,f){var o=G(l);if(!o||l.getOption("disableInput"))return ie.Pass;var u=X(o,"pairs"),s=u.indexOf(f);if(s==-1)return ie.Pass;for(var a=X(o,"closeBefore"),O=X(o,"triples"),E=u.charAt(s+1)==f,w=l.listSelections(),D=s%2==0,L,A=0;A=0&&l.getRange(x,P(x.line,x.ch+3))==f+f+f?d="skipThree":d="skip";else if(E&&x.ch>1&&O.indexOf(f)>=0&&l.getRange(P(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(l.getTokenTypeAt(P(x.line,x.ch-2))))return ie.Pass;d="addFour"}else if(E){var y=x.ch==0?" ":l.getRange(P(x.line,x.ch-1),x);if(!ie.isWordChar(S)&&y!=f&&!ie.isWordChar(y))d="both";else return ie.Pass}else if(D&&(S.length===0||/\s/.test(S)||a.indexOf(S)>-1))d="both";else return ie.Pass;if(!L)L=d;else if(L!=d)return ie.Pass}var b=s%2?u.charAt(s-1):f,B=s%2?f:u.charAt(s+1);l.operation(function(){if(L=="skip")l.execCommand("goCharRight");else if(L=="skipThree")for(var F=0;F<3;F++)l.execCommand("goCharRight");else if(L=="surround"){for(var _=l.getSelections(),F=0;F<_.length;F++)_[F]=b+_[F]+B;l.replaceSelections(_,"around"),_=l.listSelections().slice();for(var F=0;F<_.length;F++)_[F]=v(_[F]);l.setSelections(_)}else L=="both"?(l.replaceSelection(b+B,null),l.triggerElectric(b+B),l.execCommand("goCharLeft")):L=="addFour"&&(l.replaceSelection(b+b+b+b,"before"),l.execCommand("goCharRight"))})}function p(l,f){var o=l.getRange(P(f.line,f.ch-1),P(f.line,f.ch+1));return o.length==2?o:null}function h(l,f){var o=l.getTokenAt(P(f.line,f.ch+1));return/\bstring/.test(o.type)&&o.start==f.ch&&(f.ch==0||!/\bstring/.test(l.getTokenTypeAt(f)))}})},FWmy:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return ie});function ie(J,P){if(!J)throw new Error(P?`Assertion failed (${P})`:"Assertion Failed")}},GfqC:function(rt,_e,Z){"use strict";var ie=Z("q1tI"),J=Z.n(ie),P=Z("TSYQ"),X=Z.n(P);function j(M,I){var g="cannot "+M.method+" "+M.action+" "+I.status+"'",H=new Error(g);return H.status=I.status,H.method=M.method,H.url=M.action,H}function U(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(g){return I}}function K(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(ne){ne.total>0&&(ne.percent=ne.loaded/ne.total*100),M.onProgress(ne)});var g=new FormData;M.data&&Object.keys(M.data).forEach(function($){var ne=M.data[$];if(Array.isArray(ne)){ne.forEach(function(oe){g.append($+"[]",oe)});return}g.append($,M.data[$])}),M.file instanceof Blob?g.append(M.filename,M.file,M.file.name):g.append(M.filename,M.file),I.onerror=function(ne){M.onError(ne)},I.onload=function(){return I.status<200||I.status>=300?M.onError(j(M,I),U(I)):M.onSuccess(U(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=M.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&I.setRequestHeader($,H[$])}),I.send(g),{abort:function(){I.abort()}}}var G=+new Date,r=0;function R(){return"rc-upload-"+G+"-"+ ++r}function v(M,I){return M.indexOf(I,M.length-I.length)!==-1}var m=function(M,I){if(M&&I){var g=Array.isArray(I)?I:I.split(","),H=M.name||"",$=M.type||"",ne=$.replace(/\/.*$/,"");return g.some(function(oe){var Oe=oe.trim();return Oe.charAt(0)==="."?v(H.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?ne===Oe.replace(/\/.*$/,""):$===Oe})}return!0};function p(M,I){var g=M.createReader(),H=[];function $(){g.readEntries(function(ne){var oe=Array.prototype.slice.apply(ne);H=H.concat(oe);var Oe=!oe.length;Oe?I(H):$()})}$()}var h=function(I,g,H){var $=function ne(oe,Oe){Oe=Oe||"",oe.isFile?oe.file(function(ye){H(ye)&&(oe.fullPath&&!ye.webkitRelativePath&&(Object.defineProperties(ye,{webkitRelativePath:{writable:!0}}),ye.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(ye,{webkitRelativePath:{writable:!1}})),g([ye]))}):oe.isDirectory&&p(oe,function(ye){ye.forEach(function(Te){ne(Te,""+Oe+oe.name+"/")})})};I.forEach(function(ne){$(ne.webkitGetAsEntry())})},l=h,f=Object.assign||function(M){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(M,H))continue;g[H]=M[H]}return g}function O(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function E(M,I){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:M}function w(M,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);M.prototype=Object.create(I&&I.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(M,I):M.__proto__=I)}var D=function(I){return Object.keys(I).reduce(function(g,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(g[H]=I[H]),g},{})},L=function(M){w(I,M);function I(){var g,H,$,ne;O(this,I);for(var oe=arguments.length,Oe=Array(oe),ye=0;yea.length&&(E=a.length);Ow===D){const w=a[Symbol.iterator](),D=O[Symbol.iterator]();for(;;){const L=w.next(),A=D.next();if(L.done!==A.done)return!1;if(L.done)return!0;if(!E(L.value,A.value))return!1}}J.equals=s})(ie||(ie={}))},LdHM:function(rt,_e,Z){"use strict";Z.d(_e,"b",function(){return a}),Z.d(_e,"a",function(){return E});var ie=Z("1OyB"),J=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),j=Z("q1tI"),U=Z("rePB"),K=Z("Ff2n"),G=Z("ODXe"),r=Z("4IlW"),R=Z("bX4T"),v=Z("YrtM"),m=Z("TSYQ"),p=Z.n(m),h=Z("+nKL"),l=Z("8OUc"),f=function(H,$){var ne=H.prefixCls,oe=H.id,Oe=H.flattenOptions,ye=H.childrenAsData,Te=H.values,Re=H.searchValue,Le=H.multiple,ce=H.defaultActiveFirstOption,he=H.height,re=H.itemHeight,fe=H.notFoundContent,se=H.open,De=H.menuItemSelectedIcon,Ne=H.virtual,Se=H.onSelect,Pe=H.onToggleOpen,je=H.onActiveValue,le=H.onScroll,ve=H.onMouseEnter,we="".concat(ne,"-item"),Ie=Object(v.a)(function(){return Oe},[se,Oe],function(He,Ae){return Ae[0]&&He[1]!==Ae[1]}),We=j.useRef(null),Ve=function(Ae){Ae.preventDefault()},Ze=function(Ae){We.current&&We.current.scrollTo({index:Ae})},$e=function(Ae){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=Ie.length,ae=0;ae1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(g).map(function($,ne){if(!j.isValidElement($)||!$.type)return null;var oe=$.type.isSelectOptGroup,Oe=$.key,ye=$.props,Te=ye.children,Re=Object(K.a)(ye,["children"]);return H||!oe?L($):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ne:Oe,"__"),label:Oe},Re),{},{options:A(Te)})}).filter(function($){return $})}var C=Z("2Qr1"),x=Z("qNPg"),d=Z("U8pU"),S=Z("Kwbf"),y=Z("WKfj");function b(g){var H=g.mode,$=g.options,ne=g.children,oe=g.backfill,Oe=g.allowClear,ye=g.placeholder,Te=g.getInputElement,Re=g.showSearch,Le=g.onSearch,ce=g.defaultOpen,he=g.autoFocus,re=g.labelInValue,fe=g.value,se=g.inputValue,De=g.optionLabelProp,Ne=H==="multiple"||H==="tags",Se=Re!==void 0?Re:Ne||H==="combobox",Pe=$||A(ne);if(Object(S.a)(H!=="tags"||Pe.every(function(we){return!we.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var je=Pe.some(function(we){return we.options?we.options.some(function(Ie){return typeof("value"in Ie?Ie.value:Ie.key)=="number"}):typeof("value"in we?we.value:we.key)=="number"});Object(S.a)(!je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(H!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(H==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(S.a)(H==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(S.b)(H!=="combobox"||!Te||!Oe||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!Se&&H!=="combobox"&&H!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!ce||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var le=Object(y.d)(fe);Object(S.a)(!re||le.every(function(we){return Object(d.a)(we)==="object"&&("key"in we||"value"in we)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ne||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var ve=null;Object(D.a)(ne).some(function(we){if(!j.isValidElement(we)||!we.type)return!1;var Ie=we.type;if(Ie.isSelectOption)return!1;if(Ie.isSelectOptGroup){var We=Object(D.a)(we.props.children).every(function(Ve){return!j.isValidElement(Ve)||!we.type||Ve.type.isSelectOption?!0:(ve=Ve.type,!1)});return!We}return ve=Ie,!0}),ve&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(S.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=b,F=Object(x.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:A,flattenOptions:C.d,getLabeledValue:C.e,filterOptions:C.b,isValueDisabled:C.g,findValueOption:C.c,warningProps:B,fillOptionsWithMissingValue:C.a}),_=function(g){Object(P.a)($,g);var H=Object(X.a)($);function $(){var ne;return Object(ie.a)(this,$),ne=H.apply(this,arguments),ne.selectRef=j.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(J.a)($,[{key:"render",value:function(){return j.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),$}(j.Component);_.Option=a,_.OptGroup=E;var M=_,I=_e.c=M},M8RZ:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return r});var ie=Z("fWQN"),J=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),j=Z("q1tI"),U=Z.n(j),K=Z("i8i4"),G=Z.n(K),r=function(R){Object(P.a)(m,R);var v=Object(X.a)(m);function m(p){var h;Object(ie.a)(this,m),h=v.call(this,p);var l=window.document;return h.node=l.createElement("div"),l.body.appendChild(h.node),h}return Object(J.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(U.a.Component)},MI8n:function(rt,_e,Z){"use strict";Z.d(_e,"c",function(){return j}),Z.d(_e,"b",function(){return r}),Z.d(_e,"e",function(){return R}),Z.d(_e,"a",function(){return v}),Z.d(_e,"d",function(){return m}),Z.d(_e,"f",function(){return p});var ie=Z("/cxE"),J=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),j;(function(h){h.None=()=>J.a.None;function l(b){return(B,F=null,_)=>{let M=!1,I;return I=b(g=>M?void 0:(I?I.dispose():M=!0,B.call(F,g)),null,_),M&&I.dispose(),I}}h.once=l;function f(b,B){return E((F,_=null,M)=>b(I=>F.call(_,B(I)),null,M))}h.map=f;function o(b,B){return E((F,_=null,M)=>b(I=>{B(I),F.call(_,I)},null,M))}h.forEach=o;function u(b,B){return E((F,_=null,M)=>b(I=>B(I)&&F.call(_,I),null,M))}h.filter=u;function s(b){return b}h.signal=s;function a(...b){return(B,F=null,_)=>Object(J.e)(...b.map(M=>M(I=>B.call(F,I),null,_)))}h.any=a;function O(b,B,F){let _=F;return f(b,M=>(_=B(_,M),_))}h.reduce=O;function E(b){let B;const F=new r({onFirstListenerAdd(){B=b(F.fire,F)},onLastListenerRemove(){B.dispose()}});return F.event}function w(b,B,F=100,_=!1,M){let I,g,H,$=0;const ne=new r({leakWarningThreshold:M,onFirstListenerAdd(){I=b(oe=>{$++,g=B(g,oe),_&&!H&&(ne.fire(g),g=void 0),clearTimeout(H),H=setTimeout(()=>{const Oe=g;g=void 0,H=void 0,(!_||$>1)&&ne.fire(Oe),$=0},F)})},onLastListenerRemove(){I.dispose()}});return ne.event}h.debounce=w;function D(b,B=(F,_)=>F===_){let F=!0,_;return u(b,M=>{const I=F||!B(M,_);return F=!1,_=M,I})}h.latch=D;function L(b,B){return[h.filter(b,B),h.filter(b,F=>!B(F))]}h.split=L;function A(b,B=!1,F=[]){let _=F.slice(),M=b(H=>{_?_.push(H):g.fire(H)});const I=()=>{_&&_.forEach(H=>g.fire(H)),_=null},g=new r({onFirstListenerAdd(){M||(M=b(H=>g.fire(H)))},onFirstListenerDidAdd(){_&&(B?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return g.event}h.buffer=A;class C{constructor(b){this.event=b}map(b){return new C(f(this.event,b))}forEach(b){return new C(o(this.event,b))}filter(b){return new C(u(this.event,b))}reduce(b,B){return new C(O(this.event,b,B))}latch(){return new C(D(this.event))}debounce(b,B=100,F=!1,_){return new C(w(this.event,b,B,F,_))}on(b,B,F){return this.event(b,B,F)}once(b,B,F){return l(this.event)(b,B,F)}}function x(b){return new C(b)}h.chain=x;function d(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.on(B,_),I=()=>b.removeListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromNodeEventEmitter=d;function S(b,B,F=_=>_){const _=(...H)=>g.fire(F(...H)),M=()=>b.addEventListener(B,_),I=()=>b.removeEventListener(B,_),g=new r({onFirstListenerAdd:M,onLastListenerRemove:I});return g.event}h.fromDOMEventEmitter=S;function y(b){return new Promise(B=>l(b)(B))}h.toPromise=y})(j||(j={}));class U{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${U._idPool++}`}start(h){this._stopWatch=new X.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}U._idPool=0;let K=-1;class G{constructor(h,l=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=l,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let l=K;if(typeof this.customThreshold=="number"&&(l=this.customThreshold),l<=0||h{const u=this._stacks.get(f)||0;this._stacks.set(f,u-1)}}}class r{constructor(h){var l;this._disposed=!1,this._options=h,this._leakageMon=K>0?new G(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((l=this._options)===null||l===void 0?void 0:l._profName)?new U(this._options._profName):void 0}get event(){return this._event||(this._event=(h,l,f)=>{var o;this._listeners||(this._listeners=new P.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(l?[h,l]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,l);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),O=Object(J.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return f instanceof J.b?f.add(O):Array.isArray(f)&&f.push(O),O}),this._event}fire(h){var l,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let o of this._listeners)this._deliveryQueue.push([o,h]);for((l=this._perfMon)===null||l===void 0||l.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[o,u]=this._deliveryQueue.shift();try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(s){Object(ie.f)(s)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var h,l,f,o,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(l=this._deliveryQueue)===null||l===void 0||l.clear(),(o=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||o===void 0||o.call(f),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class R extends r{constructor(h){super(h);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class v extends R{constructor(h){var l;super(h);this._delay=(l=h.delay)!==null&&l!==void 0?l:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class m{constructor(){this.buffers=[]}wrapEvent(h){return(l,f,o)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>l.call(f,u)):l.call(f,u)},void 0,o)}bufferEvents(h){const l=[];this.buffers.push(l);const f=h();return this.buffers.pop(),l.forEach(o=>o()),f}}class p{constructor(){this.listening=!1,this.inputEvent=j.None,this.inputEventListener=J.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(rt,_e,Z){"use strict";(function(ie,J){Z.d(_e,"b",function(){return f}),Z.d(_e,"i",function(){return a}),Z.d(_e,"f",function(){return O}),Z.d(_e,"d",function(){return E}),Z.d(_e,"g",function(){return w}),Z.d(_e,"h",function(){return D}),Z.d(_e,"c",function(){return L}),Z.d(_e,"k",function(){return A}),Z.d(_e,"j",function(){return C}),Z.d(_e,"a",function(){return x}),Z.d(_e,"e",function(){return y});var P;const X="en";let j=!1,U=!1,K=!1,G=!1,r=!1,R=!1,v=!1,m,p=X,h,l;const f=typeof self=="object"?self:typeof ie=="object"?ie:{};let o;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?o=f.vscode.process:typeof J!="undefined"&&(o=J);const u=typeof((P=o==null?void 0:o.versions)===null||P===void 0?void 0:P.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)l=navigator.userAgent,j=l.indexOf("Windows")>=0,U=l.indexOf("Macintosh")>=0,v=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=l.indexOf("Linux")>=0,R=!0,m=navigator.language,p=m;else if(typeof o=="object"){j=o.platform==="win32",U=o.platform==="darwin",K=o.platform==="linux",G=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,p=X;const b=o.env.VSCODE_NLS_CONFIG;if(b)try{const B=JSON.parse(b),F=B.availableLanguages["*"];m=B.locale,p=F||X,h=B._translationsConfigFile}catch(B){}r=!0}else console.error("Unable to resolve platform.");let s=0;U?s=1:j?s=3:K&&(s=2);const a=j,O=U,E=K,w=r,D=R,L=v,A=l,C=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let F=[];f.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,g=F.length;I{const I=++_;F.push({id:I,callback:M}),f.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const B=Promise.resolve();return F=>B.then(F)}(),x=U||v?2:j?1:3;let d=!0,S=!1;function y(){if(!S){S=!0;const b=new Uint8Array(2);b[0]=1,b[1]=2;const B=new Uint16Array(b.buffer);d=B[0]===(2<<8)+1}return d}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(rt,_e,Z){"use strict";Z.d(_e,"C",function(){return ie}),Z.d(_e,"v",function(){return P}),Z.d(_e,"s",function(){return X}),Z.d(_e,"t",function(){return j}),Z.d(_e,"U",function(){return U}),Z.d(_e,"J",function(){return K}),Z.d(_e,"O",function(){return G}),Z.d(_e,"p",function(){return r}),Z.d(_e,"T",function(){return R}),Z.d(_e,"q",function(){return v}),Z.d(_e,"N",function(){return m}),Z.d(_e,"M",function(){return p}),Z.d(_e,"Q",function(){return h}),Z.d(_e,"u",function(){return l}),Z.d(_e,"x",function(){return f}),Z.d(_e,"I",function(){return o}),Z.d(_e,"f",function(){return u}),Z.d(_e,"h",function(){return s}),Z.d(_e,"g",function(){return a}),Z.d(_e,"i",function(){return O}),Z.d(_e,"G",function(){return E}),Z.d(_e,"H",function(){return w}),Z.d(_e,"r",function(){return D}),Z.d(_e,"R",function(){return L}),Z.d(_e,"d",function(){return A}),Z.d(_e,"e",function(){return C}),Z.d(_e,"E",function(){return x}),Z.d(_e,"F",function(){return d}),Z.d(_e,"j",function(){return S}),Z.d(_e,"z",function(){return y}),Z.d(_e,"K",function(){return B}),Z.d(_e,"L",function(){return F}),Z.d(_e,"m",function(){return M}),Z.d(_e,"k",function(){return g}),Z.d(_e,"A",function(){return $}),Z.d(_e,"a",function(){return ne}),Z.d(_e,"n",function(){return oe}),Z.d(_e,"l",function(){return Oe}),Z.d(_e,"D",function(){return ye}),Z.d(_e,"B",function(){return Te}),Z.d(_e,"b",function(){return Re}),Z.d(_e,"S",function(){return Le}),Z.d(_e,"o",function(){return ce}),Z.d(_e,"P",function(){return he}),Z.d(_e,"w",function(){return re}),Z.d(_e,"c",function(){return fe}),Z.d(_e,"y",function(){return Ne});function ie(le){return!le||typeof le!="string"?!0:le.trim().length===0}const J=/{(\d+)}/g;function P(le,...ve){return ve.length===0?le:le.replace(J,function(we,Ie){const We=parseInt(Ie,10);return isNaN(We)||We<0||We>=ve.length?we:ve[We]})}function X(le){return le.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"<";case">":return">";case"&":return"&";default:return ve}})}function j(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function U(le,ve=" "){const we=K(le,ve);return G(we,ve)}function K(le,ve){if(!le||!ve)return le;const we=ve.length;if(we===0||le.length===0)return le;let Ie=0;for(;le.indexOf(ve,Ie)===Ie;)Ie=Ie+we;return le.substring(Ie)}function G(le,ve){if(!le||!ve)return le;const we=ve.length,Ie=le.length;if(we===0||Ie===0)return le;let We=Ie,Ve=-1;for(;!(Ve=le.lastIndexOf(ve,We-1),Ve===-1||Ve+we!==We);){if(Ve===0)return"";We=Ve}return le.substring(0,We)}function r(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function R(le){return le.replace(/\*/g,"")}function v(le,ve,we={}){if(!le)throw new Error("Cannot create regex from empty string");ve||(le=j(le)),we.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let Ie="";return we.global&&(Ie+="g"),we.matchCase||(Ie+="i"),we.multiline&&(Ie+="m"),we.unicode&&(Ie+="u"),new RegExp(le,Ie)}function m(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const ve=le.exec("");return!!(ve&&le.lastIndex===0)}function p(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function h(le){return le.split(/\r\n|\r|\n/)}function l(le){for(let ve=0,we=le.length;ve=0;we--){const Ie=le.charCodeAt(we);if(Ie!==32&&Ie!==9)return we}return-1}function u(le,ve){return leve?1:0}function s(le,ve,we=0,Ie=le.length,We=0,Ve=ve.length){for(;weQe)return 1}const Ze=Ie-we,$e=Ve-We;return Ze<$e?-1:Ze>$e?1:0}function a(le,ve){return O(le,ve,0,le.length,0,ve.length)}function O(le,ve,we=0,Ie=le.length,We=0,Ve=ve.length){for(;we=128||Qe>=128)return s(le.toLowerCase(),ve.toLowerCase(),we,Ie,We,Ve);E(st)&&(st-=32),E(Qe)&&(Qe-=32);const nt=st-Qe;if(nt===0)continue;return nt}const Ze=Ie-we,$e=Ve-We;return Ze<$e?-1:Ze>$e?1:0}function E(le){return le>=97&&le<=122}function w(le){return le>=65&&le<=90}function D(le,ve){return le.length===ve.length&&O(le,ve)===0}function L(le,ve){const we=ve.length;return ve.length>le.length?!1:O(le,ve,0,we)===0}function A(le,ve){let we,Ie=Math.min(le.length,ve.length);for(we=0;we1){const Ie=le.charCodeAt(ve-2);if(x(Ie))return S(Ie,we)}return we}function B(le,ve){const we=se.getInstance(),Ie=ve,We=le.length,Ve=y(le,We,ve);ve+=Ve>=65536?2:1;let Ze=we.getGraphemeBreakType(Ve);for(;ve=65536?2:1,Ze=st}return ve-Ie}function F(le,ve){const we=se.getInstance(),Ie=ve,We=b(le,ve);ve-=We>=65536?2:1;let Ve=we.getGraphemeBreakType(We);for(;ve>0;){const Ze=b(le,ve),$e=we.getGraphemeBreakType(Ze);if(fe($e,Ve))break;ve-=Ze>=65536?2:1,Ve=$e}return Ie-ve}const _=/(?:[\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 M(le){return _.test(le)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function g(le){return I.test(le)}const H=/^[\t\n\r\x20-\x7E]*$/;function $(le){return H.test(le)}const ne=/[\u2028\u2029]/;function oe(le){return ne.test(le)}function Oe(le){for(let ve=0,we=le.length;ve=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function Te(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const Re=String.fromCharCode(65279);function Le(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function ce(le,ve=!1){return le?(ve&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function he(le){const ve=90-65+1;return le=le%(2*ve),leve[3*Ie+1])Ie=2*Ie+1;else return ve[3*Ie+2];return 0}}se._INSTANCE=null;function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(le,ve){if(le===0)return 0;const we=Se(le,ve);if(we!==void 0)return we;const Ie=b(ve,le);return le-=Pe(Ie),le}function Se(le,ve){let we=b(ve,le);for(le-=Pe(we);je(we)||we===65039||we===8419;){if(le===0)return;we=b(ve,le),le-=Pe(we)}if(!Te(we))return;if(le>=0){const Ie=b(ve,le);Ie===8205&&(le-=Pe(Ie))}return le}function Pe(le){return le>=65536?2:1}function je(le){return 127995<=le&&le<=127999}},Ot1p:function(rt,_e,Z){"use strict";var ie=Z("2qtc"),J=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),j=Z("tsqr"),U=Z("9og8"),K=Z("tJVT"),G=Z("jrin"),r=Z("WmNS"),R=Z.n(r),v=Z("q1tI"),m=Z.n(v),p=Z("VrN/"),h=Z.n(p),l=Z("bdgK"),f=Z("p77/"),o=Z("Bd2K"),u=Z("ELLl"),s=Z("19Vz"),a=Z("lZu9"),O=Z("+NIl"),E=Z("kSUc"),w=Z("9Bee"),D=function(Ce){var Ue=Ce.value,ze=Ue===void 0?"":Ue,lt=Ce.className,mt=Ce.showTextOnly,ft=Ce.showLines,wt=Ce.style,St=wt===void 0?{}:wt,ct=Object(v.useMemo)(function(){return""},[ze]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},L=Z("0Owb"),A=Z("dejd"),C=Z("C+DQ"),x=Z("1vsH"),d=Z("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(Ce){var Ue=Ce.onActionCallback,ze=Ce.title,lt=Ce.icon,mt=Ce.actionName,ft=Ce.className,wt=ft===void 0?"":ft,St=Ce.children;function ct(){Ue(mt)}return m.a.createElement("a",{title:ze,className:wt,onClick:ct},m.a.createElement("i",{className:"md-iconfont ".concat(lt)}),St)}var b=function(Ce){var Ue=Ce.watch,ze=Ce.showNullButton,lt=Ce.onActionCallback,mt=Ce.fullScreen,ft=Ce.insertTemp,wt=Ce.hidetoolBar,St=Ce.uuid,ct=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var Bt=[].concat(S,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Bt.map(function(Lt,qt){return m.a.createElement("li",{key:qt},Lt.actionName?m.a.createElement(y,Object(L.a)({},Lt,{onActionCallback:lt})):m.a.createElement("span",{className:"v-line"}))}),ze?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:lt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:lt})))},B=Z("M8RZ"),F=Z("+L6B"),_=Z("2/Rp"),M=Z("y8nQ"),I=Z("Vl3Y"),g=Z("5NDa"),H=Z("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},ne=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel;function lt(mt){Ue(mt)}return m.a.createElement(I.a,Object(L.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:lt}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(H.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(H.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},oe=Z("7ahc"),Oe=Z("HmJG"),ye=Z("BjJ7"),Te=I.a.useForm,Re={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ce=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel,lt=Te(),mt=Object(K.a)(lt,1),ft=mt[0];function wt(Bt){Ue(Bt)}function St(Bt,Lt){if(Bt.status===-1){j.b.error(Bt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Bt.id),type:Lt.type})}function ct(Bt){var Lt=Bt.target.files[0];re(Lt,St)}return m.a.createElement(I.a,Object(L.a)({form:ft},Le,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(H.a,{style:Re})),m.a.createElement(he,{onFileChange:ct}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(H.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function he(Ce){var Ue=Ce.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ue}))}function re(Ce,Ue){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var ze=new FormData;ze.append("editormd-image-file",Ce),ze.append("file_param_name","editormd-image-file"),ze.append("byxhr","true");var lt=new window.XMLHttpRequest;lt.withCredentials=!0,lt.addEventListener("load",function(mt){Ue(JSON.parse(mt.target.responseText),Ce)},!1),lt.addEventListener("error",function(mt){console.error(mt)},!1),lt.open("POST","".concat(ye.a,"/api/attachments.json")),lt.send(ze)}var fe=Z("giR+"),se=Z("fyUT"),De=Z("7Kak"),Ne=Z("9yH6"),Se=Ne.a.Group,Pe={margin:"0 8px"},je=function(Ce){var Ue=Ce.callback,ze=Ce.onCancel;function lt(mt){Ue(mt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:lt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Pe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(se.a,null)),m.a.createElement("span",{style:Pe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(se.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(Se,null,m.a.createElement(Ne.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Ne.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Ne.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Ne.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(_.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(_.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))},le=Z("ErOA"),ve=Z("7Cbv"),we="link",Ie="upload-image",We="code-block",Ve="add-table",Ze="------------",$e={default:Ze,left:":".concat(Ze),center:":".concat(Ze,":"),right:"".concat(Ze,":")},st=Z("9VGf"),Qe,nt;function Fe(){}var ot=0,tt=1e4,Be="\u2581",He=` **\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 Ae(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=me?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ue=(Qe={},Object(G.a)(Qe,xe+"-B","bold"),Object(G.a)(Qe,xe+"-I","italic"),Qe),de=(nt={},Object(G.a)(nt,we,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(nt,We,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(nt,Ie,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(nt,Ve,"\u6DFB\u52A0\u8868\u683C"),nt),ge=_e.a=function(Ce){var Ue=Ce.defaultValue,ze=Ue===void 0?"":Ue,lt=Ce.onChange,mt=Ce.width,ft=mt===void 0?"100%":mt,wt=Ce.height,St=wt===void 0?400:wt,ct=Ce.miniToolbar,Bt=ct===void 0?!1:ct,Lt=Ce.isFocus,qt=Lt===void 0?!1:Lt,Zt=Ce.watch,It=Ce.insertTemp,Cr=Ce.mode,Kr=Cr===void 0?"markdown":Cr,yt=Ce.id,Lr=yt===void 0?"markdown-editor-id":yt,bt=Ce.showResizeBar,xt=bt===void 0?!1:bt,Ft=Ce.noStorage,tr=Ft===void 0?!1:Ft,cr=Ce.showNullButton,Pt=cr===void 0?!1:cr,dt=Ce.hidetoolBar,Br=dt===void 0?!1:dt,Vt=Ce.fullScreen,Jt=Vt===void 0?!1:Vt,Ot=Ce.onBlur,lr=Ce.onCMBeforeChange,Ir=Ce.onFullScreen,Xr=Ce.className,Je=Xr===void 0?"":Xr,Ct=Ce.disablePaste,mn=Ct===void 0?!1:Ct,gn=Ce.placeholder,vn=gn===void 0?"":gn,yn=Ce.values,Y=yn===void 0?"":yn,T=Object(v.useState)(null),k=Object(K.a)(T,2),W=k[0],ee=k[1],V=Object(v.useState)(ze),Ee=Object(K.a)(V,2),Ke=Ee[0],et=Ee[1],pt=Object(v.useState)(Zt),Ye=Object(K.a)(pt,2),_t=Ye[0],jt=Ye[1],$t=Object(v.useState)(Jt),jr=Object(K.a)($t,2),Er=jr[0],xr=jr[1],Zr=Object(v.useState)(""),Dn=Object(K.a)(Zr,2),dr=Dn[0],zr=Dn[1],un=Object(v.useState)(0),hn=Object(K.a)(un,2),Hr=hn[0],kn=hn[1],bn=Object(v.useState)(St),zn=Object(K.a)(bn,2),Vn=zn[0],Qr=zn[1],$r=Object(v.useState)(!1),_n=Object(K.a)($r,2),ci=_n[0],En=_n[1],nr=Object(v.useRef)(Object(ve.a)()),Ht=Object(v.useRef)(!1),yr=Object(v.useRef)(),kt=Object(v.useRef)(),ar=Object(v.useRef)(),Kt=Object(v.useRef)(),nn=Object(v.useRef)(),fr=function(){var gt=Object(U.a)(R.a.mark(function At(){var Et,Dt;return R.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nr.current}});case 2:Dt=Yt.sent,Dt!=null&&(Et=Dt.attachments)!==null&&Et!==void 0&&Et.length&&(console.log("cm:",W,kt),Dt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?W.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?W.replaceSelection('')):Nt.content_type.indexOf("pdf")>-1?W.replaceSelection('
    ').concat(Nt.name,"")):W.replaceSelection("[".concat(Nt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Yt.stop()}},At)}));return function(){return gt.apply(this,arguments)}}();Object(v.useEffect)(function(){et(Y),W==null||W.setValue(Y)},[Y]),Object(v.useEffect)(function(){Ir==null||Ir(Er)},[Er]),Object(v.useEffect)(function(){if(kt.current){var gt=h.a.fromTextArea(kt.current,{mode:Kr,lineNumbers:!Bt,lineWrapping:!0,value:ze,autoCloseTags:!0,autoCloseBrackets:!0});qt&>.focus();function At(Et,Dt){if(mn){Dt.preventDefault();return}var Ut=Dt.clipboardData;if(Ut){var Yt=Ut.types.toString(),Nt=Ut.items;if(Yt==="Files"||Ut.types.indexOf("Files")>-1){if(Dt.preventDefault(),Kr=="stex")return;try{var ur,Dr=Nt[1];((ur=Nt[0])===null||ur===void 0?void 0:ur.kind)==="file"&&(Dr=Nt[0]);var Mt=Dr.getAsFile(),cn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(cn)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){j.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",At),gt.on("dragleave",function(Et,Dt){ar.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Et,Dt){ar.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Et,Dt){ar.current.classList.add("mouse-hover-md");var Ut;if(Ut=Dt.dataTransfer.files,Ut.length>0){Dt.preventDefault(),Dt.stopPropagation();for(var Yt=function(Dr){var Mt=Ut[Dr],cn=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var kr,Tr,Jr;(Mt==null||((kr=Mt.type)===null||kr===void 0)?void 0:kr.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):(Mt==null||((Tr=Mt.type)===null||Tr===void 0)?void 0:Tr.indexOf("video"))>-1?gt.replaceSelection('')):(Mt==null||((Jr=Mt.type)===null||Jr===void 0)?void 0:Jr.indexOf("pdf"))>-1?gt.replaceSelection('').concat(Mt.name,"")):ae.includes(cn)?gt.replaceSelection('').concat(Mt.name,"")):gt.replaceSelection("[".concat(Mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt0||Nt.target.offsetWidth>0)&&(Ar(),W.setSize("100%","100%"),W.refresh())}}catch(ur){Ut.e(ur)}finally{Ut.f()}});return Et.observe(kt.current.parentElement),Et}if(W){var At=gt();return function(){At.unobserve(kt.current.parentElement)}}},[W,Ar]),Object(v.useEffect)(function(){if(W){for(var gt=[],At=function(){var Nt=Dt[Et];Ut=Object(K.a)(Nt,2);var ur=Ut[0],Dr=Ut[1],Mt=Object(G.a)({},ur,function(){Yn(Dr)});gt.push(Mt),W.addKeyMap(Mt)},Et=0,Dt=Object.entries(ue);Et0){var gt=new Date().getTime(),At=window.sessionStorage.getItem(Lr);gt>=Hr+tt&&(!At||At!==Ke)&&(window.sessionStorage.setItem(Lr,Ke),En(!0))}},tt),Object(v.useEffect)(function(){jt(Zt)},[W,Zt]),Object(v.useEffect)(function(){W&&(qt&&W.focus())},[W,qt]),Object(v.useEffect)(function(){if(_t&&W){var gt=W.getScrollerElement();function At(Et){var Dt=Et.target;if(nn.current){var Ut=Dt.scrollTop/Dt.scrollHeight;nn.current.scrollTop=nn.current.scrollHeight*Ut}}return gt.addEventListener("scroll",At),function(){gt.removeEventListener("scroll",At)}}},[W,_t]),Object(v.useEffect)(function(){if(W&&lr){function gt(At,Et){lr(At,Et)}return W.on("beforeChange",gt),function(){W.off("beforeChange",gt)}}},[W,lr]),Object(v.useEffect)(function(){if(W&&Ot){function gt(){Ot(W.getValue())}return W.on("blur",gt),function(){W.off("blur",gt)}}},[W,Ot]),Object(v.useEffect)(function(){if(W){function gt(At){var Et=At.getValue();et(Et),kn(new Date().getTime()),At.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),lt&<(Et)}return W.on("change",gt),function(){W.off("change",gt)}}},[W,lt]),Object(v.useEffect)(function(){W&&(ze==null?(W.setValue(""),et("")):ze!==W.getValue()&&(W.setValue(ze),et(ze),W.setCursor(W.lineCount(),0)))},[W,ze]);var Yn=Object(v.useCallback)(function(gt){var At=W.getCursor(),Et=W.getSelection(),Dt=Et.split(` `);switch(gt){case"bold":return W.replaceSelection("**"+Et+"**"),Et===""&&W.setCursor(At.line,At.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Et+"*"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"code":return W.replaceSelection("`"+Et+"`"),Et===""&&W.setCursor(At.line,At.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Et+"$$`"),Et===""&&W.setCursor(At.line,At.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Et+"\n```"),W.setCursor(At.line+1,Et.length+1),W.focus();case"line-break":return W.replaceSelection(`
    `),W.focus();case"list-ul":return Et===""?W.replaceSelection("- "+Et):W.replaceSelection(Dt.map(function(Ut){return Ut===""?"":"- ".concat(Ut)}).join(` `)),W.focus();case"list-ol":return Et===""?W.replaceSelection("1. "+Et):W.replaceSelection(Dt.map(function(Ut,Yt){return Ut===""?"":"".concat(Yt+1,". ").concat(Ut)}).join(` `)),W.focus();case"add-null-ch":return Et===""&&W.setCursor(At.line,At.ch+1),W.replaceSelection(Be),W.focus();case"inster-template-1":return Et===""&&W.setCursor(At.line,At.ch),W.replaceSelection(He),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return jt(!_t),W.focus();case"trigger-full-screen":return xr(!Er),W.focus();case we:zr(we);return;case We:zr(We);return;case Ie:zr(Ie);return;case Ve:zr(Ve);return;default:throw new Error}},[W,_t,Er]),xn=Object(v.useCallback)(function(gt){zr("");switch(dr){case we:var At=gt.title,Et=gt.link;return W.replaceSelection("[".concat(At,"](").concat(Et,")")),W.focus();case We:var Dt=gt.language,Ut=gt.content;return W.replaceSelection(["```"+Dt,Ut,"```"].join(` `)),W.focus();case Ie:var Yt=gt.src,Nt=gt.alt;return Nt?W.replaceSelection("![ ".concat(Nt," ]( ").concat(Yt,' "').concat(Nt,'" )')):W.replaceSelection("![,](".concat(Yt,")")),W.focus();case Ve:for(var ur=gt.row,Dr=gt.col,Mt=gt.align,cn=` `,Wt=0;Wt300&&(ur=300);var Dr=St+ur+"px";Qr(Dr)}}return gt.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Yt),document.addEventListener("mouseup",Ut),function(){gt.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Yt),document.removeEventListener("mouseup",Ut)}}},[W,Kt]),Object(v.useEffect)(function(){Qr(St)},[St]);var an=Ae(ft),fi=Ae(Vn),qr={width:an,height:fi},pi=Object(v.useMemo)(function(){if(Hr){var gt=new Date(Hr),At=gt.getHours(),Et=gt.getMinutes(),Dt=gt.getSeconds();return At=At<10?"0"+At:At,Et=Et<10?"0"+Et:Et,Dt=Dt<10?"0"+Dt:Dt,"".concat(At,":").concat(Et,":").concat(Dt)}return 0},[Hr]);function ji(){window.sessionStorage.removeItem(Lr),En(!1),kn(0)}function Mn(){En(!1),kn(0),W.setValue(window.sessionStorage.getItem(Lr))}function ua(gt,At){var Et=W.getValue();Et=Et.replace(gt,At),et(Et),W==null||W.setValue(Et)}return m.a.createElement(v.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:ar},m.a.createElement("div",{className:"markdown-editor-container ".concat(Je," ").concat(_t?"on-preview":""," ").concat(Bt?"mini":""," ").concat(Er?"full-screen":""),style:qr},m.a.createElement(b,{insertTemp:It,watch:_t,fullScreen:Er,showNullButton:Pt,onActionCallback:Yn,hidetoolBar:Br,uuid:nr.current,setOpenPhones:function(){Ht.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:kt,placeholder:vn})),_t?m.a.createElement("div",{ref:nn,className:"preview-container"},Kr==="stex"&&m.a.createElement(D,{value:Ke}),Kr!=="stex"&&m.a.createElement(w.a,{edit:!0,value:Ke,replaces:ua})):null))),xt?m.a.createElement("a",{ref:Kt,className:"editor-resize"}):null,m.a.createElement(B.a,null,de[dr]?m.a.createElement(J.a,{centered:!0,title:de[dr],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},di):null))}},SJMd:function(rt,_e){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Z,ie,J,P=!1,X,j;window.PR_SHOULD_USE_CONTINUATION=!0;var U,K;(function(){var G=window,r=["break,continue,do,else,for,if,return,while"],R=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],v=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[v,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[v,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[m,h,p,f,o,u,s,a],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",D="kwd",L="com",A="typ",C="lit",x="pun",d="pln",S="tag",y="dec",b="src",B="atn",F="atv",_="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Se){for(var Pe=0,je=!1,le=!1,ve=0,we=Se.length;ve122||(ae<65||xe>90||ot.push([Math.max(65,xe)|32,Math.min(ae,90)|32]),ae<97||xe>122||ot.push([Math.max(97,xe)&~32,Math.min(ae,122)&~32]))}}ot.sort(function(Ce,Ue){return Ce[0]-Ue[0]||Ue[1]-Ce[1]});for(var ue=[],de=[],He=0;Hege[0]&&(ge[1]+1>ge[0]&&Be.push("-"),Be.push(Ze(ge[1])))}return Be.push("]"),Be.join("")}function st(nt){for(var Fe=nt.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")),ot=Fe.length,tt=[],Be=0,He=0;Be=2&&xe==="["?Fe[Be]=$e(Ae):xe!=="\\"&&(Fe[Be]=Ae.replace(/[a-zA-Z]/g,function(de){var ge=de.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Fe.join("")}for(var Qe=[],ve=0,we=Se.length;ve=0;)je[Qe.charAt(nt)]=st;var Fe=st[1],ot=""+Fe;Ve.hasOwnProperty(ot)||(We.push(Fe),Ve[ot]=null)}We.push(/[\0-\uffff]/),le=I(We)})();var ve=Pe.length,we=function(Ie){for(var We=Ie.sourceCode,Ve=Ie.basePos,Ze=Ie.sourceNode,$e=[Ve,d],st=0,Qe=We.match(le)||[],nt={},Fe=0,ot=Qe.length;Fe=5&&Be.substring(0,5)==="lang-",Ae&&!(He&&typeof He[1]=="string")&&(Ae=!1,Be=b),Ae||(nt[tt]=Be)}var ae=st;if(st+=tt.length,!Ae)$e.push(Ve+ae,Be);else{var ue=He[1],de=tt.indexOf(ue),ge=de+ue.length;He[2]&&(ge=tt.length-He[2].length,de=ge-ue.length);var Ce=Be.substring(5);H(Ze,Ve+ae,tt.substring(0,de),we,$e),H(Ze,Ve+ae+de,ue,he(Ce,ue),$e),H(Ze,Ve+ae+ge,tt.substring(ge),we,$e)}}Ie.decorations=$e};return we}function Oe(Se){var Pe=[],je=[];Se.tripleQuotedStrings?Pe.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Se.multiLineStrings?Pe.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Pe.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Se.verbatimStrings&&je.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=Se.hashComments;le&&(Se.cStyleComments?(le>1?Pe.push([L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Pe.push([L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),je.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Pe.push([L,/^#[^\r\n]*/,null,"#"])),Se.cStyleComments&&(je.push([L,/^\/\/[^\r\n]*/,null]),je.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=Se.regexLiterals;if(ve){var we=ve>1?"":` \r`,Ie=we?".":"[\\S\\s]",We="/(?=[^/*"+we+"])(?:[^/\\x5B\\x5C"+we+"]|\\x5C"+Ie+"|\\x5B(?:[^\\x5C\\x5D"+we+"]|\\x5C"+Ie+")*(?:\\x5D|$))+/";je.push(["lang-regex",RegExp("^"+M+"("+We+")")])}var Ve=Se.types;Ve&&je.push([A,Ve]);var Ze=(""+Se.keywords).replace(/^ | $/g,"");Ze.length&&je.push([D,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Pe.push([d,/^\s+/,null,` \r \xA0`]);var $e="^.[^\\s\\w.$@'\"`/\\\\]*";return Se.regexLiterals&&($e+="(?!s*/)"),je.push([C,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[C,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[x,new RegExp($e),null]),oe(Pe,je)}var ye=Oe({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Se,Pe,je){for(var le=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,we=Se.ownerDocument,Ie=we.createElement("li");Se.firstChild;)Ie.appendChild(Se.firstChild);var We=[Ie];function Ve(Fe){var ot=Fe.nodeType;if(ot==1&&!le.test(Fe.className))if(Fe.nodeName==="br")Ze(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var tt=Fe.firstChild;tt;tt=tt.nextSibling)Ve(tt);else if((ot==3||ot==4)&&je){var Be=Fe.nodeValue,He=Be.match(ve);if(He){var Ae=Be.substring(0,He.index);Fe.nodeValue=Ae;var me=Be.substring(He.index+He[0].length);if(me){var xe=Fe.parentNode;xe.insertBefore(we.createTextNode(me),Fe.nextSibling)}Ze(Fe),Ae||Fe.parentNode.removeChild(Fe)}}}function Ze(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function ot(He,Ae){var me=Ae?He.cloneNode(!1):He,xe=He.parentNode;if(xe){var ae=ot(xe,1),ue=He.nextSibling;ae.appendChild(me);for(var de=ue;de;de=ue)ue=de.nextSibling,ae.appendChild(de)}return me}for(var tt=ot(Fe.nextSibling,0),Be;(Be=tt.parentNode)&&Be.nodeType===1;)tt=Be;We.push(tt)}for(var $e=0;$e=xe&&(Ve+=2),we>=ae&&(st+=2)}}finally{Be&&(Be.style.display=He)}}var Le={};function ce(Se,Pe){for(var je=Pe.length;--je>=0;){var le=Pe[je];Le.hasOwnProperty(le)?G.console&&console.warn("cannot override language handler %s",le):Le[le]=Se}}function he(Se,Pe){return Se&&Le.hasOwnProperty(Se)||(Se=/^\s*]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ce(oe([[d,/^[\s]+/,null,` \r `],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),ce(oe([],[[F,/^[\s\S]+/]]),["uq.val"]),ce(Oe({keywords:m,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),ce(Oe({keywords:"null,true,false"}),["json"]),ce(Oe({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),ce(Oe({keywords:p,cStyleComments:!0}),["java"]),ce(Oe({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(Oe({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(Oe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(Oe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(Oe({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(Oe({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(oe([],[[w,/^[\s\S]+/]]),["regex"]);function re(Se){var Pe=Se.langExtension;try{var je=g(Se.sourceNode,Se.pre),le=je.sourceCode;Se.sourceCode=le,Se.spans=je.spans,Se.basePos=0,he(Pe,le)(Se),Re(Se)}catch(ve){G.console&&console.log(ve&&ve.stack||ve)}}function fe(Se,Pe,je){var le=je||!1,ve=Pe||null,we=document.createElement("div");we.innerHTML="
    "+Se+"
    ",we=we.firstChild,le&&Te(we,le,!0);var Ie={langExtension:ve,numberLines:le,sourceNode:we,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Ie),we.innerHTML}function se(Se,Pe){var je=Pe||document.body,le=je.ownerDocument||document;function ve(me){return je.getElementsByTagName(me)}for(var we=[ve("pre"),ve("code"),ve("xmp")],Ie=[],We=0;We=0),j.set("isFirefox",X.indexOf("Firefox")>=0),j.set("isChrome",X.indexOf("Chrome")>=0),j.set("isSafari",X.indexOf("Safari")>=0);const U=Object.prototype.hasOwnProperty;class K{static has(_){return m.create(_)}static equals(_,M){return p.create(_,M)}static regex(_,M){return w.create(_,M)}static not(_){return o.create(_)}static and(..._){return A.create(_,null)}static or(..._){return C.create(_,null,!0)}static deserialize(_,M=!1){return _?this._deserializeOrExpression(_,M):void 0}static _deserializeOrExpression(_,M){let I=_.split("||");return C.create(I.map(g=>this._deserializeAndExpression(g,M)),null,!0)}static _deserializeAndExpression(_,M){let I=_.split("&&");return A.create(I.map(g=>this._deserializeOne(g,M)),null)}static _deserializeOne(_,M){if(_=_.trim(),_.indexOf("!=")>=0){let I=_.split("!=");return f.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("==")>=0){let I=_.split("==");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(_.indexOf("=~")>=0){let I=_.split("=~");return w.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(_.indexOf(" in ")>=0){let I=_.split(" in ");return h.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(_)){const I=_.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(_)){const I=_.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(_)){const I=_.split("<=");return E.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(_)){const I=_.split("<");return O.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(_)?o.create(_.substr(1).trim()):m.create(_)}static _deserializeValue(_,M){if(_=_.trim(),_==="true")return!0;if(_==="false")return!1;let I=/^'([^']*)'$/.exec(_);return I?I[1].trim():_}static _deserializeRegexValue(_,M){if(Object(J.C)(_)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=_.indexOf("/"),g=_.lastIndexOf("/");if(I===g||I<0){if(M)throw new Error(`bad regexp-value '${_}', missing /-enclosure`);return console.warn(`bad regexp-value '${_}', missing /-enclosure`),null}let H=_.slice(I+1,g),$=_[g+1]==="i"?"i":"";try{return new RegExp(H,$)}catch(ne){if(M)throw new Error(`bad regexp-value '${_}', parse error: ${ne}`);return console.warn(`bad regexp-value '${_}', parse error: ${ne}`),null}}}function G(_,M){const I=_?_.substituteConstants():void 0,g=M?M.substituteConstants():void 0;return!I&&!g?!0:!I||!g?!1:I.equals(g)}function r(_,M){return _.cmp(M)}class R{constructor(){this.type=0}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}R.INSTANCE=new R;class v{constructor(){this.type=1}cmp(_){return this.type-_.type}equals(_){return _.type===this.type}substituteConstants(){return this}evaluate(_){return!0}serialize(){return"true"}keys(){return[]}negate(){return R.INSTANCE}}v.INSTANCE=new v;class m{constructor(_,M){this.key=_,this.negated=M,this.type=2}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?v.INSTANCE:R.INSTANCE:new m(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?v.INSTANCE:R.INSTANCE:this}evaluate(_){return!!_.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this)),this.negated}}class p{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=4}static create(_,M,I=null){if(typeof M=="boolean")return M?m.create(_,I):o.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const H=g?"true":"false";return M===H?v.INSTANCE:R.INSTANCE}return new p(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?v.INSTANCE:R.INSTANCE}return this}evaluate(_){return _.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class h{constructor(_,M){this.key=_,this.valueKey=M,this.type=10,this.negated=null}static create(_,M){return new h(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.valueKey,_.key,_.valueKey)}equals(_){return _.type===this.type?this.key===_.key&&this.valueKey===_.valueKey:!1}substituteConstants(){return this}evaluate(_){const M=_.getValue(this.valueKey),I=_.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?U.call(M,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=l.create(this)),this.negated}}class l{constructor(_){this._actual=_,this.type=11}static create(_){return new l(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=5}static create(_,M,I=null){if(typeof M=="boolean")return M?o.create(_,I):m.create(_,I);const g=j.get(_);if(typeof g=="boolean"){const H=g?"true":"false";return M===H?R.INSTANCE:v.INSTANCE}return new f(_,M,I)}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){const _=j.get(this.key);if(typeof _=="boolean"){const M=_?"true":"false";return this.value===M?R.INSTANCE:v.INSTANCE}return this}evaluate(_){return _.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class o{constructor(_,M){this.key=_,this.negated=M,this.type=3}static create(_,M=null){const I=j.get(_);return typeof I=="boolean"?I?R.INSTANCE:v.INSTANCE:new o(_,M)}cmp(_){return _.type!==this.type?this.type-_.type:y(this.key,_.key)}equals(_){return _.type===this.type?this.key===_.key:!1}substituteConstants(){const _=j.get(this.key);return typeof _=="boolean"?_?R.INSTANCE:v.INSTANCE:this}evaluate(_){return!_.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function u(_,M){if(typeof _=="string"){const I=parseFloat(_);isNaN(I)||(_=I)}return typeof _=="string"||typeof _=="number"?M(_):R.INSTANCE}class s{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=12}static create(_,M,I=null){return u(M,g=>new s(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class a{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=13}static create(_,M,I=null){return u(M,g=>new a(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(_,M,I){this.key=_,this.value=M,this.negated=I,this.type=14}static create(_,M,I=null){return u(M,g=>new O(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))new E(_,g,I))}cmp(_){return _.type!==this.type?this.type-_.type:b(this.key,this.value,_.key,_.value)}equals(_){return _.type===this.type?this.key===_.key&&this.value===_.value:!1}substituteConstants(){return this}evaluate(_){return typeof this.value=="string"?!1:parseFloat(_.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class w{constructor(_,M){this.key=_,this.regexp=M,this.type=7,this.negated=null}static create(_,M){return new w(_,M)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.key<_.key)return-1;if(this.key>_.key)return 1;const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return MI?1:0}equals(_){if(_.type===this.type){const M=this.regexp?this.regexp.source:"",I=_.regexp?_.regexp.source:"";return this.key===_.key&&M===I}return!1}substituteConstants(){return this}evaluate(_){let M=_.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const _=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${_}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(_){this._actual=_,this.type=8}static create(_){return new D(_)}cmp(_){return _.type!==this.type?this.type-_.type:this._actual.cmp(_._actual)}equals(_){return _.type===this.type?this._actual.equals(_._actual):!1}substituteConstants(){return this}evaluate(_){return!this._actual.evaluate(_)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function L(_){let M=null;for(let I=0,g=_.length;I_.expr.length)return 1;for(let M=0,I=this.expr.length;M1;){const H=I[I.length-1];if(H.type!==9)break;I.pop();const $=I.pop(),ne=I.length===0,oe=C.create(H.expr.map(Oe=>A.create([Oe,$],null)),null,ne);oe&&(I.push(oe),I.sort(r))}return I.length===1?I[0]:new A(I,M)}serialize(){return this.expr.map(_=>_.serialize()).join(" && ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){const _=[];for(let M of this.expr)_.push(M.negate());this.negated=C.create(_,this,!0)}return this.negated}}class C{constructor(_,M){this.expr=_,this.negated=M,this.type=9}static create(_,M,I){return C._normalizeArr(_,M,I)}cmp(_){if(_.type!==this.type)return this.type-_.type;if(this.expr.length<_.expr.length)return-1;if(this.expr.length>_.expr.length)return 1;for(let M=0,I=this.expr.length;M_.serialize()).join(" || ")}keys(){const _=[];for(let M of this.expr)_.push(...M.keys());return _}negate(){if(!this.negated){let _=[];for(let M of this.expr)_.push(M.negate());for(;_.length>1;){const M=_.shift(),I=_.shift(),g=[];for(const $ of F(M))for(const ne of F(I))g.push(A.create([$,ne],null));const H=_.length===0;_.unshift(C.create(g,null,H))}this.negated=_[0]}return this.negated}}class x extends m{constructor(_,M,I){super(_,null);this._defaultValue=M,typeof I=="object"?x._info.push(Object.assign(Object.assign({},I),{key:_})):I!==!0&&x._info.push({key:_,description:I,type:M!=null?typeof M:void 0})}static all(){return x._info.values()}bindTo(_){return _.createKey(this.key,this._defaultValue)}getValue(_){return _.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(_){return p.create(this.key,_)}}x._info=[];const d=Object(P.c)("contextKeyService"),S="setContext";function y(_,M){return _M?1:0}function b(_,M,I,g){return _I?1:Mg?1:0}function B(_,M){if(M.type===6&&_.type!==9&&_.type!==6){for(const H of M.expr)if(_.equals(H))return!0}const I=_.negate(),g=F(I).concat(F(M));g.sort(r);for(let H=0;H=0;h--)if(this.__items[h].match(p))return!0;return!1},R.prototype.set_indent=function(p,h){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(p){this.__items.push(p);var h=p.lastIndexOf(` `);h!==-1?this.__character_count=p.length-h:this.__character_count+=p.length},R.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function v(p,h){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),h=h||"",p.indent_level>0&&(h=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}v.prototype.get_indent_size=function(p,h){var l=this.__base_string_length;return h=h||0,p<0&&(l=0),l+=p*this.__indent_size,l+=h,l},v.prototype.get_indent_string=function(p,h){var l=this.__base_string;return h=h||0,p<0&&(p=0,l=""),h+=p*this.__indent_size,this.__ensure_cache(h),l+=this.__cache[h],l},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,h=0,l="";this.__indent_size&&p>=this.__indent_size&&(h=Math.floor(p/this.__indent_size),p-=h*this.__indent_size,l=new Array(h+1).join(this.__indent_string)),p&&(l+=new Array(p+1).join(" ")),this.__cache.push(l)};function m(p,h){this.__indent_cache=new v(p,h),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,h){return this.__indent_cache.get_indent_string(p,h)},m.prototype.get_indent_size=function(p,h){return this.__indent_cache.get_indent_size(p,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(` `);return p!==` `&&(l=l.replace(/[\n]/g,p)),l},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,h){return p=p||0,h=h||0,this.next_line.set_indent(p,h),this.__lines.length>1?(this.current_line.set_indent(p,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,h){for(var l=this.__lines.length-2;l>=0;){var f=this.__lines[l];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==h){this.__lines.splice(l+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},r.exports.Output=m},,,,function(r){function R(p,h){this.raw_options=v(p,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}R.prototype._get_array=function(p,h){var l=this.raw_options[p],f=h||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(f=l.concat()):typeof l=="string"&&(f=l.split(/[^a-zA-Z0-9_\/\-]+/)),f},R.prototype._get_boolean=function(p,h){var l=this.raw_options[p],f=l===void 0?!!h:!!l;return f},R.prototype._get_characters=function(p,h){var l=this.raw_options[p],f=h||"";return typeof l=="string"&&(f=l.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),f},R.prototype._get_number=function(p,h){var l=this.raw_options[p];h=parseInt(h,10),isNaN(h)&&(h=0);var f=parseInt(l,10);return isNaN(f)&&(f=h),f},R.prototype._get_selection=function(p,h,l){var f=this._get_selection_list(p,h,l);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[p]+"'");return f[0]},R.prototype._get_selection_list=function(p,h,l){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[h[0]],!this._is_valid_selection(l,h))throw new Error("Invalid Default Value!");var f=this._get_array(p,l);if(!this._is_valid_selection(f,h))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[p]+"'");return f},R.prototype._is_valid_selection=function(p,h){return p.length&&h.length&&!p.some(function(l){return h.indexOf(l)===-1})};function v(p,h){var l={};p=m(p);var f;for(f in p)f!==h&&(l[f]=p[f]);if(h&&p[h])for(f in p[h])l[f]=p[h][f];return l}function m(p){var h={},l;for(l in p){var f=l.replace(/-/g,"_");h[f]=p[l]}return h}r.exports.Options=R,r.exports.normalizeOpts=m,r.exports.mergeOpts=v},,function(r){var R=RegExp.prototype.hasOwnProperty("sticky");function v(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position=0&&m=0&&p=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},r.exports.InputScanner=v},,,,,function(r){function R(v,m){v=typeof v=="string"?v:v.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+m,"g")}R.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(v);return m},R.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=R},,function(r,R,v){var m=v(16).Beautifier,p=v(17).Options;function h(l,f){var o=new m(l,f);return o.beautify()}r.exports=h,r.exports.defaultOptions=function(){return new p}},function(r,R,v){var m=v(17).Options,p=v(2).Output,h=v(8).InputScanner,l=v(13).Directives,f=new l(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(D,L){this._source_text=D||"",this._options=new m(L),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}w.prototype.eatString=function(D){var L="";for(this._ch=this._input.next();this._ch;){if(L+=this._ch,this._ch==="\\")L+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return L},w.prototype.eatWhitespace=function(D){for(var L=s.test(this._input.peek()),A=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===` `&&((A===0||A0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,L=this._options.eol;L==="auto"&&(L=` `,D&&o.test(D||"")&&(L=D.match(o)[0])),D=D.replace(u,` `);var A=D.match(/^[\t ]*/)[0];this._output=new p(this._options,A),this._input=new h(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,x=!1,d=!1,S=!1,y=!1,b=!1,B=!1,F=this._ch,_=!1,M,I,g;M=this._input.read(a),I=M!=="",g=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(O),$=f.get_directives(H);$&&$.ignore==="start"&&(H+=f.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ne=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ne.match(/[ :]$/)&&(ne=this.eatString(": ").replace(/\s$/,""),this.print_string(ne),this._output.space_before_token=!0),ne=ne.replace(/\s$/,""),ne==="extend"?y=!0:ne==="import"&&(b=!0),ne in this.NESTED_AT_RULE?(this._nestedLevel+=1,ne in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!x&&C===0&&ne.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),S?(S=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(g==="("?this._output.space_before_token=!1:g!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),g==="{"&&this._output.trim(!0),b=!1,y=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var oe=0;oe"||this._ch==="+"||this._ch==="~")&&!d&&C===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Te=g==='"'||g==="'";this.preserveSingleSpace(Te||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&_&&this._output.add_new_line()}var Re=this._output.get_code(L);return Re},r.exports.Beautifier=w},function(r,R,v){var m=v(6).Options;function p(h){m.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o` ${v} `).trim():""}class K{constructor(r,R,v){this.id=r,this.definition=R,this.description=v,P.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var G;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const R=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function v(h){if(h instanceof K)return["codicon","codicon-"+h.id];const l=R.exec(h.id);if(!l)return v(K.error);let[,f,o]=l;const u=["codicon","codicon-"+f];return o&&u.push("codicon-modifier-"+o.substr(1)),u}r.asClassNameArray=v;function m(h){return v(h).join(" ")}r.asClassName=m;function p(h){return"."+v(h).join(".")}r.asCSSSelector=p})(G||(G={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(rt,_e,Z){(function(ie,J){rt.exports=J()})(this,function(){"use strict";var ie=navigator.userAgent,J=navigator.platform,P=/gecko\/\d/i.test(ie),X=/MSIE \d/.test(ie),j=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),U=/Edge\/(\d+)/.exec(ie),K=X||j||U,G=K&&(X?document.documentMode||6:+(U||j)[1]),r=!U&&/WebKit\//.test(ie),R=r&&/Qt\/\d+\.\d+/.test(ie),v=!U&&/Chrome\//.test(ie),m=/Opera\//.test(ie),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),l=/PhantomJS/.test(ie),f=!U&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),o=/Android/.test(ie),u=f||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=f||/Mac/.test(J),a=/\bCrOS\b/.test(ie),O=/win/i.test(J),E=m&&ie.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(m=!1,r=!0);var w=s&&(R||m&&(E==null||E<12.11)),D=P||K&&G>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var i=e.className,n=L(t).exec(i);if(n){var c=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(c?n[1]+c:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return C(e).appendChild(t)}function d(e,t,i,n){var c=document.createElement(e);if(i&&(c.className=i),n&&(c.style.cssText=n),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var N=0;N=t)return z+(t-N);z+=Q-N,z+=i-z%i,N=Q+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return n+Math.min(z,t-c);if(c+=N-n,c+=i-c%i,n=N+1,c>=t)return n}}var ce=[""];function he(e){for(;ce.length<=e;)ce.push(re(ce)+" ");return ce[e]}function re(e){return e[e.length-1]}function fe(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Se.test(e))}function je(e,t){return t?t.source.indexOf("\\w")>-1&&Pe(e)?!0:t.test(e):Pe(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ve=/[\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 we(e){return e.charCodeAt(0)>=768&&ve.test(e)}function Ie(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var c=(t+i)/2,N=n<0?Math.ceil(c):Math.floor(c);if(N==t)return e(N)?t:i;e(N)?i=N:t=N+n}}function Ve(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var c=!1,N=0;Nt||t==i&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,i),z.level==1?"rtl":"ltr",N),c=!0)}c||n(t,i,"ltr")}var Ze=null;function $e(e,t,i){var n;Ze=null;for(var c=0;ct)return c;N.to==t&&(N.from!=N.to&&i=="before"?n=c:Ze=c),N.from==t&&(N.from!=N.to&&i!="before"?n=c:Ze=c)}return n!=null?n:Ze}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,N=/[LRr]/,z=/[Lb1n]/,Q=/[1n]/;function q(te,pe,be){this.level=te,this.from=pe,this.to=be}return function(te,pe){var be=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!n.test(te))return!1;for(var Me=te.length,ke=[],Ge=0;Ge-1&&(n[t]=c.slice(0,N).concat(c.slice(N+1)))}}}function Be(e,t){var i=ot(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),c=0;c0}function xe(e){e.prototype.on=function(t,i){Fe(this,t,i)},e.prototype.off=function(t,i){tt(this,t,i)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ue(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ge(e){ae(e),ue(e)}function Ce(e){return e.target||e.srcElement}function Ue(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(K&&G<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),lt;function mt(e){if(lt==null){var t=d("span","\u200B");x(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&G<8))}var i=lt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ft;function wt(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),i=y(t,0,1).getBoundingClientRect(),n=y(t,1,2).getBoundingClientRect();return C(e),!i||i.left==i.right?!1:ft=n.right-i.right<3}var St=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var c=e.indexOf(` `,t);c==-1&&(c=e.length);var N=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),z=N.indexOf("\r");z!=-1?(i.push(N.slice(0,z)),t+=z+1):(i.push(N),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ct=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},Bt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function qt(e){if(Lt!=null)return Lt;var t=x(e,d("span","x")),i=t.getBoundingClientRect(),n=y(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Zt={},It={};function Cr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Zt[e]=t}function Kr(e,t){It[e]=t}function yt(e){if(typeof e=="string"&&It.hasOwnProperty(e))e=It[e];else if(e&&typeof e.name=="string"&&It.hasOwnProperty(e.name)){var t=It[e.name];typeof t=="string"&&(t={name:t}),e=Ne(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Lr(e,t){t=yt(t);var i=Zt[t.name];if(!i)return Lr(e,"text/plain");var n=i(e,t);if(bt.hasOwnProperty(t.name)){var c=bt[t.name];for(var N in c){if(!c.hasOwnProperty(N))continue;n.hasOwnProperty(N)&&(n["_"+N]=n[N]),n[N]=c[N]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var bt={};function xt(e,t){var i=bt.hasOwnProperty(e)?bt[e]:bt[e]={};g(t,i)}function Ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var c=t[n];c instanceof Array&&(c=c.concat([])),i[n]=c}return i}function tr(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 cr(e,t,i){return e.startState?e.startState(t,i):!0}var Pt=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};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.post},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(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 c=i.children[n],N=c.chunkSize();if(t=e.first&&ti?Je(i,dt(e,i).text.length):k(t,dt(e,t.line).text.length)}function k(e,t){var i=e.ch;return i==null||i>t?Je(e.line,t):i<0?Je(e.line,0):e}function W(e,t){for(var i=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},V.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}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,i){return t instanceof ee?new V(e,Ft(e.mode,t.state),i,t.lookAhead):new V(e,Ft(e.mode,t),i)},V.prototype.save=function(e){var t=e!==!1?Ft(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ee(e,t,i,n){var c=[e.state.modeGen],N={};Er(e,t.text,e.doc.mode,i,function(te,pe){return c.push(te,pe)},N,n);for(var z=i.state,Q=function(te){i.baseTokens=c;var pe=e.state.overlays[te],be=1,Me=0;i.state=!0,Er(e,t.text,pe.mode,i,function(ke,Ge){for(var Xe=be;Meke&&c.splice(be,1,ke,c[be+1],qe),be+=2,Me=Math.min(ke,qe)}if(!Ge)return;if(pe.opaque)c.splice(Xe,be-Xe,ke,"overlay "+Ge),be=Xe+2;else for(;Xee.options.maxHighlightLength&&Ft(e.doc.mode,n.state),N=Ee(e,t,n);c&&(n.state=c),t.stateAfter=n.save(!c),t.styles=N.styles,N.classes?t.styleClasses=N.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 et(e,t,i){var n=e.doc,c=e.display;if(!n.mode.startState)return new V(n,!0,t);var N=xr(e,t,i),z=N>n.first&&dt(n,N-1).stateAfter,Q=z?V.fromSaved(n,z,N):new V(n,cr(n.mode),N);return n.iter(N,t,function(q){pt(e,q.text,Q);var te=Q.line;q.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&tet.start)return N}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 $t(e,t,i,n){var c=e.doc,N=c.mode,z;t=T(c,t);var Q=dt(c,t.line),q=et(e,t.line,i),te=new Pt(Q.text,e.options.tabSize,q),pe;for(n&&(pe=[]);(n||te.pose.options.maxHighlightLength?(Q=!1,z&&pt(e,t,n,pe.pos),pe.pos=t.length,be=null):be=jr(_t(i,pe,n.state,Me),N),Me){var ke=Me[0].name;ke&&(be="m-"+(be?ke+" "+be:ke))}if(!Q||te!=be){for(;qz;--Q){if(Q<=N.first)return N.first;var q=dt(N,Q-1),te=q.stateAfter;if(te&&(!i||Q+(te instanceof ee?te.lookAhead:0)<=N.modeFrontier))return Q;var pe=H(q.text,null,e.options.tabSize);(c==null||n>pe)&&(c=Q-1,n=pe)}return c}function Zr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var c=dt(e,n).stateAfter;if(c&&(!(c instanceof ee)||n+c.lookAhead=t:N.to>t);(n||(n=[])).push(new hn(z,N.from,q?null:N.to))}}return n}function Vn(e,t,i){var n;if(e)for(var c=0;c=t:N.to>t);if(Q||N.from==t&&z.type=="bookmark"&&(!i||N.marker.insertLeft)){var q=N.from==null||(z.inclusiveLeft?N.from<=t:N.from0&&Q)for(var ht=0;ht0)continue;var pe=[q,1],be=Ct(te.from,Q.from),Me=Ct(te.to,Q.to);(be<0||!z.inclusiveLeft&&!be)&&pe.push({from:te.from,to:Q.from}),(Me>0||!z.inclusiveRight&&!Me)&&pe.push({from:Q.to,to:te.to}),c.splice.apply(c,pe),q+=pe.length-3}return c}function ci(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||yr(n,N.marker)<0)&&(n=N.marker)}return n}function fr(e,t,i,n,c){var N=dt(e,t),z=dr&&N.markedSpans;if(z)for(var Q=0;Q=0&&be<=0||pe<=0&&be>=0)continue;if(pe<=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.to,i)>=0:Ct(te.to,i)>0)||pe>=0&&(q.marker.inclusiveRight&&c.inclusiveLeft?Ct(te.from,n)<=0:Ct(te.from,n)<0))return!0}}function Ar(e){for(var t;t=ar(e);)e=t.find(-1,!0).line;return e}function Yn(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function di(e,t){var i=dt(e,t),n=Ar(i);return i==n?t:Ot(n)}function Tn(e,t){if(t>e.lastLine())return t;var i=dt(e,t),n;if(!an(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Ot(i)+1}function an(e,t){var i=dr&&t.markedSpans;if(i)for(var n=void 0,c=0;ct.maxLineLength&&(t.maxLineLength=c,t.maxLine=n)})}var Mn=function(e,t,i){this.text=e,En(this,t),this.height=i?i(this):1};Mn.prototype.lineNo=function(){return Ot(this)},xe(Mn);function ua(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ci(e),En(e,i);var c=n?n(e):1;c!=e.height&&Jt(e,c)}function gt(e){e.parent=null,ci(e)}var At={},Et={};function Dt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Et:At;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ut(e,t){var i=S("span",null,null,r?"padding-right: .1px":null),n={pre:S("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var N=c?t.rest[c-1]:t.line,z=void 0;n.pos=0,n.addToken=Nt,wt(e.display.measure)&&(z=Qe(N,e.doc.direction))&&(n.addToken=Dr(n.addToken,z)),n.map=[];var Q=t!=e.display.externalMeasured&&Ot(N);cn(N,n,Ke(e,N,Q)),N.styleClasses&&(N.styleClasses.bgClass&&(n.bgClass=_(N.styleClasses.bgClass,n.bgClass||"")),N.styleClasses.textClass&&(n.textClass=_(N.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),c==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(r){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=_(n.pre.className,n.textClass||"")),n}function Yt(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 Nt(e,t,i,n,c,N,z){if(!t)return;var Q=e.splitSpaces?ur(t,e.trailingSpace):t,q=e.cm.state.specialChars,te=!1,pe;if(!q.test(t))e.col+=t.length,pe=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,pe),K&&G<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var be=0;;){q.lastIndex=be;var Me=q.exec(t),ke=Me?Me.index-be:t.length-be;if(ke){var Ge=document.createTextNode(Q.slice(be,be+ke));K&&G<9?pe.appendChild(d("span",[Ge])):pe.appendChild(Ge),e.map.push(e.pos,e.pos+ke,Ge),e.col+=ke,e.pos+=ke}if(!Me)break;be+=ke+1;var Xe=void 0;if(Me[0]==" "){var qe=e.cm.options.tabSize,it=qe-e.col%qe;Xe=pe.appendChild(d("span",he(it),"cm-tab")),Xe.setAttribute("role","presentation"),Xe.setAttribute("cm-text"," "),e.col+=it}else Me[0]=="\r"||Me[0]==` `?(Xe=pe.appendChild(d("span",Me[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xe.setAttribute("cm-text",Me[0]),e.col+=1):(Xe=e.cm.options.specialCharPlaceholder(Me[0]),Xe.setAttribute("cm-text",Me[0]),K&&G<9?pe.appendChild(d("span",[Xe])):pe.appendChild(Xe),e.col+=1);e.map.push(e.pos,e.pos+1,Xe),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,i||n||c||te||N||z){var ut=i||"";n&&(ut+=n),c&&(ut+=c);var at=d("span",[pe],ut,N);if(z)for(var ht in z)z.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&at.setAttribute(ht,z[ht]);return e.content.appendChild(at)}e.content.appendChild(pe)}function ur(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",c=0;cte&&be.from<=te);Me++);if(be.to>=pe)return e(i,n,c,N,z,Q,q);e(i,n.slice(0,be.to-te),c,N,null,Q,q),N=null,n=n.slice(be.to-te),te=be.to}}}function Mt(e,t,i,n){var c=!n&&i.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!n&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",i.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function cn(e,t,i){var n=e.markedSpans,c=e.text,N=0;if(!n){for(var z=1;zq||Rt.collapsed&&vt.to==q&&vt.from==q)){if(vt.to!=null&&vt.to!=q&&ke>vt.to&&(ke=vt.to,Xe=""),Rt.className&&(Ge+=" "+Rt.className),Rt.css&&(Me=(Me?Me+";":"")+Rt.css),Rt.startStyle&&vt.from==q&&(qe+=" "+Rt.startStyle),Rt.endStyle&&vt.to==ke&&(ht||(ht=[])).push(Rt.endStyle,vt.to),Rt.title&&((ut||(ut={})).title=Rt.title),Rt.attributes)for(var Xt in Rt.attributes)(ut||(ut={}))[Xt]=Rt.attributes[Xt];Rt.collapsed&&(!it||yr(it.marker,Rt)<0)&&(it=vt)}else vt.from>q&&ke>vt.from&&(ke=vt.from)}if(ht)for(var gr=0;gr=Q)break;for(var Gr=Math.min(Q,ke);;){if(pe){var Nr=q+pe.length;if(!it){var sr=Nr>Gr?pe.slice(0,Gr-q):pe;t.addToken(t,sr,be?be+Ge:Ge,qe,q+sr.length==ke?Xe:"",Me,ut)}if(Nr>=Gr){pe=pe.slice(Gr-q),q=Gr;break}q=Nr,qe=""}pe=c.slice(N,N=i[te++]),be=Dt(i[te++],t.cm.options)}}}function Wt(e,t,i){this.line=t,this.rest=xn(t),this.size=this.rest?Ot(re(this.rest))-i+1:1,this.node=this.text=null,this.hidden=an(e,t)}function kr(e,t,i){for(var n=[],c,N=t;N2&&N.push((q.bottom+te.top)/2-i.top)}}N.push(i.bottom-i.top)}}function es(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Ar(t);var i=Ot(t),n=e.display.externalMeasured=new Wt(e.doc,t,i);n.lineN=i;var c=n.built=Ut(e,n);return n.text=c.pre,x(e.display.lineMeasure,c.pre),n}function ts(e,t,i,n){return on(e,Xn(e,t),i,n)}function fa(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(N=q-Q,c=N-1,t>=q&&(z="right")),c!=null){if(n=e[te+2],Q==q&&i==(n.insertLeft?"left":"right")&&(z=i),i=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],z="left";if(i=="right"&&c==q-Q)for(;te=0&&!((i=e[c]).left!=i.right);c--);return i}function Ho(e,t,i,n){var c=ns(t.map,i,n),N=c.node,z=c.start,Q=c.end,q=c.collapse,te;if(N.nodeType==3){for(var pe=0;pe<4;pe++){for(;z&&we(t.line.text.charAt(c.coverStart+z));)--z;for(;c.coverStart+Q0&&(q=n="right");var be;e.options.lineWrapping&&(be=N.getClientRects()).length>1?te=be[n=="right"?be.length-1:0]:te=N.getBoundingClientRect()}if(K&&G<9&&!z&&(!te||!te.left&&!te.right)){var Me=N.parentNode.getClientRects()[0];Me?te={left:Me.left,right:Me.left+Jn(e.display),top:Me.top,bottom:Me.bottom}:te=rs}for(var ke=te.top-t.rect.top,Ge=te.bottom-t.rect.top,Xe=(ke+Ge)/2,qe=t.view.measure.heights,it=0;it=n.text.length?(q=n.text.length,te="before"):q<=0&&(q=0,te="after"),!Q)return z(te=="before"?q-1:q,te=="before");function pe(Ge,Xe,qe){var it=Q[Xe],ut=it.level==1;return z(qe?Ge-1:Ge,ut!=qe)}var be=$e(Q,q,te),Me=Ze,ke=pe(q,be,te=="before");return Me!=null&&(ke.other=pe(q,Me,te!="before")),ke}function us(e,t){var i=0;t=T(e.doc,t),e.options.lineWrapping||(i=Jn(e.display)*t.ch);var n=dt(e.doc,t.line),c=qr(n)+Hi(e.display);return{left:i,right:i,top:c,bottom:c+n.height}}function ga(e,t,i,n,c){var N=Je(e,t,i);return N.xRel=c,n&&(N.outside=n),N}function va(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return ga(n.first,0,null,-1,-1);var c=lr(n,i),N=n.first+n.size-1;if(c>N)return ga(n.first+n.size-1,dt(n,N).text.length,null,1,1);t<0&&(t=0);for(var z=dt(n,c);;){var Q=Go(e,z,c,t,i),q=nn(z,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var te=q.find(1);if(te.line==c)return te;z=dt(n,c=te.line)}}function hs(e,t,i,n){n-=pa(t);var c=t.text.length,N=We(function(z){return on(e,i,z-1).bottom<=n},c,0);return c=We(function(z){return on(e,i,z).top>n},N,c),{begin:N,end:c}}function cs(e,t,i,n){i||(i=Xn(e,t));var c=Wi(e,t,on(e,i,n),"line").top;return hs(e,t,i,c)}function ya(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Go(e,t,i,n,c){c-=qr(t);var N=Xn(e,t),z=pa(t),Q=0,q=t.text.length,te=!0,pe=Qe(t,e.doc.direction);if(pe){var be=(e.options.lineWrapping?zo:Ko)(e,t,i,N,pe,n,c);te=be.level!=1,Q=te?be.from:be.to-1,q=te?be.to:be.from-1}var Me=null,ke=null,Ge=We(function(Tt){var vt=on(e,N,Tt);return vt.top+=z,vt.bottom+=z,ya(vt,n,c,!1)?(vt.top<=c&&vt.left<=n&&(Me=Tt,ke=vt),!0):!1},Q,q),Xe,qe,it=!1;if(ke){var ut=n-ke.left=ht.bottom?1:0}return Ge=Ie(t.text,Ge,1),ga(i,Ge,qe,it,n-Xe)}function Ko(e,t,i,n,c,N,z){var Q=We(function(be){var Me=c[be],ke=Me.level!=1;return ya(en(e,Je(i,ke?Me.to:Me.from,ke?"before":"after"),"line",t,n),N,z,!0)},0,c.length-1),q=c[Q];if(Q>0){var te=q.level!=1,pe=en(e,Je(i,te?q.from:q.to,te?"after":"before"),"line",t,n);ya(pe,N,z,!0)&&pe.top>z&&(q=c[Q-1])}return q}function zo(e,t,i,n,c,N,z){var Q=hs(e,t,n,z),q=Q.begin,te=Q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,be=null,Me=0;Me=te||ke.to<=q)continue;var Ge=ke.level!=1,Xe=on(e,n,Ge?Math.min(te,ke.to)-1:Math.max(q,ke.from)).right,qe=Xeqe)&&(pe=ke,be=qe)}return pe||(pe=c[c.length-1]),pe.fromte&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(d("br"));Nn.appendChild(document.createTextNode("x"))}x(e.measure,Nn);var i=Nn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),i=d("pre",[t],"CodeMirror-line-like");x(e.measure,i);var n=t.getBoundingClientRect(),c=(n.right-n.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,i={},n={},c=t.gutters.clientLeft,N=t.gutters.firstChild,z=0;N;N=N.nextSibling,++z){var Q=e.display.gutterSpecs[z].className;i[Q]=N.offsetLeft+N.clientLeft+c,n[Q]=N.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=$n(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(c){if(an(e.doc,c))return 0;var N=0;if(c.widgets)for(var z=0;z0&&(te=dt(e.doc,q.line).text).length==q.ch){var pe=H(te,te.length,e.options.tabSize)-te.length;q=Je(q.line,Math.max(0,Math.round((N-qa(e.display).left)/Jn(e.display))-pe))}return q}function Un(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;nt)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)dr&&di(e.doc,t)c.viewFrom?Sn(e):(c.viewFrom+=n,c.viewTo+=n);else if(t<=c.viewFrom&&i>=c.viewTo)Sn(e);else if(t<=c.viewFrom){var N=Gi(e,i,i+n,1);N?(c.view=c.view.slice(N.index),c.viewFrom=N.lineN,c.viewTo+=n):Sn(e)}else if(i>=c.viewTo){var z=Gi(e,t,t,-1);z?(c.view=c.view.slice(0,z.index),c.viewTo=z.lineN):Sn(e)}else{var Q=Gi(e,t,t,-1),q=Gi(e,i,i+n,1);Q&&q?(c.view=c.view.slice(0,Q.index).concat(kr(e,Q.lineN,q.lineN)).concat(c.view.slice(q.index)),c.viewTo+=n):Sn(e)}var te=c.externalMeasured;te&&(i=c.lineN&&t=n.viewTo)return;var N=n.view[Un(e,t)];if(N.node==null)return;var z=N.changes||(N.changes=[]);ne(z,i)==-1&&z.push(i)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,i,n){var c=Un(e,t),N,z=e.display.view;if(!dr||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var Q=e.display.viewFrom,q=0;q0){if(c==z.length-1)return null;N=Q+z[c].size-t,c++}else N=Q-t;t+=N,i+=N}for(;di(e.doc,i)!=i;){if(c==(n<0?0:z.length-1))return null;i+=n*z[c-(n<0?1:0)].size,c+=n}return{index:c,lineN:i}}function Vo(e,t,i){var n=e.display,c=n.view;c.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=kr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=kr(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Un(e,i)))),n.viewTo=i}function fs(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||Q.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function gs(e){e.state.focused||(e.display.input.focus(),Ta(e))}function vs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,A(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zi(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n.005||pe<-.005)&&(Jt(c.line,z),ys(c.line),c.rest))for(var be=0;bee.display.sizerWidth){var Me=Math.ceil(Q/Jn(e.display));Me>e.display.maxLineLength&&(e.display.maxLineLength=Me,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t=z&&(N=lr(t,qr(dt(t,q))-e.wrapper.clientHeight),z=q)}return{from:N,to:Math.max(z,N+1)}}function Xo(e,t){if(He(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),c=null;if(t.top+n.top<0?c=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!l){var N=d("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Hi(e.display))+`px; height: `+(t.bottom-t.top+sn(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(c),e.display.lineSpace.removeChild(N)}}function $o(e,t,i,n){n==null&&(n=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?Je(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Je(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var z=!1,Q=en(e,t),q=!i||i==t?Q:en(e,i);c={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-n,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+n};var te=wa(e,c),pe=e.doc.scrollTop,be=e.doc.scrollLeft;if(te.scrollTop!=null&&(Ei(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(z=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-be)>1&&(z=!0)),!z)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&Ei(e,i.scrollTop),i.scrollLeft!=null&&Bn(e,i.scrollLeft)}function wa(e,t){var i=e.display,n=$n(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,N=da(e),z={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Q=e.doc.height+ca(i),q=t.topQ-n;if(t.topc+N){var pe=Math.min(t.top,(te?Q:t.bottom)-N);pe!=c&&(z.scrollTop=pe)}var be=e.options.fixedGutter?0:i.gutters.offsetWidth,Me=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-be,ke=Pn(e)-i.gutters.offsetWidth,Ge=t.right-t.left>ke;return Ge&&(t.right=t.left+ke),t.left<10?z.scrollLeft=0:t.leftke+Me-3&&(z.scrollLeft=t.right+(Ge?0:10)-ke),z}function Sa(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,i){(t!=null||i!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zo(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),n=us(e,t.to);bs(e,i,n,t.margin)}}function bs(e,t,i,n){var c=wa(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});_i(e,c.scrollLeft,c.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wi(e,100)}function _s(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 Bn(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,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xi(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ca(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+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var jn=function(e,t,i){this.cm=i;var n=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=c.tabIndex=-1,e(n),e(c),Fe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Fe(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.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 c=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"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 N=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"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}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=s&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},jn.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var c=e.getBoundingClientRect(),N=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ti=function(){};Ti.prototype.update=function(){return{bottom:0,right:0}},Ti.prototype.setScrollLeft=function(){},Ti.prototype.setScrollTop=function(){},Ti.prototype.clear=function(){};function qn(e,t){t||(t=xi(e));var i=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var c=0;c<4&&i!=e.display.barWidth||n!=e.display.barHeight;c++)i!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Es(e,xi(e)),i=e.display.barWidth,n=e.display.barHeight}function Es(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 xs={native:jn,null:Ti};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Fe(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"?Bn(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function Hn(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:++Qo},Jr(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&zi(t),e.barMeasure=xi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(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+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=et(e,t.highlightFrontier),c=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(n.line>=e.display.viewFrom){var z=N.styles,Q=N.text.length>e.options.maxHighlightLength?Ft(t.mode,n.state):null,q=Ee(e,N,n,!0);Q&&(n.state=Q),N.styles=q.styles;var te=N.styleClasses,pe=q.classes;pe?N.styleClasses=pe:te&&(N.styleClasses=null);for(var be=!z||z.length!=N.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Me=0;!be&&Mei)return wi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),c.length&&Wr(e,function(){for(var N=0;N=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var c=n.first+n.size,N=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFromz&&i.viewTo-z<20&&(z=Math.min(c,i.viewTo)),dr&&(N=di(e.doc,N),z=Tn(e.doc,z));var Q=N!=i.viewFrom||z!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,N,z),i.viewOffset=qr(dt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=fs(e);if(!Q&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var te=ol(e);return q>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(te),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,wi(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ca(e.display)-da(e),i.top)}),t.visible=Vi(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vi(e.display,e.doc,i));if(!Ca(e,t))break;zi(e);var c=xi(e);bi(e),qn(e,c),Ra(e,c),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 Aa(e,t){var i=new Xi(e,t);if(Ca(e,i)){zi(e),ws(e,i);var n=xi(e);bi(e),qn(e,n),Ra(e,n),i.finish()}}function ul(e,t,i){var n=e.display,c=e.options.lineNumbers,N=n.lineDiv,z=N.firstChild;function Q(Ge){var Xe=Ge.nextSibling;return r&&s&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),Xe}for(var q=n.view,te=n.viewFrom,pe=0;pe-1&&(ke=!1),Xa(e,be,te,i)),ke&&(C(be.lineNumber),be.lineNumber.appendChild(document.createTextNode(Xr(e.options,te)))),z=be.node.nextSibling}te+=be.size}for(;z;)z=Q(z)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(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+sn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,N=n+"px",z=0;zz.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(n&&Q||c&&q))return;if(c&&s&&r){e:for(var te=t.target,pe=N.view;te!=z;te=te.parentNode)for(var be=0;be=0&&Ct(e,n.to())<=0)return i}return-1};var Gt=function(e,t){this.anchor=e,this.head=t};Gt.prototype.from=function(){return yn(this.anchor,this.head)},Gt.prototype.to=function(){return vn(this.anchor,this.head)},Gt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,i){var n=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(Me,ke){return Ct(Me.from(),ke.from())}),i=ne(t,c);for(var N=1;N0:q>=0){var te=yn(Q.from(),z.from()),pe=vn(Q.to(),z.to()),be=Q.empty()?z.from()==z.head:Q.from()==Q.head;N<=i&&--i,t.splice(--N,2,new Gt(be?pe:te,be?te:pe))}}return new Yr(t,i)}function Cn(e,t){return new Yr([new Gt(e,t||e)],0)}function An(e){return e.text?Je(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return An(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+=An(t).ch-t.to.ch),Je(i,n)}function Ia(e,t){for(var i=[],n=0;n1&&e.remove(Q.line+1,Ge-1),e.insert(Q.line+1,it)}br(e,"change",e,t)}function On(e,t,i){function n(c,N,z){if(c.linked)for(var Q=0;Q1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Ns(e,t,i,n){var c=e.history;c.undone.length=0;var N=+new Date,z,Q;if((c.lastOp==n||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(c,c.lastOp==n)))Q=re(z.changes),Ct(t.from,t.to)==0&&Ct(t.from,Q.to)==0?Q.to=An(t):z.changes.push(Ma(e,t));else{var q=re(c.done);for((!q||!q.ranges)&&Zi(e.sel,c.done),z={changes:[Ma(e,t)],generation:c.generation},c.done.push(z);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(i),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=N,c.lastOp=c.lastSelOp=n,c.lastOrigin=c.lastSelOrigin=t.origin,Q||Be(e,"historyAdded")}function ml(e,t,i,n){var c=t.charAt(0);return c=="*"||c=="+"&&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 c=e.history,N=n&&n.origin;i==c.lastSelOp||N&&c.lastSelOrigin==N&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==N||ml(e,N,re(c.done),t))?c.done[c.done.length-1]=t:Zi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=N,c.lastSelOp=i,n&&n.clearRedo!==!1&&Ps(c.undone)}function Zi(e,t){var i=re(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,n){var c=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((c||(c=t["spans_"+e.id]={}))[N]=z.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(re(Q)[be]=te[be],delete te[be]))}}return n}function Pa(e,t,i,n){if(n){var c=e.anchor;if(i){var N=Ct(t,c)<0;N!=Ct(i,c)<0?(c=t,t=i):N!=Ct(t,i)<0&&(t=i)}return new Gt(c,t)}else return new Gt(i||t,t)}function Qi(e,t,i,n,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Yr([Pa(e.sel.primary(),t,i,c)],0),n)}function Bs(e,t,i){for(var n=[],c=e.cm&&(e.cm.display.shift||e.extend),N=0;N=t.ch:Q.to>t.ch))){if(c&&(Be(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(i){var be=q.find(n<0?1:-1),Me=void 0;if((n<0?pe:te)&&(be=zs(e,be,-n,be&&be.line==t.line?N:null)),be&&be.line==t.line&&(Me=Ct(be,i))&&(n<0?Me<0:Me>0))return ti(e,be,t,n,c)}var ke=q.find(n<0?-1:1);return(n<0?te:pe)&&(ke=zs(e,ke,n,ke.line==t.line?N:null)),ke?ti(e,ke,t,n,c):null}}return t}function ea(e,t,i,n,c){var N=n||1,z=ti(e,t,i,N,c)||!c&&ti(e,t,i,N,!0)||ti(e,t,i,-N,c)||!c&&ti(e,t,i,-N,!0);return z||(e.cantEdit=!0,Je(e.first,0))}function zs(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?T(e,Je(t.line-1)):null:i>0&&t.ch==(n||dt(e,t.line)).text.length?t.line=0;--c)Xs(e,{from:n[c].from,to:n[c].to,text:c?[""]:t.text,origin:t.origin});else Xs(e,t)}function Xs(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),Ai(e,t,i,Qr(e,t));var n=[];On(e,function(c,N){!N&&ne(n,c.history)==-1&&(Qs(c.history,t),n.push(c.history)),Ai(c,t,null,Qr(c,t))})}function ta(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var c=e.history,N,z=e.sel,Q=t=="undo"?c.done:c.undone,q=t=="undo"?c.undone:c.done,te=0;te=0;--ke){var Ge=Me(ke);if(Ge)return Ge.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yr(fe(e.sel.ranges,function(c){return new Gt(Je(c.anchor.line+t,c.anchor.ch),Je(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.lineN&&(t={from:t.from,to:Je(N,dt(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Br(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qi(e,i,ye),e.cantEdit&&ea(e,Je(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,c=e.display,N=t.from,z=t.to,Q=!1,q=N.line;e.options.lineWrapping||(q=Ot(Ar(dt(n,N.line))),n.iter(q,z.line+1,function(ke){if(ke==c.maxLine)return Q=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ae(e),ka(n,t,i,ds(e)),e.options.lineWrapping||(n.iter(q,N.line+t.text.length,function(ke){var Ge=pi(ke);Ge>c.maxLineLength&&(c.maxLine=ke,c.maxLineLength=Ge,c.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Zr(n,N.line),wi(e,400);var te=t.text.length-(z.line-N.line)-1;t.full?Mr(e):N.line==z.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,N.line,"text"):Mr(e,N.line,z.line+1,te);var pe=me(e,"changes"),be=me(e,"change");if(be||pe){var Me={from:N,to:z,text:t.text,removed:t.removed,origin:t.origin};be&&br(e,"change",e,Me),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Me)}e.display.selForContextMenu=null}function ni(e,t,i,n,c){var N;n||(n=i),Ct(n,i)<0&&(N=[n,i],i=N[0],n=N[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:i,to:n,text:t,origin:c})}function Js(e,t,i,n){i1||!(this.children[0]instanceof Ri))){var Q=[];this.collapse(Q),this.children=[new Ri(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var z=c.lines.length%25+25,Q=z;Q10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Mr(e,n,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&br(e,"markerCleared",e,this,n,c),t&&Wn(e),this.parent&&this.parent.clear()},Rn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,c=0;c0||z==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=S("span",[N.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(fr(e,t.line,t,i,N)||t.line!=i.line&&fr(e,i.line,t,i,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}N.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,te;if(e.iter(Q,i.line+1,function(be){q&&N.collapsed&&!q.options.lineWrapping&&Ar(be)==q.display.maxLine&&(te=!0),N.collapsed&&Q!=t.line&&Jt(be,0),bn(be,new hn(N,Q==t.line?t.ch:null,Q==i.line?i.ch:null)),++Q}),N.collapsed&&e.iter(t.line,i.line+1,function(be){an(e,be)&&Jt(be,0)}),N.clearOnEnter&&Fe(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++eo,N.atomic=!0),q){if(te&&(q.curOp.updateMaxLine=!0),N.collapsed)Mr(q,t.line,i.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var pe=t.line;pe<=i.line;pe++)wn(q,pe,"text");N.atomic&&Gs(q.doc),br(q,"markerAdded",q,N)}return N}var Di=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;q--)ri(this,n[q]);Q?Hs(this,Q):this.cm&&Qn(this.cm)}),undo:mr(function(){ta(this,"undo")}),redo:mr(function(){ta(this,"redo")}),undoSelection:mr(function(){ta(this,"undo",!0)}),redoSelection:mr(function(){ta(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.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,i){e=T(this,e),t=T(this,t);var n=[],c=e.line;return this.iter(e.line,t.line+1,function(N){var z=N.markedSpans;if(z)for(var Q=0;Q=q.to||q.from==null&&c!=e.line||q.from!=null&&c==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&n.push(q.marker.parent||q.marker)}++c}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=N,++i}),T(this,Je(i,t))},indexFromPos:function(e){e=T(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var be;if(t.state.draggingText&&!t.state.draggingText.copy&&(be=t.listSelections()),qi(t.doc,Cn(i,i)),be)for(var Me=0;Me=0;Q--)ni(e.doc,"",n[Q].from,n[Q].to,"+delete");Qn(e)})}function Fa(e,t,i){var n=Ie(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ua(e,t,i){var n=Fa(e,t.ch,i);return n==null?null:new Je(t.line,n,i<0?"after":"before")}function Ba(e,t,i,n,c){if(e){t.doc.direction=="rtl"&&(c=-c);var N=Qe(i,t.doc.direction);if(N){var z=c<0?re(N):N[0],Q=c<0==(z.level==1),q=Q?"after":"before",te;if(z.level>0||t.doc.direction=="rtl"){var pe=Xn(t,i);te=c<0?i.text.length-1:0;var be=on(t,pe,te).top;te=We(function(Me){return on(t,pe,Me).top==be},c<0==(z.level==1)?z.from:z.to-1,te),q=="before"&&(te=Fa(i,te,1))}else te=c<0?z.to:z.from;return new Je(n,te,q)}}return new Je(n,c<0?i.text.length:0,c<0?"before":"after")}function Ml(e,t,i,n){var c=Qe(t,e.doc.direction);if(!c)return Ua(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 N=$e(c,i.ch,i.sticky),z=c[N];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>i.ch:z.from=z.from&&Me>=pe.begin)){var ke=be?"before":"after";return new Je(i.line,Me,ke)}}var Ge=function(it,ut,at){for(var ht=function(Xt,gr){return gr?new Je(i.line,Q(Xt,1),"before"):new Je(i.line,Xt,"after")};it>=0&&it0==(Tt.level!=1),Rt=vt?at.begin:Q(at.end,-1);if(Tt.from<=Rt&&Rt0?pe.end:Q(pe.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&(Xe=Ge(n>0?0:c.length-1,n,te(qe)),Xe)?Xe:null}var Pi={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ye)},killLine:function(e){return si(e,function(t){if(t.empty()){var i=dt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)c=new Je(c.line,c.ch+1),e.replaceRange(N.charAt(c.ch-1)+N.charAt(c.ch-2),Je(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var z=dt(e.doc,c.line-1).text;z&&(c=new Je(c.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),Je(c.line-1,z.length-1),c,"+transpose"))}}i.push(new Gt(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return Wr(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;ne&&Ct(t,this.pos)==0&&i==this.button};var Fi,Ui;function Hl(e,t){var i=+new Date;return Ui&&Ui.compare(i,e,t)?(Fi=Ui=null,"triple"):Fi&&Fi.compare(i,e,t)?(Ui=new Ha(i,e,t),Fi=null,"double"):(Fi=new Ha(i,e,t),Ui=null,"single")}function vo(e){var t=this,i=t.display;if(He(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,dn(i,e)){r||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),c=Ue(e),N=n?Hl(n,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,c,n,N,e))return;c==1?n?Kl(t,n,N,e):Ce(e)==i.scroller&&ae(e):c==2?(n&&Qi(t.doc,n),setTimeout(function(){return i.input.focus()},20)):c==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,n,c){var N="Click";return n=="double"?N="Double"+N:n=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,Ni(e,oo(N,c),c,function(z){if(typeof z=="string"&&(z=Pi[z]),!z)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=z(e,i)!=Oe}finally{e.state.suppressEdits=!1}return Q})}function Gl(e,t,i){var n=e.getOption("configureMouse"),c=n?n(e,t,i):{};if(c.unit==null){var N=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||i.shiftKey),c.addNew==null&&(c.addNew=s?i.metaKey:i.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(s?i.altKey:i.ctrlKey)),c}function Kl(e,t,i,n){K?setTimeout(I(gs,e),0):e.curOp.focus=B();var c=Gl(e,i,n),N=e.doc.sel,z;e.options.dragDrop&&ze&&!e.isReadOnly()&&i=="single"&&(z=N.contains(t))>-1&&(Ct((z=N.ranges[z]).from(),t)<0||t.xRel>0)&&(Ct(z.to(),t)>0||t.xRel<0)?zl(e,n,t,c):Vl(e,n,t,c)}function zl(e,t,i,n){var c=e.display,N=!1,z=pr(e,function(te){r&&(c.scroller.draggable=!1),e.state.draggingText=!1,tt(c.wrapper.ownerDocument,"mouseup",z),tt(c.wrapper.ownerDocument,"mousemove",Q),tt(c.scroller,"dragstart",q),tt(c.scroller,"drop",z),N||(ae(te),n.addNew||Qi(e.doc,i,null,null,n.extend),r&&!p||K&&G==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),Q=function(te){N=N||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},q=function(){return N=!0};r&&(c.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Fe(c.wrapper.ownerDocument,"mouseup",z),Fe(c.wrapper.ownerDocument,"mousemove",Q),Fe(c.scroller,"dragstart",q),Fe(c.scroller,"drop",z),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Gt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Gt(Je(t.line,0),T(e.doc,Je(t.line+1,0)));var n=i(e,t);return new Gt(n.from,n.to)}function Vl(e,t,i,n){var c=e.display,N=e.doc;ae(t);var z,Q,q=N.sel,te=q.ranges;if(n.addNew&&!n.extend?(Q=N.sel.contains(i),Q>-1?z=te[Q]:z=new Gt(i,i)):(z=N.sel.primary(),Q=N.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new Gt(i,i)),i=Fn(e,t,!0,!0),Q=-1;else{var pe=yo(e,i,n.unit);n.extend?z=Pa(z,pe.anchor,pe.head,n.extend):z=pe}n.addNew?Q==-1?(Q=te.length,wr(N,tn(e,te.concat([z]),Q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Q].empty()&&n.unit=="char"&&!n.extend?(wr(N,tn(e,te.slice(0,Q).concat(te.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Na(N,Q,z,Te):(Q=0,wr(N,new Yr([z],0),Te),q=N.sel);var be=i;function Me(at){if(Ct(be,at)==0)return;if(be=at,n.unit=="rectangle"){for(var ht=[],Tt=e.options.tabSize,vt=H(dt(N,i.line).text,i.ch,Tt),Rt=H(dt(N,at.line).text,at.ch,Tt),Xt=Math.min(vt,Rt),gr=Math.max(vt,Rt),er=Math.min(i.line,at.line),Gr=Math.min(e.lastLine(),Math.max(i.line,at.line));er<=Gr;er++){var Nr=dt(N,er).text,sr=Le(Nr,Xt,Tt);Xt==gr?ht.push(new Gt(Je(er,sr),Je(er,sr))):Nr.length>sr&&ht.push(new Gt(Je(er,sr),Je(er,Le(Nr,gr,Tt))))}ht.length||ht.push(new Gt(i,i)),wr(N,tn(e,q.ranges.slice(0,Q).concat(ht),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(at)}else{var Fr=z,_r=yo(e,at,n.unit),hr=Fr.anchor,or;Ct(_r.anchor,hr)>0?(or=_r.head,hr=yn(Fr.from(),_r.anchor)):(or=_r.anchor,hr=vn(Fr.to(),_r.head));var rr=q.ranges.slice(0);rr[Q]=Yl(e,new Gt(T(N,hr),or)),wr(N,tn(e,rr,Q),Te)}}var ke=c.wrapper.getBoundingClientRect(),Ge=0;function Xe(at){var ht=++Ge,Tt=Fn(e,at,!0,n.unit=="rectangle");if(!Tt)return;if(Ct(Tt,be)!=0){e.curOp.focus=B(),Me(Tt);var vt=Vi(c,N);(Tt.line>=vt.to||Tt.lineke.bottom?20:0;Rt&&setTimeout(pr(e,function(){if(Ge!=ht)return;c.scroller.scrollTop+=Rt,Xe(at)}),50)}}function qe(at){e.state.selectingText=!1,Ge=Infinity,at&&(ae(at),c.input.focus()),tt(c.wrapper.ownerDocument,"mousemove",it),tt(c.wrapper.ownerDocument,"mouseup",ut),N.history.lastSelOrigin=null}var it=pr(e,function(at){at.buttons===0||!Ue(at)?qe(at):Xe(at)}),ut=pr(e,qe);e.state.selectingText=ut,Fe(c.wrapper.ownerDocument,"mousemove",it),Fe(c.wrapper.ownerDocument,"mouseup",ut)}function Yl(e,t){var i=t.anchor,n=t.head,c=dt(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var N=Qe(c);if(!N)return t;var z=$e(N,i.ch,i.sticky),Q=N[z];if(Q.from!=i.ch&&Q.to!=i.ch)return t;var q=z+(Q.from==i.ch==(Q.level!=1)?0:1);if(q==0||q==N.length)return t;var te;if(n.line!=i.line)te=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=$e(N,n.ch,n.sticky),be=pe-z||(n.ch-i.ch)*(Q.level==1?-1:1);pe==q-1||pe==q?te=be<0:te=be>0}var Me=N[q+(te?-1:0)],ke=te==(Me.level==1),Ge=ke?Me.from:Me.to,Xe=ke?"after":"before";return i.ch==Ge&&i.sticky==Xe?t:new Gt(new Je(i.line,Ge,Xe),n)}function bo(e,t,i,n){var c,N;if(t.touches)c=t.touches[0].clientX,N=t.touches[0].clientY;else try{c=t.clientX,N=t.clientY}catch(Me){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ae(t);var z=e.display,Q=z.lineDiv.getBoundingClientRect();if(N>Q.bottom||!me(e,i))return de(t);N-=Q.top-z.viewOffset;for(var q=0;q=c){var pe=lr(e.doc,N),be=e.display.gutterSpecs[q];return Be(e,i,e,pe,be.className,t),de(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(dn(e.display,t)||Xl(e,t))return;if(He(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return me(e,"gutterContextMenu")?bo(e,t,"gutterContextMenu",!1):!1}function Eo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yi(e)}var oi={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function i(n,c,N,z){e.defaults[n]=c,N&&(t[n]=z?function(Q,q,te){te!=oi&&N(Q,q,te)}:N)}e.defineOption=i,e.Init=oi,i("value","",function(n,c){return n.setValue(c)},!0),i("mode",null,function(n,c){n.doc.modeOption=c,Da(n)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Ci(n),yi(n),Mr(n)},!0),i("lineSeparator",null,function(n,c){if(n.doc.lineSep=c,!c)return;var N=[],z=n.doc.first;n.doc.iter(function(q){for(var te=0;;){var pe=q.text.indexOf(c,te);if(pe==-1)break;te=pe+c.length,N.push(Je(z,pe))}z++});for(var Q=N.length-1;Q>=0;Q--)ni(n.doc,c,N[Q],Je(N[Q].line,N[Q].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,c,N){n.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),N!=oi&&n.refresh()}),i("specialCharPlaceholder",Yt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,c){return n.getInputField().spellcheck=c},!0),i("autocorrect",!1,function(n,c){return n.getInputField().autocorrect=c},!0),i("autocapitalize",!1,function(n,c){return n.getInputField().autocapitalize=c},!0),i("rtlMoveVisually",!O),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Eo(n),Si(n)},!0),i("keyMap","default",function(n,c,N){var z=na(c),Q=N!=oi&&na(N);Q&&Q.detach&&Q.detach(n,z),z.attach&&z.attach(n,Q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,c){n.display.gutterSpecs=La(c,n.options.lineNumbers),Si(n)},!0),i("fixedGutter",!0,function(n,c){n.display.gutters.style.left=c?_a(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),i("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,c){n.display.gutterSpecs=La(n.options.gutters,c),Si(n)},!0),i("firstLineNumber",1,Si,!0),i("lineNumberFormatter",function(n){return n},Si,!0),i("showCursorWhenSelecting",!1,bi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,c){c=="nocursor"&&(Zn(n),n.display.input.blur()),n.display.input.readOnlyChanged(c)}),i("screenReaderLabel",null,function(n,c){c=c===""?null:c,n.display.input.screenReaderLabelChanged(c)}),i("disableInput",!1,function(n,c){c||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bi,!0),i("singleCursorHeightPerLine",!0,bi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ci,!0),i("addModeClass",!1,Ci,!0),i("pollInterval",100),i("undoDepth",200,function(n,c){return n.doc.history.undoDepth=c}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Ci,!0),i("moveInputWithCursor",!0,function(n,c){c||n.display.input.resetPosition()}),i("tabindex",null,function(n,c){return n.display.input.getField().tabIndex=c||""}),i("autofocus",null),i("direction","ltr",function(n,c){return n.doc.setDirection(c)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=oi;if(!t!=!n){var c=e.display.dragFunctions,N=t?Fe:tt;N(e.display.scroller,"dragstart",c.start),N(e.display.scroller,"dragenter",c.enter),N(e.display.scroller,"dragover",c.over),N(e.display.scroller,"dragleave",c.leave),N(e.display.scroller,"drop",c.drop)}}function Zl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ea(e),Mr(e),yi(e),setTimeout(function(){return qn(e)},100)}function Qt(e,t){var i=this;if(!(this instanceof Qt))return new Qt(e,t);this.options=t=t?g(t):{},g(xo,t,!1);var n=t.value;typeof n=="string"?n=new Pr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var c=new Qt.inputStyles[t.inputStyle](this),N=this.display=new hl(e,n,c,t);N.wrapper.CodeMirror=this,Eo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ts(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 $,keySeq:null,specialChars:null},t.autofocus&&!u&&N.input.focus(),K&&G<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Rl(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Zn(this);for(var z in aa)aa.hasOwnProperty(z)&&aa[z](this,t[z],oi);Cs(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q20*20}Fe(t.scroller,"touchstart",function(q){if(!He(e,q)&&!N(q)&&!Wa(e,q)){t.input.ensurePolled(),clearTimeout(i);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Fe(t.scroller,"touchend",function(q){var te=t.activeTouch;if(te&&!dn(t,q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),be;!te.prev||z(te,te.prev)?be=new Gt(pe,pe):!te.prev.prev||z(te,te.prev.prev)?be=e.findWordAt(pe):be=new Gt(Je(pe.line,0),T(e.doc,Je(pe.line+1,0))),e.setSelection(be.anchor,be.head),e.focus(),ae(q)}c()}),Fe(t.scroller,"touchcancel",c),Fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Fe(t.scroller,"mousewheel",function(q){return Rs(e,q)}),Fe(t.scroller,"DOMMouseScroll",function(q){return Rs(e,q)}),Fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){He(e,q)||ge(q)},over:function(q){He(e,q)||(Ol(e,q),ge(q))},start:function(q){return Al(e,q)},drop:pr(e,Cl),leave:function(q){He(e,q)||no(e)}};var Q=t.input.getField();Fe(Q,"keyup",function(q){return mo.call(e,q)}),Fe(Q,"keydown",pr(e,po)),Fe(Q,"keypress",pr(e,go)),Fe(Q,"focus",function(q){return Ta(e,q)}),Fe(Q,"blur",function(q){return Zn(e,q)})}var Ga=[];Qt.defineInitHook=function(e){return Ga.push(e)};function Bi(e,t,i,n){var c=e.doc,N;i==null&&(i="add"),i=="smart"&&(c.mode.indent?N=et(e,t).state:i="prev");var z=e.options.tabSize,Q=dt(c,t),q=H(Q.text,null,z);Q.stateAfter&&(Q.stateAfter=null);var te=Q.text.match(/^\s*/)[0],pe;if(!n&&!/\S/.test(Q.text))pe=0,i="not";else if(i=="smart"&&(pe=c.mode.indent(N,Q.text.slice(te.length),Q.text),pe==Oe||pe>150)){if(!n)return;i="prev"}i=="prev"?t>c.first?pe=H(dt(c,t-1).text,null,z):pe=0:i=="add"?pe=q+e.options.indentUnit:i=="subtract"?pe=q-e.options.indentUnit:typeof i=="number"&&(pe=q+i),pe=Math.max(0,pe);var be="",Me=0;if(e.options.indentWithTabs)for(var ke=Math.floor(pe/z);ke;--ke)Me+=z,be+=" ";if(Mez,q=St(t),te=null;if(Q&&n.ranges.length>1)if(rn&&rn.text.join(` `)==t){if(n.ranges.length%rn.text.length==0){te=[];for(var pe=0;pe=0;Me--){var ke=n.ranges[Me],Ge=ke.from(),Xe=ke.to();ke.empty()&&(i&&i>0?Ge=Je(Ge.line,Ge.ch-i):e.state.overwrite&&!Q?Xe=Je(Xe.line,Math.min(dt(N,Xe.line).text.length,Xe.ch+re(q).length)):Q&&rn&&rn.lineWise&&rn.text.join(` `)==q.join(` `)&&(Ge=Xe=Je(Ge.line,0)));var qe={from:Ge,to:Xe,text:te?te[Me%te.length]:q,origin:c||(Q?"paste":e.state.cutIncoming>z?"cut":"+input")};ri(e.doc,qe),br(e,"inputRead",e,qe)}t&&!Q&&wo(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=be),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Wr(t,function(){return Ka(t,i,0,null,"paste")}),!0}function wo(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 c=i.ranges[n];if(c.head.ch>100||n&&i.ranges[n-1].head.line==c.head.line)continue;var N=e.getModeAt(c.head),z=!1;if(N.electricChars){for(var Q=0;Q-1){z=Bi(e,c.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(dt(e.doc,c.head.line).text.slice(0,c.head.ch))&&(z=Bi(e,c.head.line,"smart")));z&&br(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],i=[],n=0;nN&&(Bi(this,Q.head.line,n,!0),N=Q.head.line,z==this.doc.sel.primIndex&&Qn(this));else{var q=Q.from(),te=Q.to(),pe=Math.max(N,q.line);N=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var be=pe;be0&&Na(this.doc,z,new Gt(q,Me[z].to()),ye)}}}),getTokenAt:function(n,c){return $t(this,n,c)},getLineTokens:function(n,c){return $t(this,Je(n),c,!0)},getTokenTypeAt:function(n){n=T(this.doc,n);var c=Ke(this,dt(this.doc,n.line)),N=0,z=(c.length-1)/2,Q=n.ch,q;if(Q==0)q=c[2];else for(;;){var te=N+z>>1;if((te?c[te*2-1]:0)>=Q)z=te;else if(c[te*2+1]q&&(n=q,z=!0),Q=dt(this.doc,n)}else Q=n;return Wi(this,Q,{top:0,left:0},c||"page",N||z).top+(z?this.doc.height-qr(Q):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,c,N,z,Q){var q=this.display;n=en(this,T(this.doc,n));var te=n.bottom,pe=n.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),q.sizer.appendChild(c),z=="over")te=n.top;else if(z=="above"||z=="near"){var be=Math.max(q.wrapper.clientHeight,this.doc.height),Me=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||n.bottom+c.offsetHeight>be)&&n.top>c.offsetHeight?te=n.top-c.offsetHeight:n.bottom+c.offsetHeight<=be&&(te=n.bottom),pe+c.offsetWidth>Me&&(pe=Me-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",Q=="right"?(pe=q.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(Q=="left"?pe=0:Q=="middle"&&(pe=(q.sizer.clientWidth-c.offsetWidth)/2),c.style.left=pe+"px"),N&&Jo(this,{left:pe,top:te,right:pe+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:Or(po),triggerOnKeyPress:Or(go),triggerOnKeyUp:mo,triggerOnMouseDown:Or(vo),execCommand:function(n){if(Pi.hasOwnProperty(n))return Pi[n].call(null,this)},triggerElectric:Or(function(n){wo(this,n)}),findPosH:function(n,c,N,z){var Q=1;c<0&&(Q=-1,c=-c);for(var q=T(this.doc,n),te=0;te0&&pe(N.charAt(z-1));)--z;for(;Q.5||this.options.lineWrapping)&&Ea(this),Be(this,"refresh",this)}),swapDoc:Or(function(n){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yi(this),this.display.input.reset(),_i(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,br(this,"swapDoc",this,c),c}),phrase:function(n){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,n)?c[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}},xe(e),e.registerHelper=function(n,c,N){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][c]=N},e.registerGlobalHelper=function(n,c,N,z){e.registerHelper(n,c,z),i[n]._global.push({pred:N,val:z})}}function za(e,t,i,n,c){var N=t,z=i,Q=dt(e,t.line),q=c&&e.direction=="rtl"?-i:i;function te(){var ut=t.line+q;return ut=e.first+e.size?!1:(t=new Je(ut,t.ch,t.sticky),Q=dt(e,ut))}function pe(ut){var at;if(n=="codepoint"){var ht=Q.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?at=null:at=new Je(t.line,Math.max(0,Math.min(Q.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else c?at=Ml(e.cm,Q,t,i):at=Ua(Q,t,i);if(at==null)if(!ut&&te())t=Ba(c,e.cm,Q,t.line,q);else return!1;else t=at;return!0}if(n=="char"||n=="codepoint")pe();else if(n=="column")pe(!0);else if(n=="word"||n=="group")for(var be=null,Me=n=="group",ke=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(i<0&&!pe(!Ge));Ge=!1){var Xe=Q.text.charAt(t.ch)||` `,qe=je(Xe,ke)?"w":Me&&Xe==` `?"n":!Me||/\s/.test(Xe)?null:"p";if(Me&&!Ge&&!qe&&(qe="s"),be&&be!=qe){i<0&&(i=1,pe(),t.sticky="after");break}if(qe&&(be=qe),i>0&&!pe(!Ge))break}var it=ea(e,t,N,z,!0);return mn(N,it)&&(it.hitSide=!0),it}function Oo(e,t,i,n){var c=e.doc,N=t.left,z;if(n=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*$n(e.display),3);z=(i>0?t.bottom:t.top)+i*q}else n=="line"&&(z=i>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,N,z),!te.outside);){if(i<0?z<=0:z>=c.height){te.hitSide=!0;break}z+=i*5}return te}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,i=this,n=i.cm,c=i.div=e.lineDiv;Co(c,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function N(Q){for(var q=Q.target;q;q=q.parentNode){if(q==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Fe(c,"paste",function(Q){if(!N(Q)||He(n,Q)||To(Q,n))return;G<=11&&setTimeout(pr(n,function(){return t.updateFromDOM()}),20)}),Fe(c,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Fe(c,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Fe(c,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Fe(c,"touchstart",function(){return i.forceCompositionEnd()}),Fe(c,"input",function(){t.composing||t.readFromDOMSoon()});function z(Q){if(!N(Q)||He(n,Q))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),Q.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=So(n);sa({lineWise:!0,text:q.text}),Q.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,ye),n.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var te=rn.text.join(` `);if(Q.clipboardData.setData("Text",te),Q.clipboardData.getData("Text")==te){Q.preventDefault();return}}var pe=Ao(),be=pe.firstChild;n.display.lineSpace.insertBefore(pe,n.display.lineSpace.firstChild),be.value=rn.text.join(` `);var Me=document.activeElement;M(be),setTimeout(function(){n.display.lineSpace.removeChild(pe),Me.focus(),Me==c&&i.showPrimarySelection()},50)}Fe(c,"copy",z),Fe(c,"cut",z)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),c=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||c.line=t.display.viewFrom&&Ro(t,n)||{node:Q[0].measure.map[2],offset:0},te=c.linee.firstLine()&&(n=Je(n.line-1,dt(e.doc,n.line-1).length)),c.ch==dt(e.doc,c.line).text.length&&c.linet.viewTo-1)return!1;var N,z,Q;n.line==t.viewFrom||(N=Un(e,n.line))==0?(z=Ot(t.view[0].line),Q=t.view[0].node):(z=Ot(t.view[N].line),Q=t.view[N-1].node.nextSibling);var q=Un(e,c.line),te,pe;if(q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=Ot(t.view[q+1].line)-1,pe=t.view[q+1].node.previousSibling),!Q)return!1;for(var be=e.doc.splitLines(tu(e,Q,pe,z,te)),Me=Br(e.doc,Je(z,0),Je(te,dt(e.doc,te).text.length));be.length>1&&Me.length>1;)if(re(be)==re(Me))be.pop(),Me.pop(),te--;else if(be[0]==Me[0])be.shift(),Me.shift(),z++;else break;for(var ke=0,Ge=0,Xe=be[0],qe=Me[0],it=Math.min(Xe.length,qe.length);ken.ch&&ut.charCodeAt(ut.length-Ge-1)==at.charCodeAt(at.length-Ge-1);)ke--,Ge++;be[be.length-1]=ut.slice(0,ut.length-Ge).replace(/^\u200b+/,""),be[0]=be[0].slice(ke).replace(/\u200b+$/,"");var Tt=Je(z,ke),vt=Je(te,Me.length?re(Me).length-Ge:0);if(be.length>1||be[0]||Ct(Tt,vt))return ni(e.doc,be,Tt,vt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.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)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wr(this.cm,function(){return Mr(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||pr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Ro(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var n=dt(e.doc,t.line),c=es(i,n,t.line),N=Qe(n,e.doc.direction),z="left";if(N){var Q=$e(N,t.ch);z=Q%2?"right":"left"}var q=ns(c.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,c){var N="",z=!1,Q=e.doc.lineSeparator(),q=!1;function te(ke){return function(Ge){return Ge.id==ke}}function pe(){z&&(N+=Q,q&&(N+=Q),z=q=!1)}function be(ke){ke&&(pe(),N+=ke)}function Me(ke){if(ke.nodeType==1){var Ge=ke.getAttribute("cm-text");if(Ge){be(Ge);return}var Xe=ke.getAttribute("cm-marker"),qe;if(Xe){var it=e.findMarks(Je(n,0),Je(c+1,0),te(+Xe));it.length&&(qe=it[0].find(0))&&be(Br(e.doc,qe.from,qe.to).join(Q));return}if(ke.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(ke.nodeName);if(!/^br$/i.test(ke.nodeName)&&ke.textContent.length==0)return;ut&&pe();for(var at=0;at=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Fe(c,"paste",function(z){if(He(n,z)||To(z,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function N(z){if(He(n,z))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Q=So(n);sa({lineWise:!0,text:Q.text}),z.type=="cut"?n.setSelections(Q.ranges,null,ye):(i.prevInput="",c.value=Q.text.join(` `),M(c))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Fe(c,"cut",N),Fe(c,"copy",N),Fe(e.scroller,"paste",function(z){if(dn(e,z)||He(n,z))return;if(!c.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Q=new Event("paste");Q.clipboardData=z.clipboardData,c.dispatchEvent(Q)}),Fe(e.lineSpace,"selectstart",function(z){dn(e,z)||ae(z)}),Fe(c,"compositionstart",function(){var z=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Fe(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ir.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},ir.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ir.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var c=en(e,i.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+z.top-N.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+z.left-N.left))}return n},ir.prototype.showSelection=function(e){var t=this.cm,i=t.display;x(i.cursorDiv,e.cursors),x(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ir.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&&M(this.textarea),K&&G>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&G>=9&&(this.hasSelection=null))},ir.prototype.getField=function(){return this.textarea},ir.prototype.supportsTouch=function(){return!1},ir.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},ir.prototype.blur=function(){this.textarea.blur()},ir.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ir.prototype.receivedFocus=function(){this.slowPoll()},ir.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()})},ir.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)},ir.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ct(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=i.value;if(c==n&&!t.somethingSelected())return!1;if(K&&G>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=c.charCodeAt(0);if(N==8203&&!n&&(n="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Q=Math.min(n.length,c.length);z1e3||c.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ir.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ir.prototype.onKeyPress=function(){K&&G>=9&&(this.hasSelection=null),this.fastPoll()},ir.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=Fn(i,e),z=n.scroller.scrollTop;if(!N||m)return;var Q=i.options.resetSelectionOnContextMenu;Q&&i.doc.sel.contains(N)==-1&&pr(i,wr)(i.doc,Cn(N),ye);var q=c.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px; z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var be;r&&(be=window.scrollY),n.input.focus(),r&&window.scrollTo(null,be),n.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=ke,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Me(){if(c.selectionStart!=null){var Xe=i.somethingSelected(),qe="\u200B"+(Xe?c.value:"");c.value="\u21DA",c.value=qe,t.prevInput=Xe?"":"\u200B",c.selectionStart=1,c.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function ke(){if(t.contextMenuPending!=ke)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=q,K&&G<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),c.selectionStart!=null){(!K||K&&G<9)&&Me();var Xe=0,qe=function(){n.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?pr(i,Vs)(i):Xe++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(K&&G>=9&&Me(),D){ge(e);var Ge=function(){tt(window,"mouseup",Ge),setTimeout(ke,20)};Fe(window,"mouseup",Ge)}else setTimeout(ke,50)},ir.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ir.prototype.setUneditable=function(){},ir.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?g(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=B();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Q.getValue()}var c;if(e.form&&(Fe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var N=e.form;c=N.submit;try{var z=N.submit=function(){n(),N.submit=c,N.submit(),N.submit=z}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(tt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var Q=Qt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function iu(e){e.off=tt,e.on=Fe,e.wheelEventPixels=cl,e.Doc=Pr,e.splitLines=St,e.countColumn=H,e.findColumn=Le,e.isWordChar=Pe,e.Pass=Oe,e.signal=Be,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Je,e.cmpPos=Ct,e.modes=Zt,e.mimeModes=It,e.resolveMode=yt,e.getMode=Lr,e.modeExtensions=bt,e.extendMode=xt,e.copyState=Ft,e.startState=cr,e.innerMode=tr,e.commands=Pi,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ai,e.normalizeKeyMap=kl,e.StringStream=Pt,e.SharedTextMarker=Di,e.TextMarker=Rn,e.LineWidget=Ii,e.e_preventDefault=ae,e.e_stopPropagation=ue,e.e_stop=ge,e.addClass=F,e.contains=b,e.rmClass=A,e.keyNames=Ln}$l(Qt),ql(Qt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Pr.prototype)Pr.prototype.hasOwnProperty(la)&&ne(au,la)<0&&(Qt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Pr.prototype[la]));return xe(Pr),Qt.inputStyles={textarea:ir,contenteditable:zt},Qt.defineMode=function(e){!Qt.defaults.mode&&e!="null"&&(Qt.defaults.mode=e),Cr.apply(this,arguments)},Qt.defineMIME=Kr,Qt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Qt.defineMIME("text/plain","null"),Qt.defineExtension=function(e,t){Qt.prototype[e]=t},Qt.defineDocExtension=function(e,t){Pr.prototype[e]=t},Qt.fromTextArea=nu,iu(Qt),Qt.version="5.58.2",Qt})},Y1PL:function(rt,_e,Z){"use strict";Z.r(_e),Z.d(_e,"ResizableTextArea",function(){return ne});var ie=Z("wx14"),J=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),j=Z("LK+K"),U=Z("q1tI"),K=Z("VTBJ"),G=Z("rePB"),r=Z("Zm9Q"),R=Z("Kwbf"),v=Z("c+Xe"),m=Z("m+aA"),p=Z("bdgK"),h=new Map;function l(ye){ye.forEach(function(Te){var Re,Le=Te.target;(Re=h.get(Le))===null||Re===void 0||Re.forEach(function(ce){return ce(Le)})})}var f=new p.default(l),o=null,u=null;function s(ye,Te){h.has(ye)||(h.set(ye,new Set),f.observe(ye)),h.get(ye).add(Te)}function a(ye,Te){h.has(ye)&&(h.get(ye).delete(Te),h.get(ye).size||(f.unobserve(ye),h.delete(ye)))}var O=function(ye){Object(X.a)(Re,ye);var Te=Object(j.a)(Re);function Re(){return Object(J.a)(this,Re),Te.apply(this,arguments)}return Object(P.a)(Re,[{key:"render",value:function(){return this.props.children}}]),Re}(U.Component),E=U.createContext(null);function w(ye){var Te=ye.children,Re=ye.onBatchResize,Le=U.useRef(0),ce=U.useRef([]),he=U.useContext(E),re=U.useCallback(function(fe,se,De){Le.current+=1;var Ne=Le.current;ce.current.push({size:fe,element:se,data:De}),Promise.resolve().then(function(){Ne===Le.current&&(Re==null||Re(ce.current),ce.current=[])}),he==null||he(fe,se,De)},[Re,he]);return U.createElement(E.Provider,{value:re},Te)}function D(ye){var Te=ye.children,Re=ye.disabled,Le=U.useRef(null),ce=U.useRef(null),he=U.useContext(E),re=U.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=U.isValidElement(Te)&&Object(v.c)(Te),se=fe?Te.ref:null,De=U.useMemo(function(){return Object(v.a)(se,Le)},[se,Le]),Ne=U.useRef(ye);Ne.current=ye;var Se=U.useCallback(function(Pe){var je=Ne.current,le=je.onResize,ve=je.data,we=Pe.getBoundingClientRect(),Ie=we.width,We=we.height,Ve=Pe.offsetWidth,Ze=Pe.offsetHeight,$e=Math.floor(Ie),st=Math.floor(We);if(re.current.width!==$e||re.current.height!==st||re.current.offsetWidth!==Ve||re.current.offsetHeight!==Ze){var Qe={width:$e,height:st,offsetWidth:Ve,offsetHeight:Ze};re.current=Qe;var nt=Ve===Math.round(Ie)?Ie:Ve,Fe=Ze===Math.round(We)?We:Ze,ot=Object(K.a)(Object(K.a)({},Qe),{},{offsetWidth:nt,offsetHeight:Fe});he==null||he(ot,Pe,ve),le&&Promise.resolve().then(function(){le(ot,Pe)})}},[]);return U.useEffect(function(){var Pe=Object(m.a)(Le.current)||Object(m.a)(ce.current);return Pe&&!Re&&s(Pe,Se),function(){return a(Pe,Se)}},[Le.current,Re]),U.createElement(O,{ref:ce},fe?U.cloneElement(Te,{ref:De}):Te)}var L="rc-observer-key";function A(ye){var Te=ye.children,Re=Object(r.a)(Te);return Re.map(function(Le,ce){var he=(Le==null?void 0:Le.key)||"".concat(L,"-").concat(ce);return U.createElement(D,Object(ie.a)({},ye,{key:he}),Le)})}A.Collection=w;var C=A,x=Z("bT9E"),d=Z("TSYQ"),S=Z.n(d),y=` 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 `,b=["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"],B={},F;function _(ye){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=ye.getAttribute("id")||ye.getAttribute("data-reactid")||ye.getAttribute("name");if(Te&&B[Re])return B[Re];var Le=window.getComputedStyle(ye),ce=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),he=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),re=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),fe=b.map(function(De){return"".concat(De,":").concat(Le.getPropertyValue(De))}).join(";"),se={sizingStyle:fe,paddingSize:he,borderSize:re,boxSizing:ce};return Te&&Re&&(B[Re]=se),se}function M(ye){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),ye.getAttribute("wrap")?F.setAttribute("wrap",ye.getAttribute("wrap")):F.removeAttribute("wrap");var ce=_(ye,Te),he=ce.paddingSize,re=ce.borderSize,fe=ce.boxSizing,se=ce.sizingStyle;F.setAttribute("style","".concat(se,";").concat(y)),F.value=ye.value||ye.placeholder||"";var De=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,Se=F.scrollHeight,Pe;if(fe==="border-box"?Se+=re:fe==="content-box"&&(Se-=he),Re!==null||Le!==null){F.value=" ";var je=F.scrollHeight-he;Re!==null&&(De=je*Re,fe==="border-box"&&(De=De+he+re),Se=Math.max(De,Se)),Le!==null&&(Ne=je*Le,fe==="border-box"&&(Ne=Ne+he+re),Pe=Se>Ne?"":"hidden",Se=Math.min(Ne,Se))}return{height:Se,minHeight:De,maxHeight:Ne,overflowY:Pe,resize:"none"}}var I=Z("Gytx"),g=Z.n(I),H;(function(ye){ye[ye.NONE=0]="NONE",ye[ye.RESIZING=1]="RESIZING",ye[ye.RESIZED=2]="RESIZED"})(H||(H={}));var $=function(ye){Object(X.a)(Re,ye);var Te=Object(j.a)(Re);function Re(Le){var ce;return Object(J.a)(this,Re),ce=Te.call(this,Le),ce.nextFrameActionId=void 0,ce.resizeFrameId=void 0,ce.textArea=void 0,ce.saveTextArea=function(he){ce.textArea=he},ce.handleResize=function(he){var re=ce.state.resizeStatus,fe=ce.props,se=fe.autoSize,De=fe.onResize;if(re!==H.NONE)return;typeof De=="function"&&De(he),se&&ce.resizeOnNextFrame()},ce.resizeOnNextFrame=function(){cancelAnimationFrame(ce.nextFrameActionId),ce.nextFrameActionId=requestAnimationFrame(ce.resizeTextarea)},ce.resizeTextarea=function(){var he=ce.props.autoSize;if(!he||!ce.textArea)return;var re=he.minRows,fe=he.maxRows,se=M(ce.textArea,!1,re,fe);ce.setState({textareaStyles:se,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(ce.resizeFrameId),ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:H.RESIZED},function(){ce.resizeFrameId=requestAnimationFrame(function(){ce.setState({resizeStatus:H.NONE}),ce.fixFirefoxAutoScroll()})})})})},ce.renderTextArea=function(){var he=ce.props,re=he.prefixCls,fe=re===void 0?"rc-textarea":re,se=he.autoSize,De=he.onResize,Ne=he.className,Se=he.disabled,Pe=ce.state,je=Pe.textareaStyles,le=Pe.resizeStatus,ve=Object(x.a)(ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),we=S()(fe,Ne,Object(G.a)({},"".concat(fe,"-disabled"),Se));"value"in ve&&(ve.value=ve.value||"");var Ie=Object(K.a)(Object(K.a)(Object(K.a)({},ce.props.style),je),le===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return U.createElement(C,{onResize:ce.handleResize,disabled:!(se||De)},U.createElement("textarea",Object(ie.a)({},ve,{className:we,style:Ie,ref:ce.saveTextArea})))},ce.state={textareaStyles:{},resizeStatus:H.NONE},ce}return Object(P.a)(Re,[{key:"componentDidUpdate",value:function(ce){(ce.value!==this.props.value||!g()(ce.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 ce=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ce,he)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Re}(U.Component),ne=$,oe=function(ye){Object(X.a)(Re,ye);var Te=Object(j.a)(Re);function Re(Le){var ce;Object(J.a)(this,Re),ce=Te.call(this,Le),ce.resizableTextArea=void 0,ce.focus=function(){ce.resizableTextArea.textArea.focus()},ce.saveTextArea=function(re){ce.resizableTextArea=re},ce.handleChange=function(re){var fe=ce.props.onChange;ce.setValue(re.target.value,function(){ce.resizableTextArea.resizeTextarea()}),fe&&fe(re)},ce.handleKeyDown=function(re){var fe=ce.props,se=fe.onPressEnter,De=fe.onKeyDown;re.keyCode===13&&se&&se(re),De&&De(re)};var he=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ce.state={value:he},ce}return Object(P.a)(Re,[{key:"setValue",value:function(ce,he){"value"in this.props||this.setState({value:ce},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return U.createElement(ne,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ce){return"value"in ce?{value:ce.value}:null}}]),Re}(U.Component),Oe=_e.default=oe},ZW9T:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return I});var ie=Z("k1fw"),J=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),j=Z("rAM+"),U=Z("tJVT"),K=Z("PpiC"),G=Z("q1tI"),r=Z.n(G),R=Z("bdgK"),v=Z("9og8"),m=Z("WmNS"),p=Z.n(m),h={keywords:["print","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"]},l={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"if",content:["if () {"," $0","}"].join(` `)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},u=Z("5VLF"),s=Z.n(u),a={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(H,$){return $.map(function(ne){return{label:ne,kind:H.languages.CompletionItemKind.Keyword,insertText:ne}})},E=function(H){return Object.keys(a.tables).map(function($){return{label:$,kind:H.languages.CompletionItemKind.Variable,insertText:$}})},w=function(H,$){var ne=a.tables[H];return ne?ne.map(function(oe){return{label:oe,kind:$.languages.CompletionItemKind.Field,insertText:oe}}):[]};function D(g,H,$,ne,oe){var Oe=H.getWordUntilPosition($),ye={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},Te=ne.map(function(Re){return{label:Re,kind:g.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ye}});return oe.map(function(Re){Te.push(Object(ie.a)(Object(ie.a)({},Re),{},{range:ye}))}),Te}var L=function(g){a.languages.map(function(oe){return g.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(ye,Te,Re){return Object(v.a)(p.a.mark(function Le(){var ce;return p.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return ce=s()(ye.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),re.abrupt("return",[{range:ye.getFullModelRange(),text:ce}]);case 2:case"end":return re.stop()}},Le)}))()}}),oe});var H=f.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=o.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=l.quickKey.map(function(oe){return{label:oe.label,kind:g.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet}});g.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Oe,ye){var Te=Oe.getWordUntilPosition(ye),Re={startLineNumber:ye.lineNumber,endLineNumber:ye.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=Oe.getLineContent(ye.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(f.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(f.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),g.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Oe,ye){var Te=Oe.getWordUntilPosition(ye),Re={startLineNumber:ye.lineNumber,endLineNumber:ye.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object(J.a)(h.keywords.map(function(Le){return{label:Le,kind:g.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}}))}}}),g.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Oe,ye){var Te=Oe.getWordUntilPosition(ye),Re={startLineNumber:ye.lineNumber,endLineNumber:ye.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=Oe.getLineContent(ye.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(l.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(l.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}}),g.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Oe,ye){var Te=Oe.getWordUntilPosition(ye),Re={startLineNumber:ye.lineNumber,endLineNumber:ye.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=Oe.getLineContent(ye.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(J.a)(o.keywords.map(function(ce){return{label:ce,kind:g.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})),Object(J.a)(o.quickKey.map(function(ce){return{label:ce.label,kind:g.languages.CompletionItemKind.Function,documentation:ce.content,insertText:Le.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:g.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Re}})))}}})},A="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",C=Z("fjLI"),x=Z("LvDl"),d=Z("+ua5");function S(g){return/^\d+$/.test(g)?"".concat(g,"px"):g}function y(){}var b=!1,B={"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"};function F(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=g;if(Array.isArray(g)){for(var $=0;$0||cr.target.offsetWidth>0)&&He.current.instance.layout()}}catch(Pt){Ft.e(Pt)}finally{Ft.f()}}),bt.observe(Be.current)),bt}function ze(){X.b.warn(decodeURIComponent(A))}var lt=function(){var xt=He.current.instance;if(Oe!=null&&xt&&ge){var Ft=xt.getModel();Ft&&Oe!==Ft.getValue()&&(b=!0,Ft.setValue(Oe),xt.layout(),b=!1)}};Object(G.useEffect)(function(){me.current&&clearTimeout(me.current),me.current=setTimeout(function(){lt()},500)},[Oe,ge,He.current]),Object(G.useEffect)(function(){if(nt&&He.current&&He.current.instance){var bt=He.current.instance;bt.changeViewZones(function(Ft){var tr=document.createElement("div");tr.style.padding="10px 20px",tr.style.width="calc(100% - 20px)",tr.className="my-error-line-wrp",tr.innerHTML=ot,Ft.addZone({afterLineNumber:nt||11,heightInLines:3,domNode:tr})});var xt={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}};bt.addOverlayWidget(xt),bt.revealPositionInCenter({lineNumber:20,column:1})}},[nt,He.current,ge]);function mt(){var bt=He.current.instance;if(bt){var xt=bt.getSelection(),Ft=He.current.pastePos||{},tr=new _.Range(Ft.startLineNumber||xt.endLineNumber,Ft.startColumn||xt.endColumn,Ft.endLineNumber||xt.endLineNumber,Ft.endColumn||xt.endColumn);setTimeout(function(){bt.executeEdits("",[{range:tr,text:""}])},300)}}function ft(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),Se())}var wt=function(){if(je&&He.current.instance){var xt=He.current.instance.getContentHeight();yt(xt0||We.target.offsetWidth>0)&&je.layout()}}catch(Ve){we.e(Ve)}finally{we.f()}}),le.observe(ce.current)),le}Object(G.useEffect)(function(){ce.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function(je){_=je;var le=_.editor.createDiffEditor(ce.current,Object(ie.a)(Object(ie.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Le),{},{wordWrap:!0}));se(le);var ve=De(le);return function(){le.dispose();var we=le.getModel();we&&we.dispose(),ve.unobserve(ce.current)}})},[]),Object(G.useEffect)(function(){fe&&fe.setModel({original:_.editor.createModel(Oe,Te),modified:_.editor.createModel(ye,Te)})},[Oe,ye,Te,fe]);var Ne=S($),Se=S(oe),Pe={width:Ne,height:Se};return r.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Pe})}},ZpRC:function(rt,_e,Z){"use strict";function ie(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function J(v,m){return(!m||v!=="hidden")&&v!=="visible"&&v!=="clip"}function P(v,m){if(v.clientHeightm||f>v&&o=m&&u>=p?f-v-h:o>m&&up?o-m+l:0}var j=function(v,m){var p=window,h=m.scrollMode,l=m.block,f=m.inline,o=m.boundary,u=m.skipOverflowHiddenElements,s=typeof o=="function"?o:function(je){return je!==o};if(!ie(v))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,O=[],E=v;ie(E)&&s(E);){if((E=E.parentElement)===a){O.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,u)&&O.push(E)}for(var w=p.visualViewport?p.visualViewport.width:innerWidth,D=p.visualViewport?p.visualViewport.height:innerHeight,L=window.scrollX||pageXOffset,A=window.scrollY||pageYOffset,C=v.getBoundingClientRect(),x=C.height,d=C.width,S=C.top,y=C.right,b=C.bottom,B=C.left,F=l==="start"||l==="nearest"?S:l==="end"?b:S+x/2,_=f==="center"?B+d/2:f==="end"?y:B,M=[],I=0;I=0&&B>=0&&b<=D&&y<=w&&S>=oe&&b<=ye&&B>=Te&&y<=Oe)return M;var Re=getComputedStyle(g),Le=parseInt(Re.borderLeftWidth,10),ce=parseInt(Re.borderTopWidth,10),he=parseInt(Re.borderRightWidth,10),re=parseInt(Re.borderBottomWidth,10),fe=0,se=0,De="offsetWidth"in g?g.offsetWidth-g.clientWidth-Le-he:0,Ne="offsetHeight"in g?g.offsetHeight-g.clientHeight-ce-re:0;if(a===g)fe=l==="start"?F:l==="end"?F-D:l==="nearest"?X(A,A+D,D,ce,re,A+F,A+F+x,x):F-D/2,se=f==="start"?_:f==="center"?_-w/2:f==="end"?_-w:X(L,L+w,w,Le,he,L+_,L+_+d,d),fe=Math.max(0,fe+A),se=Math.max(0,se+L);else{fe=l==="start"?F-oe-ce:l==="end"?F-ye+re+Ne:l==="nearest"?X(oe,ye,$,ce,re+Ne,F,F+x,x):F-(oe+$/2)+Ne/2,se=f==="start"?_-Te-Le:f==="center"?_-(Te+ne/2)+De/2:f==="end"?_-Oe+he+De:X(Te,Oe,ne,Le,he+De,_,_+d,d);var Se=g.scrollLeft,Pe=g.scrollTop;F+=Pe-(fe=Math.max(0,Math.min(Pe+fe,g.scrollHeight-$+Ne))),_+=Se-(se=Math.max(0,Math.min(Se+se,g.scrollWidth-ne+De)))}M.push({el:g,top:fe,left:se})}return M};function U(v){return v===Object(v)&&Object.keys(v).length!==0}function K(v,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(h){var l=h.el,f=h.top,o=h.left;l.scroll&&p?l.scroll({top:f,left:o,behavior:m}):(l.scrollTop=f,l.scrollLeft=o)})}function G(v){return v===!1?{block:"end",inline:"nearest"}:U(v)?v:{block:"start",inline:"nearest"}}function r(v,m){var p=!v.ownerDocument.documentElement.contains(v);if(U(m)&&typeof m.behavior=="function")return m.behavior(p?[]:j(v,m));if(p)return;var h=G(m);return K(j(v,h),h.behavior)}var R=_e.a=r},Zss7:function(rt,_e,Z){var ie;(function(J){var P=/^\s+/,X=/\s+$/,j=0,U=J.round,K=J.min,G=J.max,r=J.random;function R(re,fe){if(re=re||"",fe=fe||{},re instanceof R)return re;if(!(this instanceof R))return new R(re,fe);var se=v(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=U(100*this._a)/100,this._format=fe.format||se.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=se.ok,this._tc_id=j++}R.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 re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),fe,se,De,Ne,Se,Pe;return fe=re.r/255,se=re.g/255,De=re.b/255,fe<=.03928?Ne=fe/12.92:Ne=J.pow((fe+.055)/1.055,2.4),se<=.03928?Se=se/12.92:Se=J.pow((se+.055)/1.055,2.4),De<=.03928?Pe=De/12.92:Pe=J.pow((De+.055)/1.055,2.4),.2126*Ne+.7152*Se+.0722*Pe},setAlpha:function(re){return this._a=M(re),this._roundA=U(100*this._a)/100,this},toHsv:function(){var re=l(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=l(this._r,this._g,this._b),fe=U(re.h*360),se=U(re.s*100),De=U(re.v*100);return this._a==1?"hsv("+fe+", "+se+"%, "+De+"%)":"hsva("+fe+", "+se+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var re=p(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=p(this._r,this._g,this._b),fe=U(re.h*360),se=U(re.s*100),De=U(re.l*100);return this._a==1?"hsl("+fe+", "+se+"%, "+De+"%)":"hsla("+fe+", "+se+"%, "+De+"%, "+this._roundA+")"},toHex:function(re){return o(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return u(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(I(this._r,255)*100)+"%",g:U(I(this._g,255)*100)+"%",b:U(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%)":"rgba("+U(I(this._r,255)*100)+"%, "+U(I(this._g,255)*100)+"%, "+U(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var fe="#"+s(this._r,this._g,this._b,this._a),se=fe,De=this._gradientType?"GradientType = 1, ":"";if(re){var Ne=R(re);se="#"+s(Ne._r,Ne._g,Ne._b,Ne._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+fe+",endColorstr="+se+")"},toString:function(re){var fe=!!re;re=re||this._format;var se=!1,De=this._a<1&&this._a>=0,Ne=!fe&&De&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return Ne?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function(re,fe){var se=re.apply(null,[this].concat([].slice.call(fe)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(L,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(O,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(re,fe){return re.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},R.fromRatio=function(re,fe){if(typeof re=="object"){var se={};for(var De in re)re.hasOwnProperty(De)&&(De==="a"?se[De]=re[De]:se[De]=Oe(re[De]));re=se}return R(re,fe)};function v(re){var fe={r:0,g:0,b:0},se=1,De=null,Ne=null,Se=null,Pe=!1,je=!1;return typeof re=="string"&&(re=ce(re)),typeof re=="object"&&(Le(re.r)&&Le(re.g)&&Le(re.b)?(fe=m(re.r,re.g,re.b),Pe=!0,je=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Le(re.h)&&Le(re.s)&&Le(re.v)?(De=Oe(re.s),Ne=Oe(re.v),fe=f(re.h,De,Ne),Pe=!0,je="hsv"):Le(re.h)&&Le(re.s)&&Le(re.l)&&(De=Oe(re.s),Se=Oe(re.l),fe=h(re.h,De,Se),Pe=!0,je="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=M(se),{ok:Pe,format:re.format||je,r:K(255,G(fe.r,0)),g:K(255,G(fe.g,0)),b:K(255,G(fe.b,0)),a:se}}function m(re,fe,se){return{r:I(re,255)*255,g:I(fe,255)*255,b:I(se,255)*255}}function p(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var De=G(re,fe,se),Ne=K(re,fe,se),Se,Pe,je=(De+Ne)/2;if(De==Ne)Se=Pe=0;else{var le=De-Ne;Pe=je>.5?le/(2-De-Ne):le/(De+Ne);switch(De){case re:Se=(fe-se)/le+(fe1&&(Ie-=1),Ie<1/6?ve+(we-ve)*6*Ie:Ie<1/2?we:Ie<2/3?ve+(we-ve)*(2/3-Ie)*6:ve}if(fe===0)De=Ne=Se=se;else{var je=se<.5?se*(1+fe):se+fe-se*fe,le=2*se-je;De=Pe(le,je,re+1/3),Ne=Pe(le,je,re),Se=Pe(le,je,re-1/3)}return{r:De*255,g:Ne*255,b:Se*255}}function l(re,fe,se){re=I(re,255),fe=I(fe,255),se=I(se,255);var De=G(re,fe,se),Ne=K(re,fe,se),Se,Pe,je=De,le=De-Ne;if(Pe=De===0?0:le/De,De==Ne)Se=0;else{switch(De){case re:Se=(fe-se)/le+(fe>1)+720)%360;--fe;)De.h=(De.h+Ne)%360,Se.push(R(De));return Se}function b(re,fe){fe=fe||6;for(var se=R(re).toHsv(),De=se.h,Ne=se.s,Se=se.v,Pe=[],je=1/fe;fe--;)Pe.push(R({h:De,s:Ne,v:Se})),Se=(Se+je)%1;return Pe}R.mix=function(re,fe,se){se=se===0?0:se||50;var De=R(re).toRgb(),Ne=R(fe).toRgb(),Se=se/100,Pe={r:(Ne.r-De.r)*Se+De.r,g:(Ne.g-De.g)*Se+De.g,b:(Ne.b-De.b)*Se+De.b,a:(Ne.a-De.a)*Se+De.a};return R(Pe)},R.readability=function(re,fe){var se=R(re),De=R(fe);return(J.max(se.getLuminance(),De.getLuminance())+.05)/(J.min(se.getLuminance(),De.getLuminance())+.05)},R.isReadable=function(re,fe,se){var De=R.readability(re,fe),Ne,Se;Se=!1,Ne=he(se);switch(Ne.level+Ne.size){case"AAsmall":case"AAAlarge":Se=De>=4.5;break;case"AAlarge":Se=De>=3;break;case"AAAsmall":Se=De>=7;break}return Se},R.mostReadable=function(re,fe,se){var De=null,Ne=0,Se,Pe,je,le;se=se||{},Pe=se.includeFallbackColors,je=se.level,le=se.size;for(var ve=0;veNe&&(Ne=Se,De=R(fe[ve]));return R.isReadable(re,De,{level:je,size:le})||!Pe?De:(se.includeFallbackColors=!1,R.mostReadable(re,["#fff","#000"],se))};var B=R.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"},F=R.hexNames=_(B);function _(re){var fe={};for(var se in re)re.hasOwnProperty(se)&&(fe[re[se]]=se);return fe}function M(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function I(re,fe){$(re)&&(re="100%");var se=ne(re);return re=K(fe,G(0,parseFloat(re))),se&&(re=parseInt(re*fe,10)/100),J.abs(re-fe)<1e-6?1:re%fe/parseFloat(fe)}function g(re){return K(1,G(0,re))}function H(re){return parseInt(re,16)}function $(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function ne(re){return typeof re=="string"&&re.indexOf("%")!=-1}function oe(re){return re.length==1?"0"+re:""+re}function Oe(re){return re<=1&&(re=re*100+"%"),re}function ye(re){return J.round(parseFloat(re)*255).toString(16)}function Te(re){return H(re)/255}var Re=function(){var re="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",se="(?:"+fe+")|(?:"+re+")",De="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",Ne="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+Ne),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+Ne),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+Ne),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 Le(re){return!!Re.CSS_UNIT.exec(re)}function ce(re){re=re.replace(P,"").replace(X,"").toLowerCase();var fe=!1;if(B[re])re=B[re],fe=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Re.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Re.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Re.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Re.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Re.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Re.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Re.hex8.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),a:Te(se[4]),format:fe?"name":"hex8"}:(se=Re.hex6.exec(re))?{r:H(se[1]),g:H(se[2]),b:H(se[3]),format:fe?"name":"hex"}:(se=Re.hex4.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),a:Te(se[4]+""+se[4]),format:fe?"name":"hex8"}:(se=Re.hex3.exec(re))?{r:H(se[1]+""+se[1]),g:H(se[2]+""+se[2]),b:H(se[3]+""+se[3]),format:fe?"name":"hex"}:!1}function he(re){var fe,se;return re=re||{level:"AA",size:"small"},fe=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:fe,size:se}}rt.exports?rt.exports=R:!(ie=function(){return R}.call(_e,Z,_e,rt),ie!==void 0&&(rt.exports=ie))})(Math)},bT9E:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});var ie=Z("VTBJ");function J(P,X){var j=Object(ie.a)({},P);return Array.isArray(X)&&X.forEach(function(U){delete j[U]}),j}},c5Ni:function(rt,_e,Z){},dejd:function(rt,_e,Z){},dmUQ:function(rt,_e,Z){"use strict";var ie=Z("Ff2n"),J=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),j=Z("Ji7U"),U=Z("md7G"),K=Z("foSv"),G=Z("q1tI"),r=Z.n(G),R=Z("TSYQ"),v=Z.n(R),m=Z("4IlW");function p(x,d){var S=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);d&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(x,b).enumerable})),S.push.apply(S,y)}return S}function h(x){for(var d=1;d1?ne-1:0),Oe=1;Oe1?I-1:0),H=1;H=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var I=0;return M.indexOf(".")>=0&&(I=M.length-M.indexOf(".")-1),I},b.getInputDisplayValue=function(_){var M=_||b.state,I=M.focused,g=M.inputValue,H=M.value,$;I?$=g:$=b.toPrecisionAsStep(H),$==null&&($="");var ne=b.formatWrapper($);return w(b.props.decimalSeparator)&&(ne=ne.toString().replace(".",b.props.decimalSeparator)),ne},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(_){}},b.restoreByAfter=function(_){if(_===void 0)return!1;var M=b.input.value,I=M.lastIndexOf(_);if(I===-1)return!1;var g=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(g-1)===_[0]?(b.fixCaret(g,g),!0):I+_.length===M.length?(b.fixCaret(I,I),!0):!1},b.partRestoreByAfter=function(_){return _===void 0?!1:Array.prototype.some.call(_,function(M,I){var g=_.substring(I);return b.restoreByAfter(g)})},b.isNotCompleteNumber=function(_){return isNaN(_)||_===""||_===null||_&&_.toString().indexOf(".")===_.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(_,M,I){b.pressingUpOrDown=!0,b.step("down",_,M,I)},b.up=function(_,M,I){b.pressingUpOrDown=!0,b.step("up",_,M,I)},b.saveInput=function(_){b.input=_};var B=y.value;B===void 0&&(B=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(B));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(X.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var B=this.props,F=B.value,_=B.onChange,M=B.max,I=B.min,g=this.state.focused;if(b){if(!D(b.value,F)||!D(b.max,M)||!D(b.min,I)){var H=g?F:this.getValidValue(F),$;this.pressingUpOrDown?$=H:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:$})}var ne="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==M&&typeof ne=="number"&&ne>M&&_&&_(M),"min"in this.props&&b.min!==I&&typeof ne=="number"&&ne1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,_=parseFloat(b);return isNaN(_)?b:(_F&&(_=F),_)}},{key:"setValue",value:function(b,B){var F=this.props.precision,_=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),M=this.state.value,I=M===void 0?null:M,g=this.state.inputValue,H=g===void 0?null:g,$=typeof _=="number"?_.toFixed(F):"".concat(_),ne=_!==I||$!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},B)):this.setState({value:_,inputValue:this.toPrecisionAsStep(b)},B),ne&&this.props.onChange(_),_}},{key:"getMaxPrecision",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,_=F.precision,M=F.step;if(w(_))return _;var I=this.getPrecision(B),g=this.getPrecision(M),H=this.getPrecision(b);return b?Math.max(H,I+g):I+g}},{key:"getPrecisionFactor",value:function(b){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,B);return Math.pow(10,F)}},{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(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var B=Math.abs(this.getMaxPrecision(b));return isNaN(B)?b.toString():Number(b).toFixed(B)}},{key:"toNumber",value:function(b){var B=this.props.precision,F=this.state.focused,_=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||_?b:w(B)?Math.round(b*Math.pow(10,B))/Math.pow(10,B):Number(b)}},{key:"upStep",value:function(b,B){var F=this.props.step,_=this.getPrecisionFactor(b,B),M=Math.abs(this.getMaxPrecision(b,B)),I=((_*b+_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(b,B){var F=this.props.step,_=this.getPrecisionFactor(b,B),M=Math.abs(this.getMaxPrecision(b,B)),I=((_*b-_*F*B)/_).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(b,B){var F=this,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var I=this.props;if(I.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var H=this["".concat(b,"Step")](g,_),$=H>I.max||HI.max?H=I.max:H=oe),He=(st||st===0)&&(isNaN(st)||Number(st)<=Oe),Ae=Be||_||M,me=He||_||M,xe=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(J.a)({},"".concat(F,"-handler-up-disabled"),Ae)),ae=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(J.a)({},"".concat(F,"-handler-down-disabled"),me)),ue=I?{onTouchStart:Ae?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=I?{onTouchStart:me?o:this.down,onTouchEnd:this.stop}:{onMouseDown:me?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:nt,style:ye,title:Te,onMouseEnter:Re,onMouseLeave:Le,onMouseOver:ce,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ue,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:xe}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:ae}),$||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":oe,"aria-valuenow":st,required:re,type:De,placeholder:Ne,onPaste:We,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:se,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ot?this.onKeyDown:o,onKeyUp:ot?this.onKeyUp:o,autoFocus:we,maxLength:ve,readOnly:M,disabled:_,max:oe,min:Oe,step:le,name:Ie,title:Te,id:Se,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(tt),pattern:je,inputMode:Pe,onInput:Ve},Fe))))}}]),S}(r.a.Component);L.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var A=L,C=_e.a=A},fjLI:function(rt,_e,Z){"use strict";Z.d(_e,"f",function(){return p}),Z.d(_e,"b",function(){return h}),Z.d(_e,"a",function(){return l}),Z.d(_e,"d",function(){return f}),Z.d(_e,"e",function(){return o}),Z.d(_e,"c",function(){return u});var ie=Z("8HAY"),J=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),j=Z("pmY6"),U=Z("24hK"),K=Z("nnTU"),G=Z("T8No"),r=Z("Cg/j"),R=Z("t9D7"),v=function(s,a,O,E){var w=arguments.length,D=w<3?a:E===null?E=Object.getOwnPropertyDescriptor(a,O):E,L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,O,E);else for(var A=s.length-1;A>=0;A--)(L=s[A])&&(D=(w<3?L(D):w>3?L(a,O,D):L(a,O))||D);return w>3&&D&&Object.defineProperty(a,O,D),D},m=function(s,a){return function(O,E){a(O,E,s)}};function p(s){return s.command!==void 0}class h{constructor(s){this.id=h._idPool++,this._debugName=s}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const l=Object(r.c)("menuService"),f=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new P.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.CommandPalette}}addCommand(s){return this.addCommands(X.a.single(s))}addCommands(s){for(const a of s)this._commands.set(a.id,a);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(j.i)(()=>{let a=!1;for(const O of s)a=this._commands.delete(O.id)||a;a&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((a,O)=>s.set(O,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,O=new U.a;for(const{id:E,item:w}of s){let D=this._menuItems.get(E);D||(D=new U.a,this._menuItems.set(E,D)),O.push(D.push(w)),a.add(E)}return this._onDidChangeMenu.fire(a),Object(j.i)(()=>{if(O.size>0){for(let E of O)E();this._onDidChangeMenu.fire(a),O.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===h.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const O of s)p(O)&&(a.add(O.command.id),O.alt&&a.add(O.alt.id));this._commands.forEach((O,E)=>{a.has(E)||s.push({command:O})})}};class o extends ie.e{constructor(s,a,O,E){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=O,this._options=E}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=a.getActions(this._options);a.dispose();for(const[,E]of O)E.length>0&&(s.push(...E),s.push(new ie.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,O,E,w,D){var L,A;if(this._commandService=D,this.id=a.id,this.label=(E==null?void 0:E.renderShortTitle)&&a.shortTitle?typeof a.shortTitle=="string"?a.shortTitle:a.shortTitle.value:typeof a.title=="string"?a.title:a.title.value,this.tooltip=(A=typeof a.tooltip=="string"?a.tooltip:(L=a.tooltip)===null||L===void 0?void 0:L.value)!==null&&A!==void 0?A:"",this.enabled=!a.precondition||w.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const C=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=w.contextMatchesRules(C.condition),this.checked&&C.tooltip&&(this.tooltip=typeof C.tooltip=="string"?C.tooltip:C.tooltip.value),C.title&&(this.label=typeof C.title=="string"?C.title:C.title.value)}this.item=a,this.alt=O?new s(O,void 0,E,w,D):void 0,this._options=E,R.d.isThemeIcon(a.icon)&&(this.class=J.a.asClassName(a.icon))}dispose(){}run(...a){var O,E;let w=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(w=[...w,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(w=[...w,...a]),this._commandService.executeCommand(this.id,...w)}};u=v([m(3,G.b),m(4,K.b)],u)},h78n:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return b});var ie=Z("q1tI"),J=Z.n(ie),P=Z("TSYQ"),X=Z.n(P),j={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},U=function(_){var M=_.map(function(){return Object(ie.useRef)()}),I=Object(ie.useRef)();return Object(ie.useEffect)(function(){var g=Date.now(),H=!1;Object.keys(M).forEach(function($){var ne=M[$].current;if(!ne)return;H=!0;var oe=ne.style;oe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&g-I.current<100&&(oe.transitionDuration="0s, 0s")}),H&&(I.current=Date.now())}),[M]};function K(){return K=Object.assign||function(F){for(var _=1;_F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function m(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ne;!(I=(ne=$.next()).done)&&!(M.push(ne.value),_&&M.length===_);I=!0);}catch(oe){g=!0,H=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return M}function p(F){if(Array.isArray(F))return F}function h(F,_){if(F==null)return{};var M=l(F,_),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function l(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,H;for(H=0;H=0)continue;M[g]=F[g]}return M}var f=function(_){var M=_.className,I=_.percent,g=_.prefixCls,H=_.strokeColor,$=_.strokeLinecap,ne=_.strokeWidth,oe=_.style,Oe=_.trailColor,ye=_.trailWidth,Te=_.transition,Re=h(_,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Re.gapPosition;var Le=Array.isArray(I)?I:[I],ce=Array.isArray(H)?H:[H],he=U(Le),re=G(he,1),fe=re[0],se=ne/2,De=100-ne/2,Ne="M ".concat($==="round"?se:0,",").concat(se,` L `).concat($==="round"?De:100,",").concat(se),Se="0 0 100 ".concat(ne),Pe=0;return J.a.createElement("svg",K({className:X()("".concat(g,"-line"),M),viewBox:Se,preserveAspectRatio:"none",style:oe},Re),J.a.createElement("path",{className:"".concat(g,"-line-trail"),d:Ne,strokeLinecap:$,stroke:Oe,strokeWidth:ye||ne,fillOpacity:"0"}),Le.map(function(je,le){var ve={strokeDasharray:"".concat(je,"px, 100px"),strokeDashoffset:"-".concat(Pe,"px"),transition:Te||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},we=ce[le]||ce[ce.length-1];return Pe+=je,J.a.createElement("path",{key:le,className:"".concat(g,"-line-path"),d:Ne,strokeLinecap:$,stroke:we,strokeWidth:ne,fillOpacity:"0",ref:fe[le],style:ve})}))};f.defaultProps=j;var o=f;function u(){return u=Object.assign||function(F){for(var _=1;_F.length)&&(_=F.length);for(var M=0,I=new Array(_);M<_;M++)I[M]=F[M];return I}function w(F,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var M=[],I=!0,g=!1,H=void 0;try{for(var $=F[Symbol.iterator](),ne;!(I=(ne=$.next()).done)&&!(M.push(ne.value),_&&M.length===_);I=!0);}catch(oe){g=!0,H=oe}finally{try{!I&&$.return!=null&&$.return()}finally{if(g)throw H}}return M}function D(F){if(Array.isArray(F))return F}function L(F,_){if(F==null)return{};var M=A(F,_),I,g;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for(g=0;g=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,I))continue;M[I]=F[I]}}return M}function A(F,_){if(F==null)return{};var M={},I=Object.keys(F),g,H;for(H=0;H=0)continue;M[g]=F[g]}return M}var C=0;function x(F){return+F.replace("%","")}function d(F){return Array.isArray(F)?F:[F]}function S(F,_,M,I){var g=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,$=50-I/2,ne=0,oe=-$,Oe=0,ye=-2*$;switch(H){case"left":ne=-$,oe=0,Oe=2*$,ye=0;break;case"right":ne=$,oe=0,Oe=-2*$,ye=0;break;case"bottom":oe=$,ye=2*$;break;default:}var Te="M 50,50 m ".concat(ne,",").concat(oe,` a `).concat($,",").concat($," 0 1 1 ").concat(Oe,",").concat(-ye,` a `).concat($,",").concat($," 0 1 1 ").concat(-Oe,",").concat(ye),Re=Math.PI*2*$,Le={stroke:M,strokeDasharray:"".concat(_/100*(Re-g),"px ").concat(Re,"px"),strokeDashoffset:"-".concat(g/2+F/100*(Re-g),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Te,pathStyle:Le}}var y=function(_){var M=_.prefixCls,I=_.strokeWidth,g=_.trailWidth,H=_.gapDegree,$=_.gapPosition,ne=_.trailColor,oe=_.strokeLinecap,Oe=_.style,ye=_.className,Te=_.strokeColor,Re=_.percent,Le=L(_,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ce=Object(ie.useMemo)(function(){return C+=1,C},[]),he=S(0,100,ne,I,H,$),re=he.pathString,fe=he.pathStyle,se=d(Re),De=d(Te),Ne=De.find(function(ve){return Object.prototype.toString.call(ve)==="[object Object]"}),Se=U(se),Pe=s(Se,1),je=Pe[0],le=function(){var we=0;return se.map(function(Ie,We){var Ve=De[We]||De[De.length-1],Ze=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(ce,")"):"",$e=S(we,Ie,Ve,I,H,$);return we+=Ie,J.a.createElement("path",{key:We,className:"".concat(M,"-circle-path"),d:$e.pathString,stroke:Ze,strokeLinecap:oe,strokeWidth:I,opacity:Ie===0?0:1,fillOpacity:"0",style:$e.pathStyle,ref:je[We]})})};return J.a.createElement("svg",u({className:X()("".concat(M,"-circle"),ye),viewBox:"0 0 100 100",style:Oe},Le),Ne&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(ce),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ne).sort(function(ve,we){return x(ve)-x(we)}).map(function(ve,we){return J.a.createElement("stop",{key:we,offset:ve,stopColor:Ne[ve]})}))),J.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:re,stroke:ne,strokeLinecap:oe,strokeWidth:g||I,fillOpacity:"0",style:fe}),le().reverse())};y.defaultProps=j;var b=y,B={Line:o,Circle:b}},ic2d:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return X});var ie=Z("FWmy"),J=Z("746U");class P{constructor(){this.data=new Map}add(j,U){ie.a(J.l(j)),ie.a(J.k(U)),ie.a(!this.data.has(j),"There is already an extension with this id"),this.data.set(j,U)}as(j){return this.data.get(j)||null}}const X=new P},kSUc:function(rt,_e,Z){},lZu9:function(rt,_e,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(J,P){var X=ie.getMode(J,"text/html"),j=X.name=="null";function U(I){if(ie.findModeByName){var g=ie.findModeByName(I);g&&(I=g.mime||g.mimes[0])}var H=ie.getMode(J,I);return H.name=="null"?null:H}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var K={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 G in K)K.hasOwnProperty(G)&&P.tokenTypeOverrides[G]&&(K[G]=P.tokenTypeOverrides[G]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,u=" ";function s(I,g,H){return g.f=g.inline=H,H(I,g)}function a(I,g,H){return g.f=g.block=H,H(I,g)}function O(I){return!I||!/\S/.test(I.string)}function E(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==D){var g=j;if(!g){var H=ie.innerMode(X,I.htmlState);g=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}g&&(I.f=x,I.block=w,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function w(I,g){var H=I.column()===g.indentation,$=O(g.prevLine.stream),ne=g.indentedCode,oe=g.prevLine.hr,Oe=g.list!==!1,ye=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Te=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Oe)){for(g.list=null;Te=4&&(ne||g.prevLine.fencedCodeEnd||g.prevLine.header||$))return I.skipToEnd(),g.indentedCode=!0,K.code;if(I.eatSpace())return null;if(H&&g.indentation<=ye&&(ce=I.match(m))&&ce[1].length<=6)return g.quote=0,g.header=ce[1].length,g.thisLine.header=!0,P.highlightFormatting&&(g.formatting="header"),g.f=g.inline,A(g);if(g.indentation<=ye&&I.eat(">"))return g.quote=H?1:g.quote+1,P.highlightFormatting&&(g.formatting="quote"),I.eatSpace(),A(g);if(!Le&&!g.setext&&H&&g.indentation<=ye&&(ce=I.match(R))){var he=ce[1]?"ol":"ul";return g.indentation=Te+I.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,P.taskLists&&I.match(v,!1)&&(g.taskList=!0),g.f=g.inline,P.highlightFormatting&&(g.formatting=["list","list-"+he]),A(g)}else{if(H&&g.indentation<=ye&&(ce=I.match(l,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ce[1]+"+ *$"),g.localMode=P.fencedCodeBlockHighlighting&&U(ce[2]||P.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=ie.startState(g.localMode)),g.f=g.block=L,P.highlightFormatting&&(g.formatting="code-block"),g.code=-1,A(g);if(g.setext||(!Re||!Oe)&&!g.quote&&g.list===!1&&!g.code&&!Le&&!f.test(I.string)&&(ce=I.lookAhead(1))&&(ce=ce.match(p)))return g.setext?(g.header=g.setext,g.setext=0,I.skipToEnd(),P.highlightFormatting&&(g.formatting="header")):(g.header=ce[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,A(g);if(Le)return I.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,K.hr;if(I.peek()==="[")return s(I,g,B)}return s(I,g,g.inline)}function D(I,g){var H=X.token(I,g.htmlState);if(!j){var $=ie.innerMode(X,g.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||g.md_inside&&I.current().indexOf(">")>-1)&&(g.f=x,g.block=w,g.htmlState=null)}return H}function L(I,g){var H=g.listStack[g.listStack.length-1]||0,$=g.indentation=I.quote?g.push(K.formatting+"-"+I.formatting[H]+"-"+I.quote):g.push("error"))}if(I.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(I.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(I.linkHref?g.push(K.linkHref,"url"):(I.strong&&g.push(K.strong),I.em&&g.push(K.em),I.strikethrough&&g.push(K.strikethrough),I.emoji&&g.push(K.emoji),I.linkText&&g.push(K.linkText),I.code&&g.push(K.code),I.image&&g.push(K.image),I.imageAltText&&g.push(K.imageAltText,"link"),I.imageMarker&&g.push(K.imageMarker)),I.header&&g.push(K.header,K.header+"-"+I.header),I.quote&&(g.push(K.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=I.quote?g.push(K.quote+"-"+I.quote):g.push(K.quote+"-"+P.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?g.push(K.list2):g.push(K.list3):g.push(K.list1)}return I.trailingSpaceNewLine?g.push("trailing-space-new-line"):I.trailingSpace&&g.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function C(I,g){return I.match(h,!0)?A(g):void 0}function x(I,g){var H=g.text(I,g);if(typeof H!="undefined")return H;if(g.list)return g.list=null,A(g);if(g.taskList){var $=I.match(v,!0)[1]===" ";return $?g.taskOpen=!0:g.taskClosed=!0,P.highlightFormatting&&(g.formatting="task"),g.taskList=!1,A(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&I.match(/^#+$/,!0))return P.highlightFormatting&&(g.formatting="header"),A(g);var ne=I.next();if(g.linkTitle){g.linkTitle=!1;var oe=ne;ne==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(I.match(new RegExp(Oe),!0))return K.linkHref}if(ne==="`"){var ye=g.formatting;P.highlightFormatting&&(g.formatting="code"),I.eatWhile("`");var Te=I.current().length;if(g.code==0&&(!g.quote||Te==1))return g.code=Te,A(g);if(Te==g.code){var Re=A(g);return g.code=0,Re}else return g.formatting=ye,A(g)}else if(g.code)return A(g);if(ne==="\\"&&(I.next(),P.highlightFormatting)){var Le=A(g),ce=K.formatting+"-escape";return Le?Le+" "+ce:ce}if(ne==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ne==="["&&g.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,P.highlightFormatting&&(g.formatting="image"),A(g);if(ne==="]"&&g.imageAltText){P.highlightFormatting&&(g.formatting="image");var Le=A(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=S,Le}if(ne==="["&&!g.image)return g.linkText&&I.match(/^.*?\]/)||(g.linkText=!0,P.highlightFormatting&&(g.formatting="link")),A(g);if(ne==="]"&&g.linkText){P.highlightFormatting&&(g.formatting="link");var Le=A(g);return g.linkText=!1,g.inline=g.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?S:x,Le}if(ne==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,P.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkInline}if(ne==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=d,P.highlightFormatting&&(g.formatting="link");var Le=A(g);return Le?Le+=" ":Le="",Le+K.linkEmail}if(P.xml&&ne==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=I.string.indexOf(">",I.pos);if(he!=-1){var re=I.string.substring(I.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(g.md_inside=!0)}return I.backUp(1),g.htmlState=ie.startState(X),a(I,g,D)}if(P.xml&&ne==="<"&&I.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var fe=1,se=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(ne);)fe++;var De=I.peek()||" ",Ne=!/\s/.test(De)&&(!o.test(De)||/\s/.test(se)||o.test(se)),Se=!/\s/.test(se)&&(!o.test(se)||/\s/.test(De)||o.test(De)),Pe=null,je=null;if(fe%2&&(!g.em&&Ne&&(ne==="*"||!Se||o.test(se))?Pe=!0:g.em==ne&&Se&&(ne==="*"||!Ne||o.test(De))&&(Pe=!1)),fe>1&&(!g.strong&&Ne&&(ne==="*"||!Se||o.test(se))?je=!0:g.strong==ne&&Se&&(ne==="*"||!Ne||o.test(De))&&(je=!1)),je!=null||Pe!=null){P.highlightFormatting&&(g.formatting=Pe==null?"strong":je==null?"em":"strong em"),Pe===!0&&(g.em=ne),je===!0&&(g.strong=ne);var Re=A(g);return Pe===!1&&(g.em=!1),je===!1&&(g.strong=!1),Re}}else if(ne===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(g);I.backUp(1)}if(P.strikethrough){if(ne==="~"&&I.eatWhile(ne)){if(g.strikethrough){P.highlightFormatting&&(g.formatting="strikethrough");var Re=A(g);return g.strikethrough=!1,Re}else if(I.match(/^[^\s]/,!1))return g.strikethrough=!0,P.highlightFormatting&&(g.formatting="strikethrough"),A(g)}else if(ne===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(g);I.backUp(2)}}if(P.emoji&&ne===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,P.highlightFormatting&&(g.formatting="emoji");var le=A(g);return g.emoji=!1,le}return ne===" "&&(I.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),A(g)}function d(I,g){var H=I.next();if(H===">"){g.f=g.inline=x,P.highlightFormatting&&(g.formatting="link");var $=A(g);return $?$+=" ":$="",$+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function S(I,g){if(I.eatSpace())return null;var H=I.next();return H==="("||H==="["?(g.f=g.inline=b(H==="("?")":"]"),P.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,A(g)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(I){return function(g,H){var $=g.next();if($===I){H.f=H.inline=x,P.highlightFormatting&&(H.formatting="link-string");var ne=A(H);return H.linkHref=!1,ne}return g.match(y[I]),H.linkHref=!0,A(H)}}function B(I,g){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=F,I.next(),P.highlightFormatting&&(g.formatting="link"),g.linkText=!0,A(g)):s(I,g,x)}function F(I,g){if(I.match(/^\]:/,!0)){g.f=g.inline=_,P.highlightFormatting&&(g.formatting="link");var H=A(g);return g.linkText=!1,H}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function _(I,g){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?g.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=x,K.linkHref+" url")}var M={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:x,text:C,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ie.copyState(X,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ie.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,g){if(g.formatting=!1,I!=g.thisLine.stream){if(g.header=0,g.hr=!1,I.match(/^\s*$/,!0))return E(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:I},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=D)){var H=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(g.indentation=H,g.indentationDiff=null,H>0)return null}}return g.f(I,g)},innerMode:function(I){return I.block==D?{state:I.htmlState,mode:X}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:M}},indent:function(I,g,H){return I.block==D&&X.indent?X.indent(I.htmlState,g,H):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,g,H):ie.Pass},blankLine:E,getType:A,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},nEHx:function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return ie});var ie;(function(J){J.DARK="dark",J.LIGHT="light",J.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(rt,_e,Z){"use strict";Z.d(_e,"b",function(){return K}),Z.d(_e,"a",function(){return G});var ie=Z("MI8n"),J=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),j=Z("746U"),U=Z("Cg/j");const K=Object(U.c)("commandService"),G=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,R){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!R)throw new Error("invalid command");return this.registerCommand({id:r,handler:R})}if(r.description){const l=[];for(let o of r.description.args)l.push(o.constraint);const f=r.handler;r.handler=function(o,...u){return Object(j.o)(u,l),f(o,...u)}}const{id:v}=r;let m=this._commands.get(v);m||(m=new X.a,this._commands.set(v,m));let p=m.unshift(r),h=Object(P.i)(()=>{p();const l=this._commands.get(v);(l==null?void 0:l.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),h}registerCommandAlias(r,R){return G.registerCommand(r,(v,...m)=>v.get(K).executeCommand(R,...m))}getCommand(r){const R=this._commands.get(r);return!R||R.isEmpty()?void 0:J.a.first(R)}getCommands(){const r=new Map;for(const R of this._commands.keys()){const v=this.getCommand(R);v&&r.set(R,v)}return r}};G.registerCommand("noop",()=>{})},osHv:function(rt,_e,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var J=ie.Pos;function P(o,u){return o.line-u.line||o.ch-u.ch}var X="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",j=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",U=new RegExp("<(/?)(["+X+"]["+j+"]*)","g");function K(o,u,s,a){this.line=u,this.ch=s,this.cm=o,this.text=o.getLine(u),this.min=a?Math.max(a.from,o.firstLine()):o.firstLine(),this.max=a?Math.min(a.to-1,o.lastLine()):o.lastLine()}function G(o,u){var s=o.cm.getTokenTypeAt(J(o.line,u));return s&&/\btag\b/.test(s)}function r(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function R(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function v(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(r(o))continue;return}if(!G(o,u+1)){o.ch=u+1;continue}var s=o.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(o.text.slice(s+1,u));return o.ch=u+1,a?"selfClose":"regular"}}function m(o){for(;;){var u=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(u==-1){if(R(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}U.lastIndex=u,o.ch=u;var s=U.exec(o.text);if(s&&s.index==u)return s}}function p(o){for(;;){U.lastIndex=o.ch;var u=U.exec(o.text);if(!u){if(r(o))continue;return}if(!G(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function h(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(R(o))continue;return}if(!G(o,u+1)){o.ch=u;continue}var s=o.text.lastIndexOf("/",u),a=s>-1&&!/\S/.test(o.text.slice(s+1,u));return o.ch=u+1,a?"selfClose":"regular"}}function l(o,u){for(var s=[];;){var a=p(o),O,E=o.line,w=o.ch-(a?a[0].length:0);if(!a||!(O=v(o)))return;if(O=="selfClose")continue;if(a[1]){for(var D=s.length-1;D>=0;--D)if(s[D]==a[2]){s.length=D;break}if(D<0&&(!u||u==a[2]))return{tag:a[2],from:J(E,w),to:J(o.line,o.ch)}}else s.push(a[2])}}function f(o,u){for(var s=[];;){var a=h(o);if(!a)return;if(a=="selfClose"){m(o);continue}var O=o.line,E=o.ch,w=m(o);if(!w)return;if(w[1])s.push(w[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==w[2]){s.length=D;break}if(D<0&&(!u||u==w[2]))return{tag:w[2],from:J(o.line,o.ch),to:J(O,E)}}}}ie.registerHelper("fold","xml",function(o,u){for(var s=new K(o,u.line,0);;){var a=p(s);if(!a||s.line!=u.line)return;var O=v(s);if(!O)return;if(!a[1]&&O!="selfClose"){var E=J(s.line,s.ch),w=l(s,a[2]);return w&&P(w.from,E)>0?{from:E,to:w.from}:null}}}),ie.findMatchingTag=function(o,u,s){var a=new K(o,u.line,u.ch,s);if(a.text.indexOf(">")==-1&&a.text.indexOf("<")==-1)return;var O=v(a),E=O&&J(a.line,a.ch),w=O&&m(a);if(!O||!w||P(a,u)>0)return;var D={from:J(a.line,a.ch),to:E,tag:w[2]};return O=="selfClose"?{open:D,close:null,at:"open"}:w[1]?{open:f(a,w[2]),close:D,at:"close"}:(a=new K(o,E.line,E.ch,s),{open:D,close:l(a,w[2]),at:"open"})},ie.findEnclosingTag=function(o,u,s,a){for(var O=new K(o,u.line,u.ch,s);;){var E=f(O,a);if(!E)break;var w=new K(o,u.line,u.ch,s),D=l(w,E.tag);if(D)return{open:E,close:D}}},ie.scanForClosingTag=function(o,u,s,a){var O=new K(o,u.line,u.ch,a?{from:0,to:a}:null);return l(O,s)}})},p5ED:function(rt,_e,Z){"use strict";var ie=Z("+L6B"),J=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),j=Z("k1fw"),U=Z("9og8"),K=Z("tJVT"),G=Z("WmNS"),r=Z.n(G),R=Z("q1tI"),v=Z.n(R),m=Z("vHTk"),p=Z.n(m),h=Z("yEEn"),l=Z("ZW9T"),f=Z("1vsH"),o=Z("V0Rq"),u=Z("m3rI");_e.a=function(s){var a,O,E,w,D,L,A,C=s.editOffice,x=C===void 0?"view":C,d=s.data,S=s.theme,y=s.type,b=s.filename,B=s.monacoEditor,F=s.className,_=s.style,M=s.close,I=s.onClose,g=s.hasMask,H=s.disabledDownload,$=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ne=Object(K.a)($,2),oe=ne[0],Oe=ne[1],ye=Object(R.useState)(""),Te=Object(K.a)(ye,2),Re=Te[0],Le=Te[1],ce=Object(R.useState)(),he=Object(K.a)(ce,2),re=he[0],fe=he[1],se=window.ENV==="build"?"/react/build":"",De=u.a.PROXY_SERVER||location.origin,Ne,Se=1024*1024,Pe=10*Se,je=Object(R.useRef)();(a=d)!==null&&a!==void 0&&a.startsWith("/api")&&y!=="txt"&&(d=u.a.API_SERVER+d),y==="office"&&(Ne=Object(f.T)(d).filesize,Ne>Pe&&(y="other")),b&&B&&(B.filename=b),Object(R.useEffect)(function(){var Ie,We,Ve=(Ie=document.cookie)===null||Ie===void 0||((We=Ie.replace(/\s/g,""))===null||We===void 0)?void 0:We.split(";");Ve==null||Ve.map(function(Ze){var $e=Ze.split("=");$e[0]==="_educoder_session"&&Le($e[1])})},[]),Object(R.useEffect)(function(){y==="office"&&le()},[y,d]);var le=function(){var Ie=Object(U.a)(r.a.mark(function We(){var Ve,Ze,$e;return r.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return console.log("data:",d),Ve=d,d.startsWith("http")||(Ve=location.origin+Ve),Ze=new URL(Ve).pathname.split("/").pop(),Qe.next=6,Object(o.V)({attachment_id:Ze});case 6:$e=Qe.sent,fe($e);case 8:case"end":return Qe.stop()}},We)}));return function(){return Ie.apply(this,arguments)}}(),ve=function(){if(d.startsWith("http")||d.startsWith("blob:")){we();return}Object(f.z)(b||"educoder",d,b)},we=function(){Object(f.x)(b||"educoder",decodeURIComponent(d))};return v.a.createElement("div",{style:Object(j.a)({},_||{}),className:"".concat(g&&p.a.bgBlack," ").concat(y?p.a.wrp:"hide")},M&&v.a.createElement("div",{className:p.a.close,ref:je},!H&&v.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return je.current}},v.a.createElement("span",{onClick:we},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return je.current}},v.a.createElement("span",{className:"",onClick:I},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&v.a.createElement(l.b,B)),y==="audio"&&v.a.createElement("audio",{src:"".concat(((O=d)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((E=d)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),y==="video"&&v.a.createElement(v.a.Fragment,null,((w=d)===null||w===void 0?void 0:w.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),y==="office"&&re&&v.a.createElement("iframe",{src:"".concat(se,"/office.html?key=").concat(re.key,"&url=").concat(De+re.url,"&callbackUrl=").concat(De+re.callbackUrl,"&fileType=").concat(re.fileType,"&title=").concat(re.title,"&model=").concat(x,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),y==="html"&&v.a.createElement("iframe",{src:d+"&disposition=inline"}),y==="pdf"&&v.a.createElement("iframe",{src:"".concat(se,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!H)}),y==="image"&&v.a.createElement("img",{src:"".concat(((D=d)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((L=d)===null||L===void 0?void 0:L.indexOf("https://"))>-1||(A=d)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),y==="other"&&v.a.createElement("div",null,v.a.createElement(J.a,{type:"primary",size:"large",onClick:ve},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&v.a.createElement(J.a,{type:"primary",size:"large",onClick:ve},v.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(rt,_e,Z){},pmY6:function(rt,_e,Z){"use strict";Z.d(_e,"h",function(){return R}),Z.d(_e,"g",function(){return m}),Z.d(_e,"f",function(){return p}),Z.d(_e,"e",function(){return h}),Z.d(_e,"i",function(){return l}),Z.d(_e,"b",function(){return f}),Z.d(_e,"a",function(){return o}),Z.d(_e,"d",function(){return u}),Z.d(_e,"c",function(){return s});var ie=Z("C/vA"),J=Z("JYp7");const P=!1;let X=null;function j(a){X=a}if(P){const a="__is_disposable_tracked__";j(new class{trackDisposable(O){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[a]||console.log(E)},3e3)}setParent(O,E){if(O&&O!==o.None)try{O[a]=!0}catch(w){}}markAsDisposed(O){if(O&&O!==o.None)try{O[a]=!0}catch(E){}}markAsSingleton(O){}})}function U(a){return X==null||X.trackDisposable(a),a}function K(a){X==null||X.markAsDisposed(a)}function G(a,O){X==null||X.setParent(a,O)}function r(a,O){if(!X)return;for(const E of a)X.setParent(E,O)}function R(a){return X==null||X.markAsSingleton(a),a}class v extends Error{constructor(a){super(`Encountered errors while disposing of store. Errors: [${a.join(", ")}]`);this.errors=a}}function m(a){return typeof a.dispose=="function"&&a.dispose.length===0}function p(a){if(J.a.is(a)){let O=[];for(const E of a)if(E)try{E.dispose()}catch(w){O.push(w)}if(O.length===1)throw O[0];if(O.length>1)throw new v(O);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function h(...a){const O=l(()=>p(a));return r(a,O),O}function l(a){const O=U({dispose:Object(ie.a)(()=>{K(O),a()})});return O}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,U(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return G(a,this),this._isDisposed?f.DISABLE_DISPOSED_WARNING||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(a),a}}f.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new f,U(this),G(this._store,this)}dispose(){K(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}o.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,U(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var O;if(this._isDisposed||a===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),a&&G(a,this),this._value=a}clear(){this.value=void 0}dispose(){var a;this._isDisposed=!0,K(this),(a=this._value)===null||a===void 0||a.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&G(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(rt,_e,Z){var ie,J;(function(){var P;(function(){"use strict";var K=[,,function(v){function m(l){this.__parent=l,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var l=new m(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},m.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},m.prototype.has_match=function(l){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(l))return!0;return!1},m.prototype.set_indent=function(l,f){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(l){this.__items.push(l);var f=l.lastIndexOf(` `);f!==-1?this.__character_count=l.length-f:this.__character_count+=l.length},m.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function p(l,f){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),f=f||"",l.indent_level>0&&(f=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(l,f){var o=this.__base_string_length;return f=f||0,l<0&&(o=0),o+=l*this.__indent_size,o+=f,o},p.prototype.get_indent_string=function(l,f){var o=this.__base_string;return f=f||0,l<0&&(l=0,o=""),f+=l*this.__indent_size,this.__ensure_cache(f),o+=this.__cache[f],o},p.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var l=this.__cache.length,f=0,o="";this.__indent_size&&l>=this.__indent_size&&(f=Math.floor(l/this.__indent_size),l-=f*this.__indent_size,o=new Array(f+1).join(this.__indent_string)),l&&(o+=new Array(l+1).join(" ")),this.__cache.push(o)};function h(l,f){this.__indent_cache=new p(l,f),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(l,f){return this.__indent_cache.get_indent_string(l,f)},h.prototype.get_indent_size=function(l,f){return this.__indent_cache.get_indent_size(l,f)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(l){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===` `&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return l!==` `&&(o=o.replace(/[\n]/g,l)),o},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(l,f){return l=l||0,f=f||0,this.next_line.set_indent(l,f),this.__lines.length>1?(this.current_line.set_indent(l,f),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(l){for(var f=0;f1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(l,f){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==f){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},v.exports.Output=h},function(v){function m(p,h,l,f){this.type=p,this.text=h,this.comments_before=null,this.newlines=l||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=m},,,function(v){function m(l,f){this.raw_options=p(l,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(l,f){var o=this.raw_options[l],u=f||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(u=o.concat()):typeof o=="string"&&(u=o.split(/[^a-zA-Z0-9_\/\-]+/)),u},m.prototype._get_boolean=function(l,f){var o=this.raw_options[l],u=o===void 0?!!f:!!o;return u},m.prototype._get_characters=function(l,f){var o=this.raw_options[l],u=f||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),u},m.prototype._get_number=function(l,f){var o=this.raw_options[l];f=parseInt(f,10),isNaN(f)&&(f=0);var u=parseInt(o,10);return isNaN(u)&&(u=f),u},m.prototype._get_selection=function(l,f,o){var u=this._get_selection_list(l,f,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values: `+f+` You passed in: '`+this.raw_options[l]+"'");return u[0]},m.prototype._get_selection_list=function(l,f,o){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[f[0]],!this._is_valid_selection(o,f))throw new Error("Invalid Default Value!");var u=this._get_array(l,o);if(!this._is_valid_selection(u,f))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values: `+f+` You passed in: '`+this.raw_options[l]+"'");return u},m.prototype._is_valid_selection=function(l,f){return l.length&&f.length&&!l.some(function(o){return f.indexOf(o)===-1})};function p(l,f){var o={};l=h(l);var u;for(u in l)u!==f&&(o[u]=l[u]);if(f&&l[f])for(u in l[f])o[u]=l[f][u];return o}function h(l){var f={},o;for(o in l){var u=o.replace(/-/g,"_");f[u]=l[o]}return f}v.exports.Options=m,v.exports.normalizeOpts=h,v.exports.mergeOpts=p},,function(v){var m=RegExp.prototype.hasOwnProperty("sticky");function p(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&h=0&&l=h.length&&this.__input.substring(l-h.length,l).toLowerCase()===h},v.exports.InputScanner=p},function(v,m,p){var h=p(8).InputScanner,l=p(3).Token,f=p(10).TokenStream,o=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,O){this._input=new h(a),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var a,O=new l(u.START,""),E=null,w=[],D=new f;O.type!==u.EOF;){for(a=this._get_next_token(O,E);this._is_comment(a);)D.add(a),a=this._get_next_token(O,E);D.isEmpty()||(a.comments_before=D,D=new f),a.parent=E,this._is_opening(a)?(w.push(E),E=a):E&&this._is_closing(a,E)&&(a.opened=E,E.closed=a,E=w.pop(),a.parent=E),a.previous=O,O.next=a,this.__tokens.add(a),O=a}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(a,O){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(u.RAW,E):this._create_token(u.EOF,"")},s.prototype._is_comment=function(a){return!1},s.prototype._is_opening=function(a){return!1},s.prototype._is_closing=function(a,O){return!1},s.prototype._create_token=function(a,O){var E=new l(a,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=s,v.exports.TOKEN=u},function(v){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&p/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new h,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},f.prototype.read_options=function(o){var u=this._create();for(var s in l)u._disabled[s]=o.templating.indexOf(s)===-1;return u._update(),u},f.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},f.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),o+=u,u=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},f.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},f.prototype._read_template=function(){var o="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},v.exports.TemplatablePattern=f},,,,function(v,m,p){var h=p(19).Beautifier,l=p(20).Options;function f(o,u,s,a){var O=new h(o,u,s,a);return O.beautify()}v.exports=f,v.exports.defaultOptions=function(){return new l}},function(v,m,p){var h=p(20).Options,l=p(2).Output,f=p(21).Tokenizer,o=p(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(S,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new l(S,y)};a.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},a.prototype.set_space_before_token=function(S,y){this._output.space_before_token=S,this._output.non_breaking_space=y},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},a.prototype.print_preserved_newlines=function(S){var y=0;S.type!==o.TEXT&&S.previous.type!==o.TEXT&&(y=S.newlines?1:0),this.preserve_newlines&&(y=S.newlines0);return y!==0},a.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(S){this._output.add_new_line(S)},a.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var O=function(S){for(var y=null,b=S.next;b.type!==o.EOF&&S.closed!==b;){if(b.type===o.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===o.EQUALS&&b.next.next&&b.next.next.type===o.VALUE&&(y=b.next.next.text);break}b=b.next}return y},E=function(S,y){var b=null,B=null;return y.closed?(S==="script"?b="text/javascript":S==="style"&&(b="text/css"),b=O(y)||b,b.search("text/css")>-1?B="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":b.search(/test\/null/)>-1&&(B="null"),B):null};function w(S,y){return y.indexOf(S)!==-1}function D(S,y,b){this.parent=S||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function L(S){this._printer=S,this._current_frame=null}L.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},L.prototype.record_tag=function(S){var y=new D(this._current_frame,S,this._printer.indent_level);this._current_frame=y},L.prototype._try_pop_frame=function(S){var y=null;return S&&(y=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),y},L.prototype._get_frame=function(S,y){for(var b=this._current_frame;b&&!(S.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},L.prototype.try_pop=function(S,y){var b=this._get_frame([S],y);return this._try_pop_frame(b)},L.prototype.indent_to_tag=function(S){var y=this._get_frame(S);y&&(this._printer.indent_level=y.indent_level)};function A(S,y,b,B){this._source_text=S||"",y=y||{},this._js_beautify=b,this._css_beautify=B,this._tag_stack=null;var F=new h(y,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}A.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=` `,S&&u.test(S)&&(y=S.match(u)[0])),S=S.replace(s,` `);var b=S.match(/^[\t ]*/)[0],B={text:"",type:""},F=new C,_=new a(this._options,b),M=new f(S,this._options).tokenize();this._tag_stack=new L(_);for(var I=null,g=M.next();g.type!==o.EOF;)g.type===o.TAG_OPEN||g.type===o.COMMENT?(I=this._handle_tag_open(_,g,F,B),F=I):g.type===o.ATTRIBUTE||g.type===o.EQUALS||g.type===o.VALUE||g.type===o.TEXT&&!F.tag_complete?I=this._handle_inside_tag(_,g,F,M):g.type===o.TAG_CLOSE?I=this._handle_tag_close(_,g,F):g.type===o.TEXT?I=this._handle_text(_,g,F):_.add_raw_token(g),B=I,g=M.next();var H=_._output.get_code(y);return H},A.prototype._handle_tag_close=function(S,y,b){var B={text:y.text,type:y.type};return S.alignment_size=0,b.tag_complete=!0,S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?S.add_raw_token(y):(b.tag_start_char==="<"&&(S.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(S.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&S.set_wrap_point(),B},A.prototype._handle_inside_tag=function(S,y,b,B){var F=b.has_wrapped_attrs,_={text:y.text,type:y.type};if(S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)S.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===o.TEXT)S.print_preserved_newlines(y)?(y.newlines=0,S.add_raw_token(y)):S.print_token(y);else{if(y.type===o.ATTRIBUTE?(S.set_space_before_token(!0),b.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&S.set_space_before_token(!1),y.type===o.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var M=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var I=!0,g=0,H;do{if(H=B.peek(g),H.type===o.ATTRIBUTE){I=!1;break}g+=1}while(g<4&&H.type!==o.EOF&&H.type!==o.TAG_CLOSE);M=!I}M&&(S.print_newline(!1),F=!0)}S.print_token(y),F=F||S.previous_token_wrapped(),b.has_wrapped_attrs=F}return _},A.prototype._handle_text=function(S,y,b){var B={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(S,y,b):b.is_unformatted||b.is_content_unformatted?S.add_raw_token(y):(S.traverse_whitespace(y),S.print_token(y)),B},A.prototype._print_custom_beatifier_text=function(S,y,b){var B=this;if(y.text!==""){var F=y.text,_,M=1,I="",g="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?_=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?_=this._css_beautify:b.custom_beautifier_name==="html"&&(_=function(ye,Te){var Re=new A(ye,Te,B._js_beautify,B._css_beautify);return Re.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-S.indent_level);var H=S.get_full_indent(M);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(|]]>)$/.exec(F);if(!$){S.add_raw_token(y);return}I=H+$[1]+` `,F=$[4],$[5]&&(g=H+$[5]),F=F.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(` `)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(F)if(_){var ne=function(){this.eol=` `};ne.prototype=this._options.raw_options;var oe=new ne;F=_(H+F,oe)}else{var Oe=y.whitespace_before;Oe&&(F=F.replace(new RegExp(` (`+Oe+")?","g"),` `)),F=H+F.replace(/\n/g,` `+H)}I&&(F?F=I+F+` `+g:F=I+g),S.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,S.add_raw_token(y),S.print_newline(!0))}},A.prototype._handle_tag_open=function(S,y,b,B){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};A.prototype._get_tag_open_token=function(S){var y=new C(this._tag_stack.get_parser_token(),S);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||w(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&w(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&w(y.tag_check,this._options.content_unformatted),y.is_inline_element=w(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},A.prototype._set_tag_position=function(S,y,b,B,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=E(b.tag_check,y)))),w(b.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var _=S.current_line_has_match(/{{#if/);_||S.print_newline(!1)}b.tag_name==="!--"&&F.type===o.TAG_CLOSE&&B.is_end_tag&&b.text.indexOf(` `)===-1||(b.is_inline_element||b.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,b))}else if(b.is_end_tag){var M=!1;M=b.start_tag_token&&b.start_tag_token.multiline_content,M=M||!b.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(F.type===o.TAG_CLOSE&&b.start_tag_token===B)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(M=!1),M&&S.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,b)},A.prototype._calcluate_parent_multiline=function(S,y){y.parent&&S._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var x=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],d=["a","audio","del","ins","map","noscript","video"];A.prototype._do_optional_end_element=function(S){var y=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(S.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&x.indexOf(S.tag_name)!==-1){var b=S.parent.parent;(!b||d.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):S.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(S.tag_name==="th"||S.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return S.parent=this._tag_stack.get_parser_token(),y},v.exports.Beautifier=A},function(v,m,p){var h=p(6).Options;function l(f){h.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}l.prototype=new h,v.exports.Options=l},function(v,m,p){var h=p(9).Tokenizer,l=p(9).TOKEN,f=p(13).Directives,o=p(14).TemplatablePattern,u=p(12).Pattern,s={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},a=new f(/<\!--/,/-->/),O=function(E,w){h.call(this,E,w),this._current_tag_name="";var D=new o(this._input).read_options(this._options),L=new u(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:L.starting_with(/{{!--/).until_after(/--}}/),handlebars:L.starting_with(/{{/).until_after(/}}/),handlebars_open:L.until(/[\n\r\t }]/),handlebars_raw_close:L.until(/}}/),comment:L.starting_with(//),cdata:L.starting_with(//),conditional_comment:L.starting_with(//),processing:L.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var A=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=L.matching(A).until_after(A)}};O.prototype=new h,O.prototype._is_comment=function(E){return!1},O.prototype._is_opening=function(E){return E.type===s.TAG_OPEN},O.prototype._is_closing=function(E,w){return E.type===s.TAG_CLOSE&&w&&((E.text===">"||E.text==="/>")&&w.text[0]==="<"||E.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(E,w){var D=null;this._readWhitespace();var L=this._input.peek();return L===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(L,w),D=D||this._read_attribute(L,E,w),D=D||this._read_close(L,w),D=D||this._read_raw_content(L,E,w),D=D||this._read_content_word(L),D=D||this._read_comment_or_cdata(L),D=D||this._read_processing(L),D=D||this._read_open(L,w),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},O.prototype._read_comment_or_cdata=function(E){var w=null,D=null,L=null;if(E==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(L=a.get_directives(D),L&&L.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(w=this._create_token(s.COMMENT,D),w.directives=L)}return w},O.prototype._read_processing=function(E){var w=null,D=null,L=null;if(E==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(w=this._create_token(s.COMMENT,D),w.directives=L)}return w},O.prototype._read_open=function(E,w){var D=null,L=null;return w||E==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),L=this._create_token(s.TAG_OPEN,D)),L},O.prototype._read_open_handlebars=function(E,w){var D=null,L=null;return w||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),L=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),L=this._create_token(s.TAG_OPEN,D))),L},O.prototype._read_close=function(E,w){var D=null,L=null;return w&&(w.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(D=this._input.next(),E==="/"&&(D+=this._input.next()),L=this._create_token(s.TAG_CLOSE,D)):w.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),L=this._create_token(s.TAG_CLOSE,"}}"))),L},O.prototype._read_attribute=function(E,w,D){var L=null,A="";if(D&&D.text[0]==="<")if(E==="=")L=this._create_token(s.EQUALS,this._input.next());else if(E==='"'||E==="'"){var C=this._input.next();E==='"'?C+=this.__patterns.double_quote.read():C+=this.__patterns.single_quote.read(),L=this._create_token(s.VALUE,C)}else A=this.__patterns.attribute.read(),A&&(w.type===s.EQUALS?L=this._create_token(s.VALUE,A):L=this._create_token(s.ATTRIBUTE,A));return L},O.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},O.prototype._read_raw_content=function(E,w,D){var L="";if(D&&D.text[0]==="{")L=this.__patterns.handlebars_raw_close.read();else if(w.type===s.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var A=w.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var C=this._read_comment_or_cdata(E);if(C)return C.type=s.TEXT,C;L=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(A)&&(L=this._input.readUntil(new RegExp("","ig")))}return L?this._create_token(s.TEXT,L):null},O.prototype._read_content_word=function(E){var w="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(s.TEXT,w)},v.exports.Tokenizer=O,v.exports.TOKEN=s}],G={};function r(v){var m=G[v];if(m!==void 0)return m.exports;var p=G[v]={exports:{}};return K[v](p,p.exports,r),p.exports}var R=r(18);P=R})();var X=P;if(!0)!(ie=[Z,Z("6UM0"),Z("TXwP")],J=function(K){var G=Z("6UM0"),r=Z("TXwP");return{html_beautify:function(R,v){return X(R,v,G.js_beautify,r.css_beautify)}}}.apply(_e,ie),J!==void 0&&(rt.exports=J));else var j,U})()},"rAM+":function(rt,_e,Z){"use strict";Z.d(_e,"a",function(){return J});var ie=Z("Qw5x");function J(P,X){var j;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(j=Object(ie.a)(P))||X&&P&&typeof P.length=="number"){j&&(P=j);var U=0,K=function(){};return{s:K,n:function(){return U>=P.length?{done:!0}:{done:!1,value:P[U++]}},e:function(m){throw m},f:K}}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 G=!0,r=!1,R;return{s:function(){j=P[Symbol.iterator]()},n:function(){var m=j.next();return G=m.done,m},e:function(m){r=!0,R=m},f:function(){try{!G&&j.return!=null&&j.return()}finally{if(r)throw R}}}}},rUJ1:function(rt,_e){const Z=/[&<>"']/,ie=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},j=L=>X[L];function U(L,A){if(A){if(Z.test(L))return L.replace(ie,j)}else if(J.test(L))return L.replace(P,j);return L}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(L){return L.replace(K,(A,C)=>(C=C.toLowerCase(),C==="colon"?":":C.charAt(0)==="#"?C.charAt(1)==="x"?String.fromCharCode(parseInt(C.substring(2),16)):String.fromCharCode(+C.substring(1)):""))}const r=/(^|[^\[])\^/g;function R(L,A){L=L.source||L,A=A||"";const C={replace:(x,d)=>(d=d.source||d,d=d.replace(r,"$1"),L=L.replace(x,d),C),getRegex:()=>new RegExp(L,A)};return C}const v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(L,A,C){if(L){let x;try{x=decodeURIComponent(G(C)).replace(v,"").toLowerCase()}catch(d){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}A&&!m.test(C)&&(C=u(A,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(x){return null}return C}const h={},l=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(L,A){h[" "+L]||(l.test(L)?h[" "+L]=L+"/":h[" "+L]=E(L,"/",!0)),L=h[" "+L];const C=L.indexOf(":")===-1;return A.substring(0,2)==="//"?C?A:L.replace(f,"$1")+A:A.charAt(0)==="/"?C?A:L.replace(o,"$1")+A:L+A}const s={exec:function(){}};function a(L){let A=1,C,x;for(;A{let B=!1,F=y;for(;--F>=0&&b[F]==="\\";)B=!B;return B?"|":" |"}),x=C.split(/ \|/);let d=0;if(x.length>A)x.splice(A);else for(;x.length{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new p;j.a.add(m.ThemingContribution,h);function l(o){return h.onColorThemeChange(o)}class f extends P.a{constructor(o){super();this.themeService=o,this.theme=o.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(o){this.theme=o,this.updateStyles()}updateStyles(){}}},ulZh:function(rt,_e,Z){typeof window!="undefined"&&function(J,P){rt.exports=P()}(this,function(){return function(ie){var J={};function P(X){if(J[X])return J[X].exports;var j=J[X]={i:X,l:!1,exports:{}};return ie[X].call(j.exports,j,j.exports,P),j.l=!0,j.exports}return P.m=ie,P.c=J,P.d=function(X,j,U){P.o(X,j)||Object.defineProperty(X,j,{enumerable:!0,get:U})},P.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},P.t=function(X,j){if(j&1&&(X=P(X)),j&8)return X;if(j&4&&typeof X=="object"&&X&&X.__esModule)return X;var U=Object.create(null);if(P.r(U),Object.defineProperty(U,"default",{enumerable:!0,value:X}),j&2&&typeof X!="string")for(var K in X)P.d(U,K,function(G){return X[G]}.bind(null,K));return U},P.n=function(X){var j=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(j,"a",j),j},P.o=function(X,j){return Object.prototype.hasOwnProperty.call(X,j)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,J,P){"use strict";var X=Object.prototype.hasOwnProperty,j="~";function U(){}Object.create&&(U.prototype=Object.create(null),new U().__proto__||(j=!1));function K(v,m,p){this.fn=v,this.context=m,this.once=p||!1}function G(v,m,p,h,l){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new K(p,h||v,l),o=j?j+m:m;return v._events[o]?v._events[o].fn?v._events[o]=[v._events[o],f]:v._events[o].push(f):(v._events[o]=f,v._eventsCount++),v}function r(v,m){--v._eventsCount===0?v._events=new U:delete v._events[m]}function R(){this._events=new U,this._eventsCount=0}R.prototype.eventNames=function(){var m=[],p,h;if(this._eventsCount===0)return m;for(h in p=this._events)X.call(p,h)&&m.push(j?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},R.prototype.listeners=function(m){var p=j?j+m:m,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var l=0,f=h.length,o=new Array(f);l0},!1)}function v(m,p){for(var h={main:[p]},l={main:[]},f={main:{}};R(h);)for(var o=Object.keys(h),u=0;u=2*D/A||b<=F)return;var _=Number.POSITIVE_INFINITY,M;for(M=o.level-1;M>x;M--){var I=C[M].maxBitrate;if(_=D*I/(8*.8*y),_=b)return;var g=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+o.sn+(u?" part "+u.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+` Current BW estimate: `+(Object(X.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+b.toFixed(3)+` s Estimated load time for the next fragment: `+_.toFixed(3)+` s Time to underbuffer: `+F.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(L,w.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(U.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:w})},l.onFragLoaded=function(o,u){var s=u.frag,a=u.part;if(s.type===r.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var O=a?a.stats:s.stats,E=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[s.level],D=(w.loaded?w.loaded.bytes:0)+O.loaded,L=(w.loaded?w.loaded.duration:0)+E;w.loaded={bytes:D,duration:L},w.realBitrate=Math.round(8*D/L)}if(s.bitrateTest){var A={stats:O,frag:s,part:a,id:s.type};this.onFragBuffered(U.Events.FRAG_BUFFERED,A),s.bitrateTest=!1}}},l.onFragBuffered=function(o,u){var s=u.frag,a=u.part,O=a?a.stats:s.stats;if(O.aborted)return;if(s.type!==r.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var E=O.parsing.end-O.loading.start;this.bwEstimator.sample(E,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},l.onError=function(o,u){switch(u.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.maxAutoLevel,O=s.config,E=s.minAutoLevel,w=s.media,D=u?u.duration:o?o.duration:0,L=w?w.currentTime:0,A=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,x=(K.BufferHelper.bufferInfo(w,L,O.maxBufferHole).end-L)/A,d=this.findBestLevel(C,E,a,x,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(d>=0)return d;R.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=D?Math.min(D,O.maxStarvationDelay):O.maxStarvationDelay,y=O.abrBandWidthFactor,b=O.abrBandWidthUpFactor;if(!x){var B=this.bitrateTestDelay;if(B){var F=D?Math.min(D,O.maxLoadingDelay):O.maxLoadingDelay;S=F-B,R.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),y=b=1}}return d=this.findBestLevel(C,E,a,x+S,y,b),Math.max(d,0)},l.findBestLevel=function(o,u,s,a,O,E){for(var w,D=this.fragCurrent,L=this.partCurrent,A=this.lastLoadedFragLevel,C=this.hls.levels,x=C[A],d=!!(x!=null&&(w=x.details)!==null&&w!==void 0&&w.live),S=x==null?void 0:x.codecSet,y=L?L.duration:D?D.duration:0,b=s;b>=u;b--){var B=C[b];if(!B||S&&B.codecSet!==S)continue;var F=B.details,_=(L?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,M=void 0;b<=A?M=O*o:M=E*o;var I=C[b].maxBitrate,g=I*_/M;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(M)+"/"+I+"/"+_+"/"+a+"/"+g),M>I&&(!g||d&&!this.bitrateTestDelay||g0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=j.State.IDLE):(this.loadedmetadata=!1,this.state=j.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},A.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_TRACK:{var x,d=this.levels,S=this.trackId,y=d==null||((x=d[S])===null||x===void 0)?void 0:x.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=j.State.WAITING_INIT_PTS}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var b,B=performance.now(),F=this.retryDate;(!F||B>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=j.State.IDLE);break}case j.State.WAITING_INIT_PTS:{var _=this.waitingData;if(_){var M=_.frag,I=_.part,g=_.cache,H=_.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.FRAG_LOADING;var $=g.flush(),ne={frag:M,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ne),H&&D.prototype._handleFragmentLoadComplete.call(this,ne)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var oe=this.getLoadPosition(),Oe=K.BufferHelper.bufferInfo(this.mediaBuffer,oe,this.config.maxBufferHole),ye=Object(l.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,M);ye<0&&(u.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=j.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=j.State.IDLE)},A.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:x,S=d.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},A.doTickIdle=function(){var x,d,S=this.hls,y=this.levels,b=this.media,B=this.trackId,F=S.config;if(!y||!y[B])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var _=y[B],M=_.details;if(!M||M.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(M)){this.state=j.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(),$=this.audioSwitch;if(g>=H&&!$)return;if(!$&&this._streamEnded(I,M)){S.trigger(U.Events.BUFFER_EOS,{type:"audio"}),this.state=j.State.ENDED;return}var ne=M.fragments,oe=ne[0].start,Oe=I.end;if($){var ye=this.getLoadPosition();Oe=ye,M.PTSKnown&&yeoe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=oe+.05))}var Te=this.getNextFragment(Oe,M);if(!Te){this.bufferFlushed=!0;return}((x=Te.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((d=Te.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Te,M):this.loadFragment(Te,M,Oe)},A.getMaxBufferLength=function(){var x=D.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return d===null?x:Math.max(x,d.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(x,d){var S=d.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(y){return new r.Level(y)})},A.onAudioTrackSwitching=function(x,d){var S=!!d.url;this.trackId=d.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(E):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=j.State.IDLE):this.state=j.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(x,d){this.mainDetails=d.details},A.onAudioTrackLoaded=function(x,d){var S,y=this.levels,b=d.details,B=d.id;if(!y){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[B],_=0;if(b.live||(S=F.details)!==null&&S!==void 0&&S.live){var M=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!M)return;!F.details&&b.hasProgramDateTime&&M.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(b,M),_=b.fragments[0].start):_=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,_),this.state===j.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=j.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(x){var d,S=x.frag,y=x.part,b=x.payload,B=this.config,F=this.trackId,_=this.levels;if(!_){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var M=_[F];console.assert(M,"Audio track is defined on fragment load progress");var I=M.details;console.assert(I,"Audio track details are defined on fragment load progress");var g=B.defaultAudioCodec||M.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[S.cc],ne=(d=S.initSegment)===null||d===void 0?void 0:d.data;if($!==void 0){var oe=!1,Oe=y?y.index:-1,ye=Oe!==-1,Te=new h.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,b.byteLength,Oe,ye);H.push(b,ne,g,"",S,y,I.totalduration,oe,Te,$)}else{u.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+F);var Re=this.waitingData=this.waitingData||{frag:S,part:y,cache:new m.default,complete:!1},Le=Re.cache;Le.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=j.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,x)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(x,d){var S=d.tracks.audio;S&&(this.mediaBuffer=S.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},A.onFragBuffered=function(x,d){var S=d.frag,y=d.part;if(S.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(y?" p: "+y.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,y)},A.onError=function(x,d){switch(d.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,d);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==j.State.ERROR&&this.state!==j.State.STOPPED&&(this.state=d.fatal?j.State.ERROR:j.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var S=!0,y=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);y&&y.len>.5&&(S=!this.reduceMaxBufferLength(y.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},A.onBufferFlushed=function(x,d){var S=d.type;S===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(x){var d,S="audio",y=this.hls,b=x.remuxResult,B=x.chunkMeta,F=this.getCurrentContext(B);if(!F){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var _=F.frag,M=F.part,I=b.audio,g=b.text,H=b.id3,$=b.initSegment;if(this.fragContextChanged(_))return;if(this.state=j.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,_,B),y.trigger(U.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:S,tracks:$.tracks})),I){var ne=I.startPTS,oe=I.endPTS,Oe=I.startDTS,ye=I.endDTS;M&&(M.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ne,endPTS:oe,startDTS:Oe,endDTS:ye}),_.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ne,oe,Oe,ye),this.bufferFragmentData(I,_,M,B)}if(H!=null&&(d=H.samples)!==null&&d!==void 0&&d.length){var Te=s({frag:_,id:S},H);y.trigger(U.Events.FRAG_PARSING_METADATA,Te)}if(g){var Re=s({frag:_,id:S},g);y.trigger(U.Events.FRAG_PARSING_USERDATA,Re)}},A._bufferInitSegment=function(x,d,S){if(this.state!==j.State.PARSING)return;x.video&&delete x.video;var y=x.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(U.Events.BUFFER_CODECS,x);var b=y.initSegment;if(b!=null&&b.byteLength){var B={type:"audio",frag:d,part:null,chunkMeta:S,parent:d.type,data:b};this.hls.trigger(U.Events.BUFFER_APPENDING,B)}this.tick()},A.loadFragment=function(x,d,S){var y=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||y===G.FragmentState.NOT_LOADED||y===G.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):d.live&&!Object(X.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=j.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,x,d,S)))},A.completeAudioSwitch=function(){var x=this.hls,d=this.media,S=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(U.Events.AUDIO_TRACK_SWITCHED,{id:S})},L}(j.default);J.default=w},"./src/controller/audio-track-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/controller/base-playlist-controller.ts"),K=P("./src/types/loader.ts");function G(p,h){for(var l=0;l=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+o);var a=u[o],O=a.id,E=a.groupId,w=E===void 0?"":E,D=a.name,L=a.type,A=a.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:w,name:D,type:L,url:A}),a.details&&!a.details.live)return;var C=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(C)},l.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(o){for(var u=this.tracksInGroup,s=0;sh.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new j.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,j.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,h,l){var f=this,o=h.details,u=h.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||l!=null&&l.live){if(o.reloaded(l),l&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),l&&o.fragments.length>0&&Object(U.mergeDetails)(l,o),!this.canLoad||!o.live)return;var a,O=void 0,E=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var w=this.hls.config.lowLatencyMode,D=o.lastPartSn,L=o.endSN,A=o.lastPartIndex,C=A!==-1,x=D===L,d=w?0:A;C?(O=x?L+1:D,E=x?d:A+1):O=L+1;var S=o.age,y=S+o.ageHeader,b=Math.min(y-o.partTarget,o.targetduration*1.5);if(b>0){if(l&&b>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+b+" with playlist age: "+o.age),b=0;else{var B=Math.floor(b/o.targetduration);if(O+=B,E!==void 0){var F=Math.round(b%o.targetduration/o.partTarget);E+=F}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+b+" skip sn "+B+" to part "+E)}o.tuneInGoal=b}if(a=this.getDeliveryDirectives(o,h.deliveryDirectives,O,E),w||!x){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,h.deliveryDirectives,O,E);var _=Object(U.computeReloadInterval)(o,u);O!==void 0&&o.canBlockReload&&(_-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(a)},_)}else this.clearTimer()},v.getDeliveryDirectives=function(p,h,l,f){var o=Object(j.getSkipValue)(p,l);return h!=null&&h.skip&&p.deltaUpdateFailed&&(l=h.msn,f=h.part,o=j.HlsSkip.No),new j.HlsUrlParameters(l,f,o)},v.retryLoadingOrFail=function(p){var h=this,l=this.hls.config,f=this.retryCount-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},R}()},"./src/controller/base-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"State",function(){return L}),P.d(J,"default",function(){return A});var X=P("./src/polyfills/number.ts"),j=P("./src/task-loop.ts"),U=P("./src/controller/fragment-tracker.ts"),K=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts"),r=P("./src/events.ts"),R=P("./src/errors.ts"),v=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),l=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),u=P("./src/utils/time-ranges.ts"),s=P("./src/types/loader.ts");function a(C,x){for(var d=0;d$;(M0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(_),M.key.buffer,M.iv.buffer).then(function(g){var H=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:y,payload:g,stats:{tstart:I,tdecrypt:H}}),B.payload=g,B})}return B}).then(function(B){var F=b.fragCurrent,_=b.hls,M=b.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[y.level].details;console.assert(I,"Level details are defined when init segment is loaded");var g=y.stats;b.state=L.IDLE,b.fragLoadError=0,y.data=new Uint8Array(B.payload),g.parsing.start=g.buffering.start=self.performance.now(),g.parsing.end=g.buffering.end=self.performance.now(),B.frag===F&&_.trigger(r.Events.FRAG_BUFFERED,{stats:g,frag:F,part:null,id:y.type}),b.tick()}).catch(function(B){b.warn(B),b.resetFragmentLoading(y)})},d.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},d.fragBufferedComplete=function(y,b){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+u.default.toString(K.BufferHelper.getBuffered(B))),this.state=L.IDLE,this.tick()},d._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var B=y.frag,F=y.part,_=y.partsLoaded,M=!_||_.length===0||_.some(function(g){return!g}),I=new v.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,F?F.index:-1,!M);b.flush(I)},d._handleFragmentLoadProgress=function(y){},d._doFragLoad=function(y,b,B,F){var _=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(y.start,B||0),this.config.lowLatencyMode&&b){var M=b.partList;if(M&&F){B>y.end&&b.fragmentHint&&(y=b.fragmentHint);var I=this.getNextPart(M,y,B);if(I>-1){var g=M[I];return this.log("Loading part sn: "+y.sn+" p: "+g.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=g.start+g.duration,this.state=L.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,part:M[I],targetBufferTime:B}),this.doFragPartsLoad(y,M,I,F).catch(function(H){return _.handleFragLoadError(H)})}else if(!y.url||this.loadedEndOfParts(M,B))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(B.toFixed(3))),Object(X.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=L.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:y,targetBufferTime:B}),this.fragmentLoader.load(y,F).catch(function(H){return _.handleFragLoadError(H)})},d.doFragPartsLoad=function(y,b,B,F){var _=this;return new Promise(function(M,I){var g=[],H=function $(ne){var oe=b[ne];_.fragmentLoader.loadPart(y,oe,F).then(function(Oe){g[oe.index]=Oe;var ye=Oe.part;_.hls.trigger(r.Events.FRAG_LOADED,Oe);var Te=b[ne+1];if(Te&&Te.fragment===y)$(ne+1);else return M({frag:y,part:ye,partsLoaded:g})}).catch(I)};H(B)})},d.handleFragLoadError=function(y){var b=y.data;return b&&b.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(r.Events.ERROR,b),null},d._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==L.PARSING){this.fragCurrent||(this.state=L.IDLE);return}var B=b.frag,F=b.part,_=b.level,M=self.performance.now();B.stats.parsing.end=M,F&&(F.stats.parsing.end=M),this.updateLevelTiming(B,F,_,y.partial)},d.getCurrentContext=function(y){var b=this.levels,B=y.level,F=y.sn,_=y.part;if(!b||!b[B])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+B+". The current chunk will not be buffered."),null;var M=b[B],I=_>-1?Object(l.getPartWith)(M,F,_):null,g=I?I.fragment:Object(l.getFragmentWithSN)(M,F,this.fragCurrent);return g?{frag:g,part:I,level:M}:null},d.bufferFragmentData=function(y,b,B,F){if(!y||this.state!==L.PARSING)return;var _=y.data1,M=y.data2,I=_;if(_&&M&&(I=Object(m.appendUint8Array)(_,M)),!I||!I.length)return;var g={type:y.type,frag:b,part:B,chunkMeta:F,parent:b.type,data:I};this.hls.trigger(r.Events.BUFFER_APPENDING,g),y.dropped&&y.independent&&!B&&this.flushBufferGap(b)},d.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!K.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var B=b.currentTime,F=K.BufferHelper.bufferInfo(b,B,0),_=y.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,_*.25),I=Math.max(Math.min(y.start-M,F.end-M),B+M);y.start-I>M&&this.flushMainBuffer(I,y.start)},d.getFwdBufferInfo=function(y,b){var B=this.config,F=this.getLoadPosition();if(!Object(X.isFiniteNumber)(F))return null;var _=K.BufferHelper.bufferInfo(y,F,B.maxBufferHole);if(_.len===0&&_.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(F,b);if(M&&_.nextStart=B?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(y,b){var B,F,_=b.fragments,M=_.length;if(!M)return null;var I=this.config,g=_[0].start,H;if(b.live){var $=I.initialLiveManifestSize;if(M<$)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+$+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(b,_),this.startPosition=H?this.hls.liveSyncPosition||H.start:y)}else y<=g&&(H=_[0]);if(!H){var ne=I.lowLatencyMode?b.partEnd:b.fragmentEnd;H=this.getFragmentAtPosition(y,ne,b)}return(B=H)!==null&&B!==void 0&&B.initSegment&&!((F=H)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},d.getNextPart=function(y,b,B){for(var F=-1,_=!1,M=!0,I=0,g=y.length;I-1&&BB.start&&B.loaded},d.getInitialLiveFragment=function(y,b){var B=this.fragPrevious,F=null;if(B){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),F=Object(h.findFragmentByPDT)(b,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var _=B.sn+1;if(_>=y.startSN&&_<=y.endSN){var M=b[_-y.startSN];B.cc===M.cc&&(F=M,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,B.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(F=this.getFragmentAtPosition(I,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},d.getFragmentAtPosition=function(y,b,B){var F=this.config,_=this.fragPrevious,M=B.fragments,I=B.endSN,g=B.fragmentHint,H=F.maxFragLookUpTolerance,$=!!(F.lowLatencyMode&&B.partList&&g);$&&g&&!this.bitrateTest&&(M=M.concat(g),I=g.sn);var ne;if(yb-H?0:H;ne=Object(h.findFragmentByPTS)(_,M,y,oe)}else ne=M[M.length-1];if(ne){var Oe=ne.sn-B.startSN,ye=_&&ne.level===_.level,Te=M[Oe+1],Re=this.fragmentTracker.getState(ne);if(Re===U.FragmentState.BACKTRACKED){ne=null;for(var Le=Oe;M[Le]&&this.fragmentTracker.getState(M[Le])===U.FragmentState.BACKTRACKED;)_?ne=M[Le--]:ne=M[--Le];ne||(ne=Te)}else _&&ne.sn===_.sn&&!$&&(ye&&(ne.sn=M-b.maxFragLookUpTolerance&&_<=I;if(F!==null&&B.duration>F&&(_"+y.startSN+" prev-sn: "+(_?_.sn:"na")+" fragments: "+I),ne}return g},d.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},d.setStartPosition=function(y,b){var B=this.startPosition;if(B"+y))}}]),x}(j.default)},"./src/controller/buffer-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),K=P("./src/errors.ts"),G=P("./src/utils/buffer-helper.ts"),r=P("./src/utils/mediasource-helper.ts"),R=P("./src/loader/fragment.ts"),v=P("./src/controller/buffer-operation-queue.ts"),m=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function l(o){var u=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=u.hls,a=u.media,O=u.mediaSource;U.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(j.Events.MEDIA_ATTACHED,{media:a})),O&&O.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){U.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){U.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var f=l.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var u=this.hls;u.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(j.Events.BUFFER_RESET,this.onBufferReset,this),u.on(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(j.Events.BUFFER_EOS,this.onBufferEos,this),u.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(j.Events.FRAG_PARSED,this.onFragParsed,this),u.on(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(j.Events.BUFFER_RESET,this.onBufferReset,this),u.off(j.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(j.Events.BUFFER_EOS,this.onBufferEos,this),u.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(j.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(j.Events.FRAG_PARSED,this.onFragParsed,this),u.off(j.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(u,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,U.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(u,s){var a=this.media=s.media;if(a&&m){var O=this.mediaSource=new m;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(O),this._objectUrl=a.src}},f.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(U.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(O){U.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(a&&self.URL.revokeObjectURL(a),u.src===a?(u.removeAttribute("src"),u.load()):U.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(j.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var a=u.sourceBuffer[s];try{a&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(a),u.sourceBuffer[s]=void 0)}catch(O){U.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",O)}}),this._initSourceBuffer()},f.onBufferCodecs=function(u,s){var a=this,O=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(E){if(O){var w=a.tracks[E];if(w&&typeof w.buffer.changeType=="function"){var D=s[E],L=D.codec,A=D.levelCodec,C=D.container,x=(w.levelCodec||w.codec).replace(p,"$1"),d=(A||L).replace(p,"$1");if(x!==d){var S=C+";codecs="+(A||L);a.appendChangeType(E,S)}}}else a.pendingTracks[E]=s[E]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(u,s){var a=this,O=this.operationQueue,E={execute:function(){var D=a.sourceBuffer[u];D&&(U.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),D.changeType(s)),O.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){U.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};O.append(E,u)},f.onBufferAppending=function(u,s){var a=this,O=this.hls,E=this.operationQueue,w=this.tracks,D=s.data,L=s.type,A=s.frag,C=s.part,x=s.chunkMeta,d=x.buffering[L],S=self.performance.now();d.start=S;var y=A.stats.buffering,b=C?C.stats.buffering:null;y.start===0&&(y.start=S),b&&b.start===0&&(b.start=S);var B=w.audio,F=L==="audio"&&x.id===1&&(B==null?void 0:B.container)==="audio/mpeg",_={execute:function(){if(d.executeStart=self.performance.now(),F){var I=a.sourceBuffer[L];if(I){var g=A.start-I.timestampOffset;Math.abs(g)>=.1&&(U.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+g+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}a.appendExecutor(D,L)},onStart:function(){},onComplete:function(){var I=self.performance.now();d.executeEnd=d.end=I,y.first===0&&(y.first=I),b&&b.first===0&&(b.first=I);var g=a.sourceBuffer,H={};for(var $ in g)H[$]=G.BufferHelper.getBuffered(g[$]);a.appendError=0,a.hls.trigger(j.Events.BUFFER_APPENDED,{type:L,frag:A,part:C,chunkMeta:x,parent:A.type,timeRanges:H})},onError:function(I){U.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",I);var g={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?g.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,g.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>O.config.appendErrorMaxRetry&&(U.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),g.fatal=!0)),O.trigger(j.Events.ERROR,g)}};E.append(_,L)},f.onBufferFlushing=function(u,s){var a=this,O=this.operationQueue,E=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(j.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){U.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};s.type?O.append(E(s.type),s.type):this.getSourceBufferTypes().forEach(function(w){O.append(E(w),w)})},f.onFragParsed=function(u,s){var a=this,O=s.frag,E=s.part,w=[],D=E?E.elementaryStreams:O.elementaryStreams;D[R.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(D[R.ElementaryStreamTypes.AUDIO]&&w.push("audio"),D[R.ElementaryStreamTypes.VIDEO]&&w.push("video"));var L=function(){var C=self.performance.now();O.stats.buffering.end=C,E&&(E.stats.buffering.end=C);var x=E?E.stats:O.stats;a.hls.trigger(j.Events.FRAG_BUFFERED,{frag:O,part:E,stats:x,id:O.type})};w.length===0&&U.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(L,w)},f.onFragChanged=function(u,s){this.flushBackBuffer()},f.onBufferEos=function(u,s){var a=this,O=this.getSourceBufferTypes().reduce(function(E,w){var D=a.sourceBuffer[w];return(!s.type||s.type===w)&&(D&&!D.ended&&(D.ended=!0,U.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),E&&!!(!D||D.ended)},!0);O&&this.blockBuffers(function(){var E=a.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},f.onLevelUpdated=function(u,s){var a=s.details;if(!a.fragments.length)return;this.details=a,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var u=this.hls,s=this.details,a=this.media,O=this.sourceBuffer;if(!a||s===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var w=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(w)||w<0)return;var D=a.currentTime,L=s.levelTargetDuration,A=Math.max(w,L),C=Math.floor(D/L)*L-A;E.forEach(function(x){var d=O[x];if(d){var S=G.BufferHelper.getBuffered(d);S.length>0&&C>S.start(0)&&(u.trigger(j.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&u.trigger(j.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),u.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,a=this.media,O=this.mediaSource,E=u.fragments[0].start+u.totalduration,w=a.duration,D=Object(X.isFiniteNumber)(O.duration)?O.duration:0;u.live&&s.config.liveDurationInfinity?(U.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(u)):(E>D&&E>w||!Object(X.isFiniteNumber)(w))&&(U.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),O.duration=E)},f.updateSeekableRange=function(u){var s=this.mediaSource,a=u.fragments,O=a.length;if(O&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var E=Math.max(0,a[0].start),w=Math.max(E,E+u.totalduration);s.setLiveSeekableRange(E,w)}},f.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,O=Object.keys(a).length;if(O&&!u||O===2){this.createSourceBuffers(a),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(w){s.executeNext(w)})}},f.createSourceBuffers=function(u){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var E in u)if(!s[E]){var w=u[E];if(!w)throw Error("source buffer exists for track "+E+", however track does not");var D=w.levelCodec||w.codec,L=w.container+";codecs="+D;U.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var A=s[E]=a.addSourceBuffer(L),C=E;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[E]={buffer:A,codec:D,container:w.container,levelCodec:w.levelCodec,id:w.id},O++}catch(x){U.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:L})}}O&&this.hls.trigger(j.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(u){var s=this.operationQueue,a=s.current(u);a.onStart()},f._onSBUpdateEnd=function(u){var s=this.operationQueue,a=s.current(u);a.onComplete(),s.shiftAndExecuteNext(u)},f._onSBUpdateError=function(u,s){U.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(j.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var a=this.operationQueue.current(u);a&&a.onError(s)},f.removeExecutor=function(u,s,a){var O=this.media,E=this.mediaSource,w=this.operationQueue,D=this.sourceBuffer,L=D[u];if(!O||!E||!L){U.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(u);return}var A=Object(X.isFiniteNumber)(O.duration)?O.duration:Infinity,C=Object(X.isFiniteNumber)(E.duration)?E.duration:Infinity,x=Math.max(0,s),d=Math.min(a,A,C);d>x?(U.logger.log("[buffer-controller]: Removing ["+x+","+d+"] from the "+u+" SourceBuffer"),console.assert(!L.updating,u+" sourceBuffer must not be updating"),L.remove(x,d)):w.shiftAndExecuteNext(u)},f.appendExecutor=function(u,s){var a=this.operationQueue,O=this.sourceBuffer,E=O[s];if(!E){U.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}E.ended=!1,console.assert(!E.updating,s+" sourceBuffer must not be updating"),E.appendBuffer(u)},f.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){U.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var O=this.operationQueue,E=s.map(function(w){return O.appendBlocker(w)});Promise.all(E).then(function(){u(),s.forEach(function(w){var D=a.sourceBuffer[w];(!D||!D.updating)&&O.shiftAndExecuteNext(w)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(u,s,a){var O=this.sourceBuffer[u];if(!O)return;var E=a.bind(this,u);this.listeners[u].push({event:s,listener:E}),O.addEventListener(s,E)},f.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(a){s.removeEventListener(a.event,a.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return j});var X=P("./src/utils/logger.ts"),j=function(){function U(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var K=U.prototype;return K.append=function(r,R){var v=this.queues[R];v.push(r),v.length===1&&this.buffers[R]&&this.executeNext(R)},K.insertAbort=function(r,R){var v=this.queues[R];v.unshift(r),this.executeNext(R)},K.appendBlocker=function(r){var R,v=new Promise(function(p){R=p}),m={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,r),v},K.executeNext=function(r){var R=this.buffers,v=this.queues,m=R[r],p=v[r];if(p.length){var h=p[0];try{h.execute()}catch(l){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(l),(!m||!m.updating)&&(p.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},U}()},"./src/controller/cap-level-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts");function j(G,r){for(var R=0;R0&&this.mediaWidth>0){var v=this.hls.levels;if(v.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(v.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},r.getMaxLevel=function(v){var m=this,p=this.hls.levels;if(!p.length)return-1;var h=p.filter(function(l,f){return G.isLevelAllowed(f,m.restrictedLevels)&&f<=v});return this.clientRect=null,G.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var v=this.media,m={width:0,height:0};if(v){var p=v.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||v.width||0,m.height=p.bottom-p.top||v.height||0)}return this.clientRect=m,m},G.isLevelAllowed=function(v,m){return m===void 0&&(m=[]),m.indexOf(v)===-1},G.getMaxLevelByMediaSize=function(v,m,p){if(!v||!v.length)return-1;for(var h=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},l=v.length-1,f=0;f=m||o.height>=p)&&h(o,v[f+1])){l=f;break}}return l},U(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(m){}return v}}]),G}();J.default=K},"./src/controller/cmcd-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./src/events.ts"),j=P("./src/types/cmcd.ts"),U=P("./src/utils/buffer-helper.ts"),K=P("./src/utils/logger.ts");function G(l,f){for(var o=0;o=l.length?{done:!0}:{done:!1,value:l[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(l,f){if(!l)return;if(typeof l=="string")return m(l,f);var o=Object.prototype.toString.call(l).slice(8,-1);if(o==="Object"&&l.constructor&&(o=l.constructor.name),o==="Map"||o==="Set")return Array.from(l);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(l,f)}function m(l,f){(f==null||f>l.length)&&(f=l.length);for(var o=0,u=new Array(f);os&&(s=w.bitrate)}return s>0?s:NaN},f.getBufferLength=function(u){var s=this.hls.media,a=u===j.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var O=U.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return O.len*1e3},f.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,a=u||this.config.loader;return function(){function O(w){this.loader=void 0,this.loader=new a(w)}var E=O.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,L,A){s(D),this.loader.load(D,L,A)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},f.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,a=u||this.config.loader;return function(){function O(w){this.loader=void 0,this.loader=new a(w)}var E=O.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(D,L,A){s(D),this.loader.load(D,L,A)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},l.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},l.serialize=function(u){for(var s=[],a=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},O=function(F){return Math.round(F)},E=function(F){return O(F/100)*100},w=function(F){return encodeURIComponent(F)},D={br:O,d:O,bl:E,dl:E,mtp:E,nor:w,rtp:E,tb:O},L=Object.keys(u||{}).sort(),A=R(L),C;!(C=A()).done;){var x=C.value,d=u[x];if(!a(d))continue;if(x==="v"&&d===1)continue;if(x=="pr"&&d===1)continue;var S=D[x];S&&(d=S(d));var y=typeof d,b=void 0;x==="ot"||x==="sf"||x==="st"?b=x+"="+d:y==="boolean"?b=x:y==="number"?b=x+"="+d:b=x+"="+JSON.stringify(d),s.push(b)}return s.join(",")},l.toHeaders=function(u){for(var s=Object.keys(u),a={},O=["Object","Request","Session","Status"],E=[{},{},{},{}],w={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,L=s;DR){this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=R-this._requestLicenseFailureCount+1;U.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(s,a)}break}},l._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},l._requestLicense=function(o,u){U.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){U.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),O=this._createLicenseXhr(a,o,u);U.logger.log("Sending license request to URL: "+a);var E=this._generateLicenseRequestChallenge(s,o);O.send(E)}catch(w){U.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.KEY_SYSTEM_ERROR,details:j.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var o=this._media,u=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var s=u.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),a=u.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,s,a)},r(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();J.default=p},"./src/controller/fps-controller.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=function(){function K(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var G=K.prototype;return G.setStreamController=function(R){this.streamController=R},G.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(R,v){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},G.checkFPS=function(R,v,m){var p=performance.now();if(v){if(this.lastTime){var h=p-this.lastTime,l=m-this.lastDroppedFrames,f=v-this.lastDecodedFrames,o=1e3*l/h,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:l,currentDecoded:f,totalDroppedFrames:m}),o>0&&l>u.config.fpsDroppedMonitoringThreshold*f){var s=u.currentLevel;j.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=v}},G.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var v=R.getVideoPlaybackQuality();this.checkFPS(R,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},K}();J.default=U},"./src/controller/fragment-finders.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFragmentByPDT",function(){return U}),P.d(J,"findFragmentByPTS",function(){return K}),P.d(J,"fragmentWithinToleranceTest",function(){return G}),P.d(J,"pdtWithinToleranceTest",function(){return r}),P.d(J,"findFragWithCC",function(){return R});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/binary-search.ts");function U(v,m,p){if(m===null||!Array.isArray(v)||!v.length||!Object(X.isFiniteNumber)(m))return null;var h=v[0].programDateTime;if(m<(h||0))return null;var l=v[v.length-1].endProgramDateTime;if(m>=(l||0))return null;p=p||0;for(var f=0;fv&&p.start?-1:0}function r(v,m,p){var h=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,l=p.endProgramDateTime||0;return l-h>v}function R(v,m){return j.default.search(v,function(p){return p.ccm?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"FragmentState",function(){return U}),P.d(J,"FragmentTracker",function(){return K});var X=P("./src/events.ts"),j=P("./src/types/loader.ts"),U;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(U||(U={}));var K=function(){function R(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var v=R.prototype;return v._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,h){if(h===j.PlaylistLevelType.MAIN){var l=this.activeFragment,f=this.activeParts;if(!l)return null;if(f)for(var o=f.length;o--;){var u=f[o],s=u?u.end:l.appendedPTS;if(u.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=f.slice(o-9)),u}else if(l.start<=p&&l.appendedPTS!==void 0&&p<=l.appendedPTS)return l}return this.getBufferedFrag(p,h)},v.getBufferedFrag=function(p,h){for(var l=this.fragments,f=Object.keys(l),o=f.length;o--;){var u=l[f[o]];if((u==null?void 0:u.body.type)===h&&u.buffered){var s=u.body;if(s.start<=p&&p<=s.end)return s}}return null},v.detectEvictedFragments=function(p,h,l){var f=this;Object.keys(this.fragments).forEach(function(o){var u=f.fragments[o];if(!u)return;if(!u.buffered){u.body.type===l&&f.removeFragment(u.body);return}var s=u.range[p];if(!s)return;s.time.some(function(a){var O=!f.isTimeBuffered(a.startPTS,a.endPTS,h);return O&&f.removeFragment(u.body),O})})},v.detectPartialFragments=function(p){var h=this,l=this.timeRanges,f=p.frag,o=p.part;if(!l||f.sn==="initSegment")return;var u=r(f),s=this.fragments[u];if(!s)return;Object.keys(l).forEach(function(a){var O=f.elementaryStreams[a];if(!O)return;var E=l[a],w=o!==null||O.partial===!0;s.range[a]=h.getBufferedTimes(f,o,w,E)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},v.fragBuffered=function(p){var h=r(p),l=this.fragments[h];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},v.getBufferedTimes=function(p,h,l,f){for(var o={time:[],partial:l},u=h?h.start:p.start,s=h?h.end:p.end,a=p.minEndPTS||s,O=p.maxStartPTS||u,E=0;E=w&&a<=D){o.time.push({startPTS:Math.max(u,f.start(E)),endPTS:Math.min(s,f.end(E))});break}else if(uw)o.partial=!0,o.time.push({startPTS:Math.max(u,f.start(E)),endPTS:Math.min(s,f.end(E))});else if(s<=w)break}return o},v.getPartialFragment=function(p){var h=null,l,f,o,u=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(O){var E=a[O];if(!E)return;G(E)&&(f=E.body.start-s,o=E.body.end+s,p>=f&&p<=o&&(l=Math.min(p-f,o-p),u<=l&&(h=E.body,u=l)))}),h},v.getState=function(p){var h=r(p),l=this.fragments[h];return l?l.buffered?G(l)?U.PARTIAL:U.OK:l.backtrack?U.BACKTRACKED:U.APPENDING:U.NOT_LOADED},v.backtrack=function(p,h){var l=r(p),f=this.fragments[l];if(!f||f.backtrack)return null;var o=f.backtrack=h||f.loaded;return f.loaded=null,o},v.getBacktrackData=function(p){var h=r(p),l=this.fragments[h];if(l){var f,o=l.backtrack;if(o!=null&&(f=o.payload)!==null&&f!==void 0&&f.byteLength)return o;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,h,l){for(var f,o,u=0;u=f&&h<=o)return!0;if(h<=f)return!1}return!1},v.onFragLoaded=function(p,h){var l=h.frag,f=h.part;if(l.sn==="initSegment"||l.bitrateTest||f)return;var o=r(l);this.fragments[o]={body:l,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,h){var l=this,f=h.frag,o=h.part,u=h.timeRanges;if(f.type===j.PlaylistLevelType.MAIN)if(this.activeFragment=f,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(a){var O=u[a];if(l.detectEvictedFragments(a,O),!o)for(var E=0;Ep&&f.removeFragment(s)}})},v.removeFragment=function(p){var h=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[h]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function G(R){var v,m;return R.buffered&&(((v=R.range.video)===null||v===void 0?void 0:v.partial)||((m=R.range.audio)===null||m===void 0?void 0:m.partial))}function r(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"STALL_MINIMUM_DURATION_MS",function(){return G}),P.d(J,"MAX_START_GAP_JUMP",function(){return r}),P.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),P.d(J,"SKIP_BUFFER_RANGE_START",function(){return v}),P.d(J,"default",function(){return m});var X=P("./src/utils/buffer-helper.ts"),j=P("./src/errors.ts"),U=P("./src/events.ts"),K=P("./src/utils/logger.ts"),G=250,r=2,R=.1,v=.05,m=function(){function p(l,f,o,u){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=l,this.media=f,this.fragmentTracker=o,this.hls=u}var h=p.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(f){var o=this.config,u=this.media,s=this.stalled,a=u.currentTime,O=u.seeking,E=this.seeking&&!O,w=!this.seeking&&O;if(this.seeking=O,a!==f){if(this.moved=!0,s!==null){if(this.stallReported){var D=self.performance.now()-s;K.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||E)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var L=X.BufferHelper.bufferInfo(u,a,0),A=L.len>0,C=L.nextStart||0;if(!A&&!C)return;if(O){var x=L.len>r,d=!C||C-a>r&&!this.fragmentTracker.getPartialFragment(a);if(x||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,y=Math.max(C,L.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=b==null||((S=b.details)===null||S===void 0)?void 0:S.live,F=B?b.details.targetduration*2:r;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var _=self.performance.now();if(s===null){this.stalled=_;return}var M=_-s;!O&&M>=G&&this._reportStall(L.len);var I=X.BufferHelper.bufferInfo(u,a,o.maxBufferHole);this._tryFixBufferStall(I,M)},h._tryFixBufferStall=function(f,o){var u=this.config,s=this.fragmentTracker,a=this.media,O=a.currentTime,E=s.getPartialFragment(O);if(E){var w=this._trySkipBufferHole(E);if(w)return}f.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(f){var o=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+f+")"),o.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},h._trySkipBufferHole=function(f){for(var o=this.config,u=this.hls,s=this.media,a=s.currentTime,O=0,E=X.BufferHelper.getBuffered(s),w=0;w=O&&a.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,u)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;p.playbackRate=Math.min(w,Math.max(1,D))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},G(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,h=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:h?p.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var h=p.holdBack,l=p.partHoldBack,f=p.targetduration,o=this.config,u=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,O=this.hls.userConfig,E=a&&l||h;(O.liveSyncDuration||O.liveSyncDurationCount||E===0)&&(E=u!==void 0?u:s*f);var w=f,D=1;return E+Math.min(this.stallCount*D,w)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),h=this.targetLatency,l=this.levelDetails;if(p===null||h===null||l===null)return null;var f=l.edge,o=p-h-this.edgeStalled,u=f-l.totalduration,s=f-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(u,o),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var h=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-h,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,h=this.levelDetails;if(!p||!h)return 0;var l=p.buffered.length;return l?p.buffered.end(l-1):h.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return o});var X=P("./src/types/level.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),K=P("./src/utils/codecs.ts"),G=P("./src/controller/level-helper.ts"),r=P("./src/controller/base-playlist-controller.ts"),R=P("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var s=1;s0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var B=0;Bthis.hls.config.fragLoadingMaxRetry&&(x=w.frag.level)):x=w.frag.level}break;case U.ErrorDetails.LEVEL_LOAD_ERROR:case U.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),x=D.level),A=!0;break;case U.ErrorDetails.REMUX_ALLOC_ERROR:x=w.level,A=!0;break}x!==void 0&&this.recoverLevel(w,x,A,C)},a.recoverLevel=function(E,w,D,L){var A=E.details,C=this._levels[w];if(C.loadError++,D){var x=this.retryLoadingOrFail(E);if(x)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(L){var d=C.url.length;if(d>1&&C.loadError1){var L=(w.urlId+1)%D;this.warn("Switching to redundant URL-id "+L),this._levels.forEach(function(A){A.urlId=L}),this.level=E}},a.onFragLoaded=function(E,w){var D=w.frag;if(D!==void 0&&D.type===R.PlaylistLevelType.MAIN){var L=this._levels[D.level];L!==void 0&&(L.fragmentError=0,L.loadError=0)}},a.onLevelLoaded=function(E,w){var D,L=w.level,A=w.details,C=this._levels[L];if(!C){var x;this.warn("Invalid level index "+L),(x=w.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(A.deltaUpdateFailed=!0);return}L===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(L,w,C.details)):(D=w.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(E,w){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var L=-1,A=this.hls.audioTracks[w.id].groupId,C=0;C0){var L=D.urlId,A=D.url[L];if(E)try{A=E.addDirectives(A)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+w+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+L+" "+A),this.clearTimer(),this.hls.trigger(j.Events.LEVEL_LOADING,{url:A,level:w,id:L,deliveryDirectives:E||null})}},a.removeLevel=function(E,w){var D=function(C,x){return x!==w},L=this._levels.filter(function(A,C){return C!==E?!0:A.url.length>1&&w!==void 0?(A.url=A.url.filter(D),A.audioGroupIds&&(A.audioGroupIds=A.audioGroupIds.filter(D)),A.textGroupIds&&(A.textGroupIds=A.textGroupIds.filter(D)),A.urlId=0,!0):!1}).map(function(A,C){var x=A.details;return x!=null&&x.fragments&&x.fragments.forEach(function(d){d.level=C}),A});this._levels=L,this.hls.trigger(j.Events.LEVELS_UPDATED,{levels:L})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var w,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===E&&(w=D[E])!==null&&w!==void 0&&w.details)return;if(E<0||E>=D.length){var L=E<0;if(this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.OTHER_ERROR,details:U.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:L,reason:"invalid level idx"}),L)return;E=Math.min(E,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,C=D[A],x=D[E];this.log("switching to level "+E+" from "+A),this.currentLevelIndex=E;var d=v({},x,{level:E,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete d._urlId,this.hls.trigger(j.Events.LEVEL_SWITCHING,d);var S=x.details;if(!S||S.live){var y=this.switchParams(x.uri,C==null?void 0:C.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),s}(r.default)},"./src/controller/level-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"addGroupId",function(){return U}),P.d(J,"assignTrackIdsByGroup",function(){return K}),P.d(J,"updatePTS",function(){return G}),P.d(J,"updateFragPTSDTS",function(){return R}),P.d(J,"mergeDetails",function(){return v}),P.d(J,"mapPartIntersection",function(){return m}),P.d(J,"mapFragmentIntersection",function(){return p}),P.d(J,"adjustSliding",function(){return h}),P.d(J,"addSliding",function(){return l}),P.d(J,"computeReloadInterval",function(){return f}),P.d(J,"getFragmentWithSN",function(){return o}),P.d(J,"getPartWith",function(){return u});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts");function U(s,a,O){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(O);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(O);break}}function K(s){var a={};s.forEach(function(O){var E=O.groupId||"";O.id=a[E]=a[E]||0,a[E]++})}function G(s,a,O){var E=s[a],w=s[O];r(E,w)}function r(s,a){var O=a.startPTS;if(Object(X.isFiniteNumber)(O)){var E=0,w;a.sn>s.sn?(E=O-s.start,w=s):(E=s.start-O,w=a),w.duration!==E&&(w.duration=E)}else if(a.sn>s.sn){var D=s.cc===a.cc;D&&s.minEndPTS?a.start=s.start+(s.minEndPTS-s.start):a.start=s.start+s.duration}else a.start=Math.max(s.start-a.duration,0)}function R(s,a,O,E,w,D){var L=E-O;L<=0&&(j.logger.warn("Fragment should have a positive duration",a),E=O+a.duration,D=w+a.duration);var A=O,C=E,x=a.startPTS,d=a.endPTS;if(Object(X.isFiniteNumber)(x)){var S=Math.abs(x-O);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(S,a.deltaPTS):a.deltaPTS=S,A=Math.max(O,x),O=Math.min(O,x),w=Math.min(w,a.startDTS),C=Math.min(E,d),E=Math.max(E,d),D=Math.max(D,a.endDTS)}a.duration=E-O;var y=O-a.start;a.appendedPTS=E,a.start=a.startPTS=O,a.maxStartPTS=A,a.startDTS=w,a.endPTS=E,a.minEndPTS=C,a.endDTS=D;var b=a.sn;if(!s||bs.endSN)return 0;var B,F=b-s.startSN,_=s.fragments;for(_[F]=a,B=F;B>0;B--)r(_[B],_[B-1]);for(B=F;B<_.length-1;B++)r(_[B],_[B+1]);return s.fragmentHint&&r(_[_.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,y}function v(s,a){for(var O=null,E=s.fragments,w=E.length-1;w>=0;w--){var D=E[w].initSegment;if(D){O=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var L=0,A;if(p(s,a,function(B,F){B.relurl&&(L=B.cc-F.cc),Object(X.isFiniteNumber)(B.startPTS)&&Object(X.isFiniteNumber)(B.endPTS)&&(F.start=F.startPTS=B.startPTS,F.startDTS=B.startDTS,F.appendedPTS=B.appendedPTS,F.maxStartPTS=B.maxStartPTS,F.endPTS=B.endPTS,F.endDTS=B.endDTS,F.minEndPTS=B.minEndPTS,F.duration=B.endPTS-B.startPTS,F.duration&&(A=F),a.PTSKnown=a.alignedSliding=!0),F.elementaryStreams=B.elementaryStreams,F.loader=B.loader,F.stats=B.stats,F.urlId=B.urlId,B.initSegment&&(F.initSegment=B.initSegment,O=B.initSegment)}),O){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(B){var F;(!B.initSegment||B.initSegment.relurl===((F=O)===null||F===void 0?void 0:F.relurl))&&(B.initSegment=O)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(B){return!B}),a.deltaUpdateFailed)){j.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=a.skippedSegments;x--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var d=a.fragments;if(L){j.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S=E.length)return;l(a,E[O].start)}function l(s,a){if(a){for(var O=s.fragments,E=s.skippedSegments;E0&&w0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),C=x),this.state=j.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=j.State.STOPPED},L.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},L.doTick=function(){switch(this.state){case j.State.IDLE:this.doTickIdle();break;case j.State.WAITING_LEVEL:{var C,x=this.levels,d=this.level,S=x==null||((C=x[d])===null||C===void 0)?void 0:C.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=j.State.IDLE;break}break}case j.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),B=this.retryDate;(!B||b>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=j.State.IDLE)}break;default:break}this.onTickEnd()},L.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},L.doTickIdle=function(){var C,x,d=this.hls,S=this.levelLastLoaded,y=this.levels,b=this.media,B=d.config,F=d.nextLoadLevel;if(S===null||!b&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var _=y[F];this.level=d.nextLoadLevel=F;var M=_.details;if(!M||this.state===j.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==F){this.state=j.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,R.PlaylistLevelType.MAIN);if(I===null)return;var g=I.len,H=this.getMaxBufferLength(_.maxBitrate);if(g>=H)return;if(this._streamEnded(I,M)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,$),this.state=j.State.ENDED;return}var ne=I.end,oe=this.getNextFragment(ne,M);if(this.couldBacktrack&&!this.fragPrevious&&oe&&oe.sn!=="initSegment"){var Oe=oe.sn-M.startSN;Oe>1&&(oe=M.fragments[Oe-1],this.fragmentTracker.removeFragment(oe))}if(oe&&this.fragmentTracker.getState(oe)===r.FragmentState.OK&&this.nextLoadPosition>ne){var ye=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,ye,R.PlaylistLevelType.MAIN),oe=this.getNextFragment(this.nextLoadPosition,M)}if(!oe)return;oe.initSegment&&!oe.initSegment.data&&!this.bitrateTest&&(oe=oe.initSegment),((C=oe.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((x=oe.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(oe,M):this.loadFragment(oe,M,ne)},L.loadFragment=function(C,x,d){var S,y=this.fragmentTracker.getState(C);if(this.fragCurrent=C,y===r.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(C);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=r.FragmentState.NOT_LOADED}y===r.FragmentState.NOT_LOADED||y===r.FragmentState.PARTIAL?C.sn==="initSegment"?this._loadInitSegment(C):this.bitrateTest?(C.bitrateTest=!0,this.log("Fragment "+C.sn+" of level "+C.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(C)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,C,x,d)):y===r.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},L.getAppendedFrag=function(C){var x=this.fragmentTracker.getAppendedFrag(C,R.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},L.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,R.PlaylistLevelType.MAIN)},L.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},L.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},L.nextLevelSwitch=function(){var C=this.levels,x=this.media;if(x!=null&&x.readyState){var d,S=this.getAppendedFrag(x.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!x.paused&&C){var y=this.hls.nextLoadLevel,b=C[y],B=this.fragLastKbps;B&&this.fragCurrent?d=this.fragCurrent.duration*b.maxBitrate/(1e3*B)+1:d=0}else d=0;var F=this.getBufferedFrag(x.currentTime+d);if(F){var _=this.followingBufferedFrag(F);if(_){this.abortCurrentFrag();var M=_.maxStartPTS?_.maxStartPTS:_.start,I=_.duration,g=Math.max(F.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(g,Number.POSITIVE_INFINITY)}}}},L.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===j.State.KEY_LOADING&&(this.state=j.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},L.flushMainBuffer=function(C,x){w.prototype.flushMainBuffer.call(this,C,x,this.altAudio?"video":null)},L.onMediaAttached=function(C,x){w.prototype.onMediaAttached.call(this,C,x);var d=x.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,d,this.fragmentTracker,this.hls)},L.onMediaDetaching=function(){var C=this.media;C&&(C.removeEventListener("playing",this.onvplaying),C.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},L.onMediaPlaying=function(){this.tick()},L.onMediaSeeked=function(){var C=this.media,x=C?C.currentTime:null;Object(X.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},L.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},L.onManifestParsed=function(C,x){var d=!1,S=!1,y;x.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(d=!0),y.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=d&&S&&!Object(U.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},L.onLevelLoading=function(C,x){var d=this.levels;if(!d||this.state!==j.State.IDLE)return;var S=d[x.level];(!S.details||S.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(S.details))&&(this.state=j.State.WAITING_LEVEL)},L.onLevelLoaded=function(C,x){var d,S=this.levels,y=x.level,b=x.details,B=b.totalduration;if(!S){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+B);var F=this.fragCurrent;F&&(this.state===j.State.FRAG_LOADING||this.state===j.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==x.level&&F.loader&&(this.state=j.State.IDLE,F.loader.abort()));var _=S[y],M=0;if(b.live||(d=_.details)!==null&&d!==void 0&&d.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;M=this.alignPlaylists(b,_.details)}if(_.details=b,this.levelLastLoaded=y,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===j.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=j.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,M),this.tick()},L._handleFragmentLoadProgress=function(C){var x,d=C.frag,S=C.part,y=C.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var B=b[d.level],F=B.details;if(!F){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var _=B.videoCodec,M=F.PTSKnown||!F.live,I=(x=d.initSegment)===null||x===void 0?void 0:x.data,g=this._getAudioCodec(B),H=this.transmuxer=this.transmuxer||new m.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=S?S.index:-1,ne=$!==-1,oe=new p.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,y.byteLength,$,ne),Oe=this.initPTS[d.cc];H.push(y,I,g,_,d,S,F.totalduration,M,oe,Oe)},L.onAudioTrackSwitching=function(C,x){var d=this.altAudio,S=!!x.url,y=x.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;d&&B.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:y})}},L.onAudioTrackSwitched=function(C,x){var d=x.id,S=!!this.hls.audioTracks[d].url;if(S){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=S,this.tick()},L.onBufferCreated=function(C,x){var d=x.tracks,S,y,b=!1;for(var B in d){var F=d[B];if(F.id==="main"){if(y=B,S=F,B==="video"){var _=d[B];_&&(this.videoBuffer=_.buffer)}}else b=!0}b&&S?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},L.onFragBuffered=function(C,x){var d=x.frag,S=x.part;if(d&&d.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(S?" p: "+S.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===j.State.PARSED&&(this.state=j.State.IDLE);return}var y=S?S.stats:d.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,S)},L.onError=function(C,x){switch(x.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,x);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==j.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=j.State.ERROR):!x.levelRetry&&this.state===j.State.WAITING_LEVEL&&(this.state=j.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===j.State.PARSING||this.state===j.State.PARSED)){var d=!0,S=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);S&&S.len>.5&&(d=!this.reduceMaxBufferLength(S.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},L.checkBuffer=function(){var C=this.media,x=this.gapController;if(!C||!x||!C.readyState)return;var d=G.BufferHelper.getBuffered(C);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},L.onFragLoadEmergencyAborted=function(){this.state=j.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},L.onBufferFlushed=function(C,x){var d=x.type;if(d!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(d===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,d,R.PlaylistLevelType.MAIN)}},L.onLevelsUpdated=function(C,x){this.levels=x.levels},L.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},L.seekToStartPos=function(){var C=this.media,x=C.currentTime,d=this.startPosition;if(d>=0&&x0&&(b1&&C.seeking===!1){var d=C.currentTime;if(G.BufferHelper.isBuffered(C,d)?x=this.getAppendedFrag(d):G.BufferHelper.isBuffered(C,d+.1)&&(x=this.getAppendedFrag(d+.1)),x){var S=this.fragPlaying,y=x.level;(!S||x.sn!==S.sn||S.level!==y||x.urlId!==S.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:x}),(!S||S.level!==y)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=x)}}},u(D,[{key:"nextLevel",get:function(){var C=this.nextBufferedFrag;return C?C.level:-1}},{key:"currentLevel",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var x=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(j.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"SubtitleStreamController",function(){return s});var X=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/buffer-helper.ts"),K=P("./src/controller/fragment-finders.ts"),G=P("./src/utils/discontinuities.ts"),r=P("./src/controller/level-helper.ts"),R=P("./src/controller/fragment-tracker.ts"),v=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),p=P("./src/types/level.ts");function h(a,O){for(var E=0;E=x[y].start&&S<=x[y].end){d=x[y];break}var b=A.start+A.duration;d?d.end=b:(d={start:S,end:b},x.push(d)),this.fragmentTracker.fragBuffered(A)},E.onBufferFlushing=function(D,L){var A=L.startOffset,C=L.endOffset;if(A===0&&C!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,d=this.levels;if(!d.length||!d[x]||!d[x].details)return;var S=d[x].details,y=S.targetduration,b=C-y;if(b<=0)return;L.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(B){for(var F=0;F=S.length||x!==d||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(A=y.details)!==null&&A!==void 0&&A.live){var b=this.mainDetails;if(C.deltaUpdateFailed||!b)return;var B=b.fragments[0];if(!y.details)C.hasProgramDateTime&&b.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(C,b):B&&Object(r.addSliding)(C,B.start);else{var F=this.alignPlaylists(C,y.details);F===0&&B&&Object(r.addSliding)(C,B.start)}}if(y.details=C,this.levelLastLoaded=x,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var _=Object(K.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);_||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},E._handleFragmentLoadComplete=function(D){var L=D.frag,A=D.payload,C=L.decryptdata,x=this.hls;if(this.fragContextChanged(L))return;if(A&&A.byteLength>0&&C&&C.key&&C.iv&&C.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(A),C.key.buffer,C.iv.buffer).then(function(S){var y=performance.now();x.trigger(X.Events.FRAG_DECRYPTED,{frag:L,payload:S,stats:{tstart:d,tdecrypt:y}})})}},E.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var D,L=this.currentTrackId,A=this.levels;if(!A.length||!A[L]||!A[L].details)return;var C=A[L].details,x=C.targetduration,d=this.config,S=this.media,y=U.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-x,d.maxBufferHole),b=y.end,B=y.len,F=this.getMaxBufferLength()+x;if(B>F)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var _=C.fragments,M=_.length,I=C.edge,g,H=this.fragPrevious;if(b-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=p(this.media.textTracks);u.forEach(function(s){Object(j.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},f.onSubtitleTrackLoaded=function(u,s){var a=s.id,O=s.details,E=this.trackId,w=this.tracksInGroup[E];if(!w){this.warn("Invalid subtitle track id "+a);return}var D=w.details;w.details=s.details,this.log("subtitle track "+a+" loaded ["+O.startSN+"-"+O.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},f.onLevelLoading=function(u,s){this.switchLevel(s.level)},f.onLevelSwitching=function(u,s){this.switchLevel(s.level)},f.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var a=s.textGroupIds[s.urlId];if(this.groupId!==a){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(L){return!a||L.groupId===a});this.tracksInGroup=E;var w=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,D),w!==-1&&this.setSubtitleTrack(w,O)}},f.findTrackId=function(u){for(var s=this.tracksInGroup,a=0;a=O.length)return;this.clearTimer();var E=O[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,E){var w=E.id,D=E.groupId,L=D===void 0?"":D,A=E.name,C=E.type,x=E.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:L,name:A,type:C,url:x});var d=this.switchParams(E.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=p(this.media.textTracks),a=0;a=0&&(C[0]=Math.min(C[0],O),C[1]=Math.max(C[1],E),L=!0,x/(E-O)>.5))return}if(L||D.push([O,E]),this.config.renderTextTracksNatively){var d=this.captionsTracks[a];this.Cues.newCue(d,O,E,w)}else{var S=this.Cues.newCue(null,O,E,w);this.hls.trigger(j.Events.CUES_PARSED,{type:"captions",cues:S,track:a})}},u.onInitPtsFound=function(a,O){var E=this,w=O.frag,D=O.id,L=O.initPTS,A=O.timescale,C=this.unparsedVttFrags;D==="main"&&(this.initPTS[w.cc]=L,this.timescale[w.cc]=A),C.length&&(this.unparsedVttFrags=[],C.forEach(function(x){E.onFragLoaded(j.Events.FRAG_LOADED,x)}))},u.getExistingTrack=function(a){var O=this.media;if(O)for(var E=0;E>>8^A&255^99,R[w]=A,v[A]=w;var C=E[w],x=E[C],d=E[x],S=E[A]*257^A*16843008;p[w]=S<<24|S>>>8,h[w]=S<<16|S>>>16,l[w]=S<<8|S>>>24,f[w]=S,S=d*16843009^x*65537^C*257^w*16843008,u[A]=S<<24|S>>>8,s[A]=S<<16|S>>>16,a[A]=S<<8|S>>>24,O[A]=S,w?(w=C^E[E[E[d^C]]],D^=E[E[D]]):w=D=1}},G.expandKey=function(R){for(var v=this.uint8ArrayToUint32Array_(R),m=!0,p=0;p>>6)+1;var S=(a[O+2]&60)>>>2;if(S>d.length-1){s.trigger(U.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return L=(a[O+2]&1)<<2,L|=(a[O+3]&192)>>>6,X.logger.log("manifest codec:"+E+", ADTS type:"+w+", samplingIndex:"+S),/firefox/i.test(C)?S>=6?(w=5,A=new Array(4),D=S-3):(w=2,A=new Array(2),D=S):C.indexOf("android")!==-1?(w=2,A=new Array(2),D=S):(w=5,A=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&S>=6?D=S-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(S>=6&&L===1||/vivaldi/i.test(C))||!E&&L===1)&&(w=2,A=new Array(2)),D=S)),A[0]=w<<3,A[0]|=(S&14)>>1,A[1]|=(S&1)<<7,A[1]|=L<<3,w===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:d[S],channelCount:L,codec:"mp4a.40."+w,manifestCodec:x}}function G(s,a){return s[a]===255&&(s[a+1]&246)===240}function r(s,a){return s[a+1]&1?7:9}function R(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function v(s,a){return a+5=s.length)return!1;var E=R(s,a);if(E<=O)return!1;var w=a+E;return w===s.length||m(s,w)}return!1}function l(s,a,O,E,w){if(!s.samplerate){var D=K(a,O,E,w);if(!D)return;s.config=D.config,s.samplerate=D.samplerate,s.channelCount=D.channelCount,s.codec=D.codec,s.manifestCodec=D.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function f(s){return 1024*9e4/s}function o(s,a,O,E,w){var D=r(s,a),L=R(s,a);if(L-=D,L>0){var A=O+E*w;return{headerLength:D,frameLength:L,stamp:A}}}function u(s,a,O,E,w){var D=f(s.samplerate),L=o(a,O,E,w,D);if(L){var A=L.frameLength,C=L.headerLength,x=L.stamp,d=C+A,S=Math.max(0,O+d-a.length),y;S?(y=new Uint8Array(d-C),y.set(a.subarray(O+C,a.length),0)):y=a.subarray(O+C,O+d);var b={unit:y,pts:x};return S||s.samples.push(b),{sample:b,length:d,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"initPTSFn",function(){return R});var X=P("./src/polyfills/number.ts"),j=P("./src/demux/id3.ts"),U=P("./src/demux/dummy-demuxed-track.ts"),K=P("./src/utils/mp4-tools.ts"),G=P("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=v.prototype;return m.resetInitSegment=function(h,l,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,l){return!1},m.appendFrame=function(h,l,f){},m.demux=function(h,l){this.cachedData&&(h=Object(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var f=j.getID3Data(h,0),o=f?f.length:0,u,s,a=this._audioTrack,O=this._id3Track,E=f?j.getTimeStamp(f):void 0,w=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(E,l)),f&&f.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),s=this.initPTS;or?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,R=r>>3,r-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var R=Math.min(this.bitsAvailable,r),v=this.word>>>32-R;return r>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=r-R,R>0&&this.bitsAvailable?v<>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var R=8,v=8,m,p=0;p0?w.subarray(L,L+A):void 0},K=function(w,D){var L=0;return L=(w[D]&127)<<21,L|=(w[D+1]&127)<<14,L|=(w[D+2]&127)<<7,L|=w[D+3]&127,L},G=function(w,D){return X(w,D)&&K(w,D+6)+10<=w.length-D},r=function(w){for(var D=m(w),L=0;L>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(d);break;case 12:case 13:S=w[B++],b+=String.fromCharCode((d&31)<<6|S&63);break;case 14:S=w[B++],y=w[B++],b+=String.fromCharCode((d&15)<<12|(S&63)<<6|(y&63)<<0);break;default:}}return b},s={decodeTextFrame:l},a;function O(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/demux/base-audio-demuxer.ts"),j=P("./src/demux/id3.ts"),U=P("./src/utils/logger.ts"),K=P("./src/demux/mpegaudio.ts");function G(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,r(v,m)}function r(v,m){return r=Object.setPrototypeOf||function(h,l){return h.__proto__=l,h},r(v,m)}var R=function(v){G(m,v);function m(){return v.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(l,f,o){v.prototype.resetInitSegment.call(this,l,f,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(l){if(!l)return!1;for(var f=j.getID3Data(l,0)||[],o=f.length,u=l.length;o0},G.demux=function(R){var v=R,m=Object(j.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(X.appendUint8Array)(this.remainderData,R));var p=Object(X.segmentValidRange)(v);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=v;return{audioTrack:Object(j.dummyTrack)(),avcTrack:m,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.flush=function(){var R=Object(j.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(j.dummyTrack)(),avcTrack:R,id3Track:Object(j.dummyTrack)(),textTrack:Object(j.dummyTrack)()}},G.demuxSampleAes=function(R,v,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},K}();U.minProbeByteLength=1024,J.default=U},"./src/demux/mpegaudio.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"appendFrame",function(){return r}),P.d(J,"parseHeader",function(){return R}),P.d(J,"isHeaderPattern",function(){return v}),P.d(J,"isHeader",function(){return m}),P.d(J,"canParse",function(){return p}),P.d(J,"probe",function(){return h});var X=null,j=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],U=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function r(l,f,o,u,s){if(o+24>f.length)return;var a=R(f,o);if(a&&o+a.frameLength<=f.length){var O=a.samplesPerFrame*9e4/a.sampleRate,E=u+s*O,w={unit:f.subarray(o,o+a.frameLength),pts:E,dts:E};return l.config=[],l.channelCount=a.channelCount,l.samplerate=a.sampleRate,l.samples.push(w),{sample:w,length:a.frameLength,missing:0}}}function R(l,f){var o=l[f+1]>>3&3,u=l[f+1]>>1&3,s=l[f+2]>>4&15,a=l[f+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var O=l[f+2]>>1&1,E=l[f+3]>>6,w=o===3?3-u:u===3?3:4,D=j[w*14+s-1]*1e3,L=o===3?0:o===2?1:2,A=U[L*3+a],C=E===3?1:2,x=K[o][u],d=G[u],S=x*8*d,y=Math.floor(x*D/A+O)*d;if(X===null){var b=navigator.userAgent||"",B=b.match(/Chrome\/(\d+)/i);X=B?parseInt(B[1]):0}var F=!!X&&X<=87;return F&&u===2&&D>=224e3&&E===0&&(l[f+3]=l[f+3]|128),{sampleRate:A,channelCount:C,frameLength:y,samplesPerFrame:S}}}function v(l,f){return l[f]===255&&(l[f+1]&224)===224&&(l[f+1]&6)!==0}function m(l,f){return f+1=R.length){m();return}if(R[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(R,v,m,p),!p)return}},G.getAvcEncryptedData=function(R){for(var v=Math.floor((R.length-48)/160)*16+16,m=new Int8Array(v),p=0,h=32;h<=R.length-16;h+=160,p+=16)m.set(R.subarray(h,h+16),p);return m},G.getAvcDecryptedUnit=function(R,v){for(var m=new Uint8Array(v),p=0,h=32;h<=R.length-16;h+=160,p+=16)R.set(m.subarray(p,p+16),h);return R},G.decryptAvcSample=function(R,v,m,p,h,l){var f=Object(j.discardEPB)(h.data),o=this.getAvcEncryptedData(f),u=this;this.decryptBuffer(o.buffer,function(s){h.data=u.getAvcDecryptedUnit(f,s),l||u.decryptAvcSamples(R,v,m+1,p)})},G.decryptAvcSamples=function(R,v,m,p){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,m=0){if(v>=R.length){p();return}for(var h=R[v].units;!(m>=h.length);m++){var l=h[m];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(R,v,m,p,l,f),!f)return}}},K}();J.default=U},"./src/demux/transmuxer-interface.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h});var X=P("./node_modules/webworkify-webpack/index.js"),j=P.n(X),U=P("./src/events.ts"),K=P("./src/demux/transmuxer.ts"),G=P("./src/utils/logger.ts"),r=P("./src/errors.ts"),R=P("./src/utils/mediasource-helper.ts"),v=P("./node_modules/eventemitter3/index.js"),m=P.n(v),p=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function l(o,u,s,a){var O=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=u,this.onTransmuxComplete=s,this.onFlush=a;var E=o.config,w=function(x,d){d=d||{},d.frag=O.frag,d.id=O.id,o.trigger(x,d)};this.observer=new v.EventEmitter,this.observer.on(U.Events.FRAG_DECRYPTED,w),this.observer.on(U.Events.ERROR,w);var D={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},L=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var A;try{A=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),A.addEventListener("message",this.onwmsg),A.onerror=function(C){o.trigger(U.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:L,id:u,config:JSON.stringify(E)})}catch(C){G.logger.warn("Error in worker:",C),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,E,L,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,E,L,u)}var f=l.prototype;return f.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var a=this.observer;a&&a.removeAllListeners(),this.observer=null},f.push=function(u,s,a,O,E,w,D,L,A,C){var x=this;A.transmuxing.start=self.performance.now();var d=this.transmuxer,S=this.worker,y=w?w.start:E.start,b=E.decryptdata,B=this.frag,F=!(B&&E.cc===B.cc),_=!(B&&A.level===B.level),M=B?A.sn-B.sn:-1,I=this.part?A.part-this.part.index:1,g=!_&&(M===1||M===0&&I===1),H=self.performance.now();(_||M||E.stats.parsing.start===0)&&(E.stats.parsing.start=H),w&&(I||!g)&&(w.stats.parsing.start=H);var $=new K.TransmuxState(F,g,L,_,y);if(!g||F){G.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+` discontinuity: `+F+` trackSwitch: `+_+` contiguous: `+g+` accurateTimeOffset: `+L+` timeOffset: `+y);var ne=new K.TransmuxConfig(a,O,s,D,C);this.configureTransmuxer(ne)}if(this.frag=E,this.part=w,S)S.postMessage({cmd:"demux",data:u,decryptdata:b,chunkMeta:A,state:$},u instanceof ArrayBuffer?[u]:[]);else if(d){var oe=d.push(u,b,A,$);Object(K.isPromise)(oe)?oe.then(function(Oe){x.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(oe)}},f.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:u});else if(a){var E=a.flush(u);Object(K.isPromise)(E)?E.then(function(w){s.handleFlushResult(w,u)}):this.handleFlushResult(E,u)}},f.handleFlushResult=function(u,s){var a=this;u.forEach(function(O){a.handleTransmuxComplete(O)}),this.onFlush(s)},f.onWorkerMessage=function(u){var s=u.data,a=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,a.trigger(s.event,s.data);break}}},f.configureTransmuxer=function(u){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):a&&a.configure(u)},f.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},l}()},"./src/demux/transmuxer-worker.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return r});var X=P("./src/demux/transmuxer.ts"),j=P("./src/events.ts"),U=P("./src/utils/logger.ts"),K=P("./node_modules/eventemitter3/index.js"),G=P.n(K);function r(h){var l=new K.EventEmitter,f=function(u,s){h.postMessage({event:u,data:s})};l.on(j.Events.FRAG_DECRYPTED,f),l.on(j.Events.ERROR,f),h.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);h.transmuxer=new X.default(l,u.typeSupported,s,u.vendor,u.id),Object(U.enableLogs)(s.debug),f("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var a=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(X.isPromise)(a)?a.then(function(w){R(h,w)}):R(h,a);break}case"flush":{var O=u.chunkMeta,E=h.transmuxer.flush(O);Object(X.isPromise)(E)?E.then(function(w){m(h,w,O)}):m(h,E,O);break}default:break}})}function R(h,l){if(p(l.remuxResult))return;var f=[],o=l.remuxResult,u=o.audio,s=o.video;u&&v(f,u),s&&v(f,s),h.postMessage({event:"transmuxComplete",data:l},f)}function v(h,l){l.data1&&h.push(l.data1.buffer),l.data2&&h.push(l.data2.buffer)}function m(h,l,f){l.forEach(function(o){R(h,o)}),h.postMessage({event:"flush",data:f})}function p(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"isPromise",function(){return E}),P.d(J,"TransmuxConfig",function(){return w}),P.d(J,"TransmuxState",function(){return D});var X=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/crypt/decrypter.ts"),K=P("./src/demux/aacdemuxer.ts"),G=P("./src/demux/mp4demuxer.ts"),r=P("./src/demux/tsdemuxer.ts"),R=P("./src/demux/mp3demuxer.ts"),v=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),p=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),l=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(L){l.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var o=[{demux:r.default,remux:v.default},{demux:G.default,remux:m.default},{demux:K.default,remux:v.default},{demux:R.default,remux:v.default}],u=1024;o.forEach(function(L){var A=L.demux;u=Math.max(u,A.minProbeByteLength)});var s=function(){function L(C,x,d,S,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=C,this.typeSupported=x,this.config=d,this.vendor=S,this.id=y}var A=L.prototype;return A.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},A.push=function(x,d,S,y){var b=this,B=S.transmuxing;B.executeStart=f();var F=new Uint8Array(x),_=this.cache,M=this.config,I=this.currentTransmuxState,g=this.transmuxConfig;y&&(this.currentTransmuxState=y);var H=a(F,d);if(H&&H.method==="AES-128"){var $=this.getDecrypter();if(M.enableSoftwareAES){var ne=$.softwareDecrypt(F,H.key.buffer,H.iv.buffer);if(!ne)return B.executeEnd=f(),O(S);F=new Uint8Array(ne)}else return this.decryptionPromise=$.webCryptoDecrypt(F,H.key.buffer,H.iv.buffer).then(function(Pe){var je=b.push(Pe,null,S);return b.decryptionPromise=null,je}),this.decryptionPromise}var oe=y||I,Oe=oe.contiguous,ye=oe.discontinuity,Te=oe.trackSwitch,Re=oe.accurateTimeOffset,Le=oe.timeOffset,ce=g.audioCodec,he=g.videoCodec,re=g.defaultInitPts,fe=g.duration,se=g.initSegmentData;if((ye||Te)&&this.resetInitSegment(se,ce,he,fe),ye&&this.resetInitialTimestamp(re),Oe||this.resetContiguity(),this.needsProbing(F,ye,Te)){if(_.dataLength){var De=_.flush();F=Object(h.appendUint8Array)(De,F)}this.configureTransmuxer(F,g)}var Ne=this.transmux(F,H,Le,Re,S),Se=this.currentTransmuxState;return Se.contiguous=!0,Se.discontinuity=!1,Se.trackSwitch=!1,B.executeEnd=f(),Ne},A.flush=function(x){var d=this,S=x.transmuxing;S.executeStart=f();var y=this.decrypter,b=this.cache,B=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return d.flush(x)});var _=[],M=B.timeOffset;if(y){var I=y.flush();I&&_.push(this.push(I,null,x))}var g=b.dataLength;b.reset();var H=this.demuxer,$=this.remuxer;if(!H||!$)return g>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=f(),[O(x)];var ne=H.flush(M);return E(ne)?ne.then(function(oe){return d.flushRemux(_,oe,x),_}):(this.flushRemux(_,ne,x),_)},A.flushRemux=function(x,d,S){var y=d.audioTrack,b=d.avcTrack,B=d.id3Track,F=d.textTrack,_=this.currentTransmuxState,M=_.accurateTimeOffset,I=_.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var g=this.remuxer.remux(y,b,B,F,I,M,!0,this.id);x.push({remuxResult:g,chunkMeta:S}),S.transmuxing.executeEnd=f()},A.resetInitialTimestamp=function(x){var d=this.demuxer,S=this.remuxer;if(!d||!S)return;d.resetTimeStamp(x),S.resetTimeStamp(x)},A.resetContiguity=function(){var x=this.demuxer,d=this.remuxer;if(!x||!d)return;x.resetContiguity(),d.resetNextTimestamp()},A.resetInitSegment=function(x,d,S,y){var b=this.demuxer,B=this.remuxer;if(!b||!B)return;b.resetInitSegment(d,S,y),B.resetInitSegment(x,d,S)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(x,d,S,y,b){var B;return d&&d.method==="SAMPLE-AES"?B=this.transmuxSampleAes(x,d,S,y,b):B=this.transmuxUnencrypted(x,S,y,b),B},A.transmuxUnencrypted=function(x,d,S,y){var b=this.demuxer.demux(x,d,!1,!this.config.progressive),B=b.audioTrack,F=b.avcTrack,_=b.id3Track,M=b.textTrack,I=this.remuxer.remux(B,F,_,M,d,S,!1,this.id);return{remuxResult:I,chunkMeta:y}},A.transmuxSampleAes=function(x,d,S,y,b){var B=this;return this.demuxer.demuxSampleAes(x,d,S).then(function(F){var _=B.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,y,!1,B.id);return{remuxResult:_,chunkMeta:b}})},A.configureTransmuxer=function(x,d){for(var S=this.config,y=this.observer,b=this.typeSupported,B=this.vendor,F=d.audioCodec,_=d.defaultInitPts,M=d.duration,I=d.initSegmentData,g=d.videoCodec,H,$=0,ne=o.length;$0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(C=A),C}var O=function(A){return{remuxResult:{},chunkMeta:A}};function E(L){return"then"in L&&L.then instanceof Function}var w=function(A,C,x,d,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=A,this.videoCodec=C,this.initSegmentData=x,this.duration=d,this.defaultInitPts=S},D=function(A,C,x,d,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=A,this.contiguous=C,this.accurateTimeOffset=x,this.trackSwitch=d,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"discardEPB",function(){return O});var X=P("./src/demux/adts.ts"),j=P("./src/demux/mpegaudio.ts"),U=P("./src/demux/exp-golomb.ts"),K=P("./src/demux/id3.ts"),G=P("./src/demux/sample-aes.ts"),r=P("./src/events.ts"),R=P("./src/utils/mp4-tools.ts"),v=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},h=function(){function E(D,L,A){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=L,this.typeSupported=A}E.probe=function(L){var A=E.syncOffset(L);return A<0?!1:(A&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},E.syncOffset=function(L){for(var A=Math.min(1e3,L.length-3*188),C=0;C>4,ce=void 0;if(Le>1){if(ce=ye+5+L[ye+4],ce===ye+188)continue}else ce=ye+4;switch(Re){case B:Te&&(F&&(d=u(F))&&this.parseAVCPES(d,!1),F={data:[],size:0}),F&&(F.data.push(L.subarray(ce,ye+188)),F.size+=ye+188-ce);break;case _:Te&&(I&&(d=u(I))&&(y.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),I={data:[],size:0}),I&&(I.data.push(L.subarray(ce,ye+188)),I.size+=ye+188-ce);break;case M:Te&&(g&&(d=u(g))&&this.parseID3PES(d),g={data:[],size:0}),g&&(g.data.push(L.subarray(ce,ye+188)),g.size+=ye+188-ce);break;case 0:Te&&(ce+=L[ce]+1),ne=this._pmtId=f(L,ce);break;case ne:{Te&&(ce+=L[ce]+1);var he=o(L,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);B=he.avc,B>0&&(S.pid=B),_=he.audio,_>0&&(y.pid=_,y.isAAC=he.isAAC),M=he.id3,M>0&&(b.pid=M),H&&!$&&(v.logger.log("reparse from beginning"),H=!1,ye=Oe-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,y.pesData=I,b.pesData=g;var re={audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(re),re},w.flush=function(){var L=this.remainderData;this.remainderData=null;var A;return L?A=this.demux(L,-1,!1,!0):A={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(A),this.sampleAes?this.decrypt(A,this.sampleAes):A},w.extractRemainingSamples=function(L){var A=L.audioTrack,C=L.avcTrack,x=L.id3Track,d=C.pesData,S=A.pesData,y=x.pesData,b;d&&(b=u(d))?(this.parseAVCPES(b,!0),C.pesData=null):C.pesData=d,S&&(b=u(S))?(A.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),A.pesData=null):(S!=null&&S.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=S),y&&(b=u(y))?(this.parseID3PES(b),x.pesData=null):x.pesData=y},w.demuxSampleAes=function(L,A,C){var x=this.demux(L,C,!0,!this.config.progressive),d=this.sampleAes=new G.default(this.observer,this.config,A);return this.decrypt(x,d)},w.decrypt=function(L,A){return new Promise(function(C){var x=L.audioTrack,d=L.avcTrack;x.samples&&x.isAAC?A.decryptAacSamples(x.samples,0,function(){d.samples?A.decryptAvcSamples(d.samples,0,0,function(){C(L)}):C(L)}):d.samples&&A.decryptAvcSamples(d.samples,0,0,function(){C(L)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(L,A){var C=this,x=this._avcTrack,d=this.parseAVCNALu(L.data),S=!1,y=this.avcSample,b,B=!1;L.data=null,y&&d.length&&!x.audFound&&(s(y,x),y=this.avcSample=l(!1,L.pts,L.dts,"")),d.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=C.avcSample=l(!0,L.pts,L.dts,"")),S&&(y.debug+="NDR "),y.frame=!0;var _=F.data;if(B&&_.length>4){var M=new U.default(_).readSliceType();(M===2||M===4||M===7||M===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=C.avcSample=l(!0,L.pts,L.dts,"")),S&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,S&&y&&(y.debug+="SEI ");var I=new U.default(O(F.data));I.readUByte();for(var g=0,H=0,$=!1,ne=0;!$&&I.bytesAvailable>1;){g=0;do ne=I.readUByte(),g+=ne;while(ne===255);H=0;do ne=I.readUByte(),H+=ne;while(ne===255);if(g===4&&I.bytesAvailable!==0){$=!0;var oe=I.readUByte();if(oe===181){var Oe=I.readUShort();if(Oe===49){var ye=I.readUInt();if(ye===1195456820){var Te=I.readUByte();if(Te===3){for(var Re=I.readUByte(),Le=I.readUByte(),ce=31&Re,he=[Re,Le],re=0;re16){for(var fe=[],se=0;se<16;se++)fe.push(I.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&fe.push("-");for(var De=H-16,Ne=new Uint8Array(De),Se=0;Se=0){var I={data:L.subarray(_,y-x-1),type:M};S.push(I)}else{var g=this.getLastNalUnit();if(g&&(d&&y<=4-d&&(g.state&&(g.data=g.data.subarray(0,g.data.byteLength-d))),B=y-x-1,B>0)){var H=new Uint8Array(g.data.byteLength+B);H.set(g.data,0),H.set(L.subarray(0,B),g.data.byteLength),g.data=H,g.state=0}}y=0&&x>=0){var $={data:L.subarray(_,A),type:M,state:x};S.push($)}if(S.length===0){var ne=this.getLastNalUnit();if(ne){var oe=new Uint8Array(ne.data.byteLength+L.byteLength);oe.set(ne.data,0),oe.set(L,ne.data.byteLength),ne.data=oe}}return C.naluState=x,S},w.parseAACPES=function(L){var A=0,C=this._audioTrack,x=this.aacOverFlow,d=L.data;if(x){this.aacOverFlow=null;var S=x.sample.unit.byteLength,y=Math.min(x.missing,S),b=S-y;x.sample.unit.set(d.subarray(0,y),b),C.samples.push(x.sample),A=x.missing}var B,F;for(B=A,F=d.length;B1;){var S=new Uint8Array(d[0].length+d[1].length);S.set(d[0]),S.set(d[1],d[0].length),d[0]=S,d.splice(1,1)}D=d[0];var y=(D[0]<<16)+(D[1]<<8)+D[2];if(y===1){if(L=(D[4]<<8)+D[5],L&&L>E.size-6)return null;var b=D[7];b&192&&(C=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,b&64?(x=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-x>60*9e4&&(v.logger.warn(Math.round((C-x)/9e4)+"s delta between PTS and DTS, align them"),C=x)):x=C),A=D[8];var B=A+9;if(E.size<=B)return null;E.size-=B;for(var F=new Uint8Array(E.size),_=0,M=d.length;_I){B-=I;continue}else D=D.subarray(B),I-=B,B=0;F.set(D,w),w+=I}return L&&(L-=A+3),{data:F,pts:C,dts:x,len:L}}return null}function s(E,w){if(E.units.length&&E.frame){if(E.pts===void 0){var D=w.samples,L=D.length;if(L){var A=D[L-1];E.pts=A.pts,E.dts=A.dts}else{w.dropped++;return}}w.samples.push(E)}E.debug.length&&v.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function a(E,w){var D=E.length;if(D>0){if(w.pts>=E[D-1].pts)E.push(w);else for(var L=D-1;L>=0;L--)if(w.ptsC)return d;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,C=this.autoLevelCapping,x;return C===-1&&A&&A.length?x=A.length-1:x=C,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(A){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,A)}},{key:"audioTracks",get:function(){var A=this.audioTrackController;return A?A.audioTracks:[]}},{key:"audioTrack",get:function(){var A=this.audioTrackController;return A?A.audioTrack:-1},set:function(A){var C=this.audioTrackController;C&&(C.audioTrack=A)}},{key:"subtitleTracks",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var A=this.subtitleTrackController;return A?A.subtitleTrack:-1},set:function(A){var C=this.subtitleTrackController;C&&(C.subtitleTrack=A)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var A=this.subtitleTrackController;return A?A.subtitleDisplay:!1},set:function(A){var C=this.subtitleTrackController;C&&(C.subtitleDisplay=A)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(A){this.config.lowLatencyMode=A}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:l.hlsDefaultConfig},set:function(A){w.defaultConfig=A}}]),w}();E.defaultConfig=void 0},"./src/is-supported.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isSupported",function(){return U}),P.d(J,"changeTypeSupported",function(){return K});var X=P("./src/utils/mediasource-helper.ts");function j(){return self.SourceBuffer||self.WebKitSourceBuffer}function U(){var G=Object(X.getMediaSource)();if(!G)return!1;var r=j(),R=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!R&&!!v}function K(){var G,r=j();return typeof(r==null||((G=r.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return h}),P.d(J,"LoadError",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/errors.ts");function U(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,v(o,u)}function K(o){var u=typeof Map=="function"?new Map:void 0;return K=function(a){if(a===null||!R(a))return a;if(typeof a!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(a))return u.get(a);u.set(a,O)}function O(){return G(a,arguments,m(this).constructor)}return O.prototype=Object.create(a.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v(O,a)},K(o)}function G(o,u,s){return r()?G=Reflect.construct:G=function(O,E,w){var D=[null];D.push.apply(D,E);var L=Function.bind.apply(O,D),A=new L;return w&&v(A,w.prototype),A},G.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function R(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function v(o,u){return v=Object.setPrototypeOf||function(a,O){return a.__proto__=O,a},v(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(o)}var p=Math.pow(2,17),h=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=o.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(a,O){var E=this,w=a.url;if(!w)return Promise.reject(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var D=this.config,L=D.fLoader,A=D.loader;return new Promise(function(C,x){E.loader&&E.loader.destroy();var d=E.loader=a.loader=L?new L(D):new A(D),S=l(a),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};a.stats=d.stats,d.load(S,y,{onSuccess:function(B,F,_,M){E.resetLoader(a,d),C({frag:a,part:null,payload:B.data,networkDetails:M})},onError:function(B,F,_){E.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:B,networkDetails:_}))},onAbort:function(B,F,_){E.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:_}))},onTimeout:function(B,F,_){E.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:_}))},onProgress:function(B,F,_,M){O&&O({frag:a,part:null,payload:_,networkDetails:M})}})})},u.loadPart=function(a,O,E){var w=this;this.abort();var D=this.config,L=D.fLoader,A=D.loader;return new Promise(function(C,x){w.loader&&w.loader.destroy();var d=w.loader=a.loader=L?new L(D):new A(D),S=l(a,O),y={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:p};O.stats=d.stats,d.load(S,y,{onSuccess:function(B,F,_,M){w.resetLoader(a,d),w.updateStatsFromPart(a,O);var I={frag:a,part:O,payload:B.data,networkDetails:M};E(I),C(I)},onError:function(B,F,_){w.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:O,response:B,networkDetails:_}))},onAbort:function(B,F,_){a.stats.aborted=O.stats.aborted,w.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:O,networkDetails:_}))},onTimeout:function(B,F,_){w.resetLoader(a,d),x(new f({type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:O,networkDetails:_}))}})})},u.updateStatsFromPart=function(a,O){var E=a.stats,w=O.stats,D=w.total;if(E.loaded+=w.loaded,D){var L=Math.round(a.duration/O.duration),A=Math.min(Math.round(E.loaded/D),L),C=L-A,x=C*Math.round(E.loaded/A);E.total=E.loaded+x}else E.total=Math.max(E.loaded,E.total);var d=E.loading,S=w.loading;d.start?d.first+=S.first-S.start:(d.start=S.start,d.first=S.first),d.end=S.end},u.resetLoader=function(a,O){a.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},o}();function l(o,u){u===void 0&&(u=null);var s=u||o,a={frag:o,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},O=s.byteRangeStartOffset,E=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(O)&&Object(X.isFiniteNumber)(E)&&(a.rangeStart=O,a.rangeEnd=E),a}var f=function(o){U(u,o);function u(s){for(var a,O=arguments.length,E=new Array(O>1?O-1:0),w=1;w>8*(15-D)&255;return w},a.setDecryptDataFromLevelKey=function(E,w){var D=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(D=G.LevelKey.fromURI(E.uri),D.method=E.method,D.iv=this.createInitializationVector(w),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(E,w,D,L,A,C){C===void 0&&(C=!1);var x=this.elementaryStreams,d=x[E];if(!d){x[E]={startPTS:w,endPTS:D,startDTS:L,endDTS:A,partial:C};return}d.startPTS=Math.min(d.startPTS,w),d.endPTS=Math.max(d.endPTS,D),d.startDTS=Math.min(d.startDTS,L),d.endDTS=Math.max(d.endDTS,A)},a.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[h.AUDIO]=null,E[h.VIDEO]=null,E[h.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var E=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),s}(l),o=function(u){R(s,u);function s(a,O,E,w,D){var L;L=u.call(this,E)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new r.LoadStats,L.duration=a.decimalFloatingPoint("DURATION"),L.gap=a.bool("GAP"),L.independent=a.bool("INDEPENDENT"),L.relurl=a.enumeratedString("URI"),L.fragment=O,L.index=w;var A=a.enumeratedString("BYTERANGE");return A&&L.setByteRange(A,D),D&&(L.fragOffset=D.fragOffset+D.duration),L}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),s}(l)},"./src/loader/key-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return K});var X=P("./src/events.ts"),j=P("./src/errors.ts"),U=P("./src/utils/logger.ts"),K=function(){function G(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var r=G.prototype;return r._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var m=this.loaders[v];m&&m.destroy()}this.loaders={}},r.onKeyLoading=function(v,m){var p=m.frag,h=p.type,l=this.loaders[h];if(!p.decryptdata){U.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(l&&(U.logger.warn("abort previous key loader for type:"+h),l.abort()),!f){U.logger.warn("key uri is falsy");return}var u=o.loader,s=p.loader=this.loaders[h]=new u(o);this.decrypturl=f,this.decryptkey=null;var a={url:f,frag:p,responseType:"arraybuffer"},O={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,O,E)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,m,p){var h=p.frag;if(!h.decryptdata){U.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(v.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:h})},r.loaderror=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,m){var p=m.frag,h=p.loader;h&&h.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:j.ErrorTypes.NETWORK_ERROR,details:j.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},G}()},"./src/loader/level-details.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelDetails",function(){return G});var X=P("./src/polyfills/number.ts");function j(r,R){for(var v=0;vm.endSN||p>0||p===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},U(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"LevelKey",function(){return G});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),j=P.n(X);function U(r,R){for(var v=0;v2){var x=C.shift()+".";return x+=parseInt(C.shift()).toString(16),x+=("000"+parseInt(C.shift()).toString(16)).substr(-4),x}return A},D.resolve=function(A,C){return j.buildAbsoluteURL(C,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,C){var x=[],d={},S=!1;p.lastIndex=0;for(var y;(y=p.exec(A))!=null;)if(y[1]){var b=new R.AttrList(y[1]),B={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:D.resolve(y[2],C)},F=b.decimalResolution("RESOLUTION");F&&(B.width=F.width,B.height=F.height),a((b.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=D.convertAVC1ToAVCOTI(B.videoCodec)),x.push(B)}else if(y[3]){var _=new R.AttrList(y[3]);_["DATA-ID"]&&(S=!0,d[_["DATA-ID"]]=_)}return{levels:x,sessionData:S?d:null}},D.parseMasterPlaylistMedia=function(A,C,x,d){d===void 0&&(d=[]);var S,y=[],b=0;for(h.lastIndex=0;(S=h.exec(A))!==null;){var B=new R.AttrList(S[1]);if(B.TYPE===x){var F={attrs:B,bitrate:0,id:b++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:x,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?D.resolve(B.URI,C):""};if(d.length){var _=D.findGroup(d,F.groupId)||d[0];O(F,_,"audioCodec"),O(F,_,"textCodec")}y.push(F)}}return y},D.parseLevelPlaylist=function(A,C,x,d,S){var y=new G.LevelDetails(C),b=y.fragments,B=null,F=0,_=0,M=0,I=0,g=null,H=new K.Fragment(d,C),$,ne,oe,Oe=-1,ye=!1;for(l.lastIndex=0,y.m3u8=A;($=l.exec(A))!==null;){ye&&(ye=!1,H=new K.Fragment(d,C),H.start=M,H.sn=F,H.cc=I,H.level=x,B&&(H.initSegment=B,H.rawProgramDateTime=B.rawProgramDateTime));var Te=$[1];if(Te){H.duration=parseFloat(Te);var Re=(" "+$[2]).slice(1);H.title=Re||null,H.tagList.push(Re?["INF",Te,Re]:["INF",Te])}else if($[3])Object(X.isFiniteNumber)(H.duration)&&(H.start=M,oe&&(H.levelkey=oe),H.sn=F,H.level=x,H.cc=I,H.urlId=S,b.push(H),H.relurl=(" "+$[3]).slice(1),w(H,g),g=H,M+=H.duration,F++,_=0,ye=!0);else if($[4]){var Le=(" "+$[4]).slice(1);g?H.setByteRange(Le,g):H.setByteRange(Le)}else if($[5])H.rawProgramDateTime=(" "+$[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Oe===-1&&(Oe=b.length);else{if($=$[0].match(f),!$){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(ne=1;ne<$.length&&!(typeof $[ne]!="undefined");ne++);var ce=(" "+$[ne]).slice(1),he=(" "+$[ne+1]).slice(1),re=$[ne+2]?(" "+$[ne+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":y.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(he);break;case"SKIP":{var fe=new R.AttrList(he),se=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(se)){y.skippedSegments=se;for(var De=se;De--;)b.unshift(null);F+=se}var Ne=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(y.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(he);break;case"VERSION":y.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(he||re)&&H.tagList.push(re?[he,re]:[he]);break;case"DIS":I++;case"GAP":H.tagList.push([ce]);break;case"BITRATE":H.tagList.push([ce,he]);break;case"DISCONTINUITY-SEQ":I=parseInt(he);break;case"KEY":{var Se,Pe=new R.AttrList(he),je=Pe.enumeratedString("METHOD"),le=Pe.URI,ve=Pe.hexadecimalInteger("IV"),we=Pe.enumeratedString("KEYFORMATVERSIONS"),Ie=Pe.enumeratedString("KEYID"),We=(Se=Pe.enumeratedString("KEYFORMAT"))!=null?Se:"identity",Ve=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ve.indexOf(We)>-1){v.logger.warn("Keyformat "+We+" is not supported from the manifest");continue}else if(We!=="identity")continue;je&&(oe=r.LevelKey.fromURL(C,le),le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(je)>=0&&(oe.method=je,oe.keyFormat=We,Ie&&(oe.keyID=Ie),we&&(oe.keyFormatVersions=we),oe.iv=ve));break}case"START":{var Ze=new R.AttrList(he),$e=Ze.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)($e)&&(y.startTimeOffset=$e);break}case"MAP":{var st=new R.AttrList(he);H.relurl=st.URI,st.BYTERANGE&&H.setByteRange(st.BYTERANGE),H.level=x,H.sn="initSegment",oe&&(H.levelkey=oe),H.initSegment=null,B=H,ye=!0;break}case"SERVER-CONTROL":{var Qe=new R.AttrList(he);y.canBlockReload=Qe.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Qe.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Qe.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Qe.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var nt=new R.AttrList(he);y.partTarget=nt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Fe=y.partList;Fe||(Fe=y.partList=[]);var ot=_>0?Fe[Fe.length-1]:void 0,tt=_++,Be=new K.Part(new R.AttrList(he),H,C,tt,ot);Fe.push(Be),H.duration+=Be.duration;break}case"PRELOAD-HINT":{var He=new R.AttrList(he);y.preloadHint=He;break}case"RENDITION-REPORT":{var Ae=new R.AttrList(he);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Ae);break}default:v.logger.warn("line parsed but not handled: "+$);break}}}g&&!g.relurl?(b.pop(),M-=g.duration,y.partList&&(y.fragmentHint=g)):y.partList&&(w(H,g),H.cc=I,y.fragmentHint=H);var me=b.length,xe=b[0],ae=b[me-1];if(M+=y.skippedSegments*y.targetduration,M>0&&me&&ae){y.averagetargetduration=M/me;var ue=ae.sn;y.endSN=ue!=="initSegment"?ue:0,xe&&(y.startCC=xe.cc,xe.initSegment||y.fragments.every(function(de){return de.relurl&&u(de.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new K.Fragment(d,C),H.relurl=ae.relurl,H.level=x,H.sn="initSegment",xe.initSegment=H,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(M+=y.fragmentHint.duration),y.totalduration=M,y.endCC=I,Oe>0&&E(b,Oe),y},D}();function a(D,L){["video","audio","text"].forEach(function(A){var C=D.filter(function(d){return Object(m.isCodecType)(d,A)});if(C.length){var x=C.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});L[A+"Codec"]=x.length>0?x[0]:C[0],D=D.filter(function(d){return C.indexOf(d)===-1})}}),L.unknownCodecs=D}function O(D,L,A){var C=L[A];C&&(D[A]=C)}function E(D,L){for(var A=D[L],C=L;C--;){var x=D[C];if(!x)return;x.programDateTime=A.programDateTime-x.duration*1e3,A=x}}function w(D,L){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):L!=null&&L.programDateTime&&(D.programDateTime=L.endProgramDateTime),Object(X.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/polyfills/number.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),K=P("./src/utils/logger.ts"),G=P("./src/utils/mp4-tools.ts"),r=P("./src/loader/m3u8-parser.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/attr-list.ts");function m(l){var f=l.type;switch(f){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function p(l,f){var o=l.url;return(o===void 0||o.indexOf("data:")===0)&&(o=f.url),o}var h=function(){function l(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var f=l.prototype;return f.registerListeners=function(){var u=this.hls;u.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var u=this.hls;u.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(j.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(j.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,O=s.loader,E=a||O,w=new E(s);return u.loader=w,this.loaders[u.type]=w,w},f.getInternalLoader=function(u){return this.loaders[u.type]},f.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},f.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(u,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},f.onLevelLoading=function(u,s){var a=s.id,O=s.level,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:null,level:O,responseType:"text",type:R.PlaylistContextType.LEVEL,url:E,deliveryDirectives:w})},f.onAudioTrackLoading=function(u,s){var a=s.id,O=s.groupId,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:w})},f.onSubtitleTrackLoading=function(u,s){var a=s.id,O=s.groupId,E=s.url,w=s.deliveryDirectives;this.load({id:a,groupId:O,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:w})},f.load=function(u){var s,a=this.hls.config,O=this.getInternalLoader(u);if(O){var E=O.context;if(E&&E.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),O.abort()}var w,D,L,A;switch(u.type){case R.PlaylistContextType.MANIFEST:w=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,L=a.manifestLoadingRetryDelay,A=a.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:w=0,D=a.levelLoadingTimeOut;break;default:w=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,L=a.levelLoadingRetryDelay,A=a.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var C;if(u.type===R.PlaylistContextType.LEVEL&&u.level!==null?C=this.hls.levels[u.level].details:u.type===R.PlaylistContextType.AUDIO_TRACK&&u.id!==null?C=this.hls.audioTracks[u.id].details:u.type===R.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(C=this.hls.subtitleTracks[u.id].details),C){var x=C.partTarget,d=C.targetduration;x&&d&&(D=Math.min(Math.max(x*3,d*.8)*1e3,D))}}var S={timeout:D,maxRetry:w,retryDelay:L,maxRetryDelay:A,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(u,S,y)},f.loadsuccess=function(u,s,a,O){if(O===void 0&&(O=null),a.isSidxRequest){this.handleSidxRequest(u,a),this.handlePlaylistLoaded(u,s,a,O);return}this.resetInternalLoader(a.type);var E=u.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",O);return}s.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,a,O):this.handleMasterPlaylist(u,s,a,O)},f.loaderror=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,u)},f.loadtimeout=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},f.handleMasterPlaylist=function(u,s,a,O){var E=this.hls,w=u.data,D=p(u,a),L=r.default.parseMasterPlaylist(w,D),A=L.levels,C=L.sessionData;if(!A.length){this.handleManifestParsingError(u,a,"no level found in manifest",O);return}var x=A.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),d=A.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=r.default.parseMasterPlaylistMedia(w,D,"AUDIO",x),y=r.default.parseMasterPlaylistMedia(w,D,"SUBTITLES",d),b=r.default.parseMasterPlaylistMedia(w,D,"CLOSED-CAPTIONS");if(S.length){var B=S.some(function(F){return!F.url});!B&&A[0].audioCodec&&!A[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}E.trigger(j.Events.MANIFEST_LOADED,{levels:A,audioTracks:S,subtitles:y,captions:b,url:D,stats:s,networkDetails:O,sessionData:C})},f.handleTrackOrLevelPlaylist=function(u,s,a,O){var E=this.hls,w=a.id,D=a.level,L=a.type,A=p(u,a),C=Object(X.isFiniteNumber)(w)?w:0,x=Object(X.isFiniteNumber)(D)?D:C,d=m(a),S=r.default.parseLevelPlaylist(u.data,A,x,d,C);if(!S.fragments.length){E.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:A,reason:"no fragments found in level",level:typeof a.level=="number"?a.level:void 0});return}if(L===R.PlaylistContextType.MANIFEST){var y={attrs:new v.AttrList({}),bitrate:0,details:S,name:"",url:A};E.trigger(j.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:A,stats:s,networkDetails:O,sessionData:null})}if(s.parsing.end=performance.now(),S.needSidxRanges){var b,B=(b=S.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:B,isSidxRequest:!0,type:L,level:D,levelDetails:S,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=S,this.handlePlaylistLoaded(u,s,a,O)},f.handleSidxRequest=function(u,s){var a=Object(G.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var O=a.references,E=s.levelDetails;O.forEach(function(w,D){var L=w.info,A=E.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+L.end-L.start)+"@"+String(L.start)),A.initSegment&&A.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(u,s,a,O){this.hls.trigger(j.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===R.PlaylistContextType.MANIFEST,url:u.url,reason:a,response:u,context:s,networkDetails:O})},f.handleNetworkError=function(u,s,a,O){a===void 0&&(a=!1),K.logger.warn("[playlist-loader]: A network "+(a?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var E=U.ErrorDetails.UNKNOWN,w=!1,D=this.getInternalLoader(u);switch(u.type){case R.PlaylistContextType.MANIFEST:E=a?U.ErrorDetails.MANIFEST_LOAD_TIMEOUT:U.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case R.PlaylistContextType.LEVEL:E=a?U.ErrorDetails.LEVEL_LOAD_TIMEOUT:U.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case R.PlaylistContextType.AUDIO_TRACK:E=a?U.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:E=a?U.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:U.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}D&&this.resetInternalLoader(u.type);var L={type:U.ErrorTypes.NETWORK_ERROR,details:E,fatal:w,url:u.url,loader:D,context:u,networkDetails:s};O&&(L.response=O),this.hls.trigger(j.Events.ERROR,L)},f.handlePlaylistLoaded=function(u,s,a,O){var E=a.type,w=a.level,D=a.id,L=a.groupId,A=a.loader,C=a.levelDetails,x=a.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(u,a,"invalid target duration",O);return}if(!A)return;C.live&&(A.getCacheAge&&(C.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(E){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(j.Events.LEVEL_LOADED,{details:C,level:w||0,id:D||0,stats:s,networkDetails:O,deliveryDirectives:x});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(j.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:x});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:L||"",stats:s,networkDetails:O,deliveryDirectives:x});break}},l}();J.default=h},"./src/polyfills/number.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"isFiniteNumber",function(){return X}),P.d(J,"MAX_SAFE_INTEGER",function(){return j});var X=Number.isFinite||function(U){return typeof U=="number"&&isFinite(U)},j=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,J,P){"use strict";P.r(J);var X=function(){function j(){}return j.getSilentFrame=function(K,G){switch(K){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(G===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(G===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(G===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},j}();J.default=X},"./src/remux/mp4-generator.ts":function(ie,J,P){"use strict";P.r(J);var X=Math.pow(2,32)-1,j=function(){function U(){}return U.init=function(){U.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var G;for(G in U.types)U.types.hasOwnProperty(G)&&(U.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);U.HDLR_TYPES={video:r,audio:R};var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=m,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,p,l,p,h),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,v))},U.box=function(G){for(var r=8,R=arguments.length,v=new Array(R>1?R-1:0),m=1;m>24&255,l[1]=r>>16&255,l[2]=r>>8&255,l[3]=r&255,l.set(G,4),p=0,r=8;p>24&255,G>>16&255,G>>8&255,G&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},U.mdia=function(G){return U.box(U.types.mdia,U.mdhd(G.timescale,G.duration),U.hdlr(G.type),U.minf(G))},U.mfhd=function(G){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},U.minf=function(G){return G.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(G)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(G))},U.moof=function(G,r,R){return U.box(U.types.moof,U.mfhd(G),U.traf(R,r))},U.moov=function(G){for(var r=G.length,R=[];r--;)R[r]=U.trak(G[r]);return U.box.apply(null,[U.types.moov,U.mvhd(G[0].timescale,G[0].duration)].concat(R).concat(U.mvex(G)))},U.mvex=function(G){for(var r=G.length,R=[];r--;)R[r]=U.trex(G[r]);return U.box.apply(null,[U.types.mvex].concat(R))},U.mvhd=function(G,r){r*=G;var R=Math.floor(r/(X+1)),v=Math.floor(r%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&255,R>>24,R>>16&255,R>>8&255,R&255,v>>24,v>>16&255,v>>8&255,v&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return U.box(U.types.mvhd,m)},U.sdtp=function(G){var r=G.samples||[],R=new Uint8Array(4+r.length),v,m;for(v=0;v>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(m));for(v=0;v>>8&255),R.push(p&255),R=R.concat(Array.prototype.slice.call(m));var h=U.box(U.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|G.sps.length].concat(r).concat([G.pps.length]).concat(R))),l=G.width,f=G.height,o=G.pixelRatio[0],u=G.pixelRatio[1];return U.box(U.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},U.esds=function(G){var r=G.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(G.config).concat([6,1,2]))},U.mp4a=function(G){var r=G.samplerate;return U.box(U.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),U.box(U.types.esds,U.esds(G)))},U.mp3=function(G){var r=G.samplerate;return U.box(U.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},U.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?U.box(U.types.stsd,U.STSD,U.mp3(G)):U.box(U.types.stsd,U.STSD,U.mp4a(G)):U.box(U.types.stsd,U.STSD,U.avc1(G))},U.tkhd=function(G){var r=G.id,R=G.duration*G.timescale,v=G.width,m=G.height,p=Math.floor(R/(X+1)),h=Math.floor(R%(X+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,v>>8&255,v&255,0,0,m>>8&255,m&255,0,0]))},U.traf=function(G,r){var R=U.sdtp(G),v=G.id,m=Math.floor(r/(X+1)),p=Math.floor(r%(X+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),U.trun(G,R.length+16+20+8+16+8+8),R)},U.trak=function(G){return G.duration=G.duration||4294967295,U.box(U.types.trak,U.tkhd(G),U.mdia(G))},U.trex=function(G){var r=G.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},U.trun=function(G,r){var R=G.samples||[],v=R.length,m=12+16*v,p=new Uint8Array(m),h,l,f,o,u,s;for(r+=8+m,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),h=0;h>>24&255,f>>>16&255,f>>>8&255,f&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*h);return U.box(U.types.trun,p)},U.initSegment=function(G){U.types||U.init();var r=U.moov(G),R=new Uint8Array(U.FTYP.byteLength+r.byteLength);return R.set(U.FTYP),R.set(r,U.FTYP.byteLength),R},U}();j.types=void 0,j.HDLR_TYPES=void 0,j.STTS=void 0,j.STSC=void 0,j.STCO=void 0,j.STSZ=void 0,j.VMHD=void 0,j.SMHD=void 0,j.STSD=void 0,j.FTYP=void 0,j.DINF=void 0,J.default=j},"./src/remux/mp4-remuxer.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return s}),P.d(J,"normalizePts",function(){return a});var X=P("./src/polyfills/number.ts"),j=P("./src/remux/aac-helper.ts"),U=P("./src/remux/mp4-generator.ts"),K=P("./src/events.ts"),G=P("./src/errors.ts"),r=P("./src/utils/logger.ts"),R=P("./src/types/loader.ts"),v=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var L=1;L0?S:y.pts},C[0].pts);return x&&r.logger.debug("PTS rollover detected"),d},L.remux=function(C,x,d,S,y,b,B,F){var _,M,I,g,H,$,ne=y,oe=y,Oe=C.pid>-1,ye=x.pid>-1,Te=x.samples.length,Re=C.samples.length>0,Le=Te>1,ce=(!Oe||Re)&&(!ye||Le)||this.ISGenerated||B;if(ce){this.ISGenerated||(I=this.generateIS(C,x,y));var he=this.isVideoContiguous,re=-1;if(Le&&(re=O(x.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,re>0){r.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+Te+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(re),x.dropped+=re,oe+=(x.samples[0].pts-fe)/(x.timescale||9e4)}else re===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),$=!1);if(this.ISGenerated){if(Re&&Le){var se=this.getVideoStartPts(x.samples),De=a(C.samples[0].pts,se)-se,Ne=De/x.inputTimeScale;ne+=Math.max(0,Ne),oe+=Math.max(0,-Ne)}if(Re){if(C.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,x,y)),M=this.remuxAudio(C,ne,this.isAudioContiguous,b,ye||Le||F===R.PlaylistLevelType.AUDIO?oe:void 0),Le){var Se=M?M.endPTS-M.startPTS:0;x.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,x,y)),_=this.remuxVideo(x,oe,he,Se)}}else Le&&(_=this.remuxVideo(x,oe,he,0));_&&(_.firstKeyFrame=re,_.independent=re!==-1)}}return this.ISGenerated&&(d.samples.length&&(H=this.remuxID3(d,y)),S.samples.length&&(g=this.remuxText(S,y))),{audio:M,video:_,initSegment:I,independent:$,text:g,id3:H}},L.generateIS=function(C,x,d){var S=C.samples,y=x.samples,b=this.typeSupported,B={},F=!Object(X.isFiniteNumber)(this._initPTS),_="audio/mp4",M,I,g;if(F&&(M=I=Infinity),C.config&&S.length&&(C.timescale=C.samplerate,C.isAAC||(b.mpeg?(_="audio/mpeg",C.codec=""):b.mp3&&(C.codec="mp3")),B.audio={id:"audio",container:_,codec:C.codec,initSegment:!C.isAAC&&b.mpeg?new Uint8Array(0):U.default.initSegment([C]),metadata:{channelCount:C.channelCount}},F&&(g=C.inputTimeScale,M=I=S[0].pts-Math.round(g*d))),x.sps&&x.pps&&y.length&&(x.timescale=x.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:U.default.initSegment([x]),metadata:{width:x.width,height:x.height}},F)){g=x.inputTimeScale;var H=this.getVideoStartPts(y),$=Math.round(g*d);I=Math.min(I,a(y[0].dts,H)-$),M=Math.min(M,H-$)}if(Object.keys(B).length)return this.ISGenerated=!0,F&&(this._initPTS=M,this._initDTS=I),{tracks:B,initPTS:M,timescale:g}},L.remuxVideo=function(C,x,d,S){var y=C.inputTimeScale,b=C.samples,B=[],F=b.length,_=this._initPTS,M=this.nextAvcDts,I=8,g,H,$,ne=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,Oe=0,ye=!1;if(!d||M===null){var Te=x*y,Re=b[0].pts-a(b[0].dts,b[0].pts);M=Te-Re}for(var Le=0;Lece.pts){var he=9e4*.2;Oe=Math.max(Math.min(Oe,ce.pts-ce.dts),-1*he)}ce.dts0?Le-1:Le].dts&&(ye=!0)}ye&&b.sort(function(wt,St){var ct=wt.dts-St.dts,Bt=wt.pts-St.pts;return ct||Bt}),H=b[0].dts,$=b[b.length-1].dts;var re=Math.round(($-H)/(F-1));if(Oe<0){if(Oere,Pe=Ne<-1;if(Se||Pe){Se?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),H=M;var je=b[0].pts-Ne;b[0].dts=H,b[0].pts=je,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(je,!0)+"/"+Object(v.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms")}}u&&(H=Math.max(0,H));for(var le=0,ve=0,we=0;we0?Fe-1:Fe].dts;if(ue.stretchShortVideoTrack&&this.nextAudioPts!==null){var ge=Math.floor(ue.maxBufferHole*y),Ce=(S?ne+S*y:this.nextAudioPts)-ot.pts;Ce>ge?(g=Ce-de,g<0&&(g=de),r.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+g/90+" ms for the last video frame.")):g=de}else g=de}var Ue=Math.round(ot.pts-ot.dts);B.push(new E(ot.key,g,Be,Ue))}if(B.length&&f&&f<70){var ze=B[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(g!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=$+g,this.isVideoContiguous=!0;var lt=U.default.moof(C.sequenceNumber++,H,m({},C,{samples:B})),mt="video",ft={data1:lt,data2:Qe,startPTS:ne/y,endPTS:(oe+g)/y,startDTS:H/y,endDTS:M/y,type:mt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(Qe.length,"MDAT length must not be zero"),ft},L.remuxAudio=function(C,x,d,S,y){var b=C.inputTimeScale,B=C.samplerate?C.samplerate:b,F=b/B,_=C.isAAC?h:l,M=_*F,I=this._initPTS,g=!C.isAAC&&this.typeSupported.mpeg,H=[],$=C.samples,ne=g?0:8,oe=this.nextAudioPts||-1,Oe=x*b;if(this.isAudioContiguous=d=d||$.length&&oe>0&&(S&&Math.abs(Oe-oe)<9e3||Math.abs(a($[0].pts-I,Oe)-oe)<20*M),$.forEach(function(xe){xe.pts=a(xe.pts-I,Oe)}),!d||oe<0){if($=$.filter(function(xe){return xe.pts>=0}),!$.length)return;y===0?oe=0:S?oe=Math.max(0,Oe):oe=$[0].pts}if(C.isAAC)for(var ye=y!==void 0,Te=this.config.maxAudioFramesDrift,Re=0,Le=oe;Re<$.length;Re++){var ce=$[Re],he=ce.pts,re=he-Le,fe=Math.abs(1e3*re/b);if(re<=-Te*M&&ye)Re===0&&(r.logger.warn("Audio frame @ "+(he/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/b)+" ms."),this.nextAudioPts=oe=Le=he);else if(re>=Te*M&&fe0){ve+=ne;try{le=new Uint8Array(ve)}catch(xe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ve,reason:"fail allocating audio mdat "+ve});return}if(!g){var Qe=new DataView(le.buffer);Qe.setUint32(0,ve),le.set(U.default.types.mdat,4)}}else return;le.set(Ze,ne);var nt=Ze.byteLength;ne+=nt,H.push(new E(!0,_,nt,0)),je=$e}var Fe=H.length;if(!Fe)return;var ot=H[H.length-1];this.nextAudioPts=oe=je+F*ot.duration;var tt=g?new Uint8Array(0):U.default.moof(C.sequenceNumber++,Pe/F,m({},C,{samples:H}));C.samples=[];var Be=Pe/b,He=oe/b,Ae="audio",me={data1:tt,data2:le,startPTS:Be,endPTS:He,startDTS:Be,endDTS:He,type:Ae,hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,console.assert(le.length,"MDAT length must not be zero"),me},L.remuxEmptyAudio=function(C,x,d,S){var y=C.inputTimeScale,b=C.samplerate?C.samplerate:y,B=y/b,F=this.nextAudioPts,_=(F!==null?F:S.startDTS*y)+this._initDTS,M=S.endDTS*y+this._initDTS,I=B*h,g=Math.ceil((M-_)/I),H=j.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ne=0;ne4294967296;)D+=A;return D}function O(D){for(var L=0;L0?this.lastEndDTS=C:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!D.audio,d=!!D.video,S="";x&&(S+="audio"),d&&(S+="video");var y={data1:E,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:S,hasAudio:x,hasVideo:d,nb:1,dropped:0};return O.audio=y.type==="audio"?y:void 0,O.video=y.type!=="audio"?y:void 0,O.text=o,O.id3=f,O.initSegment=w,O},v}(),r=function(m,p,h){return Object(j.getStartDTS)(m,p)-h};function R(v,m){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===U.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=G},"./src/task-loop.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"default",function(){return X});var X=function(){function j(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var U=j.prototype;return U.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},U.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},U.onHandlerDestroyed=function(){},U.hasInterval=function(){return!!this._tickInterval},U.hasNextTick=function(){return!!this._tickTimer},U.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},U.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},U.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},U.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},U.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},U.doTick=function(){},j}()},"./src/types/cmcd.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"CMCDVersion",function(){return X}),P.d(J,"CMCDObjectType",function(){return j}),P.d(J,"CMCDStreamingFormat",function(){return U}),P.d(J,"CMCDStreamType",function(){return K});var X=1,j;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(j||(j={}));var U;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(U||(U={}));var K;(function(G){G.VOD="v",G.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"HlsSkip",function(){return U}),P.d(J,"getSkipValue",function(){return K}),P.d(J,"HlsUrlParameters",function(){return G}),P.d(J,"Level",function(){return r});function X(R,v){for(var m=0;mNumber.MAX_SAFE_INTEGER?Infinity:v},G.hexadecimalInteger=function(R){if(this[R]){var v=(this[R]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var m=new Uint8Array(v.length/2),p=0;pNumber.MAX_SAFE_INTEGER?Infinity:v},G.decimalFloatingPoint=function(R){return parseFloat(this[R])},G.optionalFloat=function(R,v){var m=this[R];return m?parseFloat(m):v},G.enumeratedString=function(R){return this[R]},G.bool=function(R){return this[R]==="YES"},G.decimalResolution=function(R){var v=X.exec(this[R]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},K.parseAttrList=function(R){var v,m={},p='"';for(j.lastIndex=0;(v=j.exec(R))!==null;){var h=v[2];h.indexOf(p)===0&&h.lastIndexOf(p)===h.length-1&&(h=h.slice(1,-1)),m[v[1]]=h}return m},K}()},"./src/utils/binary-search.ts":function(ie,J,P){"use strict";P.r(J);var X={search:function(U,K){for(var G=0,r=U.length-1,R=null,v=null;G<=r;){R=(G+r)/2|0,v=U[R];var m=K(v);if(m>0)G=R+1;else if(m<0)r=R-1;else return v}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"BufferHelper",function(){return U});var X=P("./src/utils/logger.ts"),j={length:0,start:function(){return 0},end:function(){return 0}},U=function(){function K(){}return K.isBuffered=function(r,R){try{if(r){for(var v=K.getBuffered(r),m=0;m=v.start(m)&&R<=v.end(m))return!0}}catch(p){}return!1},K.bufferInfo=function(r,R,v){try{if(r){var m=K.getBuffered(r),p=[],h;for(h=0;hl&&(m[h-1].end=r[p].end):m.push(r[p])}else m.push(r[p])}else m=r;for(var f=0,o,u=R,s=R,a=0;a=O&&R=d&&X.logger.log(this.time+" ["+d+"] "+S)},A}(),f=function(C){for(var x=[],d=0;dG&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},C.moveCursor=function(d){var S=this.pos+d;if(d>1)for(var y=this.pos+1;y=144&&this.backSpace();var S=U(d);if(this.pos>=G){this.logger.log(h.ERROR,"Cannot insert "+d.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(d){var S;for(S=d;S0&&(d?y="["+S.join(" | ")+"]":y=S.join(` `)),y},C.getTextAndFormat=function(){return this.rows},A}(),O=function(){function A(x,d,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=x,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new a(S),this.nonDisplayedMemory=new a(S),this.lastOutputScreen=new a(S),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var C=A.prototype;return C.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},C.getHandler=function(){return this.outputFilter},C.setHandler=function(d){this.outputFilter=d},C.setPAC=function(d){this.writeScreen.setPAC(d)},C.setBkgData=function(d){this.writeScreen.setBkgData(d)},C.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(h.INFO,"MODE="+d),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=d},C.insertChars=function(d){for(var S=0;S=46,S.italics)S.foreground="white";else{var y=Math.floor(d/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},C.outputDataUpdate=function(d){d===void 0&&(d=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},C.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},A}(),E=function(){function A(x,d,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new l;this.channels=[null,new O(x,d,y),new O(x+1,S,y)],this.cmdHistory=L(),this.logger=y}var C=A.prototype;return C.getHandler=function(d){return this.channels[d].getHandler()},C.setHandler=function(d,S){this.channels[d].setHandler(S)},C.addData=function(d,S){var y,b,B,F=!1;this.logger.time=d;for(var _=0;_ ("+f([b,B])+")"),y=this.parseCmd(b,B),y||(y=this.parseMidrow(b,B)),y||(y=this.parsePAC(b,B)),y||(y=this.parseBackgroundAttributes(b,B)),!y&&(F=this.parseChars(b,B),F)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+f([b,B])+" orig: "+f([S[_],S[_+1]]))}},C.parseCmd=function(d,S){var y=this.cmdHistory,b=(d===20||d===28||d===21||d===29)&&S>=32&&S<=47,B=(d===23||d===31)&&S>=33&&S<=35;if(!(b||B))return!1;if(D(d,S,y))return w(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+f([d,S])+") is dropped"),!0;var F=d===20||d===21||d===23?1:2,_=this.channels[F];return d===20||d===21||d===28||d===29?S===32?_.ccRCL():S===33?_.ccBS():S===34?_.ccAOF():S===35?_.ccAON():S===36?_.ccDER():S===37?_.ccRU(2):S===38?_.ccRU(3):S===39?_.ccRU(4):S===40?_.ccFON():S===41?_.ccRDC():S===42?_.ccTR():S===43?_.ccRTD():S===44?_.ccEDM():S===45?_.ccCR():S===46?_.ccENM():S===47&&_.ccEOC():_.ccTO(S-32),w(d,S,y),this.currentChannel=F,!0},C.parseMidrow=function(d,S){var y=0;if((d===17||d===25)&&S>=32&&S<=47){if(d===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(S),this.logger.log(h.DEBUG,"MIDROW ("+f([d,S])+")"),!0):!1}return!1},C.parsePAC=function(d,S){var y,b=this.cmdHistory,B=(d>=17&&d<=23||d>=25&&d<=31)&&S>=64&&S<=127,F=(d===16||d===24)&&S>=64&&S<=95;if(!(B||F))return!1;if(D(d,S,b))return w(null,null,b),!0;var _=d<=23?1:2;S>=64&&S<=95?y=_===1?r[d]:v[d]:y=_===1?R[d]:m[d];var M=this.channels[_];return M?(M.setPAC(this.interpretPAC(y,S)),w(d,S,b),this.currentChannel=_,!0):!1},C.interpretPAC=function(d,S){var y,b={color:null,italics:!1,indent:null,underline:!1,row:d};return S>95?y=S-96:y=S-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},C.parseChars=function(d,S){var y,b=null,B=null;if(d>=25?(y=2,B=d-8):(y=1,B=d),B>=17&&B<=19){var F;B===17?F=S+80:B===18?F=S+112:F=S+144,this.logger.log(h.INFO,"Special char '"+U(F)+"' in channel "+y),b=[F]}else d>=32&&d<=127&&(b=S===0?[d]:[d,S]);if(b){var _=f(b);this.logger.log(h.DEBUG,"Char codes = "+_.join(",")),w(d,S,this.cmdHistory)}return b},C.parseBackgroundAttributes=function(d,S){var y=(d===16||d===24)&&S>=32&&S<=47,b=(d===23||d===31)&&S>=45&&S<=47;if(!(y||b))return!1;var B,F={};d===16||d===24?(B=Math.floor((S-32)/2),F.background=p[B],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var _=d<=23?1:2,M=this.channels[_];return M.setBkgData(F),w(d,S,this.cmdHistory),!0},C.reset=function(){for(var d=0;d=16?u--:u++;var w=Object(X.fixLineBreaks)(s.trim()),D=Object(j.generateCueId)(v,m,w);(!R||!R.cues||!R.cues.getCueById(D))&&(f=new a(v,m,w),f.id=D,f.line=O+1,f.align="left",f.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(f))}return R&&h.length&&(h.sort(function(L,A){return L.line==="auto"||A.line==="auto"?0:L.line>8&&A.line>8?A.line-L.line:L.line-A.line}),h.forEach(function(L){return Object(U.addCueToTrack)(R,L)})),h}};J.default=G},"./src/utils/discontinuities.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"findFirstFragWithCC",function(){return K}),P.d(J,"shouldAlignOnDiscontinuities",function(){return G}),P.d(J,"findDiscontinuousReferenceFrag",function(){return r}),P.d(J,"adjustSlidingStart",function(){return v}),P.d(J,"alignStream",function(){return m}),P.d(J,"alignPDT",function(){return h}),P.d(J,"alignFragmentByPDTDelta",function(){return l}),P.d(J,"alignMediaPlaylistByPDT",function(){return f});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/logger.ts"),U=P("./src/controller/level-helper.ts");function K(o,u){for(var s=null,a=0,O=o.length;as.startCC||o&&o.cc=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},U}();J.default=j},"./src/utils/ewma.ts":function(ie,J,P){"use strict";P.r(J);var X=function(){function j(K,G,r){G===void 0&&(G=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=G,this.totalWeight_=r}var U=j.prototype;return U.sample=function(G,r){var R=Math.pow(this.alpha_,G);this.estimate_=r*(1-R)+R*this.estimate_,this.totalWeight_+=G},U.getTotalWeight=function(){return this.totalWeight_},U.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},j}();J.default=X},"./src/utils/fetch-loader.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"fetchSupported",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/loader/load-stats.ts"),U=P("./src/demux/chunk-cache.ts");function K(a,O){a.prototype=Object.create(O.prototype),a.prototype.constructor=a,m(a,O)}function G(a){var O=typeof Map=="function"?new Map:void 0;return G=function(w){if(w===null||!v(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(w))return O.get(w);O.set(w,D)}function D(){return r(w,arguments,p(this).constructor)}return D.prototype=Object.create(w.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,w)},G(a)}function r(a,O,E){return R()?r=Reflect.construct:r=function(D,L,A){var C=[null];C.push.apply(C,L);var x=Function.bind.apply(D,C),d=new x;return A&&m(d,A.prototype),d},r.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function v(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,O){return m=Object.setPrototypeOf||function(w,D){return w.__proto__=D,w},m(a,O)}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},p(a)}function h(){return h=Object.assign||function(a){for(var O=1;O=A&&C(D,L,x.flush(),w)):C(D,L,B,w),y()}).catch(function(){return Promise.reject()})};return S()},a}();function o(a,O){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(h({},a.headers))};return a.rangeEnd&&E.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),E}function u(a,O){return new self.Request(a.url,O)}var s=function(a){K(O,a);function O(E,w,D){var L;return L=a.call(this,E)||this,L.code=void 0,L.details=void 0,L.code=w,L.details=D,L}return O}(G(Error));J.default=f},"./src/utils/imsc1-ttml-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"IMSC1_CODEC",function(){return v}),P.d(J,"parseIMSC1",function(){return l});var X=P("./src/utils/mp4-tools.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/utils/vttcue.ts"),K=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),r=P("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(A){for(var C=1;C"):X}function G(v){for(var m=arguments.length,p=new Array(m>1?m-1:0),h=1;h>24,O[E+1]=w>>16&255,O[E+2]=w>>8&255,O[E+3]=w&255}function m(O,E){var w=[];if(!E.length)return w;var D,L,A;"data"in O?(D=O.data,L=O.start,A=O.end):(D=O,L=0,A=D.byteLength);for(var C=L;C1?C+x:A;if(d===E[0])if(E.length===1)w.push({data:D,start:C+8,end:S});else{var y=m({data:D,start:C+8,end:S},E.slice(1));y.length&&K.apply(w,y)}C=S}return w}function p(O){var E=m(O,["moov"]),w=E[0],D=w?w.end:null,L=m(O,["sidx"]);if(!L||!L[0])return null;var A=[],C=L[0],x=C.data[0],d=x===0?8:16,S=R(C,d);d+=4;var y=0,b=0;x===0?d+=8:d+=16,d+=2;var B=C.end+b,F=r(C,d);d+=2;for(var _=0;_>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=R(C,M);M+=4,A.push({referenceSize:g,subsegmentDuration:$,info:{duration:$/S,start:B,end:B+g-1}}),B+=g,M+=4,d=M}return{earliestPresentationTime:y,timescale:S,version:x,referencesCount:F,references:A,moovEndOffset:D}}function h(O){for(var E=[],w=m(O,["moov","trak"]),D=0;DG)&&(this.startTime=G),this.endTime=r,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},U.reset=function(){this.cueRanges=[]},j}()},"./src/utils/texttrack-utils.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"sendAddTrackEvent",function(){return j}),P.d(J,"addCueToTrack",function(){return U}),P.d(J,"clearCurrentCues",function(){return K}),P.d(J,"removeCuesInRange",function(){return G}),P.d(J,"getCuesInRange",function(){return R});var X=P("./src/utils/logger.ts");function j(v,m){var p;try{p=new Event("addtrack")}catch(h){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,m.dispatchEvent(p)}function U(v,m){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(m.id))try{if(v.addCue(m),!v.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(l){X.logger.debug("[texttrack-utils]: "+l);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,v.addCue(h)}p==="disabled"&&(v.mode=p)}function K(v){var m=v.mode;if(m==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);m==="disabled"&&(v.mode=m)}function G(v,m,p){var h=v.mode;if(h==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var l=R(v.cues,m,p),f=0;fv[p].endTime)return-1;for(var h=0,l=p;h<=l;){var f=Math.floor((l+h)/2);if(mv[f].startTime&&h-1)for(var f=l,o=v.length;f=m&&u.endTime<=p)h.push(u);else if(u.startTime>p)return h}return h}},"./src/utils/time-ranges.ts":function(ie,J,P){"use strict";P.r(J);var X={toString:function(U){for(var K="",G=U.length,r=0;r1?m-1:0),h=1;h100)throw new Error("Position must be between 0 and 100.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},l,{get:function(){return C},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");C=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},l,{get:function(){return x},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");x=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},l,{get:function(){return d},set:function(y){var b=G(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");d=b,this.hasBeenReset=!0}})),h.displayState=void 0}return R.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"parseTimeStamp",function(){return U}),P.d(J,"fixLineBreaks",function(){return m}),P.d(J,"VTTParser",function(){return p});var X=P("./src/utils/vttcue.ts"),j=function(){function h(){}var l=h.prototype;return l.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},h}();function U(h){function l(o,u,s,a){return(o|0)*3600+(u|0)*60+(s|0)+parseFloat(a||0)}var f=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?l(f[2],f[3],0,f[4]):l(f[1],f[2],f[3],f[4]):null}var K=function(){function h(){this.values=Object.create(null)}var l=h.prototype;return l.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},l.get=function(o,u,s){return s?this.has(o)?this.values[o]:u[s]:this.has(o)?this.values[o]:u},l.has=function(o){return o in this.values},l.alt=function(o,u,s){for(var a=0;a=0&&s<=100)return this.set(o,s),!0}return!1},h}();function G(h,l,f,o){var u=o?h.split(o):[h];for(var s in u){if(typeof u[s]!="string")continue;var a=u[s].split(f);if(a.length!==2)continue;var O=a[0],E=a[1];l(O,E)}}var r=new X.default(0,0,""),R=r.align==="middle"?"middle":"center";function v(h,l,f){var o=h;function u(){var O=U(h);if(O===null)throw new Error("Malformed timestamp: "+o);return h=h.replace(/^[^\sa-zA-Z-]+/,""),O}function s(O,E){var w=new K;G(O,function(A,C){var x;switch(A){case"region":for(var d=f.length-1;d>=0;d--)if(f[d].id===C){w.set(A,f[d].region);break}break;case"vertical":w.alt(A,C,["rl","lr"]);break;case"line":x=C.split(","),w.integer(A,x[0]),w.percent(A,x[0])&&w.set("snapToLines",!1),w.alt(A,x[0],["auto"]),x.length===2&&w.alt("lineAlign",x[1],["start",R,"end"]);break;case"position":x=C.split(","),w.percent(A,x[0]),x.length===2&&w.alt("positionAlign",x[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":w.percent(A,C);break;case"align":w.alt(A,C,["start",R,"end","left","right"]);break}},/:/,/\s/),E.region=w.get("region",null),E.vertical=w.get("vertical","");var D=w.get("line","auto");D==="auto"&&r.line===-1&&(D=-1),E.line=D,E.lineAlign=w.get("lineAlign","start"),E.snapToLines=w.get("snapToLines",!0),E.size=w.get("size",100),E.align=w.get("align",R);var L=w.get("position","auto");L==="auto"&&r.position===50&&(L=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=L}function a(){h=h.replace(/^\s+/,"")}if(a(),l.startTime=u(),a(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);h=h.substr(3),a(),l.endTime=u(),a(),s(h,l)}function m(h){return h.replace(//gi,` `)}var p=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new j,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=h.prototype;return l.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function s(){var L=u.buffer,A=0;for(L=m(L);A")===-1){u.cue.id=O;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(O,u.cue,u.regionList)}catch(L){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var D=O.indexOf("-->")!==-1;if(!O||D&&(w=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=` `),u.cue.text+=O}continue;case"BADCUE":O||(u.state="ID")}}}catch(L){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=` `,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){o.onparsingerror&&o.onparsingerror(u)}return o.onflush&&o.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ie,J,P){"use strict";P.r(J),P.d(J,"generateCueId",function(){return p}),P.d(J,"parseWebVTT",function(){return l});var X=P("./src/polyfills/number.ts"),j=P("./src/utils/vttparser.ts"),U=P("./src/demux/id3.ts"),K=P("./src/utils/timescale-conversion.ts"),G=P("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,R=function(o,u,s){return s===void 0&&(s=0),o.substr(s,u.length)===u},v=function(o){var u=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),O=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(u)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*s,u+=60*1e3*a,u+=60*60*1e3*O,u},m=function(o){for(var u=5381,s=o.length;s;)u=u*33^o.charCodeAt(--s);return(u>>>0).toString()};function p(f,o,u){return m(f.toString())+m(o.toString())+m(u)}var h=function(o,u,s){var a=o[u],O=o[a.prevCC];if(!O||!O.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(E=O)!==null&&E!==void 0&&E.new;){var E;o.ccOffset+=a.start-O.start,a.new=!1,a=O,O=o[a.prevCC]}o.presentationOffset=s};function l(f,o,u,s,a,O,E,w){var D=new j.VTTParser,L=Object(U.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(r,` `).split(` `),A=[],C=Object(K.toMpegTsClockFromTimescale)(o,u),x="00:00.000",d=0,S=0,y,b=!0,B=!1;D.oncue=function(F){var _=s[a],M=s.ccOffset,I=(d-C)/9e4;if(_!=null&&_.new&&(S!==void 0?M=s.ccOffset=_.start:h(s,a,I)),I&&(M=I-s.presentationOffset),B){var g=F.endTime-F.startTime,H=Object(G.normalizePts)((F.startTime+M-S)*9e4,O*9e4)/9e4;F.startTime=H,F.endTime=H+g}var $=F.text.trim();F.text=decodeURIComponent(encodeURIComponent($)),F.id||(F.id=p(F.startTime,F.endTime,$)),F.endTime>0&&A.push(F)},D.onparsingerror=function(F){y=F},D.onflush=function(){if(y){w(y);return}E(A)},L.forEach(function(F){if(b)if(R(F,"X-TIMESTAMP-MAP=")){b=!1,B=!0,F.substr(16).split(",").forEach(function(_){R(_,"LOCAL:")?x=_.substr(6):R(_,"MPEGTS:")&&(d=parseInt(_.substr(7)))});try{S=v(x)/1e3}catch(_){B=!1,y=_}return}else F===""&&(b=!1);D.parse(F+` `)}),D.flush()}},"./src/utils/xhr-loader.ts":function(ie,J,P){"use strict";P.r(J);var X=P("./src/utils/logger.ts"),j=P("./src/loader/load-stats.ts"),U=/^age:\s*[\d.]+\s*$/m,K=function(){function G(R){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=R?R.xhrSetup:null,this.stats=new j.LoadStats,this.retryDelay=0}var r=G.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=v,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,m=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var l=this.xhrSetup;try{if(l)try{l(p,m.url)}catch(u){p.open("GET",m.url,!0),l(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var o in f)p.setRequestHeader(o,f[o])}catch(u){this.callbacks.onError({code:p.status,text:u.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,m=this.loader,p=this.stats;if(!v||!m)return;var h=m.readyState,l=this.config;if(p.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,u;if(v.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),p.loaded=p.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,v,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,p,v,m)}else p.retry>=l.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+v.url),this.callbacks.onError({code:f,text:m.statusText},v,m)):(X.logger.warn(f+" while loading "+v.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,l.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},r.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var m=this.stats;m.loaded=v.loaded,v.lengthComputable&&(m.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&U.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");v=m?parseFloat(m):null}return v},G}();J.default=K}}).default})},vHTk:function(rt,_e,Z){rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(rt,_e,Z){"use strict";Z.d(_e,"c",function(){return j}),Z.d(_e,"b",function(){return U}),Z.d(_e,"d",function(){return K}),Z.d(_e,"a",function(){return r}),Z.d(_e,"e",function(){return R});var ie=Z("9og8"),J=Z("WmNS"),P=Z.n(J),X=Z("ErOA");function j(v){return Object(X.c)("libraries/".concat(v,".json"))}function U(){return Object(X.c)("library_tags.json")}function K(v){return G.apply(this,arguments)}function G(){return G=Object(ie.a)(P.a.mark(function v(m){var p;return P.a.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Object(X.b)("attachments/".concat(m,".json"));case 2:return p=l.sent,l.abrupt("return",p.status===0);case 4:case"end":return l.stop()}},v)})),G.apply(this,arguments)}function r(v){return Object(X.f)("libraries.json",v)}function R(v,m){return Object(X.g)("libraries/".concat(v,".json"),m)}},y5JW:function(rt,_e,Z){"use strict";Z.d(_e,"c",function(){return f}),Z.d(_e,"a",function(){return o});var ie=Z("DZo9"),J=Z("8z0m"),P=Z("+L6B"),X=Z("2/Rp"),j=Z("9og8"),U=Z("miYZ"),K=Z("tsqr"),G=Z("k1fw"),r=Z("oBTY"),R=Z("WmNS"),v=Z.n(R),m=Z("q1tI"),p=Z.n(m),h=Z("m3rI"),l=Z("wzkS"),f="\u3000\u3000";function o(u){var s=["Bytes","KB","MB","GB","TB"];if(u==0)return"0 Byte";var a=parseInt(""+Math.floor(Math.log(u)/Math.log(1024)),10);return(u/Math.pow(1024,a)).toFixed(1)+" "+s[a]}_e.b=function(u){var s=u.value,a=s===void 0?[]:s,O=u.action,E=u.onChange,w=u.className,D=u.maxSize,L=D===void 0?150:D,A=u.title,C=A===void 0?"\u6587\u4EF6\u4E0A\u4F20":A,x=u.accept,d=x===void 0?null:x,S={multiple:!1,fileList:a,accept:d,withCredentials:!0,beforeUpload:function(B){var F=B.size/1024/1024;return!0},action:"".concat(h.a.API_SERVER,"/api/attachments.json"),onChange:function(B){var F,_,M=Object(r.a)(B.fileList);if(M=M.map(function(H){return H.name.indexOf(f)===-1&&(H.name="".concat(H.name).concat(f).concat(o(H.size))),Object(G.a)({},H)}),B.file.status==="done"&&((F=B.file)===null||F===void 0||((_=F.response)===null||_===void 0)?void 0:_.status)===-1){var I,g;K.b.error((I=B.file)===null||I===void 0||((g=I.response)===null||g===void 0)?void 0:g.message),E([]);return}E(M)},onRemove:function(){var b=Object(j.a)(v.a.mark(function F(_){var M,I,g;return v.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(M=_.size/1024/1024,!(_.status==="uploading")){$.next=3;break}return $.abrupt("return",!0);case 3:if(M0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:a.length>0,ghost:!0},C),p.a.createElement("span",{onClick:y,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",L,"M)"," ")))}}}]);