You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Classrooms__Lists__Group...

445 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[88,5,6,7,9,12],{"+NIl":function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){"use strict";le.defineMode("stex",function(Y,N){"use strict";function X(l,h){l.cmdState.push(h)}function H(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function P(l){var h=l.cmdState.pop();h&&h.closeBracket()}function K(l){for(var h=l.cmdState,p=h.length-1;p>=0;p--){var o=h[p];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function z(l,h,p){return function(){this.name=l,this.bracketNo=0,this.style=h,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=z("importmodule","tag",["string","builtin"]),n.documentclass=z("documentclass","tag",["","atom"]),n.usepackage=z("usepackage","tag",["atom"]),n.begin=z("begin","tag",["atom"]),n.end=z("end","tag",["atom"]),n.label=z("label","tag",["atom"]),n.ref=z("ref","tag",["atom"]),n.eqref=z("eqref","tag",["atom"]),n.cite=z("cite","tag",["atom"]),n.bibitem=z("bibitem","tag",["atom"]),n.Bibitem=z("Bibitem","tag",["atom"]),n.RBibitem=z("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(l,h){l.f=h}function y(l,h){var p;if(l.match(/^\\[a-zA-Z@]+/)){var o=l.current().slice(1);return p=n.hasOwnProperty(o)?n[o]:n.DEFAULT,p=new p,X(h,p),L(h,g),p.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return L(h,function(s,a){return m(s,a,"\\]")}),"keyword";if(l.match("\\("))return L(h,function(s,a){return m(s,a,"\\)")}),"keyword";if(l.match("$$"))return L(h,function(s,a){return m(s,a,"$$")}),"keyword";if(l.match("$"))return L(h,function(s,a){return m(s,a,"$")}),"keyword";var u=l.next();if(u=="%")return l.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=H(h),p)p.closeBracket(u),L(h,g);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,X(h,p),"bracket"):/\d/.test(u)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),p=K(h),p.name=="begin"&&(p.argument=l.current()),p.styleIdentifier())}function m(l,h,p){if(l.eatSpace())return null;if(p&&l.match(p))return L(h,y),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=l.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(l.skipToEnd(),"comment"):"error"}function g(l,h){var p=l.peek(),o;return p=="{"||p=="["?(o=H(h),o.openBracket(p),l.eat(p),L(h,y),"bracket"):/[ \t\r]/.test(p)?(l.eat(p),null):(L(h,y),P(h),y(l,h))}return{startState:function(){var l=N.inMathMode?function(h,p){return m(h,p)}:y;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,h){return h.f(l,h)},blankLine:function(l){l.f=y,l.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},"+ua5":function(Je,Ee,J){},"/cxE":function(Je,Ee,J){"use strict";J.d(Ee,"f",function(){return N}),J.d(Ee,"g",function(){return X}),J.d(Ee,"h",function(){return H}),J.d(Ee,"e",function(){return K}),J.d(Ee,"b",function(){return z}),J.d(Ee,"c",function(){return n}),J.d(Ee,"d",function(){return L}),J.d(Ee,"a",function(){return y});class le{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+`
`+m.stack):m},0)}}emit(m){this.listeners.forEach(g=>{g(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const Y=new le;function N(m){K(m)||Y.onUnexpectedError(m);return}function X(m){K(m)||Y.onUnexpectedExternalError(m);return}function H(m){if(m instanceof Error){let{name:g,message:l}=m;const h=m.stacktrace||m.stack;return{$isError:!0,name:g,message:l,stack:h}}return m}const P="Canceled";function K(m){return m instanceof Error&&m.name===P&&m.message===P}function z(){const m=new Error(P);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function L(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class y extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"19Vz":function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){le.defineOption("placeholder","",function(z,n,L){var y=L&&L!=le.Init;if(n&&!y)z.on("blur",H),z.on("change",P),z.on("swapDoc",P),le.on(z.getInputField(),"compositionupdate",z.state.placeholderCompose=function(){X(z)}),P(z);else if(!n&&y){z.off("blur",H),z.off("change",P),z.off("swapDoc",P),le.off(z.getInputField(),"compositionupdate",z.state.placeholderCompose),Y(z);var m=z.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}n&&!z.hasFocus()&&H(z)});function Y(z){z.state.placeholder&&(z.state.placeholder.parentNode.removeChild(z.state.placeholder),z.state.placeholder=null)}function N(z){Y(z);var n=z.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=z.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var L=z.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),n.appendChild(L),z.display.lineSpace.insertBefore(n,z.display.lineSpace.firstChild)}function X(z){setTimeout(function(){var n=!1,L=z.getInputField();L.nodeName=="TEXTAREA"?n=!L.value:z.lineCount()==1&&(n=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),n?N(z):Y(z)},20)}function H(z){K(z)&&N(z)}function P(z){var n=z.getWrapperElement(),L=K(z);n.className=n.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?N(z):Y(z)}function K(z){return z.lineCount()===1&&z.getLine(0)===""}})},"1eCo":function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){"use strict";var Y={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function(X,H){var P=X.indentUnit,K={},z=H.htmlMode?Y:N;for(var n in z)K[n]=z[n];for(var n in H)K[n]=H[n];var L,y;function m(d,f){function b(U){return f.tokenize=U,U(d,f)}var _=d.next();if(_=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?b(h("atom","]]>")):null:d.match("--")?b(h("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),b(p(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),f.tokenize=h("meta","?>"),"meta"):(L=d.eat("/")?"closeTag":"openTag",f.tokenize=g,"tag bracket");if(_=="&"){var j;return d.eat("#")?d.eat("x")?j=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):j=d.eatWhile(/[\d]/)&&d.eat(";"):j=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),j?"atom":"error"}else return d.eatWhile(/[^&<]/),null}m.isInText=!0;function g(d,f){var b=d.next();if(b==">"||b=="/"&&d.eat(">"))return f.tokenize=m,L=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return L="equals",null;if(b=="<"){f.tokenize=m,f.state=a,f.tagName=f.tagStart=null;var _=f.tokenize(d,f);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(b)?(f.tokenize=l(b),f.stringStartCol=d.column(),f.tokenize(d,f)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(d){var f=function(b,_){for(;!b.eol();)if(b.next()==d){_.tokenize=g;break}return"string"};return f.isInAttribute=!0,f}function h(d,f){return function(b,_){for(;!b.eol();){if(b.match(f)){_.tokenize=m;break}b.next()}return d}}function p(d){return function(f,b){for(var _;(_=f.next())!=null;){if(_=="<")return b.tokenize=p(d+1),b.tokenize(f,b);if(_==">")if(d==1){b.tokenize=m;break}else return b.tokenize=p(d-1),b.tokenize(f,b)}return"meta"}}function o(d,f,b){this.prev=d.context,this.tagName=f,this.indent=d.indented,this.startOfLine=b,(K.doNotIndent.hasOwnProperty(f)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function u(d){d.context&&(d.context=d.context.prev)}function s(d,f){for(var b;;){if(!d.context)return;if(b=d.context.tagName,!K.contextGrabbers.hasOwnProperty(b)||!K.contextGrabbers[b].hasOwnProperty(f))return;u(d)}}function a(d,f,b){return d=="openTag"?(b.tagStart=f.column(),R):d=="closeTag"?x:a}function R(d,f,b){return d=="word"?(b.tagName=f.current(),y="tag",O):K.allowMissingTagName&&d=="endTag"?(y="tag bracket",O(d,f,b)):(y="error",R)}function x(d,f,b){if(d=="word"){var _=f.current();return b.context&&b.context.tagName!=_&&K.implicitlyClosed.hasOwnProperty(b.context.tagName)&&u(b),b.context&&b.context.tagName==_||K.matchClosing===!1?(y="tag",S):(y="tag error",D)}else return K.allowMissingTagName&&d=="endTag"?(y="tag bracket",S(d,f,b)):(y="error",D)}function S(d,f,b){return d!="endTag"?(y="error",S):(u(b),a)}function D(d,f,b){return y="error",S(d,f,b)}function O(d,f,b){if(d=="word")return y="attribute",A;if(d=="endTag"||d=="selfcloseTag"){var _=b.tagName,j=b.tagStart;return b.tagName=b.tagStart=null,d=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(_)?s(b,_):(s(b,_),b.context=new o(b,_,j==b.indented)),a}return y="error",O}function A(d,f,b){return d=="equals"?C:(K.allowMissing||(y="error"),O(d,f,b))}function C(d,f,b){return d=="string"?T:d=="word"&&K.allowUnquoted?(y="string",O):(y="error",O(d,f,b))}function T(d,f,b){return d=="string"?T:O(d,f,b)}return{startState:function(d){var f={tokenize:m,state:a,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(f.baseIndent=d),f},token:function(d,f){if(!f.tagName&&d.sol()&&(f.indented=d.indentation()),d.eatSpace())return null;L=null;var b=f.tokenize(d,f);return(b||L)&&b!="comment"&&(y=null,f.state=f.state(L||b,d,f),y&&(b=y=="error"?b+" error":y)),b},indent:function(d,f,b){var _=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+P;if(_&&_.noIndent)return le.Pass;if(d.tokenize!=g&&d.tokenize!=m)return b?b.match(/^(\s*)/)[0].length:0;if(d.tagName)return K.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+P*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(f))return 0;var j=f&&/^<(\/)?([\w_:\.-]*)/.exec(f);if(j&&j[1])for(;_;)if(_.tagName==j[2]){_=_.prev;break}else if(K.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(j)for(;_;){var U=K.contextGrabbers[_.tagName];if(U&&U.hasOwnProperty(j[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+P:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(d){d.state==C&&(d.state=O)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var f=[],b=d.context;b;b=b.prev)b.tagName&&f.push(b.tagName);return f.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return Y});class le{constructor(N){this.element=N,this.next=le.Undefined,this.prev=le.Undefined}}le.Undefined=new le(void 0);class Y{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let N=this._first;for(;N!==le.Undefined;){const X=N.next;N.prev=le.Undefined,N.next=le.Undefined,N=X}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,X){const H=new le(N);if(this._first===le.Undefined)this._first=H,this._last=H;else if(X){const K=this._last;this._last=H,H.prev=K,K.next=H}else{const K=this._first;this._first=H,H.next=K,K.prev=H}this._size+=1;let P=!1;return()=>{P||(P=!0,this._remove(H))}}shift(){if(this._first===le.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===le.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==le.Undefined&&N.next!==le.Undefined){const X=N.prev;X.next=N.next,N.next.prev=X}else N.prev===le.Undefined&&N.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):N.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):N.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==le.Undefined;)yield N.element,N=N.next}}},"3/fG":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return Y});function le(N,X){let H;return X.length===0?H=N:H=N.replace(/\{(\d+)\}/g,function(P,K){const z=K[0];return typeof X[z]!="undefined"?X[z]:P}),H}function Y(N,X,...H){return le(X,H)}},"500L":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return x});var le=J("+L6B"),Y=J("2/Rp"),N=J("2qtc"),X=J("kLXV"),H=J("9og8"),P=J("k1fw"),K=J("miYZ"),z=J("tsqr"),n=J("oBTY"),L=J("tJVT"),y=J("DZo9"),m=J("8z0m"),g=J("WmNS"),l=J.n(g),h=J("q1tI"),p=J.n(h),o=J("m3rI"),u=J("wzkS"),s=J("y5JW"),a=J("LtfV"),R=m.a.Dragger;function x(S){var D=[];return S&&S.length>0&&(D=S.map(function(O){return{uid:O.id,id:O.id,name:O.title+s.c+O.filesize,url:O.url,filesize:O.filesize,status:"done",response:{id:O.id}}})),D}Ee.b=function(S){var D=S.value,O=S.onChange,A=S.action,C=S.className,T=S.maxSize,d=T===void 0?150:T,f=S.title,b=f===void 0?"\u4E0A\u4F20\u9644\u4EF6":f,_=S.showRemoveModal,j=_===void 0?!1:_,U=S.accept,w=U===void 0?"":U,M=S.additionalText,I=S.isDragger,v=S.number,W=v===void 0?1e3:v,Z=S.aloneClear,oe=Z===void 0?!1:Z,fe=Object(h.useState)(!1),Ae=Object(L.a)(fe,2),be=Ae[0],Re=Ae[1],Ce=Object(h.useState)(D||[]),Le=Object(L.a)(Ce,2),ve=Le[0],$=Le[1];Object(h.useEffect)(function(){D&&($(Object(n.a)(D)),W===(D==null?void 0:D.length)&&Re(!0))},[D]);var E=function(){setTimeout(function(){ve.pop(),$(Object(n.a)(ve))},500)},k={multiple:!0,disabled:be,accept:w,withCredentials:!0,fileList:ve,beforeUpload:function(G,he){var xe=G.size/1024/1024;return ve.concat(he).length>W?(ve.pop(),$(Object(n.a)(ve)),z.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),oe?Promise.reject():(E(),!1)):!0},action:A||"".concat(o.a.API_SERVER,"/api/attachments.json"),onChange:function(G){var he,xe,Ie=Object(n.a)(G.fileList);if(G.file.status==="done"&&((he=G.file)===null||he===void 0||((xe=he.response)===null||xe===void 0)?void 0:xe.status)===-1){var ue,ge;z.b.error((ue=G.file)===null||ue===void 0||((ge=ue.response)===null||ge===void 0)?void 0:ge.message);return}Ie.length>=W?Re(!0):Re(!1),$(Object(n.a)(Ie)),Ie=Ie.map(function(_e){var Se;if(_e!=null&&(Se=_e.response)!==null&&Se!==void 0&&Se.id){var Pe;_e.url="/api/attachments/".concat(_e==null||((Pe=_e.response)===null||Pe===void 0)?void 0:Pe.id)}return _e.name.indexOf(s.c)===-1&&(_e.name="".concat(_e.name).concat(s.c).concat(Object(s.a)(_e.size))),Object(P.a)({},_e)}),console.log("info:",G),O(Ie)},onRemove:function(){var Q=Object(H.a)(l.a.mark(function he(xe){var Ie;return l.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:if(Ie=function(){var _e=Object(H.a)(l.a.mark(function Se(){var Pe,Ue;return l.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(Pe=xe.response?xe.response.id:xe.id,!Pe){Be.next=8;break}return Be.next=4,Object(u.d)(xe.response?xe.response.id:xe.uid);case 4:return Ue=Be.sent,Be.abrupt("return",Ue);case 8:return Be.abrupt("return",!0);case 9:case"end":return Be.stop()}},Se)}));return function(){return _e.apply(this,arguments)}}(),!j){ge.next=5;break}return ge.abrupt("return",new Promise(function(_e,Se){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:p.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Pe=Object(H.a)(l.a.mark(function He(){var Be;return l.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.next=2,Ie();case 2:Be=ze.sent,z.b.success("\u5220\u9664\u6210\u529F"),_e(!0);case 5:case"end":return ze.stop()}},He)}));function Ue(){return Pe.apply(this,arguments)}return Ue}(),onCancel:function(){return _e(!1)}})}));case 5:return ge.next=7,Ie();case 7:return ge.abrupt("return",ge.sent);case 8:case"end":return ge.stop()}},he)}));function G(he){return Q.apply(this,arguments)}return G}()};function B(Q){Q.preventDefault(),Q.stopPropagation()}return p.a.createElement("div",{className:"multi-upload ".concat(C||"")},I&&p.a.createElement(R,k,p.a.createElement("p",{className:"ant-upload-drag-icon"},p.a.createElement(a.a,null)),p.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",p.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",d,"MB)"," "),M),!I&&p.a.createElement(m.a,k,p.a.createElement(Y.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:p.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:be},b),p.a.createElement("span",{onClick:B,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",d,"MB)"," ")))}},"55Ip":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return s});var le=J("Ty5D"),Y=J("dI71"),N=J("q1tI"),X=J.n(N),H=J("YS25"),P=J("17x9"),K=J.n(P),z=J("wx14"),n=J("zLVn"),L=J("9R94"),y=function(C){Object(Y.a)(T,C);function T(){for(var f,b=arguments.length,_=new Array(b),j=0;j<b;j++)_[j]=arguments[j];return f=C.call.apply(C,[this].concat(_))||this,f.history=Object(H.a)(f.props),f}var d=T.prototype;return d.render=function(){return X.a.createElement(le.c,{history:this.history,children:this.props.children})},T}(X.a.Component),m=function(C){Object(Y.a)(T,C);function T(){for(var f,b=arguments.length,_=new Array(b),j=0;j<b;j++)_[j]=arguments[j];return f=C.call.apply(C,[this].concat(_))||this,f.history=Object(H.b)(f.props),f}var d=T.prototype;return d.render=function(){return X.a.createElement(le.c,{history:this.history,children:this.props.children})},T}(X.a.Component),g=function(T,d){return typeof T=="function"?T(d):T},l=function(T,d){return typeof T=="string"?Object(H.c)(T,null,null,d):T},h=function(T){return T},p=X.a.forwardRef;typeof p=="undefined"&&(p=h);function o(C){return!!(C.metaKey||C.altKey||C.ctrlKey||C.shiftKey)}var u=p(function(C,T){var d=C.innerRef,f=C.navigate,b=C.onClick,_=Object(n.a)(C,["innerRef","navigate","onClick"]),j=_.target,U=Object(z.a)({},_,{onClick:function(M){try{b&&b(M)}catch(I){throw M.preventDefault(),I}!M.defaultPrevented&&M.button===0&&(!j||j==="_self")&&!o(M)&&(M.preventDefault(),f())}});return h!==p?U.ref=T||d:U.ref=d,X.a.createElement("a",U)}),s=p(function(C,T){var d=C.component,f=d===void 0?u:d,b=C.replace,_=C.to,j=C.innerRef,U=Object(n.a)(C,["component","replace","to","innerRef"]);return X.a.createElement(le.e.Consumer,null,function(w){w||Object(L.a)(!1);var M=w.history,I=l(g(_,w.location),w.location),v=I?M.createHref(I):"",W=Object(z.a)({},U,{href:v,navigate:function(){var oe=g(_,w.location),fe=b?M.replace:M.push;fe(oe)}});return h!==p?W.ref=T||j:W.innerRef=j,X.a.createElement(f,W)})});if(!1)var a,R;var x=function(T){return T},S=X.a.forwardRef;typeof S=="undefined"&&(S=x);function D(){for(var C=arguments.length,T=new Array(C),d=0;d<C;d++)T[d]=arguments[d];return T.filter(function(f){return f}).join(" ")}var O=S(function(C,T){var d=C["aria-current"],f=d===void 0?"page":d,b=C.activeClassName,_=b===void 0?"active":b,j=C.activeStyle,U=C.className,w=C.exact,M=C.isActive,I=C.location,v=C.sensitive,W=C.strict,Z=C.style,oe=C.to,fe=C.innerRef,Ae=Object(n.a)(C,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(le.e.Consumer,null,function(be){be||Object(L.a)(!1);var Re=I||be.location,Ce=l(g(oe,Re),Re),Le=Ce.pathname,ve=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),$=ve?Object(le.f)(Re.pathname,{path:ve,exact:w,sensitive:v,strict:W}):null,E=!!(M?M($,Re):$),k=E?D(U,_):U,B=E?Object(z.a)({},Z,{},j):Z,Q=Object(z.a)({"aria-current":E&&f||null,className:k,style:B,to:Ce},Ae);return x!==S?Q.ref=T||fe:Q.innerRef=fe,X.a.createElement(s,Q)})});if(!1)var A},"5VLF":function(Je,Ee,J){"use strict";var le,Y;function N(X,H,P){var K=function(z,n){return X.js_beautify(z,n)};return K.js=X.js_beautify,K.css=H.css_beautify,K.html=P.html_beautify,K.js_beautify=X.js_beautify,K.css_beautify=H.css_beautify,K.html_beautify=P.html_beautify,K}!(le=[J("6UM0"),J("TXwP"),J("psGv")],Y=function(X,H,P){return N(X,H,P)}.apply(Ee,le),Y!==void 0&&(Je.exports=Y))},"5Y4S":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return N});var le=J("MNsG");const Y=le.b.performance&&typeof le.b.performance.now=="function";class N{constructor(X){this._highResolution=Y&&X,this._startTime=this._now(),this._stopTime=-1}static create(X=!0){return new N(X)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?le.b.performance.now():Date.now()}}},"6UM0":function(Je,Ee,J){var le,Y;(function(){var N;(function(){"use strict";var H=[function(n,L,y){var m=y(1).Beautifier,g=y(5).Options;function l(h,p){var o=new m(h,p);return o.beautify()}n.exports=l,n.exports.defaultOptions=function(){return new g}},function(n,L,y){var m=y(2).Output,g=y(3).Token,l=y(4),h=y(5).Options,p=y(7).Tokenizer,o=y(7).line_starters,u=y(7).positionable_operators,s=y(7).TOKEN;function a(v,W){return W.indexOf(v)!==-1}function R(v){return v.replace(/^\s+/g,"")}function x(v){for(var W={},Z=0;Z<v.length;Z++)W[v[Z].replace(/-/g,"_")]=v[Z];return W}function S(v,W){return v&&v.type===s.RESERVED&&v.text===W}function D(v,W){return v&&v.type===s.RESERVED&&a(v.text,W)}var O=["case","return","do","if","throw","else","await","break","continue","async"],A=["before-newline","after-newline","preserve-newline"],C=x(A),T=[C.before_newline,C.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function f(v,W){if(W.multiline_frame||W.mode===d.ForInitializer||W.mode===d.Conditional)return;v.remove_indent(W.start_line_index)}function b(v){v=v.replace(l.allLineBreaks,`
`);for(var W=[],Z=v.indexOf(`
`);Z!==-1;)W.push(v.substring(0,Z)),v=v.substring(Z+1),Z=v.indexOf(`
`);return v.length&&W.push(v),W}function _(v){return v===d.ArrayLiteral}function j(v){return a(v,[d.Expression,d.ForInitializer,d.Conditional])}function U(v,W){for(var Z=0;Z<v.length;Z++){var oe=v[Z].trim();if(oe.charAt(0)!==W)return!1}return!0}function w(v,W){for(var Z=0,oe=v.length,fe;Z<oe;Z++)if(fe=v[Z],fe&&fe.indexOf(W)!==0)return!1;return!0}function M(v,W){W=W||{},this._source_text=v||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new h(W)}M.prototype.create_flags=function(v,W){var Z=0;v&&(Z=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>Z&&(Z=v.line_indent_level));var oe={mode:W,parent:v,last_token:v?v.last_token:new g(s.START_BLOCK,""),last_word:v?v.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:Z,alignment:0,line_indent_level:v?v.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},M.prototype._reset=function(v){var W=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var Z=new p(v,this._options);return this._tokens=Z.tokenize(),v},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,W=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
`,W&&l.lineBreak.test(W||"")&&(Z=W.match(l.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return v=this._output.get_code(Z),v},M.prototype.handle_token=function(v,W){v.type===s.START_EXPR?this.handle_start_expr(v):v.type===s.END_EXPR?this.handle_end_expr(v):v.type===s.START_BLOCK?this.handle_start_block(v):v.type===s.END_BLOCK?this.handle_end_block(v):v.type===s.WORD?this.handle_word(v):v.type===s.RESERVED?this.handle_word(v):v.type===s.SEMICOLON?this.handle_semicolon(v):v.type===s.STRING?this.handle_string(v):v.type===s.EQUALS?this.handle_equals(v):v.type===s.OPERATOR?this.handle_operator(v):v.type===s.COMMA?this.handle_comma(v):v.type===s.BLOCK_COMMENT?this.handle_block_comment(v,W):v.type===s.COMMENT?this.handle_comment(v,W):v.type===s.DOT?this.handle_dot(v):v.type===s.EOF?this.handle_eof(v):v.type===s.UNKNOWN?this.handle_unknown(v,W):this.handle_unknown(v,W)},M.prototype.handle_whitespace_and_comments=function(v,W){var Z=v.newlines,oe=this._options.keep_array_indentation&&_(this._flags.mode);if(v.comments_before)for(var fe=v.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,W),this.handle_token(fe,W),fe=v.comments_before.next();if(oe)for(var Ae=0;Ae<Z;Ae+=1)this.print_newline(Ae>0,W);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,W);for(var be=1;be<Z;be+=1)this.print_newline(!0,W)}};var I=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(v,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&v.newlines||W,oe=a(this._flags.last_token.text,u)||a(v.text,u);if(oe){var fe=a(this._flags.last_token.text,u)&&a(this._options.operator_position,T)||a(v.text,u);Z=Z&&fe}if(Z)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(v,W){if(!W&&(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 Z=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.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(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),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&&f(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(v){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&v.type===s.WORD,W=W||S(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&D(this._flags.last_token,I)&&!v.newlines,W=W||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),W=W||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),W=W||this._flags.last_token.type===s.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==s.WORD&&v.type!==s.RESERVED,W=W||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,D(v,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var W=d.Expression;if(v.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(v),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=d.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),a(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=d.ForInitializer):a(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=d.Conditional):a(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.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(v);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var oe=this._tokens.peek(-4);D(Z,["async","function"])||Z.text==="*"&&D(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(oe.text==="{"||oe.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(v);(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(v,v.newlines),this.print_token(v),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(v){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&_(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(v),this.restore_mode(),f(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(v){this.handle_whitespace_and_comments(v);var W=this._tokens.peek(),Z=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):Z&&(a(Z.text,[":",","])&&a(W.type,[s.STRING,s.WORD,s.RESERVED])||a(W.text,["get","set","..."])&&a(Z.type,[s.WORD,s.RESERVED]))?a(this._last_last_text,["class","interface"])&&!a(Z.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 oe=!W.comments_before&&W.text==="}",fe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Ae=0,be=null;this._flags.inline_frame=!0;do if(Ae+=1,be=this._tokens.peek(Ae-1),be.newlines){this._flags.inline_frame=!1;break}while(be.type!==s.EOF&&!(be.type===s.END_BLOCK&&be.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(fe||this._flags.last_token.type===s.EQUALS||D(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(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(v),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(v),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===d.Statement;)this.restore_mode();var W=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(_(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(v)},M.prototype.handle_word=function(v){if(v.type===s.RESERVED){if(a(v.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)v.type=s.WORD;else if(v.text==="import"&&a(this._tokens.peek().text,["(","."]))v.type=s.WORD;else if(a(v.text,["as","from"])&&!this._flags.import_block)v.type=s.WORD;else if(this._flags.mode===d.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(v.type=s.WORD)}}if(this.start_of_statement(v)?D(this._flags.last_token,["var","let","const"])&&v.type===s.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!j(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(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(S(v,"while")){this._output.space_before_token=!0,this.print_token(v),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&&S(v,"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(v,["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(v),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(v)),S(v,"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()&&!v.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:S(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&&(j(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var Z="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":D(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?Z="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&j(this._flags.mode)?Z="SPACE":this._flags.last_token.type===s.STRING?Z="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,["{",","]))?Z="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),D(v,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),D(v,["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"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?D(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(v,["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(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(v,"if")&&S(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(v,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===s.WORD||v.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===s.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(v,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var W=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},M.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),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(v):v.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},M.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},M.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(v)):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(v)},M.prototype.handle_operator=function(v){var W=v.text==="*"&&(D(this._flags.last_token,["function","yield"])||a(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),Z=a(v.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(v)){var oe=!W;this.handle_whitespace_and_comments(v,oe)}if(v.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===s.OPERATOR&&a(this._options.operator_position,T)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),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 fe=!0,Ae=!0,be=!1;if(v.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,be=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!W&&this._options.preserve_newlines&&a(v.text,u)){var Re=v.text===":",Ce=Re&&be,Le=Re&&!be;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Le,this.print_token(v),(!Re||Ce)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!Re||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case C.preserve_newline:Le||this.allow_wrap_or_preserved_newline(v),fe=!(this._output.just_added_newline()||Le),this._output.space_before_token=fe,this.print_token(v),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(v),fe=!1;var ve=this._tokens.peek();Ae=ve&&a(ve.type,[s.WORD,s.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),fe=this._flags.last_token.type===s.START_BLOCK,Ae=!1;else if(a(v.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),fe=!1,Ae=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var $=D(this._flags.last_token,O)&&v.newlines;$&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline($,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(fe=!0),this._flags.last_token.type===s.RESERVED?fe=!0:this._flags.last_token.type===s.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===s.OPERATOR&&(fe=a(v.text,["--","-","++","+"])&&a(this._flags.last_token.text,["--","-","++","+"]),a(v.text,["+","-"])&&a(this._flags.last_token.text,["--","++"])&&(Ae=!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||fe,this.print_token(v),this._output.space_before_token=Ae},M.prototype.handle_block_comment=function(v,W){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,W),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,W)},M.prototype.print_block_commment=function(v,W){var Z=b(v.text),oe,fe=!1,Ae=!1,be=v.whitespace_before,Re=be.length;if(this.print_newline(!1,W),this.print_token_line_indentation(v),this._output.add_token(Z[0]),this.print_newline(!1,W),Z.length>1){for(Z=Z.slice(1),fe=U(Z,"*"),Ae=w(Z,be),fe&&(this._flags.alignment=1),oe=0;oe<Z.length;oe++)fe?(this.print_token_line_indentation(v),this._output.add_token(R(Z[oe]))):Ae&&Z[oe]?(this.print_token_line_indentation(v),this._output.add_token(Z[oe].substring(Re))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[oe])),this.print_newline(!1,W);this._flags.alignment=0}},M.prototype.handle_comment=function(v,W){v.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,W)},M.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},M.prototype.handle_unknown=function(v,W){this.print_token(v),v.text[v.text.length-1]===`
`&&this.print_newline(!1,W)},M.prototype.handle_eof=function(v){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},n.exports.Beautifier=M},function(n){function L(g){this.__parent=g,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=[]}L.prototype.clone_empty=function(){var g=new L(this.__parent);return g.set_indent(this.__indent_count,this.__alignment_count),g},L.prototype.item=function(g){return g<0?this.__items[this.__items.length+g]:this.__items[g]},L.prototype.has_match=function(g){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(g))return!0;return!1},L.prototype.set_indent=function(g,l){this.is_empty()&&(this.__indent_count=g||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var g=this.__parent.current_line;return g.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),g.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),g.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,g.__items[0]===" "&&(g.__items.splice(0,1),g.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(g){this.__items.push(g);var l=g.lastIndexOf(`
`);l!==-1?this.__character_count=g.length-l:this.__character_count+=g.length},L.prototype.pop=function(){var g=null;return this.is_empty()||(g=this.__items.pop(),this.__character_count-=g.length),g},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var g="";return this.is_empty()?this.__parent.indent_empty_lines&&(g=this.__parent.get_indent_string(this.__indent_count)):(g=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),g+=this.__items.join("")),g};function y(g,l){this.__cache=[""],this.__indent_size=g.indent_size,this.__indent_string=g.indent_char,g.indent_with_tabs||(this.__indent_string=new Array(g.indent_size+1).join(g.indent_char)),l=l||"",g.indent_level>0&&(l=new Array(g.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(g,l){var h=this.__base_string_length;return l=l||0,g<0&&(h=0),h+=g*this.__indent_size,h+=l,h},y.prototype.get_indent_string=function(g,l){var h=this.__base_string;return l=l||0,g<0&&(g=0,h=""),l+=g*this.__indent_size,this.__ensure_cache(l),h+=this.__cache[l],h},y.prototype.__ensure_cache=function(g){for(;g>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var g=this.__cache.length,l=0,h="";this.__indent_size&&g>=this.__indent_size&&(l=Math.floor(g/this.__indent_size),g-=l*this.__indent_size,h=new Array(l+1).join(this.__indent_string)),g&&(h+=new Array(g+1).join(" ")),this.__cache.push(h)};function m(g,l){this.__indent_cache=new y(g,l),this.raw=!1,this._end_with_newline=g.end_with_newline,this.indent_size=g.indent_size,this.wrap_line_length=g.wrap_line_length,this.indent_empty_lines=g.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(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(g,l){return this.__indent_cache.get_indent_string(g,l)},m.prototype.get_indent_size=function(g,l){return this.__indent_cache.get_indent_size(g,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(g){return this.is_empty()||!g&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(g){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
`);return g!==`
`&&(h=h.replace(/[\n]/g,g)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(g,l){return g=g||0,l=l||0,this.next_line.set_indent(g,l),this.__lines.length>1?(this.current_line.set_indent(g,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(g){for(var l=0;l<g.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(g.whitespace_before),this.current_line.push(g.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(g){this.__add_space_before_token(),this.current_line.push(g),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(g){for(var l=this.__lines.length;g<l;)this.__lines[g]._remove_indent(),g++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(g){for(g=g===void 0?!1:g,this.current_line.trim();g&&this.__lines.length>1&&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(g,l){for(var h=this.__lines.length-2;h>=0;){var p=this.__lines[h];if(p.is_empty())break;if(p.item(0).indexOf(g)!==0&&p.item(-1)!==l){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},n.exports.Output=m},function(n){function L(y,m,g,l){this.type=y,this.text=m,this.comments_before=null,this.newlines=g||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=L},function(n,L){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\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",l="\\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",h="(?:\\\\u[0-9a-fA-F]{4}|["+y+g+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+m+g+l+"])*";L.identifier=new RegExp(h+p,"g"),L.identifierStart=new RegExp(h),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+g+l+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(n,L,y){var m=y(6).Options,g=["before-newline","after-newline","preserve-newline"];function l(h){m.call(this,h,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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<o.length;u++)o[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[u];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",g),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new m,n.exports.Options=l},function(n){function L(g,l){this.raw_options=y(g,l),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"])}L.prototype._get_array=function(g,l){var h=this.raw_options[g],p=l||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(p=h.concat()):typeof h=="string"&&(p=h.split(/[^a-zA-Z0-9_\/\-]+/)),p},L.prototype._get_boolean=function(g,l){var h=this.raw_options[g],p=h===void 0?!!l:!!h;return p},L.prototype._get_characters=function(g,l){var h=this.raw_options[g],p=l||"";return typeof h=="string"&&(p=h.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},L.prototype._get_number=function(g,l){var h=this.raw_options[g];l=parseInt(l,10),isNaN(l)&&(l=0);var p=parseInt(h,10);return isNaN(p)&&(p=l),p},L.prototype._get_selection=function(g,l,h){var p=this._get_selection_list(g,l,h);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+g+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[g]+"'");return p[0]},L.prototype._get_selection_list=function(g,l,h){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[l[0]],!this._is_valid_selection(h,l))throw new Error("Invalid Default Value!");var p=this._get_array(g,h);if(!this._is_valid_selection(p,l))throw new Error("Invalid Option Value: The option '"+g+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[g]+"'");return p},L.prototype._is_valid_selection=function(g,l){return g.length&&l.length&&!g.some(function(h){return l.indexOf(h)===-1})};function y(g,l){var h={};g=m(g);var p;for(p in g)p!==l&&(h[p]=g[p]);if(l&&g[l])for(p in g[l])h[p]=g[l][p];return h}function m(g){var l={},h;for(h in g){var p=h.replace(/-/g,"_");l[p]=g[h]}return l}n.exports.Options=L,n.exports.normalizeOpts=m,n.exports.mergeOpts=y},function(n,L,y){var m=y(8).InputScanner,g=y(9).Tokenizer,l=y(9).TOKEN,h=y(13).Directives,p=y(4),o=y(12).Pattern,u=y(14).TemplatablePattern;function s(U,w){return w.indexOf(U)!==-1}var a={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},R=new h(/\/\*/,/\*\//),x=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,D=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),A=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";A=A.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),A="\\?\\.(?!\\d) "+A,A=A.replace(/ /g,"|");var C=new RegExp(A),T="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=T.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),f=new RegExp("^(?:"+d.join("|")+")$"),b,_=function(U,w){g.call(this,U,w),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(p.identifier).matching(p.identifierMatch),number:M.matching(x),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(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(p.lineBreak),shebang:M.starting_with(/#!/).until_after(p.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(/[`}\\]/)}};_.prototype=new g,_.prototype._is_comment=function(U){return U.type===a.COMMENT||U.type===a.BLOCK_COMMENT||U.type===a.UNKNOWN},_.prototype._is_opening=function(U){return U.type===a.START_BLOCK||U.type===a.START_EXPR},_.prototype._is_closing=function(U,w){return(U.type===a.END_BLOCK||U.type===a.END_EXPR)&&w&&(U.text==="]"&&w.text==="["||U.text===")"&&w.text==="("||U.text==="}"&&w.text==="{")},_.prototype._reset=function(){b=!1},_.prototype._get_next_token=function(U,w){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(U),M=M||this._read_singles(I),M=M||this._read_comment(I),M=M||this._read_regexp(I,U),M=M||this._read_xml(I,U),M=M||this._read_punctuation(),M=M||this._create_token(a.UNKNOWN,this._input.next()),M)},_.prototype._read_word=function(U){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(p.allLineBreaks,`
`),!(U.type===a.DOT||U.type===a.RESERVED&&(U.text==="set"||U.text==="get"))&&f.test(w)?(w==="in"||w==="of")&&(U.type===a.WORD||U.type===a.STRING)?this._create_token(a.OPERATOR,w):this._create_token(a.RESERVED,w):this._create_token(a.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(a.WORD,w)},_.prototype._read_singles=function(U){var w=null;return U==="("||U==="["?w=this._create_token(a.START_EXPR,U):U===")"||U==="]"?w=this._create_token(a.END_EXPR,U):U==="{"?w=this._create_token(a.START_BLOCK,U):U==="}"?w=this._create_token(a.END_BLOCK,U):U===";"?w=this._create_token(a.SEMICOLON,U):U==="."&&D.test(this._input.peek(1))?w=this._create_token(a.DOT,U):U===","&&(w=this._create_token(a.COMMA,U)),w&&this._input.next(),w},_.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(a.EQUALS,U):U==="?."?this._create_token(a.DOT,U):this._create_token(a.OPERATOR,U)},_.prototype._read_non_javascript=function(U){var w="";if(U==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(a.UNKNOWN,w.trim()+`
`);if(w=this.__patterns.include.read(),w)return this._create_token(a.UNKNOWN,w.trim()+`
`);U=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(S)){do U=this._input.next(),M+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(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(U==="<"&&this._is_first_token()){if(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)w+=this._input.next();return b=!0,this._create_token(a.COMMENT,w)}}else if(b&&U==="-"&&(w=this.__patterns.html_comment_end.read(),w))return b=!1,this._create_token(a.COMMENT,w);return null},_.prototype._read_comment=function(U){var w=null;if(U==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var I=R.get_directives(M);I&&I.ignore==="start"&&(M+=R.readIgnored(this._input)),M=M.replace(p.allLineBreaks,`
`),w=this._create_token(a.BLOCK_COMMENT,M),w.directives=I}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),w=this._create_token(a.COMMENT,M))}return w},_.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var w=this._input.next();return this.has_char_escapes=!1,U==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(w=j(w)),this._input.peek()===U&&(w+=this._input.next()),w=w.replace(p.allLineBreaks,`
`),this._create_token(a.STRING,w)}return null},_.prototype._allow_regexp_or_xml=function(U){return U.type===a.RESERVED&&s(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===a.END_EXPR&&U.text===")"&&U.opened.previous.type===a.RESERVED&&s(U.opened.previous.text,["if","while","for"])||s(U.type,[a.COMMENT,a.START_EXPR,a.START_BLOCK,a.START,a.END_BLOCK,a.OPERATOR,a.EQUALS,a.EOF,a.SEMICOLON,a.COMMA])},_.prototype._read_regexp=function(U,w){if(U==="/"&&this._allow_regexp_or_xml(w)){for(var M=this._input.next(),I=!1,v=!1;this._input.hasNext()&&(I||v||this._input.peek()!==U)&&!this._input.testChar(p.newline);)M+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===U&&(M+=this._input.next(),M+=this._input.read(p.identifier)),this._create_token(a.STRING,M)}return null},_.prototype._read_xml=function(U,w){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(w)){var M="",I=this.__patterns.xml.read_match();if(I){for(var v=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=v.indexOf("{")===0,Z=0;I;){var oe=!!I[1],fe=I[2],Ae=!!I[I.length-1]||fe.slice(0,8)==="![CDATA[";if(!Ae&&(fe===v||W&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--Z:++Z),M+=I[0],Z<=0)break;I=this.__patterns.xml.read_match()}return I||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(p.allLineBreaks,`
`),this._create_token(a.STRING,M)}}return null};function j(U){for(var w="",M=0,I=new m(U),v=null;I.hasNext();)if(v=I.match(/([\s]|[^\\]|\\\\)+/g),v&&(w+=v[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")v=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")v=I.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",I.hasNext()&&(w+=I.next());continue}if(!v)return U;if(M=parseInt(v[1],16),M>126&&M<=255&&v[0].indexOf("x")===0)return U;if(M>=0&&M<32){w+="\\"+v[0];continue}else M===34||M===39||M===92?w+="\\"+String.fromCharCode(M):w+=String.fromCharCode(M)}return w}_.prototype._read_string_recursive=function(U,w,M){var I,v;U==="'"?v=this.__patterns.single_quote:U==='"'?v=this.__patterns.double_quote:U==="`"?v=this.__patterns.template_text:U==="}"&&(v=this.__patterns.template_expression);for(var W=v.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===U||!w&&p.newline.test(Z)){this._input.back();break}else Z==="\\"&&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(),Z+=this._input.next()):M&&(M==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),M===Z&&(U==="`"?Z+=this._read_string_recursive("}",w,"`"):Z+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=v.read(),W+=Z}return W},n.exports.Tokenizer=_,n.exports.TOKEN=a,n.exports.positionable_operators=O.slice(),n.exports.line_starters=T.slice()},function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var g=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(g=this.__input.charAt(m)),g},y.prototype.__match=function(m,g){m.lastIndex=g;var l=m.exec(this.__input);return l&&!(L&&m.sticky)&&(l.index!==g&&(l=null)),l},y.prototype.test=function(m,g){return g=g||0,g+=this.__position,g>=0&&g<this.__input_length?!!this.__match(m,g):!1},y.prototype.testChar=function(m,g){var l=this.peek(g);return m.lastIndex=0,l!==null&&m.test(l)},y.prototype.match=function(m){var g=this.__match(m,this.__position);return g?this.__position+=g[0].length:g=null,g},y.prototype.read=function(m,g,l){var h="",p;return m&&(p=this.match(m),p&&(h+=p[0])),g&&(p||!m)&&(h+=this.readUntil(g,l)),h},y.prototype.readUntil=function(m,g){var l="",h=this.__position;m.lastIndex=this.__position;var p=m.exec(this.__input);return p?(h=p.index,g&&(h+=p[0].length)):h=this.__input_length,l=this.__input.substring(this.__position,h),this.__position=h,l},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,g){var l=null,h="g";return g&&L&&(h="y"),typeof m=="string"&&m!==""?l=new RegExp(m,h):m&&(l=new RegExp(m.source,h)),l},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var g=this.__position,l=this.readUntilAfter(m);return this.__position=g,l},y.prototype.lookBack=function(m){var g=this.__position-1;return g>=m.length&&this.__input.substring(g-m.length,g).toLowerCase()===m},n.exports.InputScanner=y},function(n,L,y){var m=y(8).InputScanner,g=y(3).Token,l=y(10).TokenStream,h=y(11).WhitespacePattern,p={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 h(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var u,s=new g(p.START,""),a=null,R=[],x=new l;s.type!==p.EOF;){for(u=this._get_next_token(s,a);this._is_comment(u);)x.add(u),u=this._get_next_token(s,a);x.isEmpty()||(u.comments_before=x,x=new l),u.parent=a,this._is_opening(u)?(R.push(a),a=u):a&&this._is_closing(u,a)&&(u.opened=a,a.closed=u,a=R.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(p.RAW,a):this._create_token(p.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 g(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=o,n.exports.TOKEN=p},function(n){function L(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},L.prototype.peek=function(y){var m=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(m=this.__tokens[y]),m},L.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},n.exports.TokenStream=L},function(n,L,y){var m=y(12).Pattern;function g(l,h){m.call(this,l,h),h?this._line_regexp=this._input.get_regexp(h._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}g.prototype=new m,g.prototype.__set_whitespace_patterns=function(l,h){l+="\\t ",h+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+h+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+h+"]")},g.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var h=this.__split(this._newline_regexp,l);this.newline_count=h.length-1,this.whitespace_before_token=h[this.newline_count]}return l},g.prototype.matching=function(l,h){var p=this._create();return p.__set_whitespace_patterns(l,h),p._update(),p},g.prototype._create=function(){return new g(this._input,this)},g.prototype.__split=function(l,h){l.lastIndex=0;for(var p=0,o=[],u=l.exec(h);u;)o.push(h.substring(p,u.index)),p=u.index+u[0].length,u=l.exec(h);return p<h.length?o.push(h.substring(p,h.length)):o.push(""),o},n.exports.WhitespacePattern=g},function(n){function L(y,m){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}L.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},L.prototype.read_match=function(){return this._input.match(this._match_pattern)},L.prototype.until_after=function(y){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(y),m._update(),m},L.prototype.until=function(y){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(y),m._update(),m},L.prototype.starting_with=function(y){var m=this._create();return m._starting_pattern=this._input.get_regexp(y,!0),m._update(),m},L.prototype.matching=function(y){var m=this._create();return m._match_pattern=this._input.get_regexp(y,!0),m._update(),m},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},n.exports.Pattern=L},function(n){function L(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var g=this.__directive_pattern.exec(y);g;)m[g[1]]=g[2],g=this.__directive_pattern.exec(y);return m},L.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=L},function(n,L,y){var m=y(12).Pattern,g={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(h,p){m.call(this,h,p),this.__template_pattern=null,this._disabled=Object.assign({},g),this._excluded=Object.assign({},g),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var o=new m(h);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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}/)}}l.prototype=new m,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(h){var p=this._create();return p._disabled[h]=!0,p._update(),p},l.prototype.read_options=function(h){var p=this._create();for(var o in g)p._disabled[o]=h.templating.indexOf(o)===-1;return p._update(),p},l.prototype.exclude=function(h){var p=this._create();return p._excluded[h]=!0,p._update(),p},l.prototype.read=function(){var h="";this._match_pattern?h=this._input.read(this._starting_pattern):h=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),h+=p,p=this._read_template();return this._until_after&&(h+=this._input.readUntilAfter(this._until_pattern)),h},l.prototype.__set_templated_pattern=function(){var h=[];this._disabled.php||h.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||h.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||h.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(h.push(this.__patterns.django._starting_pattern.source),h.push(this.__patterns.django_value._starting_pattern.source),h.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||h.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&h.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+h.join("|")+")")},l.prototype._read_template=function(){var h="",p=this._input.peek();if(p==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(h=h||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(h=h||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(h=h||this.__patterns.handlebars_comment.read(),h=h||this.__patterns.handlebars_unescaped.read(),h=h||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(h=h||this.__patterns.django_value.read()),this._excluded.django||(h=h||this.__patterns.django_comment.read(),h=h||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(h=h||this.__patterns.smarty_comment.read(),h=h||this.__patterns.smarty_literal.read(),h=h||this.__patterns.smarty.read()));return h},n.exports.TemplatablePattern=l}],P={};function K(n){var L=P[n];if(L!==void 0)return L.exports;var y=P[n]={exports:{}};return H[n](y,y.exports,K),y.exports}var z=K(0);N=z})();var X=N;!(le=[],Y=function(){return{js_beautify:X}}.apply(Ee,le),Y!==void 0&&(Je.exports=Y))})()},"746U":function(Je,Ee,J){"use strict";J.d(Ee,"f",function(){return le}),J.d(Ee,"l",function(){return Y}),J.d(Ee,"k",function(){return N}),J.d(Ee,"j",function(){return X}),J.d(Ee,"g",function(){return H}),J.d(Ee,"m",function(){return P}),J.d(Ee,"h",function(){return K}),J.d(Ee,"n",function(){return z}),J.d(Ee,"c",function(){return n}),J.d(Ee,"a",function(){return L}),J.d(Ee,"i",function(){return y}),J.d(Ee,"o",function(){return m}),J.d(Ee,"e",function(){return h}),J.d(Ee,"d",function(){return p}),J.d(Ee,"p",function(){return o}),J.d(Ee,"b",function(){return u});function le(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function N(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 H(s){return s===!0||s===!1}function P(s){return typeof s=="undefined"}function K(s){return!z(s)}function z(s){return P(s)||s===null}function n(s,a){if(!s)throw new Error(a?`Unexpected type, expected '${a}'`:"Unexpected type")}function L(s){if(z(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function y(s){return typeof s=="function"}function m(s,a){const R=Math.min(s.length,a.length);for(let x=0;x<R;x++)g(s[x],a[x])}function g(s,a){if(Y(a)){if(typeof s!==a)throw new Error(`argument does not match constraint: typeof ${a}`)}else if(y(a)){try{if(s instanceof a)return}catch(R){}if(!z(s)&&s.constructor===a)return;if(a.length===1&&a.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(s){let a=[],R=Object.getPrototypeOf(s);for(;Object.prototype!==R;)a=a.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return a}function h(s){const a=[];for(const R of l(s))typeof s[R]=="function"&&a.push(R);return a}function p(s,a){const R=S=>function(){const D=Array.prototype.slice.call(arguments,0);return a(S,D)};let x={};for(const S of s)x[S]=R(S);return x}function o(s){return s===null?void 0:s}function u(s,a="Unreachable"){throw new Error(a)}},"7Cbv":function(Je,Ee,J){"use strict";var le=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function N(){if(!le)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(Y)}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 H(g){return typeof g=="string"&&X.test(g)}for(var P=H,K=[],z=0;z<256;++z)K.push((z+256).toString(16).substr(1));function n(g){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=(K[g[l+0]]+K[g[l+1]]+K[g[l+2]]+K[g[l+3]]+"-"+K[g[l+4]]+K[g[l+5]]+"-"+K[g[l+6]]+K[g[l+7]]+"-"+K[g[l+8]]+K[g[l+9]]+"-"+K[g[l+10]]+K[g[l+11]]+K[g[l+12]]+K[g[l+13]]+K[g[l+14]]+K[g[l+15]]).toLowerCase();if(!P(h))throw TypeError("Stringified UUID is invalid");return h}var L=n;function y(g,l,h){g=g||{};var p=g.random||(g.rng||N)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,l){h=h||0;for(var o=0;o<16;++o)l[h+o]=p[o];return l}return L(p)}var m=Ee.a=y},"7ahc":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return R});var le=J("k1fw"),Y=J("0Owb"),N=J("+L6B"),X=J("2/Rp"),H=J("y8nQ"),P=J("Vl3Y"),K=J("tJVT"),z=J("OaEy"),n=J("2fM7"),L=J("q1tI"),y=J.n(L),m=J("VrN/"),g=J.n(m),l=J("p77/"),h=J.n(l),p=J("c5Ni"),o=J.n(p),u=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},a={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ee.b=function(x){var S=x.callback,D=x.onCancel,O=Object(L.useState)("python"),A=Object(K.a)(O,2),C=A[0],T=A[1];function d(b){T(a[b][1])}function f(b){S(b)}return y.a.createElement(P.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:f}),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(n.a,{onChange:d},Object.keys(a).map(function(b){return y.a.createElement(u,{key:b,value:b},a[b][0])}))),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(R,{mode:C})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(X.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(x){var S=x.value,D=x.onChange,O=x.mode,A=x.options,C=A===void 0?{}:A,T=Object(L.useRef)(),d=Object(L.useState)(),f=Object(K.a)(d,2),b=f[0],_=f[1];return Object(L.useEffect)(function(){if(b){function j(U){var w=U.getValue();D&&D(w)}return b.on("change",j),function(){b.off("change",j)}}},[b,D]),Object(L.useEffect)(function(){b&&b.setOption("mode",O)},[b,O]),Object(L.useEffect)(function(){b&&((S!==b.getValue()||S==="")&&setTimeout(function(){b.setValue(S||" ")},300))},[b,S]),Object(L.useEffect)(function(){if(T.current&&!b){var j=g.a.fromTextArea(T.current,Object(le.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},C));_(j)}},[T.current,b]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:T}))}},"8EBN":function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){"use strict";le.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 Y=0;Y<le.modeInfo.length;Y++){var N=le.modeInfo[Y];N.mimes&&(N.mime=N.mimes[0])}le.findModeByMIME=function(X){X=X.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var P=le.modeInfo[H];if(P.mime==X)return P;if(P.mimes){for(var K=0;K<P.mimes.length;K++)if(P.mimes[K]==X)return P}}if(/\+xml$/.test(X))return le.findModeByMIME("application/xml");if(/\+json$/.test(X))return le.findModeByMIME("application/json")},le.findModeByExtension=function(X){X=X.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var P=le.modeInfo[H];if(P.ext){for(var K=0;K<P.ext.length;K++)if(P.ext[K]==X)return P}}},le.findModeByFileName=function(X){for(var H=0;H<le.modeInfo.length;H++){var P=le.modeInfo[H];if(P.file&&P.file.test(X))return P}var K=X.lastIndexOf("."),z=K>-1&&X.substring(K+1,X.length);if(z)return le.findModeByExtension(z)},le.findModeByName=function(X){X=X.toLowerCase();for(var H=0;H<le.modeInfo.length;H++){var P=le.modeInfo[H];if(P.name.toLowerCase()==X)return P;if(P.alias){for(var K=0;K<P.alias.length;K++)if(P.alias[K].toLowerCase()==X)return P}}}})},"8HAY":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return H}),J.d(Ee,"b",function(){return P}),J.d(Ee,"d",function(){return K}),J.d(Ee,"e",function(){return z}),J.d(Ee,"c",function(){return n});var le=J("MI8n"),Y=J("pmY6"),N=J("3/fG"),X=function(L,y,m,g){function l(h){return h instanceof m?h:new m(function(p){p(h)})}return new(m||(m=Promise))(function(h,p){function o(a){try{s(g.next(a))}catch(R){p(R)}}function u(a){try{s(g.throw(a))}catch(R){p(R)}}function s(a){a.done?h(a.value):l(a.value).then(o,u)}s((g=g.apply(L,y||[])).next())})};class H extends Y.a{constructor(L,y="",m="",g=!0,l){super();this._onDidChange=this._register(new le.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=y,this._cssClass=m,this._enabled=g,this._actionCallback=l}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,y){return X(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class P extends Y.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new le.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new le.b),this.onDidRun=this._onDidRun.event}run(L,y){return X(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let m;try{yield this.runAction(L,y)}catch(g){m=g}this._onDidRun.fire({action:L,error:m})})}runAction(L,y){return X(this,void 0,void 0,function*(){yield L.run(y)})}}class K extends H{constructor(L){super(K.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class z{constructor(L,y,m,g){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=y,this.class=g,this._actions=m}get actions(){return this._actions}dispose(){}run(){return X(this,void 0,void 0,function*(){})}}class n extends H{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(Je,Ee,J){Je.exports={button:"button___1wy9m"}},"9Bee":function(Je,Ee,J){"use strict";var le=J("DYRE"),Y=J("zeV3"),N=J("+L6B"),X=J("2/Rp"),H=J("k1fw"),P=J("9og8"),K=J("tJVT"),z=J("WmNS"),n=J.n(z),L=J("q1tI"),y=J.n(L),m=J("vg9a"),g=J("DlQD"),l=J.n(g),h=J("rUJ1");function p(ce,ee){var ne=ce.match(/^(\s+)(?:```)/);if(ne===null)return ee;var ae=ne[1];return ee.split(`
`).map(function(de){var re=de.match(/^\s+/);if(re===null)return de;var se=Object(K.a)(re,1),pe=se[0];return pe.length>=ae.length?de.slice(ae.length):de}).join(`
`)}var o=[],u=["<ul>"],s=new l.a.Renderer,a=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,u=["<ul>"]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(ce,ee,ne,ae){if(ee>=ce.length||ce[ee].level<=ne)return ee;var de=ce[ee];ae.push("<li><a href='#"+de.anchor+"'>"+de.text+"</a>"),ee++;var re=[];return ee=S(ce,ee,de.level,re),re.length>0&&(ae.push("<ul>"),re.forEach(function(se){ae.push(se)}),ae.push("</ul>")),ae.push("</li>"),ee=S(ce,ee,ne,ae),ee}function D(){return S(o,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(ee){var ne=a.exec(ee);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},fences:function(ee){var ne=this.rules.block.fences.exec(ee);if(ne){var ae=ne[0],de=p(ae,ne[3]||""),re=ne[2]?ne[2].trim():ne[2];if(["latex","katex","math"].indexOf(re)>=0){var se=T(),pe=de;de=se,d[se]={type:"block",expression:pe}}return{type:"code",raw:ae,lang:re,text:de}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,C=0,T=function(){return"__special_katext_id_".concat(C++,"__")},d={};function f(){return d}function b(){C=0,d={}}function _(ce){return ce=ce.replace(A,function(ee,ne){var ae=T();return d[ae]={type:"inline",expression:ne},ae}),ce}var j=s.listitem;s.listitem=function(ce){return j(_(ce))};var U=s.paragraph;s.paragraph=function(ce){return U(_(ce))};var w=s.tablecell;s.tablecell=function(ce,ee){return w(_(ce),ee)},s.code=function(ce,ee,ne){var ae=(ee||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(ce,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ee,'">').concat(ne?ce:Object(h.escape)(ce,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(ne?ce:Object(h.escape)(ce,!0))+"</code></pre>"},s.heading=function(ce,ee,ne){var ae=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:ae,level:ee,text:ce}),"<h"+ee+' id="'+ae+'">'+ce+"</h"+ee+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:O,renderer:s});var M=l.a,I=J("SJMd"),v=J("ulZh"),W=J.n(v),Z=J("m3rI"),oe=J("Oy/b"),fe=J("p5ED"),Ae=J("ErOA"),be=J("STEk");/* **********************************
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 Re=function(ce,ee){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,ae){ne.__proto__=ae}||function(ne,ae){for(var de in ae)Object.prototype.hasOwnProperty.call(ae,de)&&(ne[de]=ae[de])})(ce,ee)};function Ce(ce,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ne(){this.constructor=ce}Re(ce,ee),ce.prototype=ee===null?Object.create(ee):(ne.prototype=ee.prototype,new ne)}function Le(ce,ee,ne,ae){return new(ne||(ne=Promise))(function(de,re){function se(Te){try{me(ae.next(Te))}catch(Oe){re(Oe)}}function pe(Te){try{me(ae.throw(Te))}catch(Oe){re(Oe)}}function me(Te){var Oe;Te.done?de(Te.value):(Oe=Te.value,Oe instanceof ne?Oe:new ne(function(Ne){Ne(Oe)})).then(se,pe)}me((ae=ae.apply(ce,ee||[])).next())})}function ve(ce,ee){var ne,ae,de,re,se={label:0,sent:function(){if(1&de[0])throw de[1];return de[1]},trys:[],ops:[]};return re={next:pe(0),throw:pe(1),return:pe(2)},typeof Symbol=="function"&&(re[Symbol.iterator]=function(){return this}),re;function pe(me){return function(Te){return function(Oe){if(ne)throw new TypeError("Generator is already executing.");for(;se;)try{if(ne=1,ae&&(de=2&Oe[0]?ae.return:Oe[0]?ae.throw||((de=ae.return)&&de.call(ae),0):ae.next)&&!(de=de.call(ae,Oe[1])).done)return de;switch(ae=0,de&&(Oe=[2&Oe[0],de.value]),Oe[0]){case 0:case 1:de=Oe;break;case 4:return se.label++,{value:Oe[1],done:!1};case 5:se.label++,ae=Oe[1],Oe=[0];continue;case 7:Oe=se.ops.pop(),se.trys.pop();continue;default:if(!(de=se.trys,(de=de.length>0&&de[de.length-1])||Oe[0]!==6&&Oe[0]!==2)){se=0;continue}if(Oe[0]===3&&(!de||Oe[1]>de[0]&&Oe[1]<de[3])){se.label=Oe[1];break}if(Oe[0]===6&&se.label<de[1]){se.label=de[1],de=Oe;break}if(de&&se.label<de[2]){se.label=de[2],se.ops.push(Oe);break}de[2]&&se.ops.pop(),se.trys.pop();continue}Oe=ee.call(ce,se)}catch(Ne){Oe=[6,Ne],ae=0}finally{ne=de=0}if(5&Oe[0])throw Oe[1];return{value:Oe[0]?Oe[1]:void 0,done:!0}}([me,Te])}}}var $=function(){function ce(){}return ce.addKey=function(ee){ce.key=ee},Object.defineProperty(ce,"isLicensed",{get:function(){return!!ce.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ce.key)},enumerable:!1,configurable:!0}),ce}(),E=function(){function ce(){}return ce.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ce.setAttributes=function(ee,ne){for(var ae=0,de=ne;ae<de.length;ae++){var re=de[ae],se=re[0],pe=re[1];ee.setAttribute(se,pe)}},ce.createRect=function(ee,ne,ae){var de=document.createElementNS("http://www.w3.org/2000/svg","rect");return de.setAttribute("width",ee.toString()),de.setAttribute("height",ne.toString()),ae&&ce.setAttributes(de,ae),de},ce.createLine=function(ee,ne,ae,de,re){var se=document.createElementNS("http://www.w3.org/2000/svg","line");return se.setAttribute("x1",ee.toString()),se.setAttribute("y1",ne.toString()),se.setAttribute("x2",ae.toString()),se.setAttribute("y2",de.toString()),re&&ce.setAttributes(se,re),se},ce.createPolygon=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",ee),ne&&ce.setAttributes(ae,ne),ae},ce.createCircle=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(ee/2).toString()),ae.setAttribute("cy",(ee/2).toString()),ae.setAttribute("r",ee.toString()),ne&&ce.setAttributes(ae,ne),ae},ce.createEllipse=function(ee,ne,ae){var de=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return de.setAttribute("cx",(ee/2).toString()),de.setAttribute("cy",(ne/2).toString()),de.setAttribute("rx",(ee/2).toString()),de.setAttribute("ry",(ne/2).toString()),ae&&ce.setAttributes(de,ae),de},ce.createGroup=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","g");return ee&&ce.setAttributes(ne,ee),ne},ce.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ce.createMarker=function(ee,ne,ae,de,re,se,pe){var me=document.createElementNS("http://www.w3.org/2000/svg","marker");return ce.setAttributes(me,[["id",ee],["orient",ne],["markerWidth",ae.toString()],["markerHeight",de.toString()],["refX",re.toString()],["refY",se.toString()]]),me.appendChild(pe),me},ce.createText=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","text");return ne.setAttribute("x","0"),ne.setAttribute("y","0"),ee&&ce.setAttributes(ne,ee),ne},ce.createTSpan=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=ee,ne&&ce.setAttributes(ae,ne),ae},ce.createImage=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","image");return ee&&ce.setAttributes(ne,ee),ne},ce.createPoint=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=ee,ae.y=ne,ae},ce.createPath=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",ee),ne&&ce.setAttributes(ae,ne),ae},ce.createElement=function(ee,ne){var ae=document.createElementNS("http://www.w3.org/2000/svg",ee);return ne&&ce.setAttributes(ae,ne),ae},ce.getHollowRectanglePath=function(ee,ne,ae,de,re,se,pe,me){return"M"+ee+","+ne+"V"+(ne+de)+"H"+(ee+ae)+"V"+ne+"H"+re+"V"+se+"H"+(re+pe)+"V"+(se+me)+"H"+re+"V"+ne+"Z"},ce}(),k=function(){function ce(ee){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ee+"_"}return Object.defineProperty(ce.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ce.prototype.addClass=function(ee){return this.styleSheet===void 0&&this.addStyleSheet(),ee.name=""+this.classNamePrefix+ee.localName,this.classes.push(ee),this.styleSheet.sheet.insertRule("."+ee.name+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length),ee},ce.prototype.addRule=function(ee){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ee),this.styleSheet.sheet.insertRule(ee.selector+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length)},ce.prototype.addStyleSheet=function(){var ee;this.styleSheet=document.createElement("style"),((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).appendChild(this.styleSheet),this.addRule(new B("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Q("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Q("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ce.prototype.removeStyleSheet=function(){var ee;this.styleSheet&&(((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ce}(),B=function(ce,ee){this.selector=ce,this.style=ee},Q=function(ce,ee){this.localName=ce,this.style=ee},G=function(){function ce(){this.blocks=[],this.display=""}return ce.prototype.addButtonBlock=function(ee){ee.className=this.blockClassName,ee.buttonClassName=this.buttonClassName,ee.buttonColorsClassName=this.buttonColorsClassName,ee.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ee)},ce.prototype.addElementBlock=function(ee){ee.className===void 0&&(ee.className=this.blockClassName),this.blocks.push(ee)},ce.prototype.getUI=function(){var ee=document.createElement("div");return ee.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ee.style.display=this.display,this.blocks.forEach(function(ne){return ee.appendChild(ne.getUI())}),ee},ce}(),he=function(){function ce(){}return ce.prototype.getUI=function(){var ee=document.createElement("div");if(ee.className=this.className,this.minWidth!==void 0&&(ee.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ee.style.justifyContent="flex-start";break;case"center":ee.style.justifyContent="center";break;case"end":ee.style.justifyContent="flex-end"}return ee.style.whiteSpace="nowrap",ee},ce}(),xe=function(ce){function ee(){var ne=ce!==null&&ce.apply(this,arguments)||this;return ne.buttons=[],ne}return Ce(ee,ce),ee.prototype.addButton=function(ne){ne.className=this.buttonClassName,ne.colorsClassName=this.buttonColorsClassName,ne.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ne)},ee.prototype.getUI=function(){var ne=ce.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return ne.appendChild(ae.getUI())}),ne},ee}(he),Ie=function(){function ce(ee,ne){this._isActive=!1,this._isHidden=!1,this._icon=ee,this.title=ne,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ce.prototype,"icon",{get:function(){return this._icon},set:function(ee){this._icon=ee,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isActive",{get:function(){return this._isActive},set:function(ee){this._isActive=ee,this.adjustClassName()},enumerable:!1,configurable:!0}),ce.prototype.getUI=function(){var ee=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return ee.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ce.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ce.prototype.hide=function(){this._isHidden=!0},ce}(),ue=function(ce){function ee(){var ne=ce!==null&&ce.apply(this,arguments)||this;return ne.elements=[],ne}return Ce(ee,ce),ee.prototype.addElement=function(ne){this.elements.push(ne)},ee.prototype.getUI=function(){var ne=ce.prototype.getUI.call(this);return this.elements.forEach(function(ae){return ne.appendChild(ae)}),ne},ee}(he),ge=function(){function ce(ee,ne){this.horizontal=ee,this.vertical=ne}return Object.defineProperty(ce.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ce.prototype.getVerticalLength=function(ee){return ee/this.ratio},ce.prototype.getHorizontalLength=function(ee){return ee*this.ratio},ce}(),_e=function(){function ce(){}return ce.getIcon=function(ee,ne){if(ee>0&&ne>0){var ae=new ge(ee,ne),de=ae.ratio>=1?20:ae.getHorizontalLength(20),re=ae.ratio<1?20:ae.getVerticalLength(20),se=document.createElementNS("http://www.w3.org/2000/svg","svg");se.setAttribute("xmlns","http://www.w3.org/2000/svg"),se.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(se);var pe=E.createDefs();se.appendChild(pe);var me=E.createElement("clipPath",[["id","text-bg-clip"]]);pe.appendChild(me);var Te=E.createPath(E.getHollowRectanglePath((24-de)/2,(24-re)/2,de,re,(24-de)/2+2,(24-re)/2+2,de-4,re-4));se.appendChild(Te);var Oe=E.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Oe.appendChild(E.createTSpan(ee+":"+ne)),se.appendChild(Oe);var Ne=Oe.getBBox();E.setAttributes(Oe,[["x",((24-Ne.width)/2).toString()],["y",((24-Ne.height)/2-Ne.y).toString()]]);var Ke=E.createPath(E.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ne.width))/2,(24-Math.ceil(Ne.height))/2,Math.ceil(Ne.width),Math.ceil(Ne.height)));return me.appendChild(Ke),E.setAttributes(Te,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(se),se.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ce}(),Se=function(ce){function ee(ne,ae,de){var re=ce.call(this,ne,ae)||this;return re.isDropdownOpen=!1,re.onClick=re.dropdownButtonClicked,re.dropdownButtons=de,re}return Ce(ee,ce),ee.prototype.setupDropdown=function(){var ne=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ae){ae.className=ne.className,ae.colorsClassName=ne.colorsClassName,ne.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ee.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ee.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ee.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ee.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ee.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ee}(Ie),Pe=function(){function ce(ee,ne){this.GRIP_SIZE=10,this.color=ee,this.fillColor=ne,this.visual=E.createGroup(),this.visual.appendChild(E.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(E.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ce.prototype.ownsTarget=function(ee){return ee===this.visual||ee===this.visual.childNodes[0]||ee===this.visual.childNodes[1]},ce.prototype.setCenter=function(ee,ne){this.visual.childNodes.forEach(function(ae){return E.setAttributes(ae,[["cx",ee.toString()],["cy",ne.toString()]])})},ce}(),Ue=function(){function ce(ee,ne,ae,de){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ee,this.canvasHeight=ne,this.margin=ae,this.container=de,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(ce.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ee){this._aspectRatio=ee,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.gridContainer&&E.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ee){this._zoomFactor=ee,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ce.prototype.open=function(){var ee=this;this.cropShadeElement=E.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=E.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var ne=0;ne<this.numberOfGridLines;ne++)this.horizontalGridLines.push(E.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(E.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return ee.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return ee.gridContainer.appendChild(ae)}),this.cropRectElement=E.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ce.prototype.setCropRectangle=function(ee){this.cropRect=ee;var ne=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ne.width=this.cropRect.width*this.zoomFactor,ne.height=this.cropRect.height*this.zoomFactor,ne.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ne.width/2,ne.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ne.height/2),E.setAttributes(this.cropRectElement,[["x",ne.x.toString()],["y",ne.y.toString()],["width",ne.width.toString()],["height",ne.height.toString()]]);var ae=ne.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(re,se){var pe=ne.y+ae*(se+1);E.setAttributes(re,[["x1",""+ne.x],["y1",""+pe],["x2",""+(ne.x+ne.width)],["y2",""+pe]])});var de=ne.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(re,se){var pe=ne.x+de*(se+1);E.setAttributes(re,[["x1",""+pe],["y1",""+ne.y],["x2",""+pe],["y2",""+(ne.y+ne.height)]])}),E.setAttributes(this.cropShadeElement,[["d",E.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ne.x,ne.y,ne.width,ne.height)]]),this.topLeftGrip.setCenter(ne.x,ne.y),this.topRightGrip.setCenter(ne.x+ne.width,ne.y),this.bottomLeftGrip.setCenter(ne.x,ne.y+ne.height),this.bottomRightGrip.setCenter(ne.x+ne.width,ne.y+ne.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ce.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)},ce.prototype.clientToLocalCoordinates=function(ee,ne){var ae=this.container.getBoundingClientRect();return{x:ee-ae.left+this.margin,y:ne-ae.top+this.margin}},ce.prototype.onPointerDown=function(ee){this.container.setPointerCapture(ee.pointerId),this.previousPoint=this.clientToLocalCoordinates(ee.clientX,ee.clientY),this.cropRectElement===ee.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ee.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ee.target)&&(this.activeGrip=this.bottomRightGrip)},ce.prototype.onPointerMove=function(ee){if(this.isMoving)this.move(this.clientToLocalCoordinates(ee.clientX,ee.clientY));else if(this.activeGrip){var ne=this.clientToLocalCoordinates(ee.clientX,ee.clientY);this.resize(ne)}ee.preventDefault()},ce.prototype.onPointerUp=function(ee){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ee.pointerId)},ce.prototype.move=function(ee){var ne=ee.x-this.previousPoint.x,ae=ee.y-this.previousPoint.y;this.zoomFactor!==1&&(ne=-ne/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ne),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ae),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ee},ce.prototype.resize=function(ee){var ne=Object.assign({},this.cropRect),ae=ee.x-this.previousPoint.x,de=ee.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ne.x+ae<this.margin&&(ae=this.margin-ne.x),ne.x+=ae,ne.width=this.cropRect.x+this.cropRect.width-ne.x;break;case this.bottomRightGrip:case this.topRightGrip:ne.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-ne.width),ne.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ne.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),ne.height=this.aspectRatio.getVerticalLength(ne.width)):(ne.y+=de,ne.height=this.cropRect.y+this.cropRect.height-ne.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ne.height=this.aspectRatio.getVerticalLength(ne.width):ne.height+=de}ne.width<10&&(ne.x=this.cropRect.x,ne.width=10),ne.height<10&&(ne.y=this.cropRect.y,ne.height=10),this.previousPoint=ee,ne.x>=this.margin&&ne.y>=this.margin&&ne.x-this.margin+ne.width<=this.canvasWidth&&ne.y-this.margin+ne.height<=this.canvasHeight&&(this.cropRect=ne,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ce.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ee=this.cropRect.x+this.cropRect.width/2,ne=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),de=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<de/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=de,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=ee-this.cropRect.width/2,this.cropRect.y=ne-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)}},ce.prototype.getRescaledRect=function(ee,ne,ae,de,re,se){var pe=ae/ee,me=de/ne;return{x:(re.x-se)*pe+se,y:(re.y-se)*me+se,width:re.width*pe,height:re.height*me}},ce.prototype.scaleCanvas=function(ee,ne){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ee,ne,this.cropRect,this.margin);this.canvasWidth=ee,this.canvasHeight=ne,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ce}(),He=function(){function ce(ee){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ee,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(ce.prototype,"angle",{get:function(){return this._angle},set:function(ee){this._angle=ee,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ce.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},ce.prototype.onPointerDown=function(ee){this.controlContainer.setPointerCapture(ee.pointerId),this.isDragging=!0,this.previousPoint={x:ee.clientX,y:ee.clientY}},ce.prototype.onPointerMove=function(ee){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.previousPoint.x=ee.clientX)},ce.prototype.onPointerUp=function(ee){this.isDragging&&this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ee.pointerId)},ce.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ee=this.angleLabelText.getBBox();E.setAttributes(this.angleLabelElement,[["x",((this.width-ee.width)/2).toString()],["y",(this.height/2).toString()]])}},ce.prototype.positionScaleShape=function(){if(this.scaleShape){var ee=this.scaleShape.transform.baseVal.getItem(0);ee.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ee,0)}},ce.prototype.getVisual=function(){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("width",this.width+"px"),ee.setAttribute("height",this.height+"px"),ee.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ee.style.flexShrink="0",document.body.appendChild(ee);for(var ne="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var de=ae%5==0?this.height/3:this.height/6;ne+="h4v"+-de+"h1v"+de}ne+="v1H0Z",this.scaleShape=E.createPath(ne);var re=E.createTransform();this.scaleShape.transform.baseVal.appendItem(re),ee.appendChild(this.scaleShape),this.angleLabelElement=E.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=E.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var se=E.createTSpan("");return se.innerHTML="&deg;",this.angleLabelElement.appendChild(se),ee.appendChild(this.angleLabelElement),document.body.removeChild(ee),ee},ce}(),Be=function(){function ce(){this.naturalSize=!1,this.imageType="image/png"}return ce.prototype.rasterize=function(ee,ne,ae,de,re,se,pe){var me=this;return new Promise(function(Te){var Oe=document.createElement("canvas");Oe.width=ee.width.baseVal.value-2*de,Oe.height=ee.height.baseVal.value-2*de;var Ne=1,Ke=1;me.naturalSize===!0?(Ne=ne.naturalWidth/(ee.width.baseVal.value-2*de)/se,Ke=ne.naturalHeight/(ee.height.baseVal.value-2*de)/pe,Oe.width=ne.naturalWidth/se,Oe.height=ne.naturalHeight/pe):me.width!==void 0&&me.height!==void 0&&(Ne=me.width/ae.width,Ke=me.height/ae.height,Oe.width*=Ne,Oe.height*=Ke);var nt=Oe.getContext("2d");nt.translate(Oe.width/2,Oe.height/2),nt.rotate(re*Math.PI/180),nt.scale(se,pe),nt.translate(-Oe.width/2,-Oe.height/2),nt.drawImage(ne,0,0,Oe.width,Oe.height);var at=document.createElement("canvas");at.width=ae.width*Ne,at.height=ae.height*Ke,at.getContext("2d").putImageData(nt.getImageData((ae.x-de)*Ne,(ae.y-de)*Ke,ae.width*Ne,ae.height*Ke),0,0),Te(at.toDataURL(me.imageType,me.imageQuality))})},ce}(),Qe=function(){function ce(ee){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=ce.instanceCounter++,this.styles=new k(this.instanceNo),this.target=ee,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(ce.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ee){this._zoomToCropEnabled=ee,ee?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ee){this._gridLines=ee,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ee){this._rotationAngle=ee,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"aspectRatio",{get:function(){var ee;return(ee=this._aspectRatio)!==null&&ee!==void 0?ee:this.aspectRatios[0]},set:function(ee){this._aspectRatio=ee},enumerable:!1,configurable:!0}),ce.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},ce.prototype.show=function(){this.showUI(),this.open()},ce.prototype.close=function(ee){ee===void 0&&(ee=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ee||this.closeEventListeners.forEach(function(ne){return ne()}),this._isOpen=!1)},ce.prototype.addRenderEventListener=function(ee){this.renderEventListeners.push(ee)},ce.prototype.removeRenderEventListener=function(ee){this.renderEventListeners.indexOf(ee)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ee),1)},ce.prototype.addCloseEventListener=function(ee){this.closeEventListeners.push(ee)},ce.prototype.removeCloseEventListener=function(ee){this.closeEventListeners.indexOf(ee)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ee),1)},ce.prototype.setupResizeObserver=function(){var ee=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ee.resize(ee.target.clientWidth,ee.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))},ce.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ee=1*this.target.clientWidth/this.target.clientHeight,ne=this.contentDiv.clientWidth/ee>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ee:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=ne+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ee;this.resize(ne,ae)}},ce.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ce.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",E.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ce.prototype.resize=function(ee,ne){this.imageWidth=Math.round(ee),this.imageHeight=Math.round(ne),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ce.prototype.setEditingTarget=function(){var ee=document.createElement("canvas");ee.width=this.target.naturalWidth,ee.height=this.target.naturalHeight,ee.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ne=ee.toDataURL();E.setAttributes(this.editingTarget,[["href",ne]]),this.setEditingTargetSize()},ce.prototype.setTopLeft=function(){var ee=this.target.getBoundingClientRect(),ne=this.editorCanvas.getBoundingClientRect();this.left=ee.left-ne.left-this.CANVAS_MARGIN,this.top=ee.top-ne.top-this.CANVAS_MARGIN},ce.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=E.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=E.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=E.createGroup(),this.editingTargetRotationScaleContainer=E.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ee=E.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ee);var ne=E.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ne),this.editingTargetContainer=E.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ce.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ce.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=E.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ue(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ce.prototype.zoomToCrop=function(){if(this.cropRect){var ee=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ne=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=ee+"px "+ne+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ee+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ne+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ce.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ce.prototype.cropRectChanged=function(ee){this.cropRect=ee,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ce.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ce.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"},ce.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ce.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var ee=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ne=this.target.offsetTop>ee+this.CANVAS_MARGIN?this.target.offsetTop-(ee+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ne+"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},ce.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ce.prototype.addTopToolbar=function(){var ee=this;this.topToolbar=new G,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 ne=new xe;ne.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ne);var ae=[];this.aspectRatios.forEach(function(Ke){var nt=new Ie(_e.getIcon(Ke.horizontal,Ke.vertical),Ke.horizontal===0&&Ke.vertical===0?"FREE":Ke.horizontal+":"+Ke.vertical);nt.onClick=function(){return ee.ratioButtonClicked(Ke)},ae.push(nt)}),this.aspectRatioButton=new Se(_e.getIcon(0,0),"Aspect ratio",ae),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ne.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var de=new Ie('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");de.isActive=this.isGridVisible,de.onClick=function(){ee.isGridVisible=!ee.isGridVisible,de.isActive=ee.isGridVisible},ne.addButton(de);var re=new Ie('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(re.isActive=this.zoomToCropEnabled,re.onClick=function(){ee.zoomToCropEnabled=!ee.zoomToCropEnabled,re.isActive=ee.zoomToCropEnabled},ne.addButton(re),!$.isLicensed){var se=new ue;this.topToolbar.addElementBlock(se);var pe=document.createElement("div");pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var me=document.createElement("a");me.style.color="currentColor",me.href="https://markerjs.com/products/cropro",me.target="_blank",me.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',pe.appendChild(me),se.addElement(pe)}var Te=new xe;Te.minWidth=3*this.toolbarHeight+"px",Te.contentAlign="end",this.topToolbar.addButtonBlock(Te);var Oe=new Ie('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Oe.onClick=this.startRenderAndClose,Te.addButton(Oe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Oe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ne=new Ie('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Ne.onClick=this.close,Te.addButton(Ne),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ne.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ce.prototype.addBottomToolbar=function(){var ee=this;this.bottomToolbar=new G,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 ne=new xe;ne.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ne);var ae=new Ie('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");ae.onClick=this.rotateLeftButtonClicked,ne.addButton(ae);var de=new Ie('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");de.onClick=this.rotateRightButtonClicked,ne.addButton(de);var re=new ue;re.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(re),this.straightener=new He("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(Te){ee.rotateBy(Te),ee.straightener.angle=ee.rotationAngle},re.addElement(this.straightener.getUI());var se=new xe;se.minWidth=2*this.toolbarHeight+"px",se.contentAlign="end",this.bottomToolbar.addButtonBlock(se);var pe=new Ie('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");pe.onClick=this.flipHorizontallyButtonClicked,se.addButton(pe);var me=new Ie('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");me.onClick=this.flipVerticallyButtonClicked,se.addButton(me)},ce.prototype.ratioButtonClicked=function(ee){this.aspectRatio=ee,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ce.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=_e.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ce.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ge(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ce.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ce.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ce.prototype.restoreState=function(ee){if(ee){var ne=this.cropLayer.getRescaledRect(ee.width,ee.height,this.imageWidth,this.imageHeight,ee.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ne),this.cropRectChanged(ne),this.flippedHorizontally=ee.flippedHorizontally,this.flippedVertically=ee.flippedVertically,this.applyFlip(),this.rotationAngle=ee.rotationAngle,this.applyRotation()}},ce.prototype.clientToLocalCoordinates=function(ee,ne){var ae=this.cropImage.getBoundingClientRect();return{x:ee-ae.left,y:ne-ae.top}},ce.prototype.onWindowResize=function(){this.positionUI()},ce.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ee=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ee+"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()},ce.prototype.rotateLeftButtonClicked=function(){var ee=this.rotationAngle-90;this.rotationAngle%90!=0&&(ee+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ee)},ce.prototype.rotateRightButtonClicked=function(){var ee=this.rotationAngle+90;this.rotationAngle%90!=0&&(ee-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ee)},ce.prototype.rotateTo=function(ee){ee=(ee=ee>180?ee-360:ee)<=-180?ee+360:ee,this.rotationAngle=ee,this.applyRotation()},ce.prototype.rotateBy=function(ee){this.rotateTo((this.rotationAngle+ee)%360)},ce.prototype.applyRotation=function(){var ee=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ne=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ne,0);var ae=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ae.width,this.imageHeight/ae.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ee},ce.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ce.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ce.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ce.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var ee,ne;return ve(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return ee=ae.sent(),ne=this.getState(),this.renderEventListeners.forEach(function(de){return de(ee,ne)}),this.close(!0),[2]}})})},ce.prototype.render=function(){return Le(this,void 0,void 0,function(){var ee;return ve(this,function(ne){switch(ne.label){case 0:return(ee=new Be).naturalSize=this.renderAtNaturalSize,ee.imageType=this.renderImageType,ee.imageQuality=this.renderImageQuality,ee.width=this.renderWidth,ee.height=this.renderHeight,this.unzoomFromCrop(),E.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ee.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 ne.sent(),[4,ee.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,ne.sent()]}})})},ce.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Q("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 Q("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Q("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var ee=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Q("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*ee)+`px;
height: `+(this.toolbarHeight-2*ee)+`px;
padding: `+ee+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Q("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Q("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 Q("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Q("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 Q("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*ee)+`px;
padding: `+ee+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Q("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ce.instanceCounter=0,ce}(),ze=J("8hTe"),Ye=J.n(ze),Me=/<pre[^>]*>/g;function it(ce){var ee=document.createElement("div");return ee.innerHTML=ce,ee.childNodes.length===0?"":ee.childNodes[0].nodeValue}var Ze=Ee.a=function(ce){var ee=ce.value,ne=ee===void 0?"":ee,ae=ce.edit,de=ae===void 0?!1:ae,re=ce.className,se=ce.showTextOnly,pe=ce.showLines,me=ce.replaces,Te=ce.zoomImg,Oe=ce.hasMask,Ne=ce.style,Ke=Ne===void 0?{}:Ne,nt=ce.stylesPrev,at=nt===void 0?{}:nt,xt=String(ne),ut=Object(L.useRef)(),ot=Object(L.useRef)(),Tt=Object(L.useState)(""),St=Object(K.a)(Tt,2),rt=St[0],Gt=St[1],Lt=Object(L.useState)("office"),rn=Object(K.a)(Lt,2),We=rn[0],Pt=rn[1],Yt=function(){var At=new Qe(ot.current);At.displayMode="popup",At.addRenderEventListener(function(){var kt=Object(P.a)(n.a.mark(function ft(yt){var Rt;return n.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return ut.current.style.display="none",$t.next=3,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yt}});case 3:Rt=$t.sent,Rt!=null&&Rt.id&&me(ot.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 5:case"end":return $t.stop()}},ft)}));return function(ft){return kt.apply(this,arguments)}}()),At.show()},pt=function(){var At=new be.a(ot.current);At.settings.displayMode="popup",At.addEventListener("render",function(){var kt=Object(P.a)(n.a.mark(function ft(yt){var Rt;return n.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:if(ut.current.style.display="none",!ot.current){$t.next=6;break}return $t.next=4,Object(Ae.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yt.dataUrl}});case 4:Rt=$t.sent,Rt!=null&&Rt.id&&me(ot.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 6:case"end":return $t.stop()}},ft)}));return function(ft){return kt.apply(this,arguments)}}()),At.show(),window.markerArea=At},Et=Object(L.useMemo)(function(){ut.current&&(ut.current.style.zIndex=-1);try{var tt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,At=/\"\/api\/attachments\/|\"\/attachments\/download\//g,kt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xt=xt.replace(tt,"("+Z.a.API_SERVER+"/api/attachments/").replace(At,'"'+Z.a.API_SERVER+"/api/attachments/").replace(kt,'"'+Z.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(qt){}var ft=M(xt),yt=f();if(xt.match(/\[TOC\]/)&&(ft=ft.replace("<p>[TOC]</p>",D()),R()),ft=ft.replace(/(__special_katext_id_\d+__)/g,function(qt,$t){var Ge=yt[$t],mt=Ge.type,nr=Ge.expression;return Object(oe.renderToString)(it(nr)||"",{displayMode:mt==="block",throwOnError:!1,output:"html"})}),ft=ft.replace(/▁/g,"\u2581\u2581\u2581"),b(),se){var Rt=document.createElement("div");return Rt.innerHTML=ft,Rt.innerText}return setTimeout(function(){return vn()},500),ft},[xt]),wt=Object(L.useRef)();x.WebkitLineClamp=pe,pe&&(Ke=Object(H.a)(Object(H.a)({},Ke),x));function Zt(tt){var At=tt.target;if(At.tagName.toUpperCase()==="IMG"){if(Te){var kt=At.getAttribute("src");Gt(kt),Pt("image")}}else if(At.tagName.toUpperCase()==="A"){var ft=At.getAttribute("href");if(ft.indexOf("office")>-1)tt.preventDefault(),Gt(ft),Pt("office");else if(ft.indexOf("application/pdf")>-1)tt.preventDefault(),Gt(ft),Pt("pdf");else if(ft.indexOf("text/html")>-1)tt.preventDefault(),Gt(ft),Pt("html");else if(ft.startsWith("#")){tt.preventDefault();var yt=document.getElementById(ft.replace("#",""));yt&&yt.scrollIntoView(!0)}}}var vn=function(){var At,kt=(At=wt.current)===null||At===void 0?void 0:At.querySelectorAll("video");kt==null||kt.forEach(function(ft){if(ft.oncontextmenu=function(){return!1},ft.src.indexOf(".m3u8")>-1&&!ft.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var yt=new W.a;yt.loadSource(ft.src),yt.attachMedia(ft)}}})};Object(L.useEffect)(function(){if(wt.current&&Et&&(Et.match(Me)&&window.PR.prettyPrint()),wt.current)return wt.current.addEventListener("click",Zt),function(){wt.current.removeEventListener("click",Zt),b(),R()}},[Et,wt.current,Zt]);var Bt=function(At){if(!de)return;At.target.nodeName==="IMG"?(ut.current.style.zIndex=1,ut.current.style.display="flex",ut.current.style.width=At.target.clientWidth+"px",ut.current.style.height=At.target.clientHeight+"px",ut.current.style.top=At.target.offsetTop+"px",ut.current.style.left=At.target.offsetLeft+"px",ot.current.src=At.target.getAttribute("src")):ut.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:wt,style:Object(H.a)({},Ke),className:"".concat(re||""," markdown-body ").concat(Ye.a.mdBody),onMouseOver:Bt,dangerouslySetInnerHTML:{__html:Et}}),y.a.createElement("div",{ref:ut,className:Ye.a.button},y.a.createElement(Y.a,null,y.a.createElement(X.a,{onClick:function(){return Yt()}},"\u88C1\u526A"),y.a.createElement(X.a,{onClick:function(){return pt()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:ot,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(fe.a,{close:!0,data:rt,type:rt!=null&&rt.length?We:"",style:Object(H.a)({},at),onClose:function(){return Gt("")}}))}},"9VGf":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return N});var le=J("q1tI"),Y=J.n(le);function N(X,H){var P=Object(le.useRef)();Object(le.useEffect)(function(){P.current=X}),Object(le.useEffect)(function(){function K(){P.current()}if(H!==null){var z=setInterval(K,H);return function(){return clearInterval(z)}}},[H])}},BU3w:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return P});var le=J("MNnm"),Y="rc-util-key";function N(K){if(K.attachTo)return K.attachTo;var z=document.querySelector("head");return z||document.body}function X(K){var z,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var L=document.createElement("style");if((z=n.csp)===null||z===void 0?void 0:z.nonce){var y;L.nonce=(y=n.csp)===null||y===void 0?void 0:y.nonce}L.innerHTML=K;var m=N(n),g=m.firstChild;return n.prepend&&m.prepend?m.prepend(L):n.prepend&&g?m.insertBefore(L,g):m.appendChild(L),L}var H=new Map;function P(K,z){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=N(n);if(!H.has(L)){var y=X("",n),m=y.parentNode;H.set(L,m),m.removeChild(y)}var g=Array.from(H.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===z});if(g){var l,h;if(((l=n.csp)===null||l===void 0?void 0:l.nonce)&&g.nonce!==((h=n.csp)===null||h===void 0?void 0:h.nonce)){var p;g.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return g.innerHTML!==K&&(g.innerHTML=K),g}var o=X(K,n);return o[Y]=z,o}},Bd2K:function(Je,Ee,J){(function(le){le(J("VrN/"),J("osHv"))})(function(le){le.defineOption("autoCloseTags",!1,function(n,L,y){if(y!=le.Init&&y&&n.removeKeyMap("autoCloseTags"),!L)return;var m={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(m["'/'"]=function(g){return P(g)}),(typeof L!="object"||L.whenOpening!==!1)&&(m["'>'"]=function(g){return X(g)}),n.addKeyMap(m)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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(n){if(n.getOption("disableInput"))return le.Pass;for(var L=n.listSelections(),y=[],m=n.getOption("autoCloseTags"),g=0;g<L.length;g++){if(!L[g].empty())return le.Pass;var l=L[g].head,h=n.getTokenAt(l),p=le.innerMode(n.getMode(),h.state),o=p.state,u=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(o),s=u&&u.name;if(!s)return le.Pass;var a=p.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||a&&Y,x=typeof m=="object"&&m.indentTags||a&&N;h.end>l.ch&&(s=s.slice(0,s.length-h.end+l.ch));var S=s.toLowerCase();if(!s||h.type=="string"&&(h.end!=l.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||h.string.length==1)||h.type=="tag"&&u.close||h.string.indexOf("/")==l.ch-h.start-1||R&&K(R,S)>-1||z(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(o)||[],s,l,!0))return le.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&K(D,s)>-1){y[g]={text:"/>",newPos:le.Pos(l.line,l.ch+2)};continue}var O=x&&K(x,S)>-1;y[g]={indent:O,text:">"+(O?`
`:"")+"</"+s+">",newPos:O?le.Pos(l.line+1,0):le.Pos(l.line,l.ch+1)}}for(var A=typeof m=="object"&&m.dontIndentOnAutoClose,g=L.length-1;g>=0;g--){var C=y[g];n.replaceRange(C.text,L[g].head,L[g].anchor,"+insert");var T=n.listSelections().slice(0);T[g]={head:C.newPos,anchor:C.newPos},n.setSelections(T),!A&&C.indent&&(n.indentLine(C.newPos.line,null,!0),n.indentLine(C.newPos.line+1,null,!0))}}function H(n,L){for(var y=n.listSelections(),m=[],g=L?"/":"</",l=n.getOption("autoCloseTags"),h=typeof l=="object"&&l.dontIndentOnSlash,p=0;p<y.length;p++){if(!y[p].empty())return le.Pass;var o=y[p].head,u=n.getTokenAt(o),s=le.innerMode(n.getMode(),u.state),a=s.state;if(L&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=o.ch-1))return le.Pass;var R,x=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(x&&s.mode.name=="javascript")R=g+"script";else if(x&&s.mode.name=="css")R=g+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(a);if(!S||S.length&&z(n,S,S[S.length-1],o))return le.Pass;R=g+S[S.length-1]}n.getLine(o.line).charAt(u.end)!=">"&&(R+=">"),m[p]=R}if(n.replaceSelections(m),y=n.listSelections(),!h)for(var p=0;p<y.length;p++)(p==y.length-1||y[p].head.line<y[p+1].head.line)&&n.indentLine(y[p].head.line)}function P(n){return n.getOption("disableInput")?le.Pass:H(n,!0)}le.commands.closeTag=function(n){return H(n)};function K(n,L){if(n.indexOf)return n.indexOf(L);for(var y=0,m=n.length;y<m;++y)if(n[y]==L)return y;return-1}function z(n,L,y,m,g){if(!le.scanForClosingTag)return!1;var l=Math.min(n.lastLine()+1,m.line+500),h=le.scanForClosingTag(n,m,null,l);if(!h||h.tag!=y)return!1;for(var p=g?1:0,o=L.length-1;o>=0&&L[o]==y;o--)++p;m=h.to;for(var o=1;o<p;o++){var u=le.scanForClosingTag(n,m,null,l);if(!u||u.tag!=y)return!1;m=u.to}return!0}})},BjJ7:function(Je,Ee,J){"use strict";J.d(Ee,"d",function(){return Y}),J.d(Ee,"c",function(){return N}),J.d(Ee,"e",function(){return X}),J.d(Ee,"b",function(){return H}),J.d(Ee,"a",function(){return K});var le=J("m3rI");function Y(z){var n=!0;if(z.length>0){for(var L=0;L<z.length;L++)if(z[L].compile_success==0||!z[L].compile_success){n=!1;break}}else n=!1;return n}function N(z){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],y=0;y<z.length;y++){var m=z[y],g=n?"".concat(n,"/").concat(m.name):"".concat(m.name);L.push({title:m.name,isLeaf:!(m.type==="tree"),key:g})}return L}function X(z,n,L){for(var y=0;y<z.length;y++){var m=z[y];if(m.key===n){m.children=L;break}m.children&&X(m.children,n,L)}return z}function H(z,n,L){var y;return function(){var m=this,g=arguments,l=function(){y=null,L||z.apply(m,g)},h=L&&!y;clearTimeout(y),y=setTimeout(l,n),h&&z.apply(m,g)}}var P=!0,K=le.a.API_SERVER},"C+DQ":function(Je,Ee,J){},"C/vA":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return le});function le(Y){const N=this;let X=!1,H;return function(){return X||(X=!0,H=Y.apply(N,arguments)),H}}},"Cg/j":function(Je,Ee,J){"use strict";J.d(Ee,"b",function(){return le}),J.d(Ee,"a",function(){return Y}),J.d(Ee,"c",function(){return X}),J.d(Ee,"d",function(){return H});var le;(function(P){P.serviceIds=new Map,P.DI_TARGET="$di$target",P.DI_DEPENDENCIES="$di$dependencies";function K(z){return z[P.DI_DEPENDENCIES]||[]}P.getServiceDependencies=K})(le||(le={}));const Y=X("instantiationService");function N(P,K,z,n){K[le.DI_TARGET]===K?K[le.DI_DEPENDENCIES].push({id:P,index:z,optional:n}):(K[le.DI_DEPENDENCIES]=[{id:P,index:z,optional:n}],K[le.DI_TARGET]=K)}function X(P){if(le.serviceIds.has(P))return le.serviceIds.get(P);const K=function(z,n,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(K,z,L,!1)};return K.toString=()=>P,le.serviceIds.set(P,K),K}function H(P){return function(K,z,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(P,K,n,!0)}}},DlQD:function(Je,Ee,J){(function(le,Y){Je.exports=Y()})(this,function(){"use strict";function le(ne,ae){for(var de=0;de<ae.length;de++){var re=ae[de];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(ne,re.key,re)}}function Y(ne,ae,de){return ae&&le(ne.prototype,ae),de&&le(ne,de),ne}function N(ne,ae){if(!ne)return;if(typeof ne=="string")return X(ne,ae);var de=Object.prototype.toString.call(ne).slice(8,-1);if(de==="Object"&&ne.constructor&&(de=ne.constructor.name),de==="Map"||de==="Set")return Array.from(ne);if(de==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(de))return X(ne,ae)}function X(ne,ae){(ae==null||ae>ne.length)&&(ae=ne.length);for(var de=0,re=new Array(ae);de<ae;de++)re[de]=ne[de];return re}function H(ne,ae){var de;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(de=N(ne))||ae&&ne&&typeof ne.length=="number"){de&&(ne=de);var re=0;return function(){return re>=ne.length?{done:!0}:{done:!1,value:ne[re++]}}}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 de=ne[Symbol.iterator](),de.next.bind(de)}function P(ne,ae){return ae={exports:{}},ne(ae,ae.exports),ae.exports}var K=P(function(ne){function ae(){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 de(re){ne.exports.defaults=re}ne.exports={defaults:ae(),getDefaults:ae,changeDefaults:de}}),z=K.defaults,n=K.getDefaults,L=K.changeDefaults,y=/[&<>"']/,m=/[&<>"']/g,g=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(ae){return h[ae]};function o(ne,ae){if(ae){if(y.test(ne))return ne.replace(m,p)}else if(g.test(ne))return ne.replace(l,p);return ne}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(ne){return ne.replace(u,function(ae,de){return de=de.toLowerCase(),de==="colon"?":":de.charAt(0)==="#"?de.charAt(1)==="x"?String.fromCharCode(parseInt(de.substring(2),16)):String.fromCharCode(+de.substring(1)):""})}var a=/(^|[^\[])\^/g;function R(ne,ae){ne=ne.source||ne,ae=ae||"";var de={replace:function(se,pe){return pe=pe.source||pe,pe=pe.replace(a,"$1"),ne=ne.replace(se,pe),de},getRegex:function(){return new RegExp(ne,ae)}};return de}var x=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(ne,ae,de){if(ne){var re;try{re=decodeURIComponent(s(de)).replace(x,"").toLowerCase()}catch(se){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ae&&!S.test(de)&&(de=d(ae,de));try{de=encodeURI(de).replace(/%25/g,"%")}catch(se){return null}return de}var O={},A=/^[^:]+:\/*[^/]*$/,C=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(ne,ae){O[" "+ne]||(A.test(ne)?O[" "+ne]=ne+"/":O[" "+ne]=j(ne,"/",!0)),ne=O[" "+ne];var de=ne.indexOf(":")===-1;return ae.substring(0,2)==="//"?de?ae:ne.replace(C,"$1")+ae:ae.charAt(0)==="/"?de?ae:ne.replace(T,"$1")+ae:ne+ae}var f={exec:function(){}};function b(ne){for(var ae=1,de,re;ae<arguments.length;ae++){de=arguments[ae];for(re in de)Object.prototype.hasOwnProperty.call(de,re)&&(ne[re]=de[re])}return ne}function _(ne,ae){var de=ne.replace(/\|/g,function(pe,me,Te){for(var Oe=!1,Ne=me;--Ne>=0&&Te[Ne]==="\\";)Oe=!Oe;return Oe?"|":" |"}),re=de.split(/ \|/),se=0;if(re.length>ae)re.splice(ae);else for(;re.length<ae;)re.push("");for(;se<re.length;se++)re[se]=re[se].trim().replace(/\\\|/g,"|");return re}function j(ne,ae,de){var re=ne.length;if(re===0)return"";for(var se=0;se<re;){var pe=ne.charAt(re-se-1);if(pe===ae&&!de)se++;else if(pe!==ae&&de)se++;else break}return ne.substr(0,re-se)}function U(ne,ae){if(ne.indexOf(ae[1])===-1)return-1;for(var de=ne.length,re=0,se=0;se<de;se++)if(ne[se]==="\\")se++;else if(ne[se]===ae[0])re++;else if(ne[se]===ae[1]&&(re--,re<0))return se;return-1}function w(ne){ne&&ne.sanitize&&!ne.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var M={escape:o,unescape:s,edit:R,cleanUrl:D,resolveUrl:d,noopTest:f,merge:b,splitCells:_,rtrim:j,findClosingBracket:U,checkSanitizeDeprecation:w},I=K.defaults,v=M.rtrim,W=M.splitCells,Z=M.escape,oe=M.findClosingBracket;function fe(ne,ae,de){var re=ae.href,se=ae.title?Z(ae.title):null,pe=ne[1].replace(/\\([\[\]])/g,"$1");return ne[0].charAt(0)!=="!"?{type:"link",raw:de,href:re,title:se,text:pe}:{type:"image",raw:de,href:re,title:se,text:Z(pe)}}function Ae(ne,ae){var de=ne.match(/^(\s+)(?:```)/);if(de===null)return ae;var re=de[1];return ae.split(`
`).map(function(se){var pe=se.match(/^\s+/);if(pe===null)return se;var me=pe[0];return me.length>=re.length?se.slice(re.length):se}).join(`
`)}var be=function(){function ne(de){this.options=de||I}var ae=ne.prototype;return ae.space=function(re){var se=this.rules.block.newline.exec(re);if(se)return se[0].length>1?{type:"space",raw:se[0]}:{raw:`
`}},ae.code=function(re,se){var pe=this.rules.block.code.exec(re);if(pe){var me=se[se.length-1];if(me&&me.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var Te=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:v(Te,`
`)}}},ae.fences=function(re){var se=this.rules.block.fences.exec(re);if(se){var pe=se[0],me=Ae(pe,se[3]||"");return{type:"code",raw:pe,lang:se[2]?se[2].trim():se[2],text:me}}},ae.heading=function(re){var se=this.rules.block.heading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[1].length,text:se[2]}},ae.nptable=function(re){var se=this.rules.block.nptable.exec(re);if(se){var pe={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[],raw:se[0]};if(pe.header.length===pe.align.length){var me=pe.align.length,Te;for(Te=0;Te<me;Te++)/^ *-+: *$/.test(pe.align[Te])?pe.align[Te]="right":/^ *:-+: *$/.test(pe.align[Te])?pe.align[Te]="center":/^ *:-+ *$/.test(pe.align[Te])?pe.align[Te]="left":pe.align[Te]=null;for(me=pe.cells.length,Te=0;Te<me;Te++)pe.cells[Te]=W(pe.cells[Te],pe.header.length);return pe}}},ae.hr=function(re){var se=this.rules.block.hr.exec(re);if(se)return{type:"hr",raw:se[0]}},ae.blockquote=function(re){var se=this.rules.block.blockquote.exec(re);if(se){var pe=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:pe}}},ae.list=function(re){var se=this.rules.block.list.exec(re);if(se){for(var pe=se[0],me=se[2],Te=me.length>1,Oe=me[me.length-1]===")",Ne={type:"list",raw:pe,ordered:Te,start:Te?+me.slice(0,-1):"",loose:!1,items:[]},Ke=se[0].match(this.rules.block.item),nt=!1,at,xt,ut,ot,Tt,St,rt,Gt=Ke.length,Lt=0;Lt<Gt;Lt++)at=Ke[Lt],pe=at,xt=at.length,at=at.replace(/^ *([*+-]|\d+[.)]) */,""),~at.indexOf(`
`)&&(xt-=at.length,at=this.options.pedantic?at.replace(/^ {1,4}/gm,""):at.replace(new RegExp("^ {1,"+xt+"}","gm"),"")),Lt!==Gt-1&&(ut=this.rules.block.bullet.exec(Ke[Lt+1])[0],(Te?ut.length===1||!Oe&&ut[ut.length-1]===")":ut.length>1||this.options.smartLists&&ut!==me)&&(ot=Ke.slice(Lt+1).join(`
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-ot.length),Lt=Gt-1)),Tt=nt||/\n\n(?!\s*$)/.test(at),Lt!==Gt-1&&(nt=at.charAt(at.length-1)===`
`,Tt||(Tt=nt)),Tt&&(Ne.loose=!0),St=/^\[[ xX]\] /.test(at),rt=void 0,St&&(rt=at[1]!==" ",at=at.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:pe,task:St,checked:rt,loose:Tt,text:at});return Ne}},ae.html=function(re){var se=this.rules.block.html.exec(re);if(se)return{type:this.options.sanitize?"paragraph":"html",raw:se[0],pre:!this.options.sanitizer&&(se[1]==="pre"||se[1]==="script"||se[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Z(se[0]):se[0]}},ae.def=function(re){var se=this.rules.block.def.exec(re);if(se){se[3]&&(se[3]=se[3].substring(1,se[3].length-1));var pe=se[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:se[0],href:se[2],title:se[3]}}},ae.table=function(re){var se=this.rules.block.table.exec(re);if(se){var pe={type:"table",header:W(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
`):[]};if(pe.header.length===pe.align.length){pe.raw=se[0];var me=pe.align.length,Te;for(Te=0;Te<me;Te++)/^ *-+: *$/.test(pe.align[Te])?pe.align[Te]="right":/^ *:-+: *$/.test(pe.align[Te])?pe.align[Te]="center":/^ *:-+ *$/.test(pe.align[Te])?pe.align[Te]="left":pe.align[Te]=null;for(me=pe.cells.length,Te=0;Te<me;Te++)pe.cells[Te]=W(pe.cells[Te].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},ae.lheading=function(re){var se=this.rules.block.lheading.exec(re);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1]}},ae.paragraph=function(re){var se=this.rules.block.paragraph.exec(re);if(se)return{type:"paragraph",raw:se[0],text:se[1].charAt(se[1].length-1)===`
`?se[1].slice(0,-1):se[1]}},ae.text=function(re,se){var pe=this.rules.block.text.exec(re);if(pe){var me=se[se.length-1];return me&&me.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},ae.escape=function(re){var se=this.rules.inline.escape.exec(re);if(se)return{type:"escape",raw:se[0],text:Z(se[1])}},ae.tag=function(re,se,pe){var me=this.rules.inline.tag.exec(re);if(me)return!se&&/^<a /i.test(me[0])?se=!0:se&&/^<\/a>/i.test(me[0])&&(se=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:se,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Z(me[0]):me[0]}},ae.link=function(re){var se=this.rules.inline.link.exec(re);if(se){var pe=oe(se[2],"()");if(pe>-1){var me=se[0].indexOf("!")===0?5:4,Te=me+se[1].length+pe;se[2]=se[2].substring(0,pe),se[0]=se[0].substring(0,Te).trim(),se[3]=""}var Oe=se[2],Ne="";if(this.options.pedantic){var Ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);Ke?(Oe=Ke[1],Ne=Ke[3]):Ne=""}else Ne=se[3]?se[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var nt=fe(se,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},se[0]);return nt}},ae.reflink=function(re,se){var pe;if((pe=this.rules.inline.reflink.exec(re))||(pe=this.rules.inline.nolink.exec(re))){var me=(pe[2]||pe[1]).replace(/\s+/g," ");if(me=se[me.toLowerCase()],!me||!me.href){var Te=pe[0].charAt(0);return{type:"text",raw:Te,text:Te}}var Oe=fe(pe,me,pe[0]);return Oe}},ae.strong=function(re,se,pe){pe===void 0&&(pe="");var me=this.rules.inline.strong.start.exec(re);if(me&&(!me[1]||me[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){se=se.slice(-1*re.length);var Te=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var Oe;(me=Te.exec(se))!=null;)if(Oe=this.rules.inline.strong.middle.exec(se.slice(0,me.index+3)),Oe)return{type:"strong",raw:re.slice(0,Oe[0].length),text:re.slice(2,Oe[0].length-2)}}},ae.em=function(re,se,pe){pe===void 0&&(pe="");var me=this.rules.inline.em.start.exec(re);if(me&&(!me[1]||me[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){se=se.slice(-1*re.length);var Te=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var Oe;(me=Te.exec(se))!=null;)if(Oe=this.rules.inline.em.middle.exec(se.slice(0,me.index+2)),Oe)return{type:"em",raw:re.slice(0,Oe[0].length),text:re.slice(1,Oe[0].length-1)}}},ae.codespan=function(re){var se=this.rules.inline.code.exec(re);if(se){var pe=se[2].replace(/\n/g," "),me=/[^ ]/.test(pe),Te=pe.startsWith(" ")&&pe.endsWith(" ");return me&&Te&&(pe=pe.substring(1,pe.length-1)),pe=Z(pe,!0),{type:"codespan",raw:se[0],text:pe}}},ae.br=function(re){var se=this.rules.inline.br.exec(re);if(se)return{type:"br",raw:se[0]}},ae.del=function(re){var se=this.rules.inline.del.exec(re);if(se)return{type:"del",raw:se[0],text:se[1]}},ae.autolink=function(re,se){var pe=this.rules.inline.autolink.exec(re);if(pe){var me,Te;return pe[2]==="@"?(me=Z(this.options.mangle?se(pe[1]):pe[1]),Te="mailto:"+me):(me=Z(pe[1]),Te=me),{type:"link",raw:pe[0],text:me,href:Te,tokens:[{type:"text",raw:me,text:me}]}}},ae.url=function(re,se){var pe;if(pe=this.rules.inline.url.exec(re)){var me,Te;if(pe[2]==="@")me=Z(this.options.mangle?se(pe[0]):pe[0]),Te="mailto:"+me;else{var Oe;do Oe=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Oe!==pe[0]);me=Z(pe[0]),pe[1]==="www."?Te="http://"+me:Te=me}return{type:"link",raw:pe[0],text:me,href:Te,tokens:[{type:"text",raw:me,text:me}]}}},ae.inlineText=function(re,se,pe){var me=this.rules.inline.text.exec(re);if(me){var Te;return se?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Z(me[0]):me[0]:Te=Z(this.options.smartypants?pe(me[0]):me[0]),{type:"text",raw:me[0],text:Te}}},ne}(),Re=M.noopTest,Ce=M.edit,Le=M.merge,ve={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Ce(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Ce(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Ce(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Ce(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Ce(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.blockquote=Ce(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=Le({},ve),ve.gfm=Le({},ve.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*|$)"}),ve.gfm.nptable=Ce(ve.gfm.nptable).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.gfm.table=Ce(ve.gfm.table).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.pedantic=Le({},ve.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Re,paragraph:Ce(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};$._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",$.punctuation=Ce($.punctuation).replace(/punctuation/g,$._punctuation).getRegex(),$._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",$._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",$.em.start=Ce($.em.start).replace(/punctuation/g,$._punctuation).getRegex(),$.em.middle=Ce($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex(),$.em.endAst=Ce($.em.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.em.endUnd=Ce($.em.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.start=Ce($.strong.start).replace(/punctuation/g,$._punctuation).getRegex(),$.strong.middle=Ce($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex(),$.strong.endAst=Ce($.strong.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.endUnd=Ce($.strong.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.blockSkip=Ce($._blockSkip,"g").getRegex(),$.overlapSkip=Ce($._overlapSkip,"g").getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._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])?)+(?![-_])/,$.autolink=Ce($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=Ce($.tag).replace("comment",ve._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=Ce($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=Ce($.reflink).replace("label",$._label).getRegex(),$.reflinkSearch=Ce($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex(),$.normal=Le({},$),$.pedantic=Le({},$.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=Le({},$.normal,{escape:Ce($.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),$.gfm.url=Ce($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=Le({},$.gfm,{br:Ce($.br).replace("{2,}","*").getRegex(),text:Ce($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var E={block:ve,inline:$},k=K.defaults,B=E.block,Q=E.inline;function G(ne){return ne.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function he(ne){var ae="",de,re,se=ne.length;for(de=0;de<se;de++)re=ne.charCodeAt(de),Math.random()>.5&&(re="x"+re.toString(16)),ae+="&#"+re+";";return ae}var xe=function(){function ne(de){this.tokens=[],this.tokens.links=Object.create(null),this.options=de||k,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:B.normal,inline:Q.normal};this.options.pedantic?(re.block=B.pedantic,re.inline=Q.pedantic):this.options.gfm&&(re.block=B.gfm,this.options.breaks?re.inline=Q.breaks:re.inline=Q.gfm),this.tokenizer.rules=re}ne.lex=function(re,se){var pe=new ne(se);return pe.lex(re)};var ae=ne.prototype;return ae.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ae.blockTokens=function(re,se,pe){se===void 0&&(se=[]),pe===void 0&&(pe=!0),re=re.replace(/^ +$/gm,"");for(var me,Te,Oe,Ne;re;){if(me=this.tokenizer.space(re)){re=re.substring(me.raw.length),me.type&&se.push(me);continue}if(me=this.tokenizer.code(re,se)){re=re.substring(me.raw.length),me.type?se.push(me):(Ne=se[se.length-1],Ne.raw+=`
`+me.raw,Ne.text+=`
`+me.text);continue}if(me=this.tokenizer.fences(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.heading(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.nptable(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.hr(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.blockquote(re)){re=re.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],pe),se.push(me);continue}if(me=this.tokenizer.list(re)){for(re=re.substring(me.raw.length),Oe=me.items.length,Te=0;Te<Oe;Te++)me.items[Te].tokens=this.blockTokens(me.items[Te].text,[],!1);se.push(me);continue}if(me=this.tokenizer.html(re)){re=re.substring(me.raw.length),se.push(me);continue}if(pe&&(me=this.tokenizer.def(re))){re=re.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(re)){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.lheading(re)){re=re.substring(me.raw.length),se.push(me);continue}if(pe&&(me=this.tokenizer.paragraph(re))){re=re.substring(me.raw.length),se.push(me);continue}if(me=this.tokenizer.text(re,se)){re=re.substring(me.raw.length),me.type?se.push(me):(Ne=se[se.length-1],Ne.raw+=`
`+me.raw,Ne.text+=`
`+me.text);continue}if(re){var Ke="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return se},ae.inline=function(re){var se,pe,me,Te,Oe,Ne,Ke=re.length;for(se=0;se<Ke;se++){Ne=re[se];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},Te=Ne.header.length,pe=0;pe<Te;pe++)Ne.tokens.header[pe]=[],this.inlineTokens(Ne.header[pe],Ne.tokens.header[pe]);for(Te=Ne.cells.length,pe=0;pe<Te;pe++)for(Oe=Ne.cells[pe],Ne.tokens.cells[pe]=[],me=0;me<Oe.length;me++)Ne.tokens.cells[pe][me]=[],this.inlineTokens(Oe[me],Ne.tokens.cells[pe][me]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(Te=Ne.items.length,pe=0;pe<Te;pe++)this.inline(Ne.items[pe].tokens);break}}}return re},ae.inlineTokens=function(re,se,pe,me,Te){se===void 0&&(se=[]),pe===void 0&&(pe=!1),me===void 0&&(me=!1),Te===void 0&&(Te="");var Oe,Ne=re,Ke;if(this.tokens.links){var nt=Object.keys(this.tokens.links);if(nt.length>0)for(;(Ke=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)nt.includes(Ke[0].slice(Ke[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ke=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,Ke.index)+"["+"a".repeat(Ke[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Oe=this.tokenizer.escape(re)){re=re.substring(Oe.raw.length),se.push(Oe);continue}if(Oe=this.tokenizer.tag(re,pe,me)){re=re.substring(Oe.raw.length),pe=Oe.inLink,me=Oe.inRawBlock,se.push(Oe);continue}if(Oe=this.tokenizer.link(re)){re=re.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,me)),se.push(Oe);continue}if(Oe=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,me)),se.push(Oe);continue}if(Oe=this.tokenizer.strong(re,Ne,Te)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),se.push(Oe);continue}if(Oe=this.tokenizer.em(re,Ne,Te)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),se.push(Oe);continue}if(Oe=this.tokenizer.codespan(re)){re=re.substring(Oe.raw.length),se.push(Oe);continue}if(Oe=this.tokenizer.br(re)){re=re.substring(Oe.raw.length),se.push(Oe);continue}if(Oe=this.tokenizer.del(re)){re=re.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],pe,me),se.push(Oe);continue}if(Oe=this.tokenizer.autolink(re,he)){re=re.substring(Oe.raw.length),se.push(Oe);continue}if(!pe&&(Oe=this.tokenizer.url(re,he))){re=re.substring(Oe.raw.length),se.push(Oe);continue}if(Oe=this.tokenizer.inlineText(re,me,G)){re=re.substring(Oe.raw.length),Te=Oe.raw.slice(-1),se.push(Oe);continue}if(re){var at="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return se},Y(ne,null,[{key:"rules",get:function(){return{block:B,inline:Q}}}]),ne}(),Ie=K.defaults,ue=M.cleanUrl,ge=M.escape,_e=function(){function ne(de){this.options=de||Ie}var ae=ne.prototype;return ae.code=function(re,se,pe){var me=(se||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(re,me);Te!=null&&Te!==re&&(pe=!0,re=Te)}return me?'<pre><code class="'+this.options.langPrefix+ge(me,!0)+'">'+(pe?re:ge(re,!0))+`</code></pre>
`:"<pre><code>"+(pe?re:ge(re,!0))+`</code></pre>
`},ae.blockquote=function(re){return`<blockquote>
`+re+`</blockquote>
`},ae.html=function(re){return re},ae.heading=function(re,se,pe,me){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+me.slug(pe)+'">'+re+"</h"+se+`>
`:"<h"+se+">"+re+"</h"+se+`>
`},ae.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ae.list=function(re,se,pe){var me=se?"ol":"ul",Te=se&&pe!==1?' start="'+pe+'"':"";return"<"+me+Te+`>
`+re+"</"+me+`>
`},ae.listitem=function(re){return"<li>"+re+`</li>
`},ae.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ae.paragraph=function(re){return"<p>"+re+`</p>
`},ae.table=function(re,se){return se&&(se="<tbody>"+se+"</tbody>"),`<table>
<thead>
`+re+`</thead>
`+se+`</table>
`},ae.tablerow=function(re){return`<tr>
`+re+`</tr>
`},ae.tablecell=function(re,se){var pe=se.header?"th":"td",me=se.align?"<"+pe+' align="'+se.align+'">':"<"+pe+">";return me+re+"</"+pe+`>
`},ae.strong=function(re){return"<strong>"+re+"</strong>"},ae.em=function(re){return"<em>"+re+"</em>"},ae.codespan=function(re){return"<code>"+re+"</code>"},ae.br=function(){return this.options.xhtml?"<br/>":"<br>"},ae.del=function(re){return"<del>"+re+"</del>"},ae.link=function(re,se,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var me='<a href="'+ge(re)+'"';return se&&(me+=' title="'+se+'"'),me+=">"+pe+"</a>",me},ae.image=function(re,se,pe){if(re=ue(this.options.sanitize,this.options.baseUrl,re),re===null)return pe;var me='<img src="'+re+'" alt="'+pe+'"';return se&&(me+=' title="'+se+'"'),me+=this.options.xhtml?"/>":">",me},ae.text=function(re){return re},ne}(),Se=function(){function ne(){}var ae=ne.prototype;return ae.strong=function(re){return re},ae.em=function(re){return re},ae.codespan=function(re){return re},ae.del=function(re){return re},ae.html=function(re){return re},ae.text=function(re){return re},ae.link=function(re,se,pe){return""+pe},ae.image=function(re,se,pe){return""+pe},ae.br=function(){return""},ne}(),Pe=function(){function ne(){this.seen={}}var ae=ne.prototype;return ae.slug=function(re){var se=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(se)){var pe=se;do this.seen[pe]++,se=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(se))}return this.seen[se]=0,se},ne}(),Ue=K.defaults,He=M.unescape,Be=function(){function ne(de){this.options=de||Ue,this.options.renderer=this.options.renderer||new _e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Pe}ne.parse=function(re,se){var pe=new ne(se);return pe.parse(re)};var ae=ne.prototype;return ae.parse=function(re,se){se===void 0&&(se=!0);var pe="",me,Te,Oe,Ne,Ke,nt,at,xt,ut,ot,Tt,St,rt,Gt,Lt,rn,We,Pt,Yt=re.length;for(me=0;me<Yt;me++){ot=re[me];switch(ot.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,He(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(xt="",at="",Ne=ot.header.length,Te=0;Te<Ne;Te++)at+=this.renderer.tablecell(this.parseInline(ot.tokens.header[Te]),{header:!0,align:ot.align[Te]});for(xt+=this.renderer.tablerow(at),ut="",Ne=ot.cells.length,Te=0;Te<Ne;Te++){for(nt=ot.tokens.cells[Te],at="",Ke=nt.length,Oe=0;Oe<Ke;Oe++)at+=this.renderer.tablecell(this.parseInline(nt[Oe]),{header:!1,align:ot.align[Oe]});ut+=this.renderer.tablerow(at)}pe+=this.renderer.table(xt,ut);continue}case"blockquote":{ut=this.parse(ot.tokens),pe+=this.renderer.blockquote(ut);continue}case"list":{for(Tt=ot.ordered,St=ot.start,rt=ot.loose,Ne=ot.items.length,ut="",Te=0;Te<Ne;Te++)Lt=ot.items[Te],rn=Lt.checked,We=Lt.task,Gt="",Lt.task&&(Pt=this.renderer.checkbox(rn),rt?Lt.tokens.length>0&&Lt.tokens[0].type==="text"?(Lt.tokens[0].text=Pt+" "+Lt.tokens[0].text,Lt.tokens[0].tokens&&Lt.tokens[0].tokens.length>0&&Lt.tokens[0].tokens[0].type==="text"&&(Lt.tokens[0].tokens[0].text=Pt+" "+Lt.tokens[0].tokens[0].text)):Lt.tokens.unshift({type:"text",text:Pt}):Gt+=Pt),Gt+=this.parse(Lt.tokens,rt),ut+=this.renderer.listitem(Gt,We,rn);pe+=this.renderer.list(ut,Tt,St);continue}case"html":{pe+=this.renderer.html(ot.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(ut=ot.tokens?this.parseInline(ot.tokens):ot.text;me+1<Yt&&re[me+1].type==="text";)ot=re[++me],ut+=`
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);pe+=se?this.renderer.paragraph(ut):ut;continue}default:{var pt='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(pt);return}else throw new Error(pt)}}}return pe},ae.parseInline=function(re,se){se=se||this.renderer;var pe="",me,Te,Oe=re.length;for(me=0;me<Oe;me++){Te=re[me];switch(Te.type){case"escape":{pe+=se.text(Te.text);break}case"html":{pe+=se.html(Te.text);break}case"link":{pe+=se.link(Te.href,Te.title,this.parseInline(Te.tokens,se));break}case"image":{pe+=se.image(Te.href,Te.title,Te.text);break}case"strong":{pe+=se.strong(this.parseInline(Te.tokens,se));break}case"em":{pe+=se.em(this.parseInline(Te.tokens,se));break}case"codespan":{pe+=se.codespan(Te.text);break}case"br":{pe+=se.br();break}case"del":{pe+=se.del(this.parseInline(Te.tokens,se));break}case"text":{pe+=se.text(Te.text);break}default:{var Ne='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return pe},ne}(),Qe=M.merge,ze=M.checkSanitizeDeprecation,Ye=M.escape,Me=K.getDefaults,it=K.changeDefaults,Ze=K.defaults;function ce(ne,ae,de){if(typeof ne=="undefined"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof ae=="function"&&(de=ae,ae=null),ae=Qe({},ce.defaults,ae||{}),ze(ae),de){var re=ae.highlight,se;try{se=xe.lex(ne,ae)}catch(Oe){return de(Oe)}var pe=function(Ne){var Ke;if(!Ne)try{Ke=Be.parse(se,ae)}catch(nt){Ne=nt}return ae.highlight=re,Ne?de(Ne):de(null,Ke)};if(!re||re.length<3)return pe();if(delete ae.highlight,!se.length)return pe();var me=0;ce.walkTokens(se,function(Oe){Oe.type==="code"&&(me++,setTimeout(function(){re(Oe.text,Oe.lang,function(Ne,Ke){if(Ne)return pe(Ne);Ke!=null&&Ke!==Oe.text&&(Oe.text=Ke,Oe.escaped=!0),me--,me===0&&pe()})},0))}),me===0&&pe();return}try{var Te=xe.lex(ne,ae);return ae.walkTokens&&ce.walkTokens(Te,ae.walkTokens),Be.parse(Te,ae)}catch(Oe){if(Oe.message+=`
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Ye(Oe.message+"",!0)+"</pre>";throw Oe}}ce.options=ce.setOptions=function(ne){return Qe(ce.defaults,ne),it(ce.defaults),ce},ce.getDefaults=Me,ce.defaults=Ze,ce.use=function(ne){var ae=Qe({},ne);if(ne.renderer&&function(){var re=ce.defaults.renderer||new _e,se=function(Te){var Oe=re[Te];re[Te]=function(){for(var Ne=arguments.length,Ke=new Array(Ne),nt=0;nt<Ne;nt++)Ke[nt]=arguments[nt];var at=ne.renderer[Te].apply(re,Ke);return at===!1&&(at=Oe.apply(re,Ke)),at}};for(var pe in ne.renderer)se(pe);ae.renderer=re}(),ne.tokenizer&&function(){var re=ce.defaults.tokenizer||new be,se=function(Te){var Oe=re[Te];re[Te]=function(){for(var Ne=arguments.length,Ke=new Array(Ne),nt=0;nt<Ne;nt++)Ke[nt]=arguments[nt];var at=ne.tokenizer[Te].apply(re,Ke);return at===!1&&(at=Oe.apply(re,Ke)),at}};for(var pe in ne.tokenizer)se(pe);ae.tokenizer=re}(),ne.walkTokens){var de=ce.defaults.walkTokens;ae.walkTokens=function(re){ne.walkTokens(re),de&&de(re)}}ce.setOptions(ae)},ce.walkTokens=function(ne,ae){for(var de=H(ne),re;!(re=de()).done;){var se=re.value;ae(se);switch(se.type){case"table":{for(var pe=H(se.tokens.header),me;!(me=pe()).done;){var Te=me.value;ce.walkTokens(Te,ae)}for(var Oe=H(se.tokens.cells),Ne;!(Ne=Oe()).done;)for(var Ke=Ne.value,nt=H(Ke),at;!(at=nt()).done;){var xt=at.value;ce.walkTokens(xt,ae)}break}case"list":{ce.walkTokens(se.items,ae);break}default:se.tokens&&ce.walkTokens(se.tokens,ae)}}},ce.Parser=Be,ce.parser=Be.parse,ce.Renderer=_e,ce.TextRenderer=Se,ce.Lexer=xe,ce.lexer=xe.lex,ce.Tokenizer=be,ce.Slugger=Pe,ce.parse=ce;var ee=ce;return ee})},ELLl:function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=le.Pos;le.defineOption("autoCloseBrackets",!1,function(h,p,o){o&&o!=le.Init&&(h.removeKeyMap(H),h.state.closeBrackets=null),p&&(P(X(p,"pairs")),h.state.closeBrackets=p,h.addKeyMap(H))});function X(h,p){return p=="pairs"&&typeof h=="string"?h:typeof h=="object"&&h[p]!=null?h[p]:Y[p]}var H={Backspace:n,Enter:L};function P(h){for(var p=0;p<h.length;p++){var o=h.charAt(p),u="'"+o+"'";H[u]||(H[u]=K(o))}}P(Y.pairs+"`");function K(h){return function(p){return m(p,h)}}function z(h){var p=h.state.closeBrackets;if(!p||p.override)return p;var o=h.getModeAt(h.getCursor());return o.closeBrackets||p}function n(h){var p=z(h);if(!p||h.getOption("disableInput"))return le.Pass;for(var o=X(p,"pairs"),u=h.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return le.Pass;var a=g(h,u[s].head);if(!a||o.indexOf(a)%2!=0)return le.Pass}for(var s=u.length-1;s>=0;s--){var R=u[s].head;h.replaceRange("",N(R.line,R.ch-1),N(R.line,R.ch+1),"+delete")}}function L(h){var p=z(h),o=p&&X(p,"explode");if(!o||h.getOption("disableInput"))return le.Pass;for(var u=h.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return le.Pass;var a=g(h,u[s].head);if(!a||o.indexOf(a)%2!=0)return le.Pass}h.operation(function(){var R=h.lineSeparator()||`
`;h.replaceSelection(R+R,null),h.execCommand("goCharLeft"),u=h.listSelections();for(var x=0;x<u.length;x++){var S=u[x].head.line;h.indentLine(S,null,!0),h.indentLine(S+1,null,!0)}})}function y(h){var p=le.cmpPos(h.anchor,h.head)>0;return{anchor:new N(h.anchor.line,h.anchor.ch+(p?-1:1)),head:new N(h.head.line,h.head.ch+(p?1:-1))}}function m(h,p){var o=z(h);if(!o||h.getOption("disableInput"))return le.Pass;var u=X(o,"pairs"),s=u.indexOf(p);if(s==-1)return le.Pass;for(var a=X(o,"closeBefore"),R=X(o,"triples"),x=u.charAt(s+1)==p,S=h.listSelections(),D=s%2==0,O,A=0;A<S.length;A++){var C=S[A],T=C.head,d,f=h.getRange(T,N(T.line,T.ch+1));if(D&&!C.empty())d="surround";else if((x||!D)&&f==p)x&&l(h,T)?d="both":R.indexOf(p)>=0&&h.getRange(T,N(T.line,T.ch+3))==p+p+p?d="skipThree":d="skip";else if(x&&T.ch>1&&R.indexOf(p)>=0&&h.getRange(N(T.line,T.ch-2),T)==p+p){if(T.ch>2&&/\bstring/.test(h.getTokenTypeAt(N(T.line,T.ch-2))))return le.Pass;d="addFour"}else if(x){var b=T.ch==0?" ":h.getRange(N(T.line,T.ch-1),T);if(!le.isWordChar(f)&&b!=p&&!le.isWordChar(b))d="both";else return le.Pass}else if(D&&(f.length===0||/\s/.test(f)||a.indexOf(f)>-1))d="both";else return le.Pass;if(!O)O=d;else if(O!=d)return le.Pass}var _=s%2?u.charAt(s-1):p,j=s%2?p:u.charAt(s+1);h.operation(function(){if(O=="skip")h.execCommand("goCharRight");else if(O=="skipThree")for(var U=0;U<3;U++)h.execCommand("goCharRight");else if(O=="surround"){for(var w=h.getSelections(),U=0;U<w.length;U++)w[U]=_+w[U]+j;h.replaceSelections(w,"around"),w=h.listSelections().slice();for(var U=0;U<w.length;U++)w[U]=y(w[U]);h.setSelections(w)}else O=="both"?(h.replaceSelection(_+j,null),h.triggerElectric(_+j),h.execCommand("goCharLeft")):O=="addFour"&&(h.replaceSelection(_+_+_+_,"before"),h.execCommand("goCharRight"))})}function g(h,p){var o=h.getRange(N(p.line,p.ch-1),N(p.line,p.ch+1));return o.length==2?o:null}function l(h,p){var o=h.getTokenAt(N(p.line,p.ch+1));return/\bstring/.test(o.type)&&o.start==p.ch&&(p.ch==0||!/\bstring/.test(h.getTokenTypeAt(p)))}})},FWmy:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return le});function le(Y,N){if(!Y)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},GfqC:function(Je,Ee,J){"use strict";var le=J("q1tI"),Y=J.n(le),N=J("TSYQ"),X=J.n(N);function H(M,I){var v="cannot "+M.method+" "+M.action+" "+I.status+"'",W=new Error(v);return W.status=I.status,W.method=M.method,W.url=M.action,W}function P(M){var I=M.responseText||M.response;if(!I)return I;try{return JSON.parse(I)}catch(v){return I}}function K(M){var I=new XMLHttpRequest;M.onProgress&&I.upload&&(I.upload.onprogress=function(oe){oe.total>0&&(oe.percent=oe.loaded/oe.total*100),M.onProgress(oe)});var v=new FormData;M.data&&Object.keys(M.data).forEach(function(Z){var oe=M.data[Z];if(Array.isArray(oe)){oe.forEach(function(fe){v.append(Z+"[]",fe)});return}v.append(Z,M.data[Z])}),M.file instanceof Blob?v.append(M.filename,M.file,M.file.name):v.append(M.filename,M.file),I.onerror=function(oe){M.onError(oe)},I.onload=function(){return I.status<200||I.status>=300?M.onError(H(M,I),P(I)):M.onSuccess(P(I),I)},I.open(M.method,M.action,!0),M.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=M.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(Z){W[Z]!==null&&I.setRequestHeader(Z,W[Z])}),I.send(v),{abort:function(){I.abort()}}}var z=+new Date,n=0;function L(){return"rc-upload-"+z+"-"+ ++n}function y(M,I){return M.indexOf(I,M.length-I.length)!==-1}var m=function(M,I){if(M&&I){var v=Array.isArray(I)?I:I.split(","),W=M.name||"",Z=M.type||"",oe=Z.replace(/\/.*$/,"");return v.some(function(fe){var Ae=fe.trim();return Ae.charAt(0)==="."?y(W.toLowerCase(),Ae.toLowerCase()):/\/\*$/.test(Ae)?oe===Ae.replace(/\/.*$/,""):Z===Ae})}return!0};function g(M,I){var v=M.createReader(),W=[];function Z(){v.readEntries(function(oe){var fe=Array.prototype.slice.apply(oe);W=W.concat(fe);var Ae=!fe.length;Ae?I(W):Z()})}Z()}var l=function(I,v,W){var Z=function oe(fe,Ae){Ae=Ae||"",fe.isFile?fe.file(function(be){W(be)&&(fe.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),v([be]))}):fe.isDirectory&&g(fe,function(be){be.forEach(function(Re){oe(Re,""+Ae+fe.name+"/")})})};I.forEach(function(oe){Z(oe.webkitGetAsEntry())})},h=l,p=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var v=arguments[I];for(var W in v)Object.prototype.hasOwnProperty.call(v,W)&&(M[W]=v[W])}return M},o=function(){function M(I,v){var W=[],Z=!0,oe=!1,fe=void 0;try{for(var Ae=I[Symbol.iterator](),be;!(Z=(be=Ae.next()).done)&&!(W.push(be.value),v&&W.length===v);Z=!0);}catch(Re){oe=!0,fe=Re}finally{try{!Z&&Ae.return&&Ae.return()}finally{if(oe)throw fe}}return W}return function(I,v){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return M(I,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function M(I,v){for(var W=0;W<v.length;W++){var Z=v[W];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(I,Z.key,Z)}}return function(I,v,W){return v&&M(I.prototype,v),W&&M(I,W),I}}();function s(M,I,v){return I in M?Object.defineProperty(M,I,{value:v,enumerable:!0,configurable:!0,writable:!0}):M[I]=v,M}function a(M,I){var v={};for(var W in M){if(I.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(M,W))continue;v[W]=M[W]}return v}function R(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function x(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 S(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(v,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(v[W]=I[W]),v},{})},O=function(M){S(I,M);function I(){var v,W,Z,oe;R(this,I);for(var fe=arguments.length,Ae=Array(fe),be=0;be<fe;be++)Ae[be]=arguments[be];return oe=(W=(Z=x(this,(v=I.__proto__||Object.getPrototypeOf(I)).call.apply(v,[this].concat(Ae))),Z),Z.state={uid:L()},Z.reqs={},Z.onChange=function(Re){var Ce=Re.target.files;Z.uploadFiles(Ce),Z.reset()},Z.onClick=function(Re){var Ce=Z.fileInput;if(!Ce)return;var Le=Z.props,ve=Le.children,$=Le.onClick;ve&&ve.type==="button"&&(Ce.parentNode.focus(),Ce.parentNode.querySelector("button").blur()),Ce.click(),$&&$(Re)},Z.onKeyDown=function(Re){Re.key==="Enter"&&Z.onClick()},Z.onFileDrop=function(Re){var Ce=Z.props.multiple;if(Re.preventDefault(),Re.type==="dragover")return;if(Z.props.directory)h(Array.prototype.slice.call(Re.dataTransfer.items),Z.uploadFiles,function(ve){return m(ve,Z.props.accept)});else{var Le=Array.prototype.slice.call(Re.dataTransfer.files).filter(function(ve){return m(ve,Z.props.accept)});Ce===!1&&(Le=Le.slice(0,1)),Z.uploadFiles(Le)}},Z.uploadFiles=function(Re){var Ce=Array.prototype.slice.call(Re);Ce.map(function(Le){return Le.uid=L(),Le}).forEach(function(Le){Z.upload(Le,Ce)})},Z.saveFileInput=function(Re){Z.fileInput=Re},W),x(Z,oe)}return u(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,Z){var oe=this,fe=this.props;if(!fe.beforeUpload)return setTimeout(function(){return oe.post(W)},0);var Ae=fe.beforeUpload(W,Z);Ae&&Ae.then?Ae.then(function(be){var Re=Object.prototype.toString.call(be);return Re==="[object File]"||Re==="[object Blob]"?oe.post(be):oe.post(W)}).catch(function(be){console.log(be)}):Ae!==!1&&setTimeout(function(){return oe.post(W)},0);return}},{key:"post",value:function(W){var Z=this;if(!this._isMounted)return;var oe=this.props,fe=oe.onStart,Ae=oe.onProgress,be=oe.transformFile,Re=be===void 0?function(Ce){return Ce}:be;new Promise(function(Ce){var Le=oe.action;return typeof Le=="function"&&(Le=Le(W)),Ce(Le)}).then(function(Ce){var Le=W.uid,ve=oe.customRequest||K,$=Promise.resolve(Re(W)).then(function(E){var k=oe.data;return typeof k=="function"&&(k=k(E)),Promise.all([E,k])}).catch(function(E){console.error(E)});$.then(function(E){var k=o(E,2),B=k[0],Q=k[1],G={action:Ce,filename:oe.name,data:Q,file:B,headers:oe.headers,withCredentials:oe.withCredentials,method:oe.method||"post",onProgress:Ae?function(he){Ae(he,W)}:null,onSuccess:function(xe,Ie){delete Z.reqs[Le],oe.onSuccess(xe,W,Ie)},onError:function(xe,Ie){delete Z.reqs[Le],oe.onError(xe,Ie,W)}};fe(W),Z.reqs[Le]=ve(G)})})}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(W){var Z=this.reqs;if(W){var oe=W;W&&W.uid&&(oe=W.uid),Z[oe]&&Z[oe].abort&&Z[oe].abort(),delete Z[oe]}else Object.keys(Z).forEach(function(fe){Z[fe]&&Z[fe].abort&&Z[fe].abort(),delete Z[fe]})}},{key:"render",value:function(){var W,Z=this.props,oe=Z.component,fe=Z.prefixCls,Ae=Z.className,be=Z.disabled,Re=Z.id,Ce=Z.style,Le=Z.multiple,ve=Z.accept,$=Z.children,E=Z.directory,k=Z.openFileDialogOnClick,B=Z.onMouseEnter,Q=Z.onMouseLeave,G=a(Z,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),he=X()((W={},s(W,fe,!0),s(W,fe+"-disabled",be),s(W,Ae,Ae),W)),xe=be?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:B,onMouseLeave:Q,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Y.a.createElement(oe,p({},xe,{className:he,role:"button",style:Ce}),Y.a.createElement("input",p({},D(G),{id:Re,type:"file",ref:this.saveFileInput,onClick:function(ue){return ue.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ve,directory:E?"directory":null,webkitdirectory:E?"webkitdirectory":null,multiple:Le,onChange:this.onChange})),$)}}]),I}(le.Component),A=O,C=Object.assign||function(M){for(var I=1;I<arguments.length;I++){var v=arguments[I];for(var W in v)Object.prototype.hasOwnProperty.call(v,W)&&(M[W]=v[W])}return M},T=function(){function M(I,v){for(var W=0;W<v.length;W++){var Z=v[W];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(I,Z.key,Z)}}return function(I,v,W){return v&&M(I.prototype,v),W&&M(I,W),I}}();function d(M,I){if(!(M instanceof I))throw new TypeError("Cannot call a class as a function")}function f(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 b(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)}function _(){}var j=function(M){b(I,M);function I(){var v,W,Z,oe;d(this,I);for(var fe=arguments.length,Ae=Array(fe),be=0;be<fe;be++)Ae[be]=arguments[be];return oe=(W=(Z=f(this,(v=I.__proto__||Object.getPrototypeOf(I)).call.apply(v,[this].concat(Ae))),Z),Z.saveUploader=function(Re){Z.uploader=Re},W),f(Z,oe)}return T(I,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return Y.a.createElement(A,C({},this.props,{ref:this.saveUploader}))}}]),I}(le.Component);j.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:_,onError:_,onSuccess:_,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=j,w=Ee.a=U},HmJG:function(Je,Ee,J){},JYp7:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return le});var le;(function(Y){function N(a){return a&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"}Y.is=N;const X=Object.freeze([]);function H(){return X}Y.empty=H;function*P(a){yield a}Y.single=P;function K(a){return a||X}Y.from=K;function z(a){return!a||a[Symbol.iterator]().next().done===!0}Y.isEmpty=z;function n(a){return a[Symbol.iterator]().next().value}Y.first=n;function L(a,R){for(const x of a)if(R(x))return!0;return!1}Y.some=L;function y(a,R){for(const x of a)if(R(x))return x;return}Y.find=y;function*m(a,R){for(const x of a)R(x)&&(yield x)}Y.filter=m;function*g(a,R){let x=0;for(const S of a)yield R(S,x++)}Y.map=g;function*l(...a){for(const R of a)for(const x of R)yield x}Y.concat=l;function*h(a){for(const R of a)for(const x of R)yield x}Y.concatNested=h;function p(a,R,x){let S=x;for(const D of a)S=R(S,D);return S}Y.reduce=p;function*o(a,R,x=a.length){for(R<0&&(R+=a.length),x<0?x+=a.length:x>a.length&&(x=a.length);R<x;R++)yield a[R]}Y.slice=o;function u(a,R=Number.POSITIVE_INFINITY){const x=[];if(R===0)return[x,a];const S=a[Symbol.iterator]();for(let D=0;D<R;D++){const O=S.next();if(O.done)return[x,Y.empty()];x.push(O.value)}return[x,{[Symbol.iterator](){return S}}]}Y.consume=u;function s(a,R,x=(S,D)=>S===D){const S=a[Symbol.iterator](),D=R[Symbol.iterator]();for(;;){const O=S.next(),A=D.next();if(O.done!==A.done)return!1;if(O.done)return!0;if(!x(O.value,A.value))return!1}}Y.equals=s})(le||(le={}))},LdHM:function(Je,Ee,J){"use strict";J.d(Ee,"b",function(){return a}),J.d(Ee,"a",function(){return x});var le=J("1OyB"),Y=J("vuIU"),N=J("Ji7U"),X=J("LK+K"),H=J("q1tI"),P=J("rePB"),K=J("Ff2n"),z=J("ODXe"),n=J("4IlW"),L=J("bX4T"),y=J("YrtM"),m=J("TSYQ"),g=J.n(m),l=J("+nKL"),h=J("8OUc"),p=function(W,Z){var oe=W.prefixCls,fe=W.id,Ae=W.flattenOptions,be=W.childrenAsData,Re=W.values,Ce=W.searchValue,Le=W.multiple,ve=W.defaultActiveFirstOption,$=W.height,E=W.itemHeight,k=W.notFoundContent,B=W.open,Q=W.menuItemSelectedIcon,G=W.virtual,he=W.onSelect,xe=W.onToggleOpen,Ie=W.onActiveValue,ue=W.onScroll,ge=W.onMouseEnter,_e="".concat(oe,"-item"),Se=Object(y.a)(function(){return Ae},[B,Ae],function(ee,ne){return ne[0]&&ee[1]!==ne[1]}),Pe=H.useRef(null),Ue=function(ne){ne.preventDefault()},He=function(ne){Pe.current&&Pe.current.scrollTo({index:ne})},Be=function(ne){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=Se.length,re=0;re<de;re+=1){var se=(ne+re*ae+de)%de,pe=Se[se],me=pe.group,Te=pe.data;if(!me&&!Te.disabled)return se}return-1},Qe=H.useState(function(){return Be(0)}),ze=Object(z.a)(Qe,2),Ye=ze[0],Me=ze[1],it=function(ne){Me(ne);var ae=Se[ne];if(!ae){Ie(null,-1);return}Ie(ae.data.value,ne)};H.useEffect(function(){it(ve!==!1?Be(0):-1)},[Se.length,Ce]),H.useEffect(function(){var ee=setTimeout(function(){if(!Le&&B&&Re.size===1){var ne=Array.from(Re)[0],ae=Se.findIndex(function(de){var re=de.data;return re.value===ne});it(ae),He(ae)}});return function(){return clearTimeout(ee)}},[B]);var Ze=function(ne){ne!==void 0&&he(ne,{selected:!Re.has(ne)}),Le||xe(!1)};if(H.useImperativeHandle(Z,function(){return{onKeyDown:function(ne){var ae=ne.which;switch(ae){case n.a.UP:case n.a.DOWN:{var de=0;if(ae===n.a.UP?de=-1:ae===n.a.DOWN&&(de=1),de!==0){var re=Be(Ye+de,de);He(re),it(re)}break}case n.a.ENTER:{var se=Se[Ye];se&&!se.data.disabled?Ze(se.data.value):Ze(void 0),B&&ne.preventDefault();break}case n.a.ESC:xe(!1)}},onKeyUp:function(){},scrollTo:function(ne){He(ne)}}}),Se.length===0)return H.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(_e,"-empty"),onMouseDown:Ue},k);function ce(ee){var ne=Se[ee];if(!ne)return null;var ae=ne.data||{},de=ae.value,re=ae.label,se=ae.children,pe=Object(L.a)(ae,!0),me=be?se:re;return ne?H.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},pe,{key:ee,role:"option",id:"".concat(fe,"_list_").concat(ee),"aria-selected":Re.has(de)}),de):null}return H.createElement(H.Fragment,null,H.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ce(Ye-1),ce(Ye),ce(Ye+1)),H.createElement(l.a,{itemKey:"key",ref:Pe,data:Se,height:$,itemHeight:E,fullHeight:!1,onMouseDown:Ue,onScroll:ue,virtual:G,onMouseEnter:ge},function(ee,ne){var ae,de=ee.group,re=ee.groupOption,se=ee.data,pe=se.label,me=se.key;if(de)return H.createElement("div",{className:g()(_e,"".concat(_e,"-group"))},pe!==void 0?pe:me);var Te=se.disabled,Oe=se.value,Ne=se.title,Ke=se.children,nt=se.style,at=se.className,xt=Object(K.a)(se,["disabled","value","title","children","style","className"]),ut=Re.has(Oe),ot="".concat(_e,"-option"),Tt=g()(_e,ot,at,(ae={},Object(P.a)(ae,"".concat(ot,"-grouped"),re),Object(P.a)(ae,"".concat(ot,"-active"),Ye===ne&&!Te),Object(P.a)(ae,"".concat(ot,"-disabled"),Te),Object(P.a)(ae,"".concat(ot,"-selected"),ut),ae)),St=be?Ke:pe,rt=!Q||typeof Q=="function"||ut;return H.createElement("div",Object.assign({},xt,{"aria-selected":ut,className:Tt,title:Ne,onMouseMove:function(){if(Ye===ne||Te)return;it(ne)},onClick:function(){Te||Ze(Oe)},style:nt}),H.createElement("div",{className:"".concat(ot,"-content")},St||Oe),H.isValidElement(Q)||ut,rt&&H.createElement(h.a,{className:"".concat(_e,"-option-state"),customizeIcon:Q,customizeIconProps:{isSelected:ut}},ut?"\u2713":null))}))},o=H.forwardRef(p);o.displayName="OptionList";var u=o,s=function(){return null};s.isSelectOption=!0;var a=s,R=function(){return null};R.isSelectOptGroup=!0;var x=R,S=J("VTBJ"),D=J("Zm9Q");function O(v){var W=v.key,Z=v.props,oe=Z.children,fe=Z.value,Ae=Object(K.a)(Z,["children","value"]);return Object(S.a)({key:W,value:fe!==void 0?fe:W,children:oe},Ae)}function A(v){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(v).map(function(Z,oe){if(!H.isValidElement(Z)||!Z.type)return null;var fe=Z.type.isSelectOptGroup,Ae=Z.key,be=Z.props,Re=be.children,Ce=Object(K.a)(be,["children"]);return W||!fe?O(Z):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Ae===null?oe:Ae,"__"),label:Ae},Ce),{},{options:A(Re)})}).filter(function(Z){return Z})}var C=J("2Qr1"),T=J("qNPg"),d=J("U8pU"),f=J("Kwbf"),b=J("WKfj");function _(v){var W=v.mode,Z=v.options,oe=v.children,fe=v.backfill,Ae=v.allowClear,be=v.placeholder,Re=v.getInputElement,Ce=v.showSearch,Le=v.onSearch,ve=v.defaultOpen,$=v.autoFocus,E=v.labelInValue,k=v.value,B=v.inputValue,Q=v.optionLabelProp,G=W==="multiple"||W==="tags",he=Ce!==void 0?Ce:G||W==="combobox",xe=Z||A(oe);if(Object(f.a)(W!=="tags"||xe.every(function(_e){return!_e.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ie=xe.some(function(_e){return _e.options?_e.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in _e?_e.value:_e.key)=="number"});Object(f.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(f.a)(W!=="combobox"||!Q,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(f.a)(W==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(f.a)(W==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(f.b)(W!=="combobox"||!Re||!Ae||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!he&&W!=="combobox"&&W!=="tags"&&Object(f.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(f.b)(!ve||$,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),k!=null){var ue=Object(b.d)(k);Object(f.a)(!E||ue.every(function(_e){return Object(d.a)(_e)==="object"&&("key"in _e||"value"in _e)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(f.a)(!G||Array.isArray(k),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var ge=null;Object(D.a)(oe).some(function(_e){if(!H.isValidElement(_e)||!_e.type)return!1;var Se=_e.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Pe=Object(D.a)(_e.props.children).every(function(Ue){return!H.isValidElement(Ue)||!_e.type||Ue.type.isSelectOption?!0:(ge=Ue.type,!1)});return!Pe}return ge=Se,!0}),ge&&Object(f.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ge.displayName||ge.name||ge,"`.")),Object(f.a)(B===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=_,U=Object(T.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:j,fillOptionsWithMissingValue:C.a}),w=function(v){Object(N.a)(Z,v);var W=Object(X.a)(Z);function Z(){var oe;return Object(le.a)(this,Z),oe=W.apply(this,arguments),oe.selectRef=H.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(Y.a)(Z,[{key:"render",value:function(){return H.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),Z}(H.Component);w.Option=a,w.OptGroup=x;var M=w,I=Ee.c=M},M8RZ:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return n});var le=J("fWQN"),Y=J("mtLc"),N=J("yKVA"),X=J("879j"),H=J("q1tI"),P=J.n(H),K=J("i8i4"),z=J.n(K),n=function(L){Object(N.a)(m,L);var y=Object(X.a)(m);function m(g){var l;Object(le.a)(this,m),l=y.call(this,g);var h=window.document;return l.node=h.createElement("div"),h.body.appendChild(l.node),l}return Object(Y.a)(m,[{key:"render",value:function(){var l=this.props.children;return Object(K.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(P.a.Component)},MI8n:function(Je,Ee,J){"use strict";J.d(Ee,"c",function(){return H}),J.d(Ee,"b",function(){return n}),J.d(Ee,"e",function(){return L}),J.d(Ee,"a",function(){return y}),J.d(Ee,"d",function(){return m}),J.d(Ee,"f",function(){return g});var le=J("/cxE"),Y=J("pmY6"),N=J("24hK"),X=J("5Y4S"),H;(function(l){l.None=()=>Y.a.None;function h(_){return(j,U=null,w)=>{let M=!1,I;return I=_(v=>M?void 0:(I?I.dispose():M=!0,j.call(U,v)),null,w),M&&I.dispose(),I}}l.once=h;function p(_,j){return x((U,w=null,M)=>_(I=>U.call(w,j(I)),null,M))}l.map=p;function o(_,j){return x((U,w=null,M)=>_(I=>{j(I),U.call(w,I)},null,M))}l.forEach=o;function u(_,j){return x((U,w=null,M)=>_(I=>j(I)&&U.call(w,I),null,M))}l.filter=u;function s(_){return _}l.signal=s;function a(..._){return(j,U=null,w)=>Object(Y.e)(..._.map(M=>M(I=>j.call(U,I),null,w)))}l.any=a;function R(_,j,U){let w=U;return p(_,M=>(w=j(w,M),w))}l.reduce=R;function x(_){let j;const U=new n({onFirstListenerAdd(){j=_(U.fire,U)},onLastListenerRemove(){j.dispose()}});return U.event}function S(_,j,U=100,w=!1,M){let I,v,W,Z=0;const oe=new n({leakWarningThreshold:M,onFirstListenerAdd(){I=_(fe=>{Z++,v=j(v,fe),w&&!W&&(oe.fire(v),v=void 0),clearTimeout(W),W=setTimeout(()=>{const Ae=v;v=void 0,W=void 0,(!w||Z>1)&&oe.fire(Ae),Z=0},U)})},onLastListenerRemove(){I.dispose()}});return oe.event}l.debounce=S;function D(_,j=(U,w)=>U===w){let U=!0,w;return u(_,M=>{const I=U||!j(M,w);return U=!1,w=M,I})}l.latch=D;function O(_,j){return[l.filter(_,j),l.filter(_,U=>!j(U))]}l.split=O;function A(_,j=!1,U=[]){let w=U.slice(),M=_(W=>{w?w.push(W):v.fire(W)});const I=()=>{w&&w.forEach(W=>v.fire(W)),w=null},v=new n({onFirstListenerAdd(){M||(M=_(W=>v.fire(W)))},onFirstListenerDidAdd(){w&&(j?setTimeout(I):I())},onLastListenerRemove(){M&&M.dispose(),M=null}});return v.event}l.buffer=A;class C{constructor(_){this.event=_}map(_){return new C(p(this.event,_))}forEach(_){return new C(o(this.event,_))}filter(_){return new C(u(this.event,_))}reduce(_,j){return new C(R(this.event,_,j))}latch(){return new C(D(this.event))}debounce(_,j=100,U=!1,w){return new C(S(this.event,_,j,U,w))}on(_,j,U){return this.event(_,j,U)}once(_,j,U){return h(this.event)(_,j,U)}}function T(_){return new C(_)}l.chain=T;function d(_,j,U=w=>w){const w=(...W)=>v.fire(U(...W)),M=()=>_.on(j,w),I=()=>_.removeListener(j,w),v=new n({onFirstListenerAdd:M,onLastListenerRemove:I});return v.event}l.fromNodeEventEmitter=d;function f(_,j,U=w=>w){const w=(...W)=>v.fire(U(...W)),M=()=>_.addEventListener(j,w),I=()=>_.removeEventListener(j,w),v=new n({onFirstListenerAdd:M,onLastListenerRemove:I});return v.event}l.fromDOMEventEmitter=f;function b(_){return new Promise(j=>h(_)(j))}l.toPromise=b})(H||(H={}));class P{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${P._idPool++}`}start(l){this._stopWatch=new X.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}P._idPool=0;let K=-1;class z{constructor(l,h=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=h,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let h=K;if(typeof this.customThreshold=="number"&&(h=this.customThreshold),h<=0||l<h)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
`).slice(3).join(`
`),o=this._stacks.get(p)||0;if(this._stacks.set(p,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=h*.5;let u,s=0;for(const[a,R]of this._stacks)(!u||s<R)&&(u=a,s=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(l){var h;this._disposed=!1,this._options=l,this._leakageMon=K>0?new z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((h=this._options)===null||h===void 0?void 0:h._profName)?new P(this._options._profName):void 0}get event(){return this._event||(this._event=(l,h,p)=>{var o;this._listeners||(this._listeners=new N.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(h?[l,h]:l);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,h);const a=(o=this._leakageMon)===null||o===void 0?void 0:o.check(this._listeners.size),R=Object(Y.i)(()=>{if(a&&a(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return p instanceof Y.b?p.add(R):Array.isArray(p)&&p.push(R),R}),this._event}fire(l){var h,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let o of this._listeners)this._deliveryQueue.push([o,l]);for((h=this._perfMon)===null||h===void 0||h.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(le.f)(s)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var l,h,p,o,u;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(h=this._deliveryQueue)===null||h===void 0||h.clear(),(o=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||o===void 0||o.call(p),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class L extends n{constructor(l){super(l);this._isPaused=0,this._eventQueue=new N.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class y extends L{constructor(l){var h;super(l);this._delay=(h=l.delay)!==null&&h!==void 0?h:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class m{constructor(){this.buffers=[]}wrapEvent(l){return(h,p,o)=>l(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>h.call(p,u)):h.call(p,u)},void 0,o)}bufferEvents(l){const h=[];this.buffers.push(h);const p=l();return this.buffers.pop(),h.forEach(o=>o()),p}}class g{constructor(){this.listening=!1,this.inputEvent=H.None,this.inputEventListener=Y.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Je,Ee,J){"use strict";(function(le,Y){J.d(Ee,"b",function(){return p}),J.d(Ee,"i",function(){return a}),J.d(Ee,"f",function(){return R}),J.d(Ee,"d",function(){return x}),J.d(Ee,"g",function(){return S}),J.d(Ee,"h",function(){return D}),J.d(Ee,"c",function(){return O}),J.d(Ee,"k",function(){return A}),J.d(Ee,"j",function(){return C}),J.d(Ee,"a",function(){return T}),J.d(Ee,"e",function(){return b});var N;const X="en";let H=!1,P=!1,K=!1,z=!1,n=!1,L=!1,y=!1,m,g=X,l,h;const p=typeof self=="object"?self:typeof le=="object"?le:{};let o;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?o=p.vscode.process:typeof Y!="undefined"&&(o=Y);const u=typeof((N=o==null?void 0:o.versions)===null||N===void 0?void 0:N.electron)=="string"&&o.type==="renderer";if(typeof navigator=="object"&&!u)h=navigator.userAgent,H=h.indexOf("Windows")>=0,P=h.indexOf("Macintosh")>=0,y=(h.indexOf("Macintosh")>=0||h.indexOf("iPad")>=0||h.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=h.indexOf("Linux")>=0,L=!0,m=navigator.language,g=m;else if(typeof o=="object"){H=o.platform==="win32",P=o.platform==="darwin",K=o.platform==="linux",z=K&&!!o.env.SNAP&&!!o.env.SNAP_REVISION,m=X,g=X;const _=o.env.VSCODE_NLS_CONFIG;if(_)try{const j=JSON.parse(_),U=j.availableLanguages["*"];m=j.locale,g=U||X,l=j._translationsConfigFile}catch(j){}n=!0}else console.error("Unable to resolve platform.");let s=0;P?s=1:H?s=3:K&&(s=2);const a=H,R=P,x=K,S=n,D=L,O=y,A=h,C=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let U=[];p.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let I=0,v=U.length;I<v;I++){const W=U[I];if(W.id===M.data.vscodeSetImmediateId){U.splice(I,1),W.callback();return}}});let w=0;return M=>{const I=++w;U.push({id:I,callback:M}),p.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(o==null?void 0:o.nextTick)=="function")return o.nextTick.bind(o);const j=Promise.resolve();return U=>j.then(U)}(),T=P||y?2:H?1:3;let d=!0,f=!1;function b(){if(!f){f=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const j=new Uint16Array(_.buffer);d=j[0]===(2<<8)+1}return d}}).call(this,J("IyRk"),J("Q2Ig"))},N0LK:function(Je,Ee,J){"use strict";J.d(Ee,"C",function(){return le}),J.d(Ee,"v",function(){return N}),J.d(Ee,"s",function(){return X}),J.d(Ee,"t",function(){return H}),J.d(Ee,"U",function(){return P}),J.d(Ee,"J",function(){return K}),J.d(Ee,"O",function(){return z}),J.d(Ee,"p",function(){return n}),J.d(Ee,"T",function(){return L}),J.d(Ee,"q",function(){return y}),J.d(Ee,"N",function(){return m}),J.d(Ee,"M",function(){return g}),J.d(Ee,"Q",function(){return l}),J.d(Ee,"u",function(){return h}),J.d(Ee,"x",function(){return p}),J.d(Ee,"I",function(){return o}),J.d(Ee,"f",function(){return u}),J.d(Ee,"h",function(){return s}),J.d(Ee,"g",function(){return a}),J.d(Ee,"i",function(){return R}),J.d(Ee,"G",function(){return x}),J.d(Ee,"H",function(){return S}),J.d(Ee,"r",function(){return D}),J.d(Ee,"R",function(){return O}),J.d(Ee,"d",function(){return A}),J.d(Ee,"e",function(){return C}),J.d(Ee,"E",function(){return T}),J.d(Ee,"F",function(){return d}),J.d(Ee,"j",function(){return f}),J.d(Ee,"z",function(){return b}),J.d(Ee,"K",function(){return j}),J.d(Ee,"L",function(){return U}),J.d(Ee,"m",function(){return M}),J.d(Ee,"k",function(){return v}),J.d(Ee,"A",function(){return Z}),J.d(Ee,"a",function(){return oe}),J.d(Ee,"n",function(){return fe}),J.d(Ee,"l",function(){return Ae}),J.d(Ee,"D",function(){return be}),J.d(Ee,"B",function(){return Re}),J.d(Ee,"b",function(){return Ce}),J.d(Ee,"S",function(){return Le}),J.d(Ee,"o",function(){return ve}),J.d(Ee,"P",function(){return $}),J.d(Ee,"w",function(){return E}),J.d(Ee,"c",function(){return k}),J.d(Ee,"y",function(){return G});function le(ue){return!ue||typeof ue!="string"?!0:ue.trim().length===0}const Y=/{(\d+)}/g;function N(ue,...ge){return ge.length===0?ue:ue.replace(Y,function(_e,Se){const Pe=parseInt(Se,10);return isNaN(Pe)||Pe<0||Pe>=ge.length?_e:ge[Pe]})}function X(ue){return ue.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ge}})}function H(ue){return ue.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function P(ue,ge=" "){const _e=K(ue,ge);return z(_e,ge)}function K(ue,ge){if(!ue||!ge)return ue;const _e=ge.length;if(_e===0||ue.length===0)return ue;let Se=0;for(;ue.indexOf(ge,Se)===Se;)Se=Se+_e;return ue.substring(Se)}function z(ue,ge){if(!ue||!ge)return ue;const _e=ge.length,Se=ue.length;if(_e===0||Se===0)return ue;let Pe=Se,Ue=-1;for(;!(Ue=ue.lastIndexOf(ge,Pe-1),Ue===-1||Ue+_e!==Pe);){if(Ue===0)return"";Pe=Ue}return ue.substring(0,Pe)}function n(ue){return ue.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(ue){return ue.replace(/\*/g,"")}function y(ue,ge,_e={}){if(!ue)throw new Error("Cannot create regex from empty string");ge||(ue=H(ue)),_e.wholeWord&&(/\B/.test(ue.charAt(0))||(ue="\\b"+ue),/\B/.test(ue.charAt(ue.length-1))||(ue=ue+"\\b"));let Se="";return _e.global&&(Se+="g"),_e.matchCase||(Se+="i"),_e.multiline&&(Se+="m"),_e.unicode&&(Se+="u"),new RegExp(ue,Se)}function m(ue){if(ue.source==="^"||ue.source==="^$"||ue.source==="$"||ue.source==="^\\s*$")return!1;const ge=ue.exec("");return!!(ge&&ue.lastIndex===0)}function g(ue){return(ue.global?"g":"")+(ue.ignoreCase?"i":"")+(ue.multiline?"m":"")+(ue.unicode?"u":"")}function l(ue){return ue.split(/\r\n|\r|\n/)}function h(ue){for(let ge=0,_e=ue.length;ge<_e;ge++){const Se=ue.charCodeAt(ge);if(Se!==32&&Se!==9)return ge}return-1}function p(ue,ge=0,_e=ue.length){for(let Se=ge;Se<_e;Se++){const Pe=ue.charCodeAt(Se);if(Pe!==32&&Pe!==9)return ue.substring(ge,Se)}return ue.substring(ge,_e)}function o(ue,ge=ue.length-1){for(let _e=ge;_e>=0;_e--){const Se=ue.charCodeAt(_e);if(Se!==32&&Se!==9)return _e}return-1}function u(ue,ge){return ue<ge?-1:ue>ge?1:0}function s(ue,ge,_e=0,Se=ue.length,Pe=0,Ue=ge.length){for(;_e<Se&&Pe<Ue;_e++,Pe++){let Qe=ue.charCodeAt(_e),ze=ge.charCodeAt(Pe);if(Qe<ze)return-1;if(Qe>ze)return 1}const He=Se-_e,Be=Ue-Pe;return He<Be?-1:He>Be?1:0}function a(ue,ge){return R(ue,ge,0,ue.length,0,ge.length)}function R(ue,ge,_e=0,Se=ue.length,Pe=0,Ue=ge.length){for(;_e<Se&&Pe<Ue;_e++,Pe++){let Qe=ue.charCodeAt(_e),ze=ge.charCodeAt(Pe);if(Qe===ze)continue;if(Qe>=128||ze>=128)return s(ue.toLowerCase(),ge.toLowerCase(),_e,Se,Pe,Ue);x(Qe)&&(Qe-=32),x(ze)&&(ze-=32);const Ye=Qe-ze;if(Ye===0)continue;return Ye}const He=Se-_e,Be=Ue-Pe;return He<Be?-1:He>Be?1:0}function x(ue){return ue>=97&&ue<=122}function S(ue){return ue>=65&&ue<=90}function D(ue,ge){return ue.length===ge.length&&R(ue,ge)===0}function O(ue,ge){const _e=ge.length;return ge.length>ue.length?!1:R(ue,ge,0,_e)===0}function A(ue,ge){let _e,Se=Math.min(ue.length,ge.length);for(_e=0;_e<Se;_e++)if(ue.charCodeAt(_e)!==ge.charCodeAt(_e))return _e;return Se}function C(ue,ge){let _e,Se=Math.min(ue.length,ge.length);const Pe=ue.length-1,Ue=ge.length-1;for(_e=0;_e<Se;_e++)if(ue.charCodeAt(Pe-_e)!==ge.charCodeAt(Ue-_e))return _e;return Se}function T(ue){return 55296<=ue&&ue<=56319}function d(ue){return 56320<=ue&&ue<=57343}function f(ue,ge){return(ue-55296<<10)+(ge-56320)+65536}function b(ue,ge,_e){const Se=ue.charCodeAt(_e);if(T(Se)&&_e+1<ge){const Pe=ue.charCodeAt(_e+1);if(d(Pe))return f(Se,Pe)}return Se}function _(ue,ge){const _e=ue.charCodeAt(ge-1);if(d(_e)&&ge>1){const Se=ue.charCodeAt(ge-2);if(T(Se))return f(Se,_e)}return _e}function j(ue,ge){const _e=B.getInstance(),Se=ge,Pe=ue.length,Ue=b(ue,Pe,ge);ge+=Ue>=65536?2:1;let He=_e.getGraphemeBreakType(Ue);for(;ge<Pe;){const Be=b(ue,Pe,ge),Qe=_e.getGraphemeBreakType(Be);if(k(He,Qe))break;ge+=Be>=65536?2:1,He=Qe}return ge-Se}function U(ue,ge){const _e=B.getInstance(),Se=ge,Pe=_(ue,ge);ge-=Pe>=65536?2:1;let Ue=_e.getGraphemeBreakType(Pe);for(;ge>0;){const He=_(ue,ge),Be=_e.getGraphemeBreakType(He);if(k(Be,Ue))break;ge-=He>=65536?2:1,Ue=Be}return Se-ge}const w=/(?:[\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(ue){return w.test(ue)}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 v(ue){return I.test(ue)}const W=/^[\t\n\r\x20-\x7E]*$/;function Z(ue){return W.test(ue)}const oe=/[\u2028\u2029]/;function fe(ue){return oe.test(ue)}function Ae(ue){for(let ge=0,_e=ue.length;ge<_e;ge++)if(be(ue.charCodeAt(ge)))return!0;return!1}function be(ue){return ue=+ue,ue>=11904&&ue<=55215||ue>=63744&&ue<=64255||ue>=65281&&ue<=65374}function Re(ue){return ue>=127462&&ue<=127487||ue===8986||ue===8987||ue===9200||ue===9203||ue>=9728&&ue<=10175||ue===11088||ue===11093||ue>=127744&&ue<=128591||ue>=128640&&ue<=128764||ue>=128992&&ue<=129003||ue>=129280&&ue<=129535||ue>=129648&&ue<=129750}const Ce=String.fromCharCode(65279);function Le(ue){return!!(ue&&ue.length>0&&ue.charCodeAt(0)===65279)}function ve(ue,ge=!1){return ue?(ge&&(ue=ue.replace(/\\./g,"")),ue.toLowerCase()!==ue):!1}function $(ue){const ge=90-65+1;return ue=ue%(2*ge),ue<ge?String.fromCharCode(97+ue):String.fromCharCode(65+ue-ge)}function E(ue){const ge=B.getInstance();return ge.getGraphemeBreakType(ue)}function k(ue,ge){return ue===0?ge!==5&&ge!==7:ue===2&&ge===3?!1:ue===4||ue===2||ue===3||(ge===4||ge===2||ge===3)?!0:ue===8&&(ge===8||ge===9||ge===11||ge===12)||((ue===11||ue===9)&&(ge===9||ge===10)||((ue===12||ue===10)&&ge===10||(ge===5||ge===13||(ge===7||(ue===1||ue===13&&ge===14)))))?!1:!(ue===6&&ge===6)}class B{constructor(){this._data=Q()}static getInstance(){return B._INSTANCE||(B._INSTANCE=new B),B._INSTANCE}getGraphemeBreakType(ue){if(ue<32)return ue===10?3:ue===13?2:4;if(ue<127)return 0;const ge=this._data,_e=ge.length/3;let Se=1;for(;Se<=_e;)if(ue<ge[3*Se])Se=2*Se;else if(ue>ge[3*Se+1])Se=2*Se+1;else return ge[3*Se+2];return 0}}B._INSTANCE=null;function Q(){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 G(ue,ge){if(ue===0)return 0;const _e=he(ue,ge);if(_e!==void 0)return _e;const Se=_(ge,ue);return ue-=xe(Se),ue}function he(ue,ge){let _e=_(ge,ue);for(ue-=xe(_e);Ie(_e)||_e===65039||_e===8419;){if(ue===0)return;_e=_(ge,ue),ue-=xe(_e)}if(!Re(_e))return;if(ue>=0){const Se=_(ge,ue);Se===8205&&(ue-=xe(Se))}return ue}function xe(ue){return ue>=65536?2:1}function Ie(ue){return 127995<=ue&&ue<=127999}},Ot1p:function(Je,Ee,J){"use strict";var le=J("2qtc"),Y=J("kLXV"),N=J("rAM+"),X=J("miYZ"),H=J("tsqr"),P=J("9og8"),K=J("tJVT"),z=J("jrin"),n=J("WmNS"),L=J.n(n),y=J("q1tI"),m=J.n(y),g=J("VrN/"),l=J.n(g),h=J("bdgK"),p=J("p77/"),o=J("Bd2K"),u=J("ELLl"),s=J("19Vz"),a=J("lZu9"),R=J("+NIl"),x=J("kSUc"),S=J("9Bee"),D=function(Te){var Oe=Te.value,Ne=Oe===void 0?"":Oe,Ke=Te.className,nt=Te.showTextOnly,at=Te.showLines,xt=Te.style,ut=xt===void 0?{}:xt,ot=Object(y.useMemo)(function(){return""},[Ne]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},O=J("0Owb"),A=J("dejd"),C=J("C+DQ"),T=J("1vsH"),d=J("m3rI"),f=[{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 b(Te){var Oe=Te.onActionCallback,Ne=Te.title,Ke=Te.icon,nt=Te.actionName,at=Te.className,xt=at===void 0?"":at,ut=Te.children;function ot(){Oe(nt)}return m.a.createElement("a",{title:Ne,className:xt,onClick:ot},m.a.createElement("i",{className:"md-iconfont ".concat(Ke)}),ut)}var _=function(Te){var Oe=Te.watch,Ne=Te.showNullButton,Ke=Te.onActionCallback,nt=Te.fullScreen,at=Te.insertTemp,xt=Te.hidetoolBar,ut=Te.uuid,ot=Te.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(T.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(T.F)("_educoder_session"),"&key=").concat(ut,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var Tt=[].concat(f,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!xt&&Tt.map(function(St,rt){return m.a.createElement("li",{key:rt},St.actionName?m.a.createElement(b,Object(O.a)({},St,{onActionCallback:Ke})):m.a.createElement("span",{className:"v-line"}))}),Ne?m.a.createElement("li",null,m.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ke},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,at&&m.a.createElement("li",null,m.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(at),onActionCallback:Ke},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(b,{icon:"".concat(nt?"icon-shrink":"icon-enlarge"),title:nt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ke})))},j=J("M8RZ"),U=J("+L6B"),w=J("2/Rp"),M=J("y8nQ"),I=J("Vl3Y"),v=J("5NDa"),W=J("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},oe=function(Te){var Oe=Te.callback,Ne=Te.onCancel;function Ke(nt){Oe(nt)}return m.a.createElement(I.a,Object(O.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ke}),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(W.a,null)),m.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(w.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},fe=J("7ahc"),Ae=J("HmJG"),be=J("BjJ7"),Re=I.a.useForm,Ce={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ve=function(Te){var Oe=Te.callback,Ne=Te.onCancel,Ke=Re(),nt=Object(K.a)(Ke,1),at=nt[0];function xt(Tt){Oe(Tt)}function ut(Tt,St){if(Tt.status===-1){H.b.error(Tt.message);return}at.setFieldsValue({src:"/api/attachments/".concat(Tt.id),type:St.type})}function ot(Tt){var St=Tt.target.files[0];E(St,ut)}return m.a.createElement(I.a,Object(O.a)({form:at},Le,{className:"upload-image-panel",onFinish:xt}),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(W.a,{style:Ce})),m.a.createElement($,{onFileChange:ot}))),m.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(I.a.Item,{style:{textAlign:"right"}},m.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(w.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function $(Te){var Oe=Te.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Oe}))}function E(Te,Oe){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ne=new FormData;Ne.append("editormd-image-file",Te),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var Ke=new window.XMLHttpRequest;Ke.withCredentials=!0,Ke.addEventListener("load",function(nt){Oe(JSON.parse(nt.target.responseText),Te)},!1),Ke.addEventListener("error",function(nt){console.error(nt)},!1),Ke.open("POST","".concat(be.a,"/api/attachments.json")),Ke.send(Ne)}var k=J("giR+"),B=J("fyUT"),Q=J("7Kak"),G=J("9yH6"),he=G.a.Group,xe={margin:"0 8px"},Ie=function(Te){var Oe=Te.callback,Ne=Te.onCancel;function Ke(nt){Oe(nt)}return m.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ke},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:xe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:xe},"\u884C\u6570"),m.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(B.a,null)),m.a.createElement("span",{style:xe},"\u5217\u6570"),m.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(B.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(I.a.Item,{name:"align"},m.a.createElement(he,null,m.a.createElement(G.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(G.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(G.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(G.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(w.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},ue=J("ErOA"),ge=J("7Cbv"),_e="link",Se="upload-image",Pe="code-block",Ue="add-table",He="------------",Be={default:He,left:":".concat(He),center:":".concat(He,":"),right:"".concat(He,":")},Qe=J("9VGf"),ze,Ye;function Me(){}var it=0,Ze=1e4,ce="\u2581",ee=`
**\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 ne(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,de=ae?"Cmd":"Ctrl",re=["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"],se=(ze={},Object(z.a)(ze,de+"-B","bold"),Object(z.a)(ze,de+"-I","italic"),ze),pe=(Ye={},Object(z.a)(Ye,_e,"\u6DFB\u52A0\u94FE\u63A5"),Object(z.a)(Ye,Pe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(z.a)(Ye,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(z.a)(Ye,Ue,"\u6DFB\u52A0\u8868\u683C"),Ye),me=Ee.a=function(Te){var Oe=Te.defaultValue,Ne=Oe===void 0?"":Oe,Ke=Te.onChange,nt=Te.width,at=nt===void 0?"100%":nt,xt=Te.height,ut=xt===void 0?400:xt,ot=Te.miniToolbar,Tt=ot===void 0?!1:ot,St=Te.isFocus,rt=St===void 0?!1:St,Gt=Te.watch,Lt=Te.insertTemp,rn=Te.mode,We=rn===void 0?"markdown":rn,Pt=Te.id,Yt=Pt===void 0?"markdown-editor-id":Pt,pt=Te.showResizeBar,Et=pt===void 0?!1:pt,wt=Te.noStorage,Zt=wt===void 0?!1:wt,vn=Te.showNullButton,Bt=vn===void 0?!1:vn,tt=Te.hidetoolBar,At=tt===void 0?!1:tt,kt=Te.fullScreen,ft=kt===void 0?!1:kt,yt=Te.onBlur,Rt=Te.onCMBeforeChange,qt=Te.onFullScreen,$t=Te.className,Ge=$t===void 0?"":$t,mt=Te.disablePaste,nr=mt===void 0?!1:mt,dr=Te.placeholder,fr=dr===void 0?"":dr,Hn=Te.values,pr=Hn===void 0?"":Hn,bt=Object(y.useState)(null),Dn=Object(K.a)(bt,2),Ve=Dn[0],mr=Dn[1],Tn=Object(y.useState)(Ne),wn=Object(K.a)(Tn,2),Jn=wn[0],Nn=wn[1],gr=Object(y.useState)(Gt),Ar=Object(K.a)(gr,2),kn=Ar[0],Rr=Ar[1],Or=Object(y.useState)(ft),vr=Object(K.a)(Or,2),Fn=vr[0],Gn=vr[1],li=Object(y.useState)(""),rr=Object(K.a)(li,2),fn=rr[0],zn=rr[1],ui=Object(y.useState)(0),Kn=Object(K.a)(ui,2),$e=Kn[0],Ot=Kn[1],Jt=Object(y.useState)(ut),gt=Object(K.a)(Jt,2),jt=gt[0],Ht=gt[1],Wt=Object(y.useState)(!1),Kt=Object(K.a)(Wt,2),ir=Kt[0],pn=Kt[1],Zn=Object(y.useRef)(Object(ge.a)()),Lr=Object(y.useRef)(!1),Wr=Object(y.useRef)(),ar=Object(y.useRef)(),sr=Object(y.useRef)(),or=Object(y.useRef)(),Gr=Object(y.useRef)(),Ui=function(){var ht=Object(P.a)(L.a.mark(function _t(){var dt,It;return L.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,Object(ue.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zn.current}});case 2:It=Vt.sent,It!=null&&(dt=It.attachments)!==null&&dt!==void 0&&dt.length&&(console.log("cm:",Ve,ar),It.attachments.map(function(Mt){Mt.content_type.indexOf("image")>-1?Ve.replaceSelection("![,](/api/attachments/".concat(Mt.id,"?type=").concat(Mt.content_type,")")):Mt.content_type.indexOf("video")>-1?Ve.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Mt.content_type.indexOf("pdf")>-1?Ve.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(Mt.content_type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):Ve.replaceSelection("[".concat(Mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Mt.id,"?type=").concat(Mt.content_type,")"))}));case 4:case"end":return Vt.stop()}},_t)}));return function(){return ht.apply(this,arguments)}}();Object(y.useEffect)(function(){Nn(pr),Ve==null||Ve.setValue(pr)},[pr]),Object(y.useEffect)(function(){qt==null||qt(Fn)},[Fn]),Object(y.useEffect)(function(){if(ar.current){var ht=l.a.fromTextArea(ar.current,{mode:We,lineNumbers:!Tt,lineWrapping:!0,value:Ne,autoCloseTags:!0,autoCloseBrackets:!0});rt&&ht.focus();function _t(dt,It){if(nr){It.preventDefault();return}var Nt=It.clipboardData;if(Nt){var Vt=Nt.types.toString(),Mt=Nt.items;if(Vt==="Files"||Nt.types.indexOf("Files")>-1){if(It.preventDefault(),We=="stex")return;try{var on,Sn=Mt[1];((on=Mt[0])===null||on===void 0?void 0:on.kind)==="file"&&(Sn=Mt[0]);var Dt=Sn.getAsFile(),lr=Dt.name.split(".").pop();E(Dt,function(Ft){if(Ft.id){var Cn,yn,Wn;(Dt==null||((Cn=Dt.type)===null||Cn===void 0)?void 0:Cn.indexOf("image"))>-1?ht.replaceSelection("![,](/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type,")")):(Dt==null||((yn=Dt.type)===null||yn===void 0)?void 0:yn.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Dt==null||((Wn=Dt.type)===null||Wn===void 0)?void 0:Wn.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):re.includes(lr)?ht.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ht.replaceSelection("[".concat(Dt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})}catch(Ft){H.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ht.on("paste",_t),ht.on("dragleave",function(dt,It){sr.current.classList.remove("mouse-hover-md")}),ht.on("dragover",function(dt,It){sr.current.classList.add("mouse-hover-md")}),ht.on("drop",function(dt,It){sr.current.classList.add("mouse-hover-md");var Nt;if(Nt=It.dataTransfer.files,Nt.length>0){It.preventDefault(),It.stopPropagation();for(var Vt=function(Sn){var Dt=Nt[Sn],lr=Dt.name.split(".").pop();E(Dt,function(Ft){if(Ft.id){var Cn,yn,Wn;(Dt==null||((Cn=Dt.type)===null||Cn===void 0)?void 0:Cn.indexOf("image"))>-1?ht.replaceSelection("![,](/api/attachments/".concat(Ft.id,"?type=").concat(Ft.content_type,")")):(Dt==null||((yn=Dt.type)===null||yn===void 0)?void 0:yn.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,'"></video>')):(Dt==null||((Wn=Dt.type)===null||Wn===void 0)?void 0:Wn.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):re.includes(lr)?ht.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ht.replaceSelection("[".concat(Dt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Ft.id,"?type=").concat(Ft.content_type,")"))}else(Ft==null?void 0:Ft.status)===401&&(document.location.href="/user/login")})},Mt=0;Mt<Nt.length;Mt++)Vt(Mt)}}),mr(ht),function(){ht.off("paste",_t)}}},[]);var Un=Object(y.useCallback)(function(){if(sr.current)try{}catch(ht){console.log(ht,"---- to set md editor body height")}},[jt,sr,Fn]);Object(y.useEffect)(function(){function ht(){var dt=new h.default(function(It){var Nt=Object(N.a)(It),Vt;try{for(Nt.s();!(Vt=Nt.n()).done;){var Mt=Vt.value;(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&(Un(),Ve.setSize("100%","100%"),Ve.refresh())}}catch(on){Nt.e(on)}finally{Nt.f()}});return dt.observe(ar.current.parentElement),dt}if(Ve){var _t=ht();return function(){_t.unobserve(ar.current.parentElement)}}},[Ve,Un]),Object(y.useEffect)(function(){if(Ve){for(var ht=[],_t=function(){var Mt=It[dt];Nt=Object(K.a)(Mt,2);var on=Nt[0],Sn=Nt[1],Dt=Object(z.a)({},on,function(){Bi(Sn)});ht.push(Dt),Ve.addKeyMap(Dt)},dt=0,It=Object.entries(se);dt<It.length;dt++){var Nt;_t()}return Wr.current=setInterval(function(){Lr.current&&Ui()},4e3),function(){clearInterval(Wr.current);var Vt=Object(N.a)(ht),Mt;try{for(Vt.s();!(Mt=Vt.n()).done;){var on=Mt.value;Ve.removeKeyMap(on)}}catch(Sn){Vt.e(Sn)}finally{Vt.f()}}}},[Ve]),Object(y.useEffect)(function(){ft!==Fn&&Gn(ft)},[ft]),Object(Qe.a)(function(){if(!Zt&&$e>0){var ht=new Date().getTime(),_t=window.sessionStorage.getItem(Yt);ht>=$e+Ze&&(!_t||_t!==Jn)&&(window.sessionStorage.setItem(Yt,Jn),pn(!0))}},Ze),Object(y.useEffect)(function(){Rr(Gt)},[Ve,Gt]),Object(y.useEffect)(function(){Ve&&(rt&&Ve.focus())},[Ve,rt]),Object(y.useEffect)(function(){if(kn&&Ve){var ht=Ve.getScrollerElement();function _t(dt){var It=dt.target;if(Gr.current){var Nt=It.scrollTop/It.scrollHeight;Gr.current.scrollTop=Gr.current.scrollHeight*Nt}}return ht.addEventListener("scroll",_t),function(){ht.removeEventListener("scroll",_t)}}},[Ve,kn]),Object(y.useEffect)(function(){if(Ve&&Rt){function ht(_t,dt){Rt(_t,dt)}return Ve.on("beforeChange",ht),function(){Ve.off("beforeChange",ht)}}},[Ve,Rt]),Object(y.useEffect)(function(){if(Ve&&yt){function ht(){yt(Ve.getValue())}return Ve.on("blur",ht),function(){Ve.off("blur",ht)}}},[Ve,yt]),Object(y.useEffect)(function(){if(Ve){function ht(_t){var dt=_t.getValue();Nn(dt),Ot(new Date().getTime()),_t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ke&&Ke(dt)}return Ve.on("change",ht),function(){Ve.off("change",ht)}}},[Ve,Ke]),Object(y.useEffect)(function(){Ve&&(Ne==null?(Ve.setValue(""),Nn("")):Ne!==Ve.getValue()&&(Ve.setValue(Ne),Nn(Ne),Ve.setCursor(Ve.lineCount(),0)))},[Ve,Ne]);var Bi=Object(y.useCallback)(function(ht){var _t=Ve.getCursor(),dt=Ve.getSelection(),It=dt.split(`
`);switch(ht){case"bold":return Ve.replaceSelection("**"+dt+"**"),dt===""&&Ve.setCursor(_t.line,_t.ch+2),Ve.focus();case"italic":return Ve.replaceSelection("*"+dt+"*"),dt===""&&Ve.setCursor(_t.line,_t.ch+1),Ve.focus();case"code":return Ve.replaceSelection("`"+dt+"`"),dt===""&&Ve.setCursor(_t.line,_t.ch+1),Ve.focus();case"inline-latex":return Ve.replaceSelection("`$$"+dt+"$$`"),dt===""&&Ve.setCursor(_t.line,_t.ch+3),Ve.focus();case"latex":return Ve.replaceSelection("```latex\n"+dt+"\n```"),Ve.setCursor(_t.line+1,dt.length+1),Ve.focus();case"line-break":return Ve.replaceSelection(`<br/>
`),Ve.focus();case"list-ul":return dt===""?Ve.replaceSelection("- "+dt):Ve.replaceSelection(It.map(function(Nt){return Nt===""?"":"- ".concat(Nt)}).join(`
`)),Ve.focus();case"list-ol":return dt===""?Ve.replaceSelection("1. "+dt):Ve.replaceSelection(It.map(function(Nt,Vt){return Nt===""?"":"".concat(Vt+1,". ").concat(Nt)}).join(`
`)),Ve.focus();case"add-null-ch":return dt===""&&Ve.setCursor(_t.line,_t.ch+1),Ve.replaceSelection(ce),Ve.focus();case"inster-template-1":return dt===""&&Ve.setCursor(_t.line,_t.ch),Ve.replaceSelection(ee),Ve.focus();case"eraser":return Ve.setValue(""),Ve.focus();case"trigger-watch":return Rr(!kn),Ve.focus();case"trigger-full-screen":return Gn(!Fn),Ve.focus();case _e:zn(_e);return;case Pe:zn(Pe);return;case Se:zn(Se);return;case Ue:zn(Ue);return;default:throw new Error}},[Ve,kn,Fn]),zr=Object(y.useCallback)(function(ht){zn("");switch(fn){case _e:var _t=ht.title,dt=ht.link;return Ve.replaceSelection("[".concat(_t,"](").concat(dt,")")),Ve.focus();case Pe:var It=ht.language,Nt=ht.content;return Ve.replaceSelection(["```"+It,Nt,"```"].join(`
`)),Ve.focus();case Se:var Vt=ht.src,Mt=ht.alt;return Mt?Ve.replaceSelection("![ ".concat(Mt," ]( ").concat(Vt,' "').concat(Mt,'" )')):Ve.replaceSelection("![,](".concat(Vt,")")),Ve.focus();case Ue:for(var on=ht.row,Sn=ht.col,Dt=ht.align,lr=`
`,Ft=0;Ft<on;Ft++){for(var Cn=[],yn=[],Wn=0;Wn<Sn;Wn++)Ft===1&&yn.push(Be[Dt]),Cn.push(" ");Ft===1&&(lr+="| ".concat(yn.join(" | "),` |
`)),lr+="| ".concat(Cn.join(Sn===1?"":" | "),` |
`)}return Ve.replaceSelection(lr+`
`),Ve.focus();default:throw new Error}},[Ve,fn]),hi=Object(y.useMemo)(function(){switch(fn){case _e:return m.a.createElement(oe,{callback:zr,onCancel:yr});case Pe:return m.a.createElement(fe.b,{callback:zr,onCancel:yr});case Se:return m.a.createElement(ve,{callback:zr,onCancel:yr});case Ue:return m.a.createElement(Ie,{callback:zr,onCancel:yr});default:return null}},[fn]);function yr(){zn("")}Object(y.useEffect)(function(){if(or.current){var ht=or.current,_t=!1,dt=0;function It(Mt){_t=!0,dt=Mt.pageY}function Nt(){_t=!1}function Vt(Mt){if(_t){var on=Mt.pageY-dt;on<0&&(on=0),on>300&&(on=300);var Sn=ut+on+"px";Ht(Sn)}}return ht.addEventListener("mousedown",It),document.addEventListener("mousemove",Vt),document.addEventListener("mouseup",Nt),function(){ht.removeEventListener("mousedown",It),document.removeEventListener("mousemove",Vt),document.removeEventListener("mouseup",Nt)}}},[Ve,or]),Object(y.useEffect)(function(){Ht(ut)},[ut]);var Qn=ne(at),ci=ne(jt),Vn={width:Qn,height:ci},di=Object(y.useMemo)(function(){if($e){var ht=new Date($e),_t=ht.getHours(),dt=ht.getMinutes(),It=ht.getSeconds();return _t=_t<10?"0"+_t:_t,dt=dt<10?"0"+dt:dt,It=It<10?"0"+It:It,"".concat(_t,":").concat(dt,":").concat(It)}return 0},[$e]);function ji(){window.sessionStorage.removeItem(Yt),pn(!1),Ot(0)}function Ir(){pn(!1),Ot(0),Ve.setValue(window.sessionStorage.getItem(Yt))}function ua(ht,_t){var dt=Ve.getValue();dt=dt.replace(ht,_t),Nn(dt),Ve==null||Ve.setValue(dt)}return m.a.createElement(y.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:sr},m.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(kn?"on-preview":""," ").concat(Tt?"mini":""," ").concat(Fn?"full-screen":""),style:Vn},m.a.createElement(_,{insertTemp:Lt,watch:kn,fullScreen:Fn,showNullButton:Bt,onActionCallback:Bi,hidetoolBar:At,uuid:Zn.current,setOpenPhones:function(){Lr.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:ar,placeholder:fr})),kn?m.a.createElement("div",{ref:Gr,className:"preview-container"},We==="stex"&&m.a.createElement(D,{value:Jn}),We!=="stex"&&m.a.createElement(S.a,{edit:!0,value:Jn,replaces:ua})):null))),Et?m.a.createElement("a",{ref:or,className:"editor-resize"}):null,m.a.createElement(j.a,null,pe[fn]?m.a.createElement(Y.a,{centered:!0,title:pe[fn],visible:!0,onCancel:yr,footer:null,className:"markdown-popup-form"},hi):null))}},SJMd:function(Je,Ee){/**
* @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 J,le,Y,N=!1,X,H;window.PR_SHOULD_USE_CONTINUATION=!0;var P,K;(function(){var z=window,n=["break,continue,do,else,for,if,return,while"],L=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[y,"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"],g=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[y,"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"],h="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",p=[y,"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=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],a=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,l,g,p,o,u,s,a],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",D="kwd",O="com",A="typ",C="lit",T="pun",d="pln",f="tag",b="dec",_="src",j="atn",U="atv",w="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(he){for(var xe=0,Ie=!1,ue=!1,ge=0,_e=he.length;ge<_e;++ge){var Se=he[ge];if(Se.ignoreCase)ue=!0;else if(/[a-z]/i.test(Se.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,ue=!1;break}}var Pe={b:8,t:9,n:10,v:11,f:12,r:13};function Ue(Ye){var Me=Ye.charCodeAt(0);if(Me!==92)return Me;var it=Ye.charAt(1);return Me=Pe[it],Me||("0"<=it&&it<="7"?parseInt(Ye.substring(1),8):it==="u"||it==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function He(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Me=String.fromCharCode(Ye);return Me==="\\"||Me==="-"||Me==="]"||Me==="^"?"\\"+Me:Me}function Be(Ye){var Me=Ye.substring(1,Ye.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),it=[],Ze=Me[0]==="^",ce=["["];Ze&&ce.push("^");for(var ee=Ze?1:0,ne=Me.length;ee<ne;++ee){var ae=Me[ee];if(/\\[bdsw]/i.test(ae))ce.push(ae);else{var de=Ue(ae),re;ee+2<ne&&Me[ee+1]==="-"?(re=Ue(Me[ee+2]),ee+=2):re=de,it.push([de,re]),re<65||de>122||(re<65||de>90||it.push([Math.max(65,de)|32,Math.min(re,90)|32]),re<97||de>122||it.push([Math.max(97,de)&~32,Math.min(re,122)&~32]))}}it.sort(function(Te,Oe){return Te[0]-Oe[0]||Oe[1]-Te[1]});for(var se=[],pe=[],ee=0;ee<it.length;++ee){var me=it[ee];me[0]<=pe[1]+1?pe[1]=Math.max(pe[1],me[1]):se.push(pe=me)}for(var ee=0;ee<se.length;++ee){var me=se[ee];ce.push(He(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&ce.push("-"),ce.push(He(me[1])))}return ce.push("]"),ce.join("")}function Qe(Ye){for(var Me=Ye.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")),it=Me.length,Ze=[],ce=0,ee=0;ce<it;++ce){var ne=Me[ce];if(ne==="(")++ee;else if(ne.charAt(0)==="\\"){var ae=+ne.substring(1);ae&&(ae<=ee?Ze[ae]=-1:Me[ce]=He(ae))}}for(var ce=1;ce<Ze.length;++ce)Ze[ce]===-1&&(Ze[ce]=++xe);for(var ce=0,ee=0;ce<it;++ce){var ne=Me[ce];if(ne==="(")++ee,Ze[ee]||(Me[ce]="(?:");else if(ne.charAt(0)==="\\"){var ae=+ne.substring(1);ae&&ae<=ee&&(Me[ce]="\\"+Ze[ae])}}for(var ce=0;ce<it;++ce)Me[ce]==="^"&&Me[ce+1]!=="^"&&(Me[ce]="");if(Ye.ignoreCase&&Ie)for(var ce=0;ce<it;++ce){var ne=Me[ce],de=ne.charAt(0);ne.length>=2&&de==="["?Me[ce]=Be(ne):de!=="\\"&&(Me[ce]=ne.replace(/[a-zA-Z]/g,function(pe){var me=pe.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Me.join("")}for(var ze=[],ge=0,_e=he.length;ge<_e;++ge){var Se=he[ge];if(Se.global||Se.multiline)throw new Error(""+Se);ze.push("(?:"+Qe(Se)+")")}return new RegExp(ze.join("|"),ue?"gi":"g")}function v(he,xe){var Ie=/(?:^|\s)nocode(?:\s|$)/,ue=[],ge=0,_e=[],Se=0;function Pe(Ue){var He=Ue.nodeType;if(He==1){if(Ie.test(Ue.className))return;for(var Be=Ue.firstChild;Be;Be=Be.nextSibling)Pe(Be);var Qe=Ue.nodeName.toLowerCase();(Qe==="br"||Qe==="li")&&(ue[Se]=`
`,_e[Se<<1]=ge++,_e[Se++<<1|1]=Ue)}else if(He==3||He==4){var ze=Ue.nodeValue;ze.length&&(xe?ze=ze.replace(/\r\n?/g,`
`):ze=ze.replace(/[ \t\r\n]+/g," "),ue[Se]=ze,_e[Se<<1]=ge,ge+=ze.length,_e[Se++<<1|1]=Ue)}}return Pe(he),{sourceCode:ue.join("").replace(/\n$/,""),spans:_e}}function W(he,xe,Ie,ue,ge){if(!Ie)return;var _e={sourceNode:he,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:xe,decorations:null};ue(_e),ge.push.apply(ge,_e.decorations)}var Z=/\S/;function oe(he){for(var xe=void 0,Ie=he.firstChild;Ie;Ie=Ie.nextSibling){var ue=Ie.nodeType;xe=ue===1?xe?he:Ie:ue===3&&Z.test(Ie.nodeValue)?he:xe}return xe===he?void 0:xe}function fe(he,xe){var Ie={},ue;(function(){for(var Se=he.concat(xe),Pe=[],Ue={},He=0,Be=Se.length;He<Be;++He){var Qe=Se[He],ze=Qe[3];if(ze)for(var Ye=ze.length;--Ye>=0;)Ie[ze.charAt(Ye)]=Qe;var Me=Qe[1],it=""+Me;Ue.hasOwnProperty(it)||(Pe.push(Me),Ue[it]=null)}Pe.push(/[\0-\uffff]/),ue=I(Pe)})();var ge=xe.length,_e=function(Se){for(var Pe=Se.sourceCode,Ue=Se.basePos,He=Se.sourceNode,Be=[Ue,d],Qe=0,ze=Pe.match(ue)||[],Ye={},Me=0,it=ze.length;Me<it;++Me){var Ze=ze[Me],ce=Ye[Ze],ee=void 0,ne;if(typeof ce=="string")ne=!1;else{var ae=Ie[Ze.charAt(0)];if(ae)ee=Ze.match(ae[1]),ce=ae[0];else{for(var de=0;de<ge;++de)if(ae=xe[de],ee=Ze.match(ae[1]),ee){ce=ae[0];break}ee||(ce=d)}ne=ce.length>=5&&ce.substring(0,5)==="lang-",ne&&!(ee&&typeof ee[1]=="string")&&(ne=!1,ce=_),ne||(Ye[Ze]=ce)}var re=Qe;if(Qe+=Ze.length,!ne)Be.push(Ue+re,ce);else{var se=ee[1],pe=Ze.indexOf(se),me=pe+se.length;ee[2]&&(me=Ze.length-ee[2].length,pe=me-se.length);var Te=ce.substring(5);W(He,Ue+re,Ze.substring(0,pe),_e,Be),W(He,Ue+re+pe,se,$(Te,se),Be),W(He,Ue+re+me,Ze.substring(me),_e,Be)}}Se.decorations=Be};return _e}function Ae(he){var xe=[],Ie=[];he.tripleQuotedStrings?xe.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):he.multiLineStrings?xe.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):xe.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),he.verbatimStrings&&Ie.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ue=he.hashComments;ue&&(he.cStyleComments?(ue>1?xe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):xe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):xe.push([O,/^#[^\r\n]*/,null,"#"])),he.cStyleComments&&(Ie.push([O,/^\/\/[^\r\n]*/,null]),Ie.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ge=he.regexLiterals;if(ge){var _e=ge>1?"":`
\r`,Se=_e?".":"[\\S\\s]",Pe="/(?=[^/*"+_e+"])(?:[^/\\x5B\\x5C"+_e+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+_e+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+M+"("+Pe+")")])}var Ue=he.types;Ue&&Ie.push([A,Ue]);var He=(""+he.keywords).replace(/^ | $/g,"");He.length&&Ie.push([D,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),xe.push([d,/^\s+/,null,` \r
\xA0`]);var Be="^.[^\\s\\w.$@'\"`/\\\\]*";return he.regexLiterals&&(Be+="(?!s*/)"),Ie.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],[T,new RegExp(Be),null]),fe(xe,Ie)}var be=Ae({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(he,xe,Ie){for(var ue=/(?:^|\s)nocode(?:\s|$)/,ge=/\r\n?|\n/,_e=he.ownerDocument,Se=_e.createElement("li");he.firstChild;)Se.appendChild(he.firstChild);var Pe=[Se];function Ue(Me){var it=Me.nodeType;if(it==1&&!ue.test(Me.className))if(Me.nodeName==="br")He(Me),Me.parentNode&&Me.parentNode.removeChild(Me);else for(var Ze=Me.firstChild;Ze;Ze=Ze.nextSibling)Ue(Ze);else if((it==3||it==4)&&Ie){var ce=Me.nodeValue,ee=ce.match(ge);if(ee){var ne=ce.substring(0,ee.index);Me.nodeValue=ne;var ae=ce.substring(ee.index+ee[0].length);if(ae){var de=Me.parentNode;de.insertBefore(_e.createTextNode(ae),Me.nextSibling)}He(Me),ne||Me.parentNode.removeChild(Me)}}}function He(Me){for(;!Me.nextSibling;)if(Me=Me.parentNode,!Me)return;function it(ee,ne){var ae=ne?ee.cloneNode(!1):ee,de=ee.parentNode;if(de){var re=it(de,1),se=ee.nextSibling;re.appendChild(ae);for(var pe=se;pe;pe=se)se=pe.nextSibling,re.appendChild(pe)}return ae}for(var Ze=it(Me.nextSibling,0),ce;(ce=Ze.parentNode)&&ce.nodeType===1;)Ze=ce;Pe.push(Ze)}for(var Be=0;Be<Pe.length;++Be)Ue(Pe[Be]);xe===(xe|0)&&Pe[0].setAttribute("value",xe);var Qe=_e.createElement("ol");Qe.className="linenums";for(var ze=Math.max(0,xe-1|0)||0,Be=0,Ye=Pe.length;Be<Ye;++Be)Se=Pe[Be],Se.className="L"+(Be+ze)%10,Se.firstChild||Se.appendChild(_e.createTextNode("\xA0")),Qe.appendChild(Se);he.appendChild(Qe)}function Ce(he){var xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);xe=xe&&+xe[1]<=8;var Ie=/\n/g,ue=he.sourceCode,ge=ue.length,_e=0,Se=he.spans,Pe=Se.length,Ue=0,He=he.decorations,Be=He.length,Qe=0;He[Be]=ge;var ze,Ye;for(Ye=ze=0;Ye<Be;)He[Ye]!==He[Ye+2]?(He[ze++]=He[Ye++],He[ze++]=He[Ye++]):Ye+=2;for(Be=ze,Ye=ze=0;Ye<Be;){for(var Me=He[Ye],it=He[Ye+1],Ze=Ye+2;Ze+2<=Be&&He[Ze+1]===it;)Ze+=2;He[ze++]=Me,He[ze++]=it,Ye=Ze}Be=He.length=ze;var ce=he.sourceNode,ee="";ce&&(ee=ce.style.display,ce.style.display="none");try{for(var ne=null;Ue<Pe;){var ae=Se[Ue],de=Se[Ue+2]||ge,re=He[Qe+2]||ge,Ze=Math.min(de,re),se=Se[Ue+1],pe;if(se.nodeType!==1&&(pe=ue.substring(_e,Ze))){xe&&(pe=pe.replace(Ie,"\r")),se.nodeValue=pe;var me=se.ownerDocument,Te=me.createElement("span");Te.className=He[Qe+1];var Oe=se.parentNode;Oe.replaceChild(Te,se),Te.appendChild(se),_e<de&&(Se[Ue+1]=se=me.createTextNode(ue.substring(Ze,de)),Oe.insertBefore(se,Te.nextSibling))}_e=Ze,_e>=de&&(Ue+=2),_e>=re&&(Qe+=2)}}finally{ce&&(ce.style.display=ee)}}var Le={};function ve(he,xe){for(var Ie=xe.length;--Ie>=0;){var ue=xe[Ie];Le.hasOwnProperty(ue)?z.console&&console.warn("cannot override language handler %s",ue):Le[ue]=he}}function $(he,xe){return he&&Le.hasOwnProperty(he)||(he=/^\s*</.test(xe)?"default-markup":"default-code"),Le[he]}ve(be,["default-code"]),ve(fe([],[[d,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[T,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(fe([[d,/^[\s]+/,null,` \r
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[f,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[T,/^[=<>\/]+/],["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"]),ve(fe([],[[U,/^[\s\S]+/]]),["uq.val"]),ve(Ae({keywords:m,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),ve(Ae({keywords:"null,true,false"}),["json"]),ve(Ae({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),ve(Ae({keywords:g,cStyleComments:!0}),["java"]),ve(Ae({keywords:a,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve(Ae({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve(Ae({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve(Ae({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve(Ae({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve(Ae({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(fe([],[[S,/^[\s\S]+/]]),["regex"]);function E(he){var xe=he.langExtension;try{var Ie=v(he.sourceNode,he.pre),ue=Ie.sourceCode;he.sourceCode=ue,he.spans=Ie.spans,he.basePos=0,$(xe,ue)(he),Ce(he)}catch(ge){z.console&&console.log(ge&&ge.stack||ge)}}function k(he,xe,Ie){var ue=Ie||!1,ge=xe||null,_e=document.createElement("div");_e.innerHTML="<pre>"+he+"</pre>",_e=_e.firstChild,ue&&Re(_e,ue,!0);var Se={langExtension:ge,numberLines:ue,sourceNode:_e,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return E(Se),_e.innerHTML}function B(he,xe){var Ie=xe||document.body,ue=Ie.ownerDocument||document;function ge(ae){return Ie.getElementsByTagName(ae)}for(var _e=[ge("pre"),ge("code"),ge("xmp")],Se=[],Pe=0;Pe<_e.length;++Pe)for(var Ue=0,He=_e[Pe].length;Ue<He;++Ue)Se.push(_e[Pe][Ue]);_e=null;var Be=Date;Be.now||(Be={now:function(){return+new Date}});var Qe=0,ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,Me=/\bprettyprinted\b/,it=/pre|xmp/i,Ze=/^code$/i,ce=/^(?:pre|code|xmp)$/i,ee={};function ne(){for(var ae=z.PR_SHOULD_USE_CONTINUATION?Be.now()+250:Infinity;Qe<Se.length&&Be.now()<ae;Qe++){for(var de=Se[Qe],re=ee,se=de;se=se.previousSibling;){var pe=se.nodeType,me=(pe===7||pe===8)&&se.nodeValue;if(me?!/^\??prettify\b/.test(me):pe!==3||/\S/.test(se.nodeValue))break;if(me){re={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Gt,Lt,rn){re[Lt]=rn});break}}var Te=de.className;if((re!==ee||Ye.test(Te))&&!Me.test(Te)){for(var Oe=!1,Ne=de.parentNode;Ne;Ne=Ne.parentNode){var Ke=Ne.tagName;if(ce.test(Ke)&&Ne.className&&Ye.test(Ne.className)){Oe=!0;break}}if(!Oe){de.className+=" prettyprinted";var nt=re.lang;if(!nt){nt=Te.match(ze);var at;!nt&&(at=oe(de))&&Ze.test(at.tagName)&&(nt=at.className.match(ze)),nt&&(nt=nt[1])}var xt;if(it.test(de.tagName))xt=1;else{var ut=de.currentStyle,ot=ue.defaultView,Tt=ut?ut.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(de,null).getPropertyValue("white-space"):0;xt=Tt&&Tt.substring(0,3)==="pre"}var St=re.linenums;(St=St==="true"||+St)||(St=Te.match(/\blinenums\b(?::(\d+))?/),St=St?St[1]&&St[1].length?+St[1]:!0:!1),St&&Re(de,St,xt);var rt={langExtension:nt,sourceNode:de,numberLines:St,pre:xt,sourceCode:null,basePos:null,spans:null,decorations:null};E(rt)}}}Qe<Se.length?z.setTimeout(ne,250):typeof he=="function"&&he()}ne()}var Q=z.PR={createSimpleLexer:fe,registerLangHandler:ve,sourceDecorator:Ae,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:U,PR_COMMENT:O,PR_DECLARATION:b,PR_KEYWORD:D,PR_LITERAL:C,PR_NOCODE:w,PR_PLAIN:d,PR_PUNCTUATION:T,PR_SOURCE:_,PR_STRING:S,PR_TAG:f,PR_TYPE:A,prettyPrintOne:N?z.prettyPrintOne=k:P=k,prettyPrint:K=N?z.prettyPrint=B:K=B},G=z.define;typeof G=="function"&&G.amd&&G("google-code-prettify",[],function(){return Q})})()},STEk:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return ve});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var le=function($,E){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,B){k.__proto__=B}||function(k,B){for(var Q in B)Object.prototype.hasOwnProperty.call(B,Q)&&(k[Q]=B[Q])})($,E)};function Y($,E){function k(){this.constructor=$}le($,E),$.prototype=E===null?Object.create(E):(k.prototype=E.prototype,new k)}function N($,E,k,B){return new(k||(k=Promise))(function(Q,G){function he(ue){try{Ie(B.next(ue))}catch(ge){G(ge)}}function xe(ue){try{Ie(B.throw(ue))}catch(ge){G(ge)}}function Ie(ue){var ge;ue.done?Q(ue.value):(ge=ue.value,ge instanceof k?ge:new k(function(_e){_e(ge)})).then(he,xe)}Ie((B=B.apply($,E||[])).next())})}function X($,E){var k,B,Q,G,he={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return G={next:xe(0),throw:xe(1),return:xe(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function xe(Ie){return function(ue){return function(ge){if(k)throw new TypeError("Generator is already executing.");for(;he;)try{if(k=1,B&&(Q=2&ge[0]?B.return:ge[0]?B.throw||((Q=B.return)&&Q.call(B),0):B.next)&&!(Q=Q.call(B,ge[1])).done)return Q;switch(B=0,Q&&(ge=[2&ge[0],Q.value]),ge[0]){case 0:case 1:Q=ge;break;case 4:return he.label++,{value:ge[1],done:!1};case 5:he.label++,B=ge[1],ge=[0];continue;case 7:ge=he.ops.pop(),he.trys.pop();continue;default:if(!(Q=he.trys,(Q=Q.length>0&&Q[Q.length-1])||ge[0]!==6&&ge[0]!==2)){he=0;continue}if(ge[0]===3&&(!Q||ge[1]>Q[0]&&ge[1]<Q[3])){he.label=ge[1];break}if(ge[0]===6&&he.label<Q[1]){he.label=Q[1],Q=ge;break}if(Q&&he.label<Q[2]){he.label=Q[2],he.ops.push(ge);break}Q[2]&&he.ops.pop(),he.trys.pop();continue}ge=E.call($,he)}catch(_e){ge=[6,_e],B=0}finally{k=Q=0}if(5&ge[0])throw ge[1];return{value:ge[0]?ge[1]:void 0,done:!0}}([Ie,ue])}}}function H(){for(var $=0,E=0,k=arguments.length;E<k;E++)$+=arguments[E].length;var B=Array($),Q=0;for(E=0;E<k;E++)for(var G=arguments[E],he=0,xe=G.length;he<xe;he++,Q++)B[Q]=G[he];return B}var P=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(E,k){for(var B=0,Q=k;B<Q.length;B++){var G=Q[B],he=G[0],xe=G[1];E.setAttribute(he,xe)}},$.createRect=function(E,k,B){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",E.toString()),Q.setAttribute("height",k.toString()),B&&$.setAttributes(Q,B),Q},$.createLine=function(E,k,B,Q,G){var he=document.createElementNS("http://www.w3.org/2000/svg","line");return he.setAttribute("x1",E.toString()),he.setAttribute("y1",k.toString()),he.setAttribute("x2",B.toString()),he.setAttribute("y2",Q.toString()),G&&$.setAttributes(he,G),he},$.createPolygon=function(E,k){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",E),k&&$.setAttributes(B,k),B},$.createCircle=function(E,k){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(E/2).toString()),B.setAttribute("cy",(E/2).toString()),B.setAttribute("r",E.toString()),k&&$.setAttributes(B,k),B},$.createEllipse=function(E,k,B){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(E/2).toString()),Q.setAttribute("cy",(k/2).toString()),Q.setAttribute("rx",(E/2).toString()),Q.setAttribute("ry",(k/2).toString()),B&&$.setAttributes(Q,B),Q},$.createGroup=function(E){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return E&&$.setAttributes(k,E),k},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(E,k,B,Q,G,he,xe){var Ie=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(Ie,[["id",E],["orient",k],["markerWidth",B.toString()],["markerHeight",Q.toString()],["refX",G.toString()],["refY",he.toString()]]),Ie.appendChild(xe),Ie},$.createText=function(E){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),E&&$.setAttributes(k,E),k},$.createTSpan=function(E,k){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=E,k&&$.setAttributes(B,k),B},$.createImage=function(E){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return E&&$.setAttributes(k,E),k},$.createPoint=function(E,k){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=E,B.y=k,B},$.createPath=function(E,k){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",E),k&&$.setAttributes(B,k),B},$}(),K=function(){function $(){}return $.addKey=function(E){$.key=E},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),z=function(){function $(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return $.prototype.rasterize=function(E,k,B){var Q=this;return new Promise(function(G){var he=B!==void 0?B:document.createElement("canvas");E===null&&(Q.markersOnly=!0,Q.naturalSize=!1);var xe=document.createElementNS("http://www.w3.org/2000/svg","svg");xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),xe.setAttribute("width",k.width.baseVal.valueAsString),xe.setAttribute("height",k.height.baseVal.valueAsString),xe.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),xe.innerHTML=k.innerHTML,Q.naturalSize===!0?(xe.width.baseVal.value=E.naturalWidth,xe.height.baseVal.value=E.naturalHeight):Q.width!==void 0&&Q.height!==void 0&&(xe.width.baseVal.value=Q.width,xe.height.baseVal.value=Q.height),he.width=xe.width.baseVal.value,he.height=xe.height.baseVal.value;var Ie=xe.outerHTML,ue=he.getContext("2d");Q.markersOnly!==!0&&ue.drawImage(E,0,0,he.width,he.height);var ge=window.URL,_e=new Image(he.width,he.height);_e.setAttribute("crossOrigin","anonymous");var Se=new Blob([Ie],{type:"image/svg+xml"}),Pe=ge.createObjectURL(Se);_e.onload=function(){ue.drawImage(_e,0,0),ge.revokeObjectURL(Pe);var Ue=he.toDataURL(Q.imageType,Q.imageQuality);G(Ue)},_e.src=Pe})},$}(),n=function(){},L=function(){function $(E){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+E+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(E){return this.styleSheet===void 0&&this.addStyleSheet(),E.name=""+this.classNamePrefix+E.localName,this.classes.push(E),this.styleSheet.sheet.insertRule("."+E.name+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length),E},$.prototype.addRule=function(E){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(E),this.styleSheet.sheet.insertRule(E.selector+" {"+E.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var E;this.styleSheet=document.createElement("style"),((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).appendChild(this.styleSheet),this.addRule(new y("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new y("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new y("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new m("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new m("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var E;this.styleSheet&&(((E=this.styleSheetRoot)!==null&&E!==void 0?E:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),y=function($,E){this.selector=$,this.style=E},m=function($,E){this.localName=$,this.style=E},g=function(){function $(E,k,B,Q,G){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=E,this.displayMode=k,this.markerItems=B,this.uiStyleSettings=Q,this.styles=G,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return $.prototype.show=function(E){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",this.uiContainer.appendChild(B),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(G){var he=document.createElement("div");he.className=""+k.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",G.typeName),he.innerHTML=G.icon,he.addEventListener("click",function(){k.markerToolbarButtonClicked(he,G)}),k.buttons.push(he),k.markerButtons.push(he)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",Q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(E){this.buttonClickListeners.push(E)},$.prototype.removeButtonClickListener=function(E){this.buttonClickListeners.indexOf(E)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(E),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var E=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<E||k===E&&this.markerButtons.length-1===E?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===E&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},$.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},$.prototype.resetButtonStyles=function(){var E=this;this.buttons.forEach(function(k){k.className=k.className.replace(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?E.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:E.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(E.uiStyleSettings.toolbarButtonStyleColorsClassName?E.uiStyleSettings.toolbarButtonStyleColorsClassName:E.toolbarButtonStyleColorsClass.name)})},$.prototype.addActionButton=function(E,k,B){var Q=this,G=document.createElement("div");switch(G.className=""+this.toolbarButtonStyleClass.name,G.innerHTML=k,G.setAttribute("data-action",B),G.addEventListener("click",function(){Q.actionToolbarButtonClicked(G,B)}),B){case"select":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":G.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":G.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":G.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":G.style.fill=this.uiStyleSettings.closeButtonColor}E.appendChild(G),this.buttons.push(G)},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new m("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new m("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new m("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new m("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new m("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var E=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new m("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*E)+`px;
padding: `+E+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new m("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new y("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new y("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},$.prototype.markerToolbarButtonClicked=function(E,k){this.setActiveButton(E),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(E,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(E){this.resetButtonStyles(),E.className=E.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),E.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(E){var k=this.markerButtons.find(function(B){return B.getAttribute("data-type-name")===E});k&&this.setActiveButton(k)},$.prototype.setCurrentMarker=function(E){var k=this;this.currentMarker=E,this.buttons.filter(function(B){return/delete|notes/.test(B.getAttribute("data-action"))}).forEach(function(B){k.currentMarker===void 0?(B.style.fillOpacity="0.4",B.style.pointerEvents="none"):(B.style.fillOpacity="1",B.style.pointerEvents="all")})},$}(),l=function(){function $(E,k,B,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=E,this.displayMode=k,this.uiStyleSettings=B,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var E;this.toolboxStyleClass=this.styles.addClass(new m("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 m("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new m("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new m("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new m("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 m("toolbox-panel-row_colors",`
background-color: `+((E=this.uiStyleSettings.toolboxBackgroundColor)!==null&&E!==void 0?E:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new m("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 m("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new m("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new y("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new y("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},$.prototype.show=function(E){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=E,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(E){var k,B,Q=this;this.panels=E,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+" "+((B=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(G){var he;G.uiStyleSettings=Q.uiStyleSettings;var xe=document.createElement("div");xe.className=Q.toolboxButtonStyleClass.name+" "+((he=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:Q.toolboxButtonStyleColorsClass.name),xe.innerHTML=G.icon,xe.title=G.title,xe.addEventListener("click",function(){Q.panelButtonClick(G)}),Q.panelButtons.push(xe),Q.buttonRow.appendChild(xe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(E){var k=this,B=-1;if(E!==this.activePanel){B=this.panels.indexOf(E),this.panelRow.innerHTML="";var Q=E.getUi();Q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Q),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=E}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(G,he){var xe,Ie;G.className=k.toolboxButtonStyleClass.name+" "+(he===B?""+((xe=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&xe!==void 0?xe:k.toolboxActiveButtonStyleColorsClass.name):""+((Ie=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:k.toolboxButtonStyleColorsClass.name))})},$}(),h=function($,E){this.title=$,this.icon=E},p=function($){function E(k,B,Q,G){var he=$.call(this,k,G||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=B,he.currentColor=Q,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var G=k.getColorBox(Q);B.appendChild(G),k.colorBoxes.push(G)}),B},E.prototype.getColorBox=function(k){var B=this,Q=this.uiStyleSettings.toolbarHeight/4,G=this.uiStyleSettings.toolbarHeight-Q,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=G-2+"px",he.style.height=G-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(G+2)/2+"px",he.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){B.setCurrentColor(k,he)});var xe=document.createElement("div");return xe.style.display="inline-block",xe.style.width=G-2+"px",xe.style.height=G-2+"px",xe.style.backgroundColor=k,xe.style.borderRadius=G/2+"px",k==="transparent"&&(xe.style.fill=this.uiStyleSettings.toolboxAccentColor,xe.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),he.appendChild(xe),he},E.prototype.setCurrentColor=function(k,B){var Q=this;this.currentColor=k,this.colorBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},E}(h),o=function(){function $(E,k,B){this._state="new",this._isSelected=!1,this._container=E,this._overlayContainer=k,this.globalSettings=B,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(E){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(E,k){},$.prototype.dblClick=function(E,k){},$.prototype.manipulate=function(E){},$.prototype.pointerUp=function(E){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(E){this.container.childNodes.length>0?this.container.insertBefore(E,this.container.childNodes[0]):this.container.appendChild(E)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(E){this._state=E.state,this.notes=E.notes},$.prototype.scale=function(E,k){},$.prototype.colorChanged=function(E){this.onColorChanged&&this.onColorChanged(E),this.stateChanged()},$.prototype.fillColorChanged=function(E){this.onFillColorChanged&&this.onFillColorChanged(E),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var E=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),E.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(E)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),u=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(E){return this.topLeft.ownsTarget(E)?this.topLeft:this.topCenter.ownsTarget(E)?this.topCenter:this.topRight.ownsTarget(E)?this.topRight:this.centerLeft.ownsTarget(E)?this.centerLeft:this.centerRight.ownsTarget(E)?this.centerRight:this.bottomLeft.ownsTarget(E)?this.bottomLeft:this.bottomCenter.ownsTarget(E)?this.bottomCenter:this.bottomRight.ownsTarget(E)?this.bottomRight:void 0},$}(),s=function(){function $(){this.GRIP_SIZE=10,this.visual=P.createGroup(),this.visual.appendChild(P.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(P.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(E){return E===this.visual||E===this.visual.childNodes[0]||E===this.visual.childNodes[1]},$}(),a=function(){function $(){}return $.toITransformMatrix=function(E){return{a:E.a,b:E.b,c:E.c,d:E.d,e:E.e,f:E.f}},$.toSVGMatrix=function(E,k){return E.a=k.a,E.b=k.b,E.c=k.c,E.d=k.d,E.e=k.e,E.f=k.f,E},$}(),R=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.left=0,G.top=0,G.width=0,G.height=0,G.defaultSize={x:50,y:20},G.offsetX=0,G.offsetY=0,G.rotationAngle=0,G.CB_DISTANCE=10,G._suppressMarkerCreateEvent=!1,G.container.transform.baseVal.appendItem(P.createTransform()),G.setupControlBox(),G}return Y(E,$),Object.defineProperty(E.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var B=P.createTransform();this._visual.transform.baseVal.appendItem(B)},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(k){return!!$.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),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 Q=this.unrotatePoint(k);if(this.manipulationStartX=Q.x,this.manipulationStartY=Q.y,this.offsetX=Q.x-this.left,this.offsetY=Q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(B),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B)){this.activeGrip=this.rotatorGrip;var G=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=G.x-this.width/2,this.top=G.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},E.prototype.pointerUp=function(k){var B=this.state;$.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",B==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},E.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},E.prototype.manipulate=function(k){var B=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(B.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(B.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(B):this.state==="rotate"&&this.rotate(k)},E.prototype.resize=function(k){var B=this.manipulationStartLeft,Q=this.manipulationStartWidth,G=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:B=this.manipulationStartLeft+k.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-B;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Q=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:G=this.manipulationStartTop+k.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-G;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+k.y-this.manipulationStartY}Q>=0?(this.left=B,this.width=Q):(this.left=B+Q,this.width=-Q),he>=0?(this.top=G,this.height=he):(this.top=G+he,this.height=-he),this.setSize()},E.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},E.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var B=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*B,this.applyRotation()}},E.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)},E.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var B=this.container.getCTM(),Q=P.createPoint(k.x,k.y);return{x:(Q=Q.matrixTransform(B)).x,y:Q.y}},E.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var B=this.container.getCTM();B=B.inverse();var Q=P.createPoint(k.x,k.y);return{x:(Q=Q.matrixTransform(B)).x,y:Q.y}},E.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=P.createGroup();var k=P.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=P.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=P.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 u,this.addControlGrips(),this.controlBox.style.display="none"},E.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()},E.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()},E.prototype.createGrip=function(){var k=new s;return k.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(k.visual),k},E.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,B=-k/2,Q=B,G=(this.width+this.CB_DISTANCE)/2-k/2,he=(this.height+this.CB_DISTANCE)/2-k/2,xe=this.height+this.CB_DISTANCE-k/2,Ie=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,B,Q),this.positionGrip(this.controlGrips.topCenter.visual,G,Q),this.positionGrip(this.controlGrips.topRight.visual,Ie,Q),this.positionGrip(this.controlGrips.centerLeft.visual,B,he),this.positionGrip(this.controlGrips.centerRight.visual,Ie,he),this.positionGrip(this.controlGrips.bottomLeft.visual,B,xe),this.positionGrip(this.controlGrips.bottomCenter.visual,G,xe),this.positionGrip(this.controlGrips.bottomRight.visual,Ie,xe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,G,Q-3*this.CB_DISTANCE)},E.prototype.positionGrip=function(k,B,Q){var G=k.transform.baseVal.getItem(0);G.setTranslate(B,Q),k.transform.baseVal.replaceItem(G,0)},E.prototype.hideControlBox=function(){this.controlBox.style.display="none"},E.prototype.showControlBox=function(){this.controlBox.style.display=""},E.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:a.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:a.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k);var B=k;this.left=B.left,this.top=B.top,this.width=B.width,this.height=B.height,this.rotationAngle=B.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,B.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(a.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,B.containerTransformMatrix))},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B);var Q=this.rotatePoint({x:this.left,y:this.top}),G=this.unrotatePoint({x:Q.x*k,y:Q.y*B});this.left=G.x,this.top=G.y,this.width=this.width*k,this.height=this.height*B,this.adjustControlBox()},E}(o),x=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.createVisual=G.createVisual.bind(G),G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.visual)},E.prototype.createVisual=function(){this.visual=P.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)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},E.prototype.manipulate=function(k){$.prototype.manipulate.call(this,k)},E.prototype.resize=function(k){$.prototype.resize.call(this,k),this.setSize()},E.prototype.setSize=function(){$.prototype.setSize.call(this),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(k){$.prototype.pointerUp.call(this,k),this.setSize()},E.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},E.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},E.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},E.prototype.restoreState=function(k){var B=k;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),$.prototype.restoreState.call(this,k),this.setSize()},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.setSize()},E.title="Rectangle marker",E}(R),S=function($){function E(k,B,Q,G){var he=$.call(this,k,G||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return he.widths=[],he.widthBoxes=[],he.widths=B,he.currentWidth=Q,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.widths.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.flexGrow="2",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Q===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){k.setCurrentWidth(Q,G)}),B.appendChild(G);var he=document.createElement("div");he.innerText=Q.toString(),he.style.marginRight="5px",G.appendChild(he);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.display="flex",xe.style.alignItems="center";var Ie=document.createElement("hr");Ie.style.minWidth="20px",Ie.style.border="0px",Ie.style.borderTop=Q+"px solid "+k.uiStyleSettings.toolboxColor,Ie.style.flexGrow="2",xe.appendChild(Ie),G.appendChild(xe),k.widthBoxes.push(G)}),B},E.prototype.setCurrentWidth=function(k,B){var Q=this;this.currentWidth=k,this.widthBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},E}(h),D=function($){function E(k,B,Q,G){var he=$.call(this,k,G||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return he.styles=[],he.styleBoxes=[],he.styles=B,he.currentStyle=Q,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.styles.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/k.styles.length-5+"%",G.style.borderColor=Q===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){k.setCurrentStyle(Q,G)}),B.appendChild(G);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var xe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Q!==""?'stroke-dasharray="'+Q+'"':"")+` />
</svg>`;he.innerHTML=xe,G.appendChild(he),k.styleBoxes.push(G)}),B},E.prototype.setCurrentStyle=function(k,B){var Q=this;this.currentStyle=k,this.styleBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},E}(h),O=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new p("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new S("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new D("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Y(E,$),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=$.prototype.getState.call(this);return k.typeName=E.typeName,k},E.typeName="FrameMarker",E.title="Frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',E}(x),A=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},C=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.x1=0,G.y1=0,G.x2=0,G.y2=0,G.defaultLength=50,G.manipulationStartX=0,G.manipulationStartY=0,G.manipulationStartX1=0,G.manipulationStartY1=0,G.manipulationStartX2=0,G.manipulationStartY2=0,G.setupControlBox(),G}return Y(E,$),E.prototype.ownsTarget=function(k){return!!$.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),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(B)?this.activeGrip=this.grip1:this.grip2.ownsTarget(B)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},E.prototype.pointerUp=function(k){var B=this.state;$.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",B==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},E.prototype.adjustVisual=function(){},E.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)},E.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()},E.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},E.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},E.prototype.setupControlBox=function(){this.controlBox=P.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},E.prototype.adjustControlBox=function(){this.positionGrips()},E.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},E.prototype.createGrip=function(){var k=new s;return k.visual.transform.baseVal.appendItem(P.createTransform()),this.controlBox.appendChild(k.visual),k},E.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)},E.prototype.positionGrip=function(k,B,Q){var G=k.transform.baseVal.getItem(0);G.setTranslate(B,Q),k.transform.baseVal.replaceItem(G,0)},E.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k);var B=k;this.x1=B.x1,this.y1=B.y1,this.x2=B.x2,this.y2=B.y2},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.x1=this.x1*k,this.y1=this.y1*B,this.x2=this.x2*k,this.y2=this.y2*B,this.adjustVisual(),this.adjustControlBox()},E}(o),T=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new p("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new S("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new D("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},E.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorLine=P.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=P.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)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},E.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()),P.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},E.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},E.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k);var B=k;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.createVisual(),this.adjustVisual()},E.typeName="LineMarker",E.title="Line marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',E}(C),d=function($){function E(k,B,Q,G){var he=$.call(this,k,G||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return he.fonts=[],he.fontBoxes=[],he.fonts=B,he.currentFont=Q,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.flexGrow="2",this.fonts.forEach(function(Q){var G=document.createElement("div");G.style.display="inline-block",G.style.alignItems="center",G.style.justifyContent="space-between",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.overflow="hidden",G.style.maxWidth=100/k.fonts.length-5+"%",G.style.borderColor=Q===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){k.setCurrentFont(Q,G)}),B.appendChild(G);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=Q,he.style.overflow="hidden";var xe=document.createElement("div");xe.style.whiteSpace="nowrap",xe.style.overflow="hidden",xe.style.textOverflow="ellipsis",xe.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(xe),G.appendChild(he),k.fontBoxes.push(G)}),B},E.prototype.setCurrentFont=function(k,B){var Q=this;this.currentFont=k,this.fontBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},E}(h),f=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.color="transparent",G.padding=5,G.DEFAULT_TEXT="your text here",G.text=G.DEFAULT_TEXT,G.isMoved=!1,G.color=Q.defaultColor,G.fontFamily=Q.defaultFontFamily,G.defaultSize={x:100,y:30},G.setColor=G.setColor.bind(G),G.setFont=G.setFont.bind(G),G.renderText=G.renderText.bind(G),G.sizeText=G.sizeText.bind(G),G.textEditDivClicked=G.textEditDivClicked.bind(G),G.showTextEditor=G.showTextEditor.bind(G),G.setSize=G.setSize.bind(G),G.positionTextEditor=G.positionTextEditor.bind(G),G.colorPanel=new p("Color",Q.defaultColorSet,Q.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.fontFamilyPanel=new d("Font",Q.defaultFontFamilies,Q.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G}return Y(E,$),E.prototype.ownsTarget=function(k){if($.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var B=!1;return this.textElement.childNodes.forEach(function(Q){Q===k&&(B=!0)}),B},E.prototype.createVisual=function(){this.visual=P.createGroup(),this.bgRectangle=P.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=P.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.textElement.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},E.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(B){k.textElement.appendChild(P.createTSpan(B.trim()===""?" ":B.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},E.prototype.getTextScale=function(){var k=this.textElement.getBBox(),B=1;if(k.width>0&&k.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/k.width,G=(1*this.height-this.height*this.padding*2/100)/k.height;B=Math.min(Q,G)}return B},E.prototype.getTextPosition=function(k){var B=this.textElement.getBBox(),Q=0,G=0;return B.width>0&&B.height>0&&(Q=(this.width-B.width*k)/2,G=this.height/2-B.height*k/2),{x:Q,y:G}},E.prototype.sizeText=function(){var k=this.textElement.getBBox(),B=this.getTextScale(),Q=this.getTextPosition(B);Q.y-=k.y*B,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+B+", "+B+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(B,B))},E.prototype.manipulate=function(k){$.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)},E.prototype.resize=function(k){$.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},E.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},E.prototype.pointerUp=function(k){var B=this.state;B==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,k),this.setSize(),(B==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},E.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(B){B.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var B=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&B>.9;)B-=.1,k.textEditor.style.fontSize=Math.max(B,.9)+"em"}),this.textEditor.addEventListener("keyup",function(B){B.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(B){if(B.clipboardData){var Q=B.clipboardData.getData("text"),G=window.getSelection();if(!G.rangeCount)return!1;G.deleteFromDocument(),G.getRangeAt(0).insertNode(document.createTextNode(Q)),B.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")},E.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),B=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),G={x:Q.width*k,y:Q.height*k};B.x-=G.x/2,B.y-=G.y/2,this.textEditor.style.top=B.y+"px",this.textEditor.style.left=B.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-B.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},E.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()},E.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},E.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},E.prototype.dblClick=function(k,B){$.prototype.dblClick.call(this,k,B),this.showTextEditor()},E.prototype.setColor=function(k){this.textElement&&P.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},E.prototype.setFont=function(k){this.textElement&&P.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},E.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},E.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){var B=k;this.color=B.color,this.fontFamily=B.fontFamily,this.padding=B.padding,this.text=B.text,this.createVisual(),$.prototype.restoreState.call(this,k),this.setSize()},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.setSize(),this.sizeText(),this.positionTextEditor()},E.typeName="TextMarker",E.title="Text marker",E.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',E}(R),b=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.color="transparent",G.lineWidth=3,G.drawing=!1,G.pixelRatio=1,G.color=Q.defaultColor,G.lineWidth=Q.defaultStrokeWidth,G.pixelRatio=Q.freehandPixelRatio,G.setColor=G.setColor.bind(G),G.addCanvas=G.addCanvas.bind(G),G.finishCreation=G.finishCreation.bind(G),G.setLineWidth=G.setLineWidth.bind(G),G.colorPanel=new p("Color",Q.defaultColorSet,Q.defaultColor),G.colorPanel.onColorChanged=G.setColor,G.lineWidthPanel=new S("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.lineWidthPanel.onWidthChanged=G.setLineWidth,G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},E.prototype.createVisual=function(){this.visual=P.createGroup(),this.drawingImage=P.createImage(),this.visual.appendChild(this.drawingImage);var k=P.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(k,B){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):$.prototype.pointerDown.call(this,k,B)},E.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,k)},E.prototype.resize=function(k){$.prototype.resize.call(this,k),P.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},E.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,k)},E.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)},E.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},E.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},E.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),B=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=B[0],G=B[1],he=B[2],xe=B[3],Ie=!1,ue=0;ue<this.canvasElement.height;ue++)for(var ge=0;ge<this.canvasElement.width;ge++)k.data[ue*this.canvasElement.width*4+4*ge+3]>0&&(Ie=!0,ue<G&&(G=ue),ge<Q&&(Q=ge),ue>xe&&(xe=ue),ge>he&&(he=ge));if(Ie){this.left=Q/this.pixelRatio,this.top=G/this.pixelRatio,this.width=(he-Q)/this.pixelRatio,this.height=(xe-G)/this.pixelRatio;var _e=document.createElement("canvas");_e.width=he-Q,_e.height=xe-G,_e.getContext("2d").putImageData(this.canvasContext.getImageData(Q,G,he-Q,xe-G),0,0),this.drawingImgUrl=_e.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},E.prototype.setDrawingImage=function(){P.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),P.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},E.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},E.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){this.createVisual(),$.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.setDrawingImage()},E.typeName="FreehandMarker",E.title="Freehand marker",E.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',E}(R),_=function($){function E(k,B,Q){var G=$.call(this,k,Q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return G.typeBoxes=[],G.currentType=B,G.setCurrentType=G.setCurrentType.bind(G),G}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2";for(var Q=function(xe){var Ie="both";switch(xe){case 0:Ie="both";break;case 1:Ie="start";break;case 2:Ie="end";break;case 3:Ie="none"}var ue=document.createElement("div");if(ue.style.display="flex",ue.style.flexGrow="2",ue.style.alignItems="center",ue.style.justifyContent="space-between",ue.style.padding="5px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderColor=Ie===G.currentType?G.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){k.setCurrentType(Ie,ue)}),B.appendChild(ue),Ie==="both"||Ie==="start"){var ge=document.createElement("div");ge.style.display="flex",ge.style.alignItems="center",ge.style.minHeight="20px",ge.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ge.style.marginLeft="5px",ue.appendChild(ge)}var _e=document.createElement("div");_e.style.display="flex",_e.style.alignItems="center",_e.style.minHeight="20px",_e.style.flexGrow="2";var Se=document.createElement("hr");if(Se.style.minWidth="20px",Se.style.border="0px",Se.style.borderTop="3px solid "+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee"),Se.style.flexGrow="2",_e.appendChild(Se),ue.appendChild(_e),Ie==="both"||Ie==="end"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Pe.style.marginRight="5px",ue.appendChild(Pe)}G.typeBoxes.push(ue)},G=this,he=0;he<4;he++)Q(he);return B},E.prototype.setCurrentType=function(k,B){var Q=this;this.currentType=k,this.typeBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},E}(h),j=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.arrowType="end",G.arrowBaseHeight=10,G.arrowBaseWidth=10,G.getArrowPoints=G.getArrowPoints.bind(G),G.setArrowType=G.setArrowType.bind(G),G.arrowTypePanel=new _("Arrow type","end"),G.arrowTypePanel.onArrowTypeChanged=G.setArrowType,G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},E.prototype.getArrowPoints=function(k,B){var Q=this.arrowBaseWidth+2*this.strokeWidth,G=this.arrowBaseHeight+2*this.strokeWidth;return k-Q/2+","+(B+G/2)+" "+k+","+(B-G/2)+" "+(k+Q/2)+","+(B+G/2)},E.prototype.createTips=function(){this.arrow1=P.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=P.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.arrow2)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if($.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",P.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),P.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),B=this.arrow1.transform.baseVal.getItem(0);B.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(B,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},E.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k);var B=k;this.arrowType=B.arrowType,this.createTips(),this.adjustVisual()},E.typeName="ArrowMarker",E.title="Arrow marker",E.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',E}(T),U=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.fillColor=Q.defaultFillColor,G.strokeWidth=0,G.fillPanel=new p("Color",Q.defaultColorSet,Q.defaultFillColor),G.fillPanel.onColorChanged=G.setFillColor,G}return Y(E,$),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=$.prototype.getState.call(this);return k.typeName=E.typeName,k},E.typeName="CoverMarker",E.title="Cover marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',E}(x),w=function($){function E(k,B,Q,G){var he=$.call(this,k,G||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return he.opacities=[],he.opacityBoxes=[],he.opacities=B,he.currentOpacity=Q,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Y(E,$),E.prototype.getUi=function(){var k=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",B.style.justifyContent="space-between",this.opacities.forEach(function(Q){var G=document.createElement("div");G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",G.style.padding="5px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderColor=Q===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){k.setCurrentOpacity(Q,G)}),B.appendChild(G);var he=document.createElement("div");he.innerText=100*Q+"%",G.appendChild(he),k.opacityBoxes.push(G)}),B},E.prototype.setCurrentOpacity=function(k,B){var Q=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(G){G.style.borderColor=G===B?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},E}(h),M=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.setOpacity=G.setOpacity.bind(G),G.fillColor=Q.defaultHighlightColor,G.strokeWidth=0,G.opacity=Q.defaultHighlightOpacity,G.fillPanel=new p("Color",Q.defaultColorSet,G.fillColor),G.fillPanel.onColorChanged=G.setFillColor,G.opacityPanel=new w("Opacity",Q.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return Y(E,$),E.prototype.setOpacity=function(k){this.opacity=k,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=$.prototype.getState.call(this);return k.typeName=E.typeName,k},E.typeName="HighlightMarker",E.title="Highlight marker",E.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',E}(U),I='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',v=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.bgColor="transparent",G.tipPosition={x:0,y:0},G.tipBase1Position={x:0,y:0},G.tipBase2Position={x:0,y:0},G.tipMoving=!1,G.color=Q.defaultStrokeColor,G.bgColor=Q.defaultFillColor,G.fontFamily=Q.defaultFontFamily,G.defaultSize={x:100,y:30},G.setBgColor=G.setBgColor.bind(G),G.getTipPoints=G.getTipPoints.bind(G),G.positionTip=G.positionTip.bind(G),G.setTipPoints=G.setTipPoints.bind(G),G.colorPanel=new p("Text color",Q.defaultColorSet,G.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),G.colorPanel.onColorChanged=G.setColor,G.bgColorPanel=new p("Fill color",Q.defaultColorSet,G.bgColor,I),G.bgColorPanel.onColorChanged=G.setBgColor,G.fontFamilyPanel=new d("Font",Q.defaultFontFamilies,Q.defaultFontFamily),G.fontFamilyPanel.onFontChanged=G.setFont,G.tipGrip=new s,G.tipGrip.visual.transform.baseVal.appendItem(P.createTransform()),G.controlBox.appendChild(G.tipGrip.visual),G}return Y(E,$),E.prototype.ownsTarget=function(k){return $.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},E.prototype.createTip=function(){P.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=P.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},E.prototype.pointerDown=function(k,B){this.state==="new"&&$.prototype.pointerDown.call(this,k,B),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(B)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,k,B)},E.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,k);else{var B=this.state==="creating";$.prototype.pointerUp.call(this,k),this.setTipPoints(B),this.positionTip()}},E.prototype.manipulate=function(k){if(this.tipMoving){var B=this.unrotatePoint(k);this.tipPosition={x:B.x-this.manipulationStartLeft,y:B.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,k)},E.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(P.setAttributes(this.bgRectangle,[["fill",k]]),P.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},E.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},E.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var B=Math.min(this.height/2,15),Q=this.height/5;k&&(this.tipPosition={x:B+Q/2,y:this.height+20});var G=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:0},this.tipBase2Position={x:B+Q,y:0}):(this.tipBase1Position={x:0,y:B},this.tipBase2Position={x:0,y:B+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?G<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Q,y:0},this.tipBase2Position={x:this.width-B,y:0}):(this.tipBase1Position={x:this.width,y:B},this.tipBase2Position={x:this.width,y:B+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?G<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-Q,y:this.height},this.tipBase2Position={x:this.width-B,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-B-Q},this.tipBase2Position={x:this.width,y:this.height-B}):G<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:this.height},this.tipBase2Position={x:B+Q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-B},this.tipBase2Position={x:0,y:this.height-B-Q})},E.prototype.resize=function(k){$.prototype.resize.call(this,k),this.positionTip()},E.prototype.positionTip=function(){P.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),E.prototype.select=function(){this.positionTip(),$.prototype.select.call(this)},E.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){var B=k;this.bgColor=B.bgColor,this.tipPosition=B.tipPosition,$.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*B},this.positionTip()},E.typeName="CalloutMarker",E.title="Callout marker",E.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',E}(f),W=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.fillColor="transparent",G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.opacity=1,G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.fillColor=Q.defaultFillColor,G.setStrokeColor=G.setStrokeColor.bind(G),G.setFillColor=G.setFillColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.setOpacity=G.setOpacity.bind(G),G.createVisual=G.createVisual.bind(G),G.strokePanel=new p("Line color",H(Q.defaultColorSet,["transparent"]),Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.fillPanel=new p("Fill color",H(Q.defaultColorSet,["transparent"]),G.fillColor,I),G.fillPanel.onColorChanged=G.setFillColor,G.strokeWidthPanel=new S("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new D("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G.opacityPanel=new w("Opacity",Q.defaultOpacitySteps,G.opacity),G.opacityPanel.onOpacityChanged=G.setOpacity,G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.visual)},E.prototype.createVisual=function(){this.visual=P.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},E.prototype.manipulate=function(k){$.prototype.manipulate.call(this,k)},E.prototype.resize=function(k){$.prototype.resize.call(this,k),this.setSize()},E.prototype.setSize=function(){$.prototype.setSize.call(this),P.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},E.prototype.pointerUp=function(k){$.prototype.pointerUp.call(this,k),this.setSize()},E.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&P.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},E.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&P.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},E.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&P.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},E.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&P.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},E.prototype.setOpacity=function(k){this.opacity=k,this.visual&&P.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){var B=k;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),$.prototype.restoreState.call(this,k),this.setSize()},E.prototype.scale=function(k,B){$.prototype.scale.call(this,k,B),this.setSize()},E.typeName="EllipseMarker",E.title="Ellipse marker",E.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',E}(R),Z=function($){function E(k,B,Q){return $.call(this,k,B,Q)||this}return Y(E,$),Object.defineProperty(E.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},E.prototype.createTips=function(){this.tip1=P.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.tip1),this.tip2=P.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(P.createTransform()),this.visual.appendChild(this.tip2)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),this.state==="creating"&&this.createTips()},E.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(P.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),B=this.tip1.transform.baseVal.getItem(0);B.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(B,0);var Q=this.tip2.transform.baseVal.getItem(0);Q.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Q,0)}},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=$.prototype.getState.call(this);return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},E.typeName="MeasurementMarker",E.title="Measurement marker",E.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',E}(T),oe=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.strokePanel.colors=Q.defaultColorSet,G.fillColor="transparent",G}return Y(E,$),Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=$.prototype.getState.call(this);return k.typeName=E.typeName,k},E.typeName="EllipseFrameMarker",E.title="Ellipse frame marker",E.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',E}(W),fe=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(E){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(E)||(this.undoStack.push(E),JSON.stringify(this.lastRedoStep)!==JSON.stringify(E)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(E){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=E)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var E=this.undoStack.pop();return E!==void 0&&this.redoStack.push(E),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),Ae=function($){function E(k,B,Q){var G=$.call(this,k,B,Q)||this;return G.strokeColor="transparent",G.strokeWidth=0,G.strokeDasharray="",G.curveX=0,G.curveY=0,G.manipulationStartCurveX=0,G.manipulationStartCurveY=0,G.setStrokeColor=G.setStrokeColor.bind(G),G.setStrokeWidth=G.setStrokeWidth.bind(G),G.setStrokeDasharray=G.setStrokeDasharray.bind(G),G.positionGrips=G.positionGrips.bind(G),G.addControlGrips=G.addControlGrips.bind(G),G.adjustVisual=G.adjustVisual.bind(G),G.setupControlBox=G.setupControlBox.bind(G),G.resize=G.resize.bind(G),G.strokeColor=Q.defaultColor,G.strokeWidth=Q.defaultStrokeWidth,G.strokeDasharray=Q.defaultStrokeDasharray,G.strokePanel=new p("Line color",Q.defaultColorSet,Q.defaultColor),G.strokePanel.onColorChanged=G.setStrokeColor,G.strokeWidthPanel=new S("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),G.strokeWidthPanel.onWidthChanged=G.setStrokeWidth,G.strokeStylePanel=new D("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),G.strokeStylePanel.onStyleChanged=G.setStrokeDasharray,G}return Y(E,$),E.prototype.ownsTarget=function(k){return!(!$.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},E.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},E.prototype.createVisual=function(){this.visual=P.createGroup(),this.selectorCurve=P.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=P.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)},E.prototype.pointerDown=function(k,B){$.prototype.pointerDown.call(this,k,B),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(B)&&(this.activeGrip=this.curveGrip,this._state="resize")},E.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),P.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),P.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),P.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},E.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=P.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=P.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)},E.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},E.prototype.positionGrips=function(){$.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()))},E.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),$.prototype.manipulate.call(this,k)},E.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.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)},E.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},E.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},E.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},E.prototype.scale=function(k,B){this.curveX=this.curveX*k,this.curveY=this.curveY*B,$.prototype.scale.call(this,k,B)},Object.defineProperty(E.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),E.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return k.typeName=E.typeName,k},E.prototype.restoreState=function(k){$.prototype.restoreState.call(this,k);var B=k;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.curveX=B.curveX,this.curveY=B.curveY,this.createVisual(),this.adjustVisual()},E.typeName="CurveMarker",E.title="Curve marker",E.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',E}(C),be=function(){function $(E,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=E,this.cancelable=k}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),Re=function($){function E(k,B,Q){var G=$.call(this,k,!1)||this;return G.dataUrl=B,G.state=Q,G}return Y(E,$),E}(be),Ce=function($){function E(k,B,Q){Q===void 0&&(Q=!1);var G=$.call(this,k,Q)||this;return G.marker=B,G}return Y(E,$),E}(be),Le=function(){function $(){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 $.prototype.addEventListener=function(E,k){this[E].push(k)},$.prototype.removeEventListener=function(E,k){var B=this[E].indexOf(k);B>-1&&this[E].splice(B,1)},$}(),ve=function(){function $(E){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new A,this._isOpen=!1,this.undoRedoManager=new fe,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 Le,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new L(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=E,this.targetRoot=document.body,this.width=E.clientWidth,this.height=E.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($.prototype,"ALL_MARKER_TYPES",{get:function(){return[O,b,j,f,oe,W,M,v,Z,U,T,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[O,b,j,f,W,M,v]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[O,b,j,f,M]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(E){var k=this;this._availableMarkerTypes.splice(0),E.forEach(function(B){if(typeof B=="string"){var Q=k.ALL_MARKER_TYPES.find(function(G){return G.typeName===B});Q!==void 0&&k._availableMarkerTypes.push(Q)}else k._availableMarkerTypes.push(B)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(E){this._zoomLevel=E,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($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var E=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new be(E))})},$.prototype.render=function(){return N(this,void 0,void 0,function(){var E;return X(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(E=new z).naturalSize=this.renderAtNaturalSize,E.imageType=this.renderImageType,E.imageQuality=this.renderImageQuality,E.markersOnly=this.renderMarkersOnly,E.width=this.renderWidth,E.height=this.renderHeight,[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,E.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},$.prototype.close=function(E){var k=this;if(E===void 0&&(E=!1),this.isOpen){var B=!1;E||this.eventListeners.beforeclose.forEach(function(Q){var G=new be(k,!0);Q(G),G.defaultPrevented&&(B=!0)}),B||(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(Q){return Q(new be(k))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var E,k=[],B=0;B<arguments.length;B++)k[B]=arguments[B];(E=this._availableMarkerTypes).push.apply(E,k)},$.prototype.addRenderEventListener=function(E){this.addEventListener("render",function(k){E(k.dataUrl,k.state)})},$.prototype.removeRenderEventListener=function(E){},$.prototype.addCloseEventListener=function(E){this.addEventListener("close",function(){E()})},$.prototype.removeCloseEventListener=function(E){},$.prototype.setupResizeObserver=function(){var E=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){E.resize(E.target.clientWidth,E.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return E.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupTargetResize=function(){var E=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/E>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*E:this.editorCanvas.clientWidth,B=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/E;this.resize(k,B)},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.resize=function(E,k){this._isResizing=!0;var B=E/this.imageWidth,Q=k/this.imageHeight;this.imageWidth=Math.round(E),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(B,Q),this._isResizing=!1},$.prototype.scaleMarkers=function(E,k){var B,Q=this;this._currentMarker&&this._currentMarker instanceof f?this._currentMarker.scale(E,k):(B=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(G){G!==Q._currentMarker&&G.scale(E,k)}),B!==void 0&&this.setCurrentMarker(B)},$.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},$.prototype.setTopLeft=function(){var E=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=E.left-k.left,this.top=E.top-k.top},$.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},$.prototype.addDefs=function(){for(var E,k=[],B=0;B<arguments.length;B++)k[B]=arguments[B];this.defs=P.createDefs(),this.addDefsToImage(),(E=this.defs).append.apply(E,k)},$.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},$.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},$.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},$.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},$.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},$.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},$.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},$.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var E=document.createElement("a");E.href="https://markerjs.com/",E.target="_blank",E.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',E.title="Powered by marker.js",E.style.display="grid",E.style.alignItems="center",E.style.justifyItems="center",E.style.padding="3px",E.style.width="20px",E.style.height="20px",this.logoUI.appendChild(E),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.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")},$.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"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.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 E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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 g(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new l(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},$.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.removeMarker=function(E){this.markerImage.removeChild(E.container),this.markers.indexOf(E)>-1&&this.markers.splice(this.markers.indexOf(E),1),E.dispose()},$.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())},$.prototype.toolbarButtonClicked=function(E,k){if(E==="marker"&&k!==void 0)this.createNewMarker(k);else if(E==="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()}},$.prototype.deleteSelectedMarker=function(){var E=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var G=new Ce(E,E._currentMarker,!0);Q(G),G.defaultPrevented&&(k=!0)}),!k){var B=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(Q){return Q(new Ce(E,B))})}}},$.prototype.clear=function(){var E=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var xe=new Ce(E,void 0,!0);he(xe),xe.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var B=function(he){var xe=Q.markers[he];Q.setCurrentMarker(Q.markers[he]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(Ie){return Ie(new Ce(E,xe))})},Q=this,G=this.markers.length-1;G>=0;G--)B(G);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var E;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=(E=this._currentMarker.notes)!==null&&E!==void 0?E:"",this.overlayContainer.appendChild(this.notesArea))},$.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)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var E=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),B=this.undoRedoManager.getLastUndoStep();if(!B||B.width===k.width&&B.height===k.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),Q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(G){return G(new be(E))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(G){return G(new be(E))})}},$.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},$.prototype.undoStep=function(){var E=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new be(E))}))},$.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},$.prototype.redoStep=function(){var E=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new be(E))}))},$.prototype.stepZoom=function(){var E=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=E<this.zoomSteps.length-1?this.zoomSteps[E+1]:this.zoomSteps[0]},$.prototype.panTo=function(E){this.contentDiv.scrollBy({left:this.prevPanPoint.x-E.x,top:this.prevPanPoint.y-E.y}),this.prevPanPoint=E},$.prototype.startRenderAndClose=function(){return N(this,void 0,void 0,function(){var E,k,B=this;return X(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return E=Q.sent(),k=this.getState(),this.eventListeners.render.forEach(function(G){return G(new Re(B,E,k))}),this.close(!0),[2]}})})},$.prototype.getState=function(E){E===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(B){return k.markers.push(B.getState())}),k},$.prototype.restoreState=function(E){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);E.markers.forEach(function(B){var Q=k._availableMarkerTypes.find(function(he){return he.typeName===B.typeName});if(Q!==void 0){var G=k.addNewMarker(Q);G.restoreState(B),k.markers.push(G)}}),E.width&&E.height&&(E.width!==this.imageWidth||E.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/E.width,this.imageHeight/E.height),this.eventListeners.restorestate.forEach(function(B){return B(new be(k))})},$.prototype.addNewMarker=function(E){var k=P.createGroup();return this.markerImage.appendChild(k),new E(k,this.overlayContainer,this.settings)},$.prototype.createNewMarker=function(E){var k,B=this;(k=typeof E=="string"?this._availableMarkerTypes.find(function(Q){return Q.typeName===E}):E)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Q){return Q(new Ce(B,B._currentMarker))}))},$.prototype.markerCreated=function(E){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(E),this.setCurrentMarker(E),E instanceof b&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(b):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(B){return B(new Ce(k,k._currentMarker))})},$.prototype.colorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=E,this.settings.defaultStrokeColor=E)},$.prototype.fillColorChanged=function(E){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=E)},$.prototype.markerStateChanged=function(E){var k=this;this.eventListeners.markerchange.forEach(function(B){return B(new Ce(k,E))})},$.prototype.setCurrentMarker=function(E){var k=this;this._currentMarker!==E&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(B){return B(new Ce(k,k._currentMarker))})),this._currentMarker=E,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(B){return B(new Ce(k,k._currentMarker))}))},$.prototype.onPointerDown=function(E){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||E.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(B){return B.ownsTarget(E.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:E.clientX,y:E.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(E.clientX,E.clientY))},$.prototype.onDblClick=function(E){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(B){return B.ownsTarget(E.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(E.clientX,E.clientY),E.target):this.setCurrentMarker()}},$.prototype.onPointerMove=function(E){this.touchPoints!==1&&E.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||E.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(E.clientX,E.clientY)):this.zoomLevel>1&&this.panTo({x:E.clientX,y:E.clientY}))},$.prototype.onPointerUp=function(E){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(E.clientX,E.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(E){this._currentMarker===void 0||this.notesArea!==void 0||E.key!=="Delete"&&E.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(E,k){var B=this.markerImage.getBoundingClientRect();return{x:(E-B.left)/this.zoomLevel,y:(k-B.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var E=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=E+"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()},$.prototype.addLicenseKey=function(E){K.addKey(E)},$.prototype.addEventListener=function(E,k){this.eventListeners.addEventListener(E,k)},$.prototype.removeEventListener=function(E,k){this.eventListeners.removeEventListener(E,k)},$.prototype.renderState=function(E){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(E),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var E=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 be(E))}))},$.prototype.blur=function(){var E=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new be(E))}))},$.instanceCounter=0,$}()},Sdqs:function(Je,Ee,J){"use strict";J.r(Ee);var le=J("5Dmo"),Y=J("3S7+"),N=J("+L6B"),X=J("2/Rp"),H=J("giR+"),P=J("fyUT"),K=J("sRBo"),z=J("kaz8"),n=J("/zsF"),L=J("PArb"),y=J("14J3"),m=J("BMrR"),g=J("jCWc"),l=J("kPKH"),h=J("sPJy"),p=J("bE4q"),o=J("miYZ"),u=J("tsqr"),s=J("9og8"),a=J("k1fw"),R=J("y8nQ"),x=J("Vl3Y"),S=J("2qtc"),D=J("kLXV"),O=J("tJVT"),A=J("PpiC"),C=J("WmNS"),T=J.n(C),d=J("q1tI"),f=J.n(d),b=J("Ty5D"),_=J("9kvl"),j=J("55Ip"),U=J("jhfD"),w=J("/MfK"),M=J("kaH+"),I=J("Ot1p"),v=J("dhSg"),W=J("wd/R"),Z=J.n(W),oe=J("m3rI"),fe=J("LvDl"),Ae=J("XYT7"),be=J("5NDa"),Re=J("5rEg"),Ce=J("ErOA"),Le=function(Se){var Pe=Se.shixunHomeworks,Ue=Se.dispatch,He=Object(b.i)(),Be=Object(d.useState)(!0),Qe=Object(O.a)(Be,2),ze=Qe[0],Ye=Qe[1],Me=x.a.useForm(),it=Object(O.a)(Me,1),Ze=it[0];return f.a.createElement(f.a.Fragment,null,f.a.createElement(D.a,{centered:!0,title:"\u8C03\u5206",visible:Pe.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(s.a)(T.a.mark(function ce(){var ee,ne;return T.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return de.next=2,Ze.validateFields();case 2:return ee=Ze.getFieldsValue(),de.next=5,Object(Ce.a)("/api/student_works/".concat(Pe.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(a.a)({},ee)});case 5:ne=de.sent,ne.status===0&&(u.b.success("\u8BC4\u9605\u6210\u529F"),Ze.resetFields(),Ue({type:"shixunHomeworks/setActionTabs",payload:{}}),Ue({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(a.a)({},He)}));case 7:case"end":return de.stop()}},ce)})),onCancel:function(){Ue({type:"shixunHomeworks/setActionTabs",payload:{}})}},f.a.createElement("p",{className:"tc"},"\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"),f.a.createElement(x.a,{form:Ze,layout:"horizontal"},f.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},f.a.createElement(x.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},f.a.createElement(P.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),f.a.createElement("span",{className:"ml10"},"\u5206")),f.a.createElement("div",null,f.a.createElement(x.a.Item,{name:"comment"},f.a.createElement(Re.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},ve=Object(_.a)(function(_e){var Se=_e.shixunHomeworks;return{shixunHomeworks:Se}})(Le),$=J("500L"),E=function(Se){var Pe=Se.classroomList,Ue=Se.loading,He=Se.dispatch,Be=Object(b.i)(),Qe=x.a.useForm(),ze=Object(O.a)(Qe,1),Ye=ze[0];return f.a.createElement(D.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:Pe.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(s.a)(T.a.mark(function Me(){var it,Ze,ce,ee;return T.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Ye.validateFields();case 2:return Ze=Object(a.a)({},Ye.getFieldValue()),ce=Pe.actionTabs.selectArrs,Ze.attachment_ids=(it=Ze.attachment_ids)===null||it===void 0?void 0:it.map(function(de){return de.response.id}),ae.next=7,Object(Ae.V)(Object(a.a)(Object(a.a)({},Ze),{},{homeworkId:ce.work_id}));case 7:ee=ae.sent,ee.status===0&&(He({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(a.a)({},Pe.actionTabs.params)}),He({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return ae.stop()}},Me)})),onCancel:function(){He({type:"classroomList/setActionTabs",payload:{}})}},f.a.createElement(x.a,{form:Ye,initialValues:{}},f.a.createElement(x.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},f.a.createElement($.b,null)),f.a.createElement(x.a.Item,{name:"description"},f.a.createElement(Re.a.TextArea,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",rows:7}))))},k=Object(_.a)(function(_e){var Se=_e.classroomList,Pe=_e.loading;return{classroomList:Se,loading:Pe}})(E),B=J("xKgJ"),Q=J("T/ev"),G=J.n(Q),he=J("9Bee"),xe=J("1vsH"),Ie=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898"],ue=function(Se){var Pe,Ue,He,Be,Qe,ze,Ye,Me,it,Ze,ce,ee,ne,ae,de,re,se,pe,me,Te,Oe,Ne,Ke,nt,at=Se.shixunHomeworks,xt=Se.globalSetting,ut=Se.loading,ot=Se.user,Tt=Se.dispatch,St=Object(A.a)(Se,["shixunHomeworks","globalSetting","loading","user","dispatch"]),rt=Object(b.i)(),Gt=Object(d.useRef)(),Lt=Object(b.h)(),rn=ot.userInfo,We=at.studentWorkDetail,Pt=at.studentWorkCommon,Yt=at.studentWorkSupplyDetail,pt=at.workList,Et=Object(d.useState)({}),wt=Object(O.a)(Et,2),Zt=wt[0],vn=wt[1],Bt=Object(d.useState)(""),tt=Object(O.a)(Bt,2),At=tt[0],kt=tt[1],ft=Object(d.useState)(!1),yt=Object(O.a)(ft,2),Rt=yt[0],qt=yt[1],$t=D.a.useModal(),Ge=Object(O.a)($t,2),mt=Ge[0],nr=Ge[1],dr=x.a.useForm(),fr=Object(O.a)(dr,1),Hn=fr[0],pr=Object(d.useState)({last:!1}),bt=Object(O.a)(pr,2),Dn=bt[0],Ve=bt[1],mr=Object(d.useState)({last:!1}),Tn=Object(O.a)(mr,2),wn=Tn[0],Jn=Tn[1],Nn=Object(d.useState)(!1),gr=Object(O.a)(Nn,2),Ar=gr[0],kn=gr[1],Rr=Object(d.useState)(""),Or=Object(O.a)(Rr,2),vr=Or[0],Fn=Or[1],Gn=function(){Tt({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(a.a)({},rt)})};Object(d.useEffect)(function(){return Tt({type:"globalSetting/footerToggle",payload:!1}),function(){Tt({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(d.useEffect)(function(){Tt({type:"shixunHomeworks/getStudentWorkDetail",payload:Object(a.a)({},rt)}),Tt({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(a.a)({},rt)}),Gn(),li(),Gt.current.onclick=function($e){$e.target.nodeName==="IMG"&&$e.target.alt!==""&&v.a.publish("preview-image",$e.target.src)}},[rt.categoryId,rt.userId]);function li(){return rr.apply(this,arguments)}function rr(){return rr=Object(s.a)(T.a.mark(function $e(){var Ot,Jt,gt,jt,Ht,Wt,Kt;return T.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return gt=JSON.parse(localStorage.getItem("all_student_works_param")||"{}"),pn.next=3,Tt({type:"shixunHomeworks/getAllStudentWorks",payload:Object(a.a)(Object(a.a)({},rt),gt)});case 3:jt=pn.sent,Ht=(Ot=jt.all_student_works)===null||Ot===void 0?void 0:Ot.map(function(Zn){return String(Zn.student_work_id)}).indexOf(rt.userId),Ht===((Jt=jt.all_student_works)===null||Jt===void 0?void 0:Jt.length)-1?Ve({last:!0}):Ve((Wt=jt.all_student_works)===null||Wt===void 0?void 0:Wt[Ht+1]),Ht===0?Jn({last:!0}):Jn((Kt=jt.all_student_works)===null||Kt===void 0?void 0:Kt[Ht-1]);case 7:case"end":return pn.stop()}},$e)})),rr.apply(this,arguments)}var fn=function(Ot){mt.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Jt=Object(s.a)(T.a.mark(function jt(){var Ht;return T.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Tt({type:"shixunHomeworks/deleteReply",payload:{object_id:Ot.id,object_type:"journals_for_message"}});case 2:Ht=Kt.sent,Ht.status===0&&(u.b.success("\u5220\u9664\u6210\u529F"),Gn());case 4:case"end":return Kt.stop()}},jt)}));function gt(){return Jt.apply(this,arguments)}return gt}()})},zn=function(Ot){mt.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Jt=Object(s.a)(T.a.mark(function jt(){var Ht;return T.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(Ae.k)({score_id:Ot.comment_id,userId:rt.userId});case 2:Ht=Kt.sent,Ht.status===0&&(u.b.success("\u5220\u9664\u6210\u529F"),Gn());case 4:case"end":return Kt.stop()}},jt)}));function gt(){return Jt.apply(this,arguments)}return gt}()})},ui=function(){var $e=Object(s.a)(T.a.mark(function Ot(Jt){var gt,jt;return T.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Jt.attachment_ids=(gt=Jt.attachment_ids)===null||gt===void 0?void 0:gt.map(function(Kt){var ir;return Kt==null||((ir=Kt.response)===null||ir===void 0)?void 0:ir.id}),Wt.next=3,Object(Ae.e)(Object(a.a)(Object(a.a)({},Jt),{},{userId:rt.userId}));case 3:jt=Wt.sent,jt.status===0&&(u.b.success("\u63D0\u4EA4\u6210\u529F"),Hn.resetFields(),Gn());case 5:case"end":return Wt.stop()}},Ot)}));return function(Jt){return $e.apply(this,arguments)}}(),Kn=function(){var $e=Object(s.a)(T.a.mark(function Ot(Jt){var gt,jt,Ht,Wt,Kt;return T.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(gt=Hn.getFieldsValue(),jt=gt.comment,Ht=gt.score,Wt=gt.attachment_ids,Kt=!Object(fe.isNil)(Ht),console.log("-------",rt),!(jt||Kt||Wt)){pn.next=6;break}return D.a.confirm({centered:!0,okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:f.a.createElement("div",{className:"tc"},"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539"),onOk:function(){Hn.resetFields(),Jt==="last"?_.d.push("/classrooms/".concat(rt==null?void 0:rt.coursesId,"/group_homework/").concat(rt==null?void 0:rt.commonHomeworkId,"/review/").concat(wn==null?void 0:wn.student_work_id)):Jt==="read"?_.d.push("/classrooms/".concat(rt==null?void 0:rt.coursesId,"/group_homework/").concat(rt==null?void 0:rt.commonHomeworkId,"/review/").concat(Dn==null?void 0:Dn.student_work_id)):_.d.push("/classrooms/".concat(rt.coursesId,"/group_homework/").concat(rt.commonHomeworkId,"/detail"))}}),pn.abrupt("return");case 6:Jt==="last"?_.d.push("/classrooms/".concat(rt==null?void 0:rt.coursesId,"/group_homework/").concat(rt==null?void 0:rt.commonHomeworkId,"/review/").concat(wn==null?void 0:wn.student_work_id)):Jt==="read"?_.d.push("/classrooms/".concat(rt==null?void 0:rt.coursesId,"/group_homework/").concat(rt==null?void 0:rt.commonHomeworkId,"/review/").concat(Dn==null?void 0:Dn.student_work_id)):_.d.push("/classrooms/".concat(rt.coursesId,"/group_homework/").concat(rt.commonHomeworkId,"/detail"));case 7:case"end":return pn.stop()}},Ot)}));return function(Jt){return $e.apply(this,arguments)}}();return f.a.createElement("section",{className:"edu-container",ref:Gt},f.a.createElement("section",{className:"animated fadeIn"},f.a.createElement("aside",{className:"mt10"},rn&&f.a.createElement(p.a,{separator:">"},f.a.createElement(p.a.Item,null,f.a.createElement(j.a,{to:"/classrooms/".concat(rt.coursesId,"/group_homework")},rn==null||((Pe=rn.course)===null||Pe===void 0)?void 0:Pe.course_name)),f.a.createElement(p.a.Item,null,f.a.createElement(j.a,{to:"/classrooms/".concat(rt.coursesId,"/group_homework")},"\u5206\u7EC4\u4F5C\u4E1A")),f.a.createElement(p.a.Item,null,f.a.createElement(j.a,{to:"/classrooms/".concat(rt.coursesId,"/group_homework/").concat(rt.commonHomeworkId,"/detail")},"\u4F5C\u4E1A\u8BE6\u60C5")),f.a.createElement(p.a.Item,null,We==null?void 0:We.author_name))),f.a.createElement("aside",{className:[G.a.title,"mt20"].join(" ")},f.a.createElement(m.a,{style:{width:"100%"}},f.a.createElement(l.a,{flex:"1"},f.a.createElement(j.a,{to:"/classrooms/".concat(rt.coursesId,"/group_homework")},f.a.createElement(U.a,{className:"font16 c-black"})),f.a.createElement("strong",{className:"font20 ml5"},We==null?void 0:We.homework_name),f.a.createElement(xe.m,{status:We==null?void 0:We.homework_status})),f.a.createElement(l.a,null,Object(B.t)()&&(We==null||((Ue=We.homework_status)===null||Ue===void 0)?void 0:Ue.includes("\u8865\u4EA4\u4E2D"))&&f.a.createElement("span",{onClick:function(){Tt({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:rt,selectArrs:{homework_id:rt.commonHomeworkId,work_id:rt.userId}}})},className:"c-blue current font14"},"\u8865\u4EA4\u9644\u4EF6"))))),f.a.createElement("section",{className:[G.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},(We==null?void 0:We.description)&&f.a.createElement("aside",null,f.a.createElement("div",{className:"font16"},"\u5185\u5BB9"),f.a.createElement("div",{className:"pl30 mt20"},f.a.createElement(he.a,{value:(We==null?void 0:We.description)||"\u6682\u65E0\uFF5E"})),We==null||((He=We.attachments)===null||He===void 0)?void 0:He.map(function($e,Ot){return f.a.createElement("div",{className:"pl30",key:Ot},f.a.createElement("a",{href:"".concat(oe.a.API_SERVER).concat($e.url)},f.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),f.a.createElement("span",{className:"ml10 c-black"},$e.title),f.a.createElement("span",{className:"c-light-black ml20 font12"},$e.filesize)))}),f.a.createElement("aside",{className:"tr"},f.a.createElement("span",{className:" c-light-black"},Z()(We.commit_time).format("YYYY-MM-DD HH:mm")),f.a.createElement("span",{className:"ml10"},We.commit_user_name),f.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),f.a.createElement("span",{className:"ml30 c-light-black"},Z()(We.update_time).format("YYYY-MM-DD HH:mm")),f.a.createElement("span",{className:"ml10"},We.update_user_name),f.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(We==null?void 0:We.redo_description)&&f.a.createElement("aside",null,f.a.createElement(L.a,null),f.a.createElement("div",{className:"font16"},"\u91CD\u505A\u8BB0\u5F55"),f.a.createElement("div",{className:"pl30 mt20"},f.a.createElement(he.a,{value:(We==null?void 0:We.redo_description)||"\u6682\u65E0\uFF5E"})),We==null||((Be=We.redo_attachments)===null||Be===void 0)?void 0:Be.map(function($e,Ot){return f.a.createElement("div",{className:"pl30",key:Ot},f.a.createElement("a",{href:"".concat(oe.a.API_SERVER).concat($e.url)},f.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),f.a.createElement("span",{className:"ml10 c-black"},$e.title),f.a.createElement("span",{className:"c-light-black ml20 font12"},$e.filesize)))}),f.a.createElement("aside",{className:"tr"},f.a.createElement("span",{className:" c-light-black"},Z()(We.redo_commit_time).format("YYYY-MM-DD HH:mm")),f.a.createElement("span",{className:"ml10"},We.commit_user_name),f.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),f.a.createElement("span",{className:"ml30 c-light-black"},Z()(We.redo_update_time).format("YYYY-MM-DD HH:mm")),f.a.createElement("span",{className:"ml10"},We.update_user_name),f.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(Yt==null?void 0:Yt.revise_reason)&&f.a.createElement("aside",null,f.a.createElement(L.a,null),f.a.createElement("div",{className:"font16"},"\u8865\u4EA4\u5185\u5BB9"),f.a.createElement("div",{className:"pl30 mt20"},f.a.createElement(he.a,{value:(Yt==null?void 0:Yt.revise_reason)||"\u6682\u65E0\uFF5E"})),Yt==null||((Qe=Yt.revise_attachments)===null||Qe===void 0)?void 0:Qe.map(function($e,Ot){return f.a.createElement("div",{className:"pl30",key:Ot},f.a.createElement("a",{href:"".concat(oe.a.API_SERVER).concat($e.url)},f.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),f.a.createElement("span",{className:"ml10 c-black"},$e.title),f.a.createElement("span",{className:"c-light-black ml20 font12"},$e.filesize)))}),f.a.createElement("aside",{className:"tr"},f.a.createElement("span",{className:"ml30 c-light-black"},Z()(Yt.atta_update_time).format("YYYY-MM-DD HH:mm")),f.a.createElement("span",{className:"ml10"},Yt.atta_update_user),f.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),f.a.createElement(L.a,null),(We==null||((ze=We.project_info)===null||ze===void 0)?void 0:ze.id)&&f.a.createElement("aside",null,f.a.createElement("div",{className:"font16"},"\u5173\u8054\u9879\u76EE"),f.a.createElement("div",{className:"pl30 mt20"},(We==null||((Ye=We.project_info)===null||Ye===void 0)?void 0:Ye.id)===-1&&f.a.createElement("span",{className:"c-blue"},We==null||((Me=We.project_info)===null||Me===void 0)?void 0:Me.name),(We==null||((it=We.project_info)===null||it===void 0)?void 0:it.id)!==-1&&f.a.createElement("a",{target:"_blank",href:"".concat((Ze=ot.navigationInfo)===null||Ze===void 0||((ce=Ze.top)===null||ce===void 0)?void 0:ce.old_url).concat(We==null||((ee=We.project_info)===null||ee===void 0)?void 0:ee.id)},We==null||((ne=We.project_info)===null||ne===void 0)?void 0:ne.name))),f.a.createElement(L.a,null),(We==null||((ae=We.project_info)===null||ae===void 0)?void 0:ae.id)&&f.a.createElement("aside",null,f.a.createElement("div",{className:"font16"},"\u5168\u90E8\u7EC4\u5458"),f.a.createElement("div",{className:"pl30 mt20"},"\u5F53\u524D\u7EC4\u5458\uFF1A",We==null?void 0:We.author_name," ",(We==null?void 0:We.is_leader_work)&&f.a.createElement("span",{className:G.a.leader},"\u7EC4\u957F"),f.a.createElement("br",null),(We==null||((de=We.work_members)===null||de===void 0)?void 0:de.length)>0&&f.a.createElement("span",null,"\u5176\u4ED6\u7EC4\u5458\uFF1A",We==null||((re=We.work_members)===null||re===void 0)?void 0:re.map(function($e,Ot){return Object(B.t)()?f.a.createElement("a",{style:{pointerEvents:"none"}},$e.user_name,($e==null?void 0:$e.is_leader)&&f.a.createElement("span",{className:G.a.leader},"\u7EC4\u957F")):f.a.createElement(j.a,{key:Ot,className:"mr10",to:"/classrooms/".concat(rt.coursesId,"/group_homework/").concat(rt.commonHomeworkId,"/review/").concat($e.work_id),target:"_blank"},$e.user_name,($e==null?void 0:$e.is_leader)&&f.a.createElement("span",{className:G.a.leader},"\u7EC4\u957F"))}))),!Object(B.t)()&&f.a.createElement("div",{className:"c-grey-999 pl30"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u5176\u4ED6\u7EC4\u5458\u7684\u59D3\u540D\uFF0C\u53EF\u4EE5\u5FEB\u901F\u8BC4\u9605TA\u7684\u4F5C\u54C1"))),(We==null?void 0:We.anonymous_comment)&&Object(B.e)()&&f.a.createElement("section",null,f.a.createElement("aside",{className:[G.a.replyList,"bg-white"].join(" ")},f.a.createElement("span",{style:{fontSize:"16px"}},"\u533F\u8BC4\u5B66\u5458"),f.a.createElement("br",null),(We==null||((se=We.no_commented_user_names)===null||se===void 0)?void 0:se.length)>0&&f.a.createElement("p",{style:{marginTop:"1em"}},"\u672A\u5B8C\u6210\u533F\u8BC4\uFF1A",We==null||((pe=We.no_commented_user_names)===null||pe===void 0)?void 0:pe.toString()),f.a.createElement("span",{style:{marginTop:(We==null||((me=We.no_commented_user_names)===null||me===void 0)?void 0:me.length)>0?"":"1em",display:"flex"}},"\u5DF2\u5B8C\u6210\u533F\u8BC4\uFF1A",We==null||((Te=We.commented_user_names)===null||Te===void 0)?void 0:Te.toString()))),(Object(B.c)()||(We==null||((Oe=We.homework_status)===null||Oe===void 0)?void 0:Oe.includes("\u533F\u8BC4\u4E2D"))||(We==null||((Ne=We.homework_status)===null||Ne===void 0)?void 0:Ne.includes("\u7533\u8BC9\u4E2D")))&&f.a.createElement("section",null,f.a.createElement("aside",{className:[G.a.replyList,"bg-white"].join(" ")},f.a.createElement(m.a,{gutter:[10,20]},f.a.createElement(l.a,{flex:1},f.a.createElement("span",{className:"font-16"},"\u5168\u90E8\u8BC4\u9605(",Pt==null?void 0:Pt.comment_count,")")),f.a.createElement(l.a,{style:{lineHeight:"40px"}},Object(B.c)()&&(Pt==null?void 0:Pt.ultimate)&&f.a.createElement("span",{className:"font-16 c-blue current",onClick:function(){Tt({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:We,id:rt.userId,params:rt}})}},"\u8C03\u5206")),f.a.createElement(l.a,null)),(!(Pt!=null&&Pt.ultimate)||(We==null||((Ke=We.homework_status)===null||Ke===void 0)?void 0:Ke.includes("\u533F\u8BC4\u4E2D")))&&!(Pt!=null&&Pt.is_author)&&f.a.createElement("aside",null,f.a.createElement(x.a,{layout:"vertical",form:Hn,onFinish:function(Ot){return ui(Ot)},initialValues:{same_score:!0}},f.a.createElement(x.a.Item,{label:"\u8BC4\u8BED",name:"comment",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BC4\u8BED"}]},f.a.createElement(I.a,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u5BF9\u672C\u4F5C\u54C1\u7684\u8BC4\u8BED\uFF0C\u6700\u5927\u9650\u52362000\u4E2A\u5B57\u7B26",maxLength:2e3,defaultValue:"",height:200})),f.a.createElement(x.a.Item,{name:"same_score",valuePropName:"checked"},f.a.createElement(z.a,null,"\u6574\u7EC4\u540C\u8BC4(\u9009\u4E2D\uFF0C\u5219\u672C\u6B21\u8BC4\u9605\u5BF9\u8C61\u6307\u5C0F\u7EC4\u5168\u90E8\u6210\u5458\uFF0C\u5426\u5219\u4EC5\u8BC4\u9605\u6B64\u6210\u54581\u4EBA )")),f.a.createElement("div",null,f.a.createElement(x.a.Item,{name:"attachment_ids"},f.a.createElement($.b,null))),f.a.createElement("div",{className:"mt10"},f.a.createElement(m.a,null,f.a.createElement(l.a,{flex:"1"},f.a.createElement(m.a,{align:"middle",justify:"start"},f.a.createElement(l.a,null,f.a.createElement(x.a.Item,{noStyle:!0,name:"score",rules:[{required:!Object(B.c)(),message:"\u8BF7\u586B\u5199\u5206\u6570"}]},f.a.createElement(P.a,{min:0,step:.1,style:{width:100},size:"large",placeholder:"\u8BF7\u586B\u5199\u5206\u6570"}))),f.a.createElement(l.a,null,f.a.createElement("span",{className:"ml5 mr20"},"\u5206")))))),f.a.createElement("aside",{className:"".concat(G.a.buttonFixed)},f.a.createElement("aside",{className:"edu-container"},f.a.createElement(m.a,{align:"middle"},f.a.createElement(l.a,{flex:"1"},f.a.createElement(X.a,{type:"default",onClick:function(){return Kn("list")}},"\u8FD4\u56DE\u5217\u8868")),f.a.createElement(l.a,{flex:"1",className:"tr"},!Object(B.t)()&&f.a.createElement(X.a,{type:"default",onClick:function(){return Kn("last")},disabled:wn==null?void 0:wn.last},"\u4E0A\u4E00\u4E2A"),!Object(B.t)()&&f.a.createElement(X.a,{type:"default",disabled:Dn==null?void 0:Dn.last,style:{marginLeft:"20px",marginRight:"20px"},onClick:function(){return Kn("read")}},"\u4E0B\u4E00\u4E2A"),f.a.createElement(X.a,{htmlType:"submit",type:"primary"},"\u63D0\u4EA4\u8BC4\u9605"))))))),f.a.createElement(L.a,null),Pt==null||((nt=Pt.comment_scores)===null||nt===void 0)?void 0:nt.map(function($e,Ot){var Jt;return f.a.createElement("aside",{key:Ot},f.a.createElement(m.a,{gutter:[12,12],key:Ot},f.a.createElement(l.a,{flex:"40px"},f.a.createElement("img",{className:G.a.headpic,width:"40",src:"".concat(oe.a.IMG_SERVER,"/images/").concat($e==null?void 0:$e.user_image_url)})),f.a.createElement(l.a,{flex:"1"},f.a.createElement(m.a,{align:"middle"},f.a.createElement(l.a,{span:24},f.a.createElement(m.a,null,f.a.createElement(l.a,{flex:1},f.a.createElement("span",{className:"c-light-black"},$e==null?void 0:$e.user_name),f.a.createElement("span",{className:"c-light-black"},"\uFF08",$e==null?void 0:$e.comment_role,"\uFF09"),f.a.createElement("span",{className:"c-light-black ml10"},Z()($e==null?void 0:$e.comment_time).format("YYYY-MM-DD HH:mm")),$e.score!==null&&f.a.createElement("span",{className:"ml30 c-orange"},$e.score,"\u5206")),f.a.createElement(l.a,null,Ot===0?f.a.createElement("aside",null,$e.delete&&f.a.createElement("span",{className:"c-blue current",onClick:function(){zn($e)}},"\u5220\u9664"),$e.can_appeal&&f.a.createElement("span",{className:"c-blue current",onClick:function(){qt(!0)}},"\u7533\u8BC9"),$e.can_reply&&f.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return qt(!0)}},"\u56DE\u590D")):f.a.createElement("aside",null,$e.delete&&f.a.createElement("span",{className:"c-blue current",onClick:function(){zn($e)}},"\u5220\u9664"),$e.can_appeal&&f.a.createElement("span",{className:"c-blue current",onClick:function(){qt(!0)}},"\u7533\u8BC9"),$e.can_reply&&f.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return qt(!0)}},"\u56DE\u590D"),!$e.can_reply&&f.a.createElement("span",{className:"c-light-black ml10"},"\u5931\u6548"))))),f.a.createElement(l.a,{span:24},$e.content&&f.a.createElement(he.a,{value:$e.content}),!$e.content&&f.a.createElement("span",{className:"c-light-black"},"\u6682\u672A\u5199\u8BC4\u8BED"),$e==null||((Jt=$e.attachments)===null||Jt===void 0)?void 0:Jt.map(function(gt,jt){return f.a.createElement("div",{key:jt},f.a.createElement("a",{href:"".concat(oe.a.API_SERVER).concat(gt.url)},f.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),f.a.createElement("span",{className:"ml10 c-black"},gt.title),f.a.createElement("span",{className:"c-light-black ml20 font12"},gt.filesize)))})),$e.journals!=""&&f.a.createElement("div",{className:"w100"},f.a.createElement(L.a,null),f.a.createElement("aside",{className:[G.a.comment,"w100"].join(" ")},$e.journals.map(function(gt,jt){var Ht,Wt;return f.a.createElement("aside",{key:jt},f.a.createElement(m.a,{key:jt},f.a.createElement(l.a,{span:24},f.a.createElement(m.a,null,f.a.createElement(l.a,{flex:"50px"},f.a.createElement("img",{className:G.a.headpic,width:"40",src:"".concat(oe.a.IMG_SERVER,"/images/").concat(gt==null||((Ht=gt.user_info)===null||Ht===void 0)?void 0:Ht.user_image_url)})),f.a.createElement(l.a,{flex:"1"},gt==null||((Wt=gt.user_info)===null||Wt===void 0)?void 0:Wt.user_name,f.a.createElement("span",{className:"c-light-black ml10"},Z()(gt==null?void 0:gt.time).format("YYYY-MM-DD HH:mm")),f.a.createElement("br",null),f.a.createElement("strong",null,f.a.createElement(he.a,{value:gt.content}))),f.a.createElement(l.a,null,f.a.createElement(Y.a,{title:"\u5220\u9664"},f.a.createElement(w.a,{className:"current c-light-black",onClick:function(){fn(gt)}})))))),f.a.createElement(L.a,null))})))),Rt&&Ot===0&&f.a.createElement("aside",{className:["bg-white"].join(" ")},f.a.createElement(I.a,{onChange:function(jt){kt(jt)},height:150,isFocus:!0,watch:!0}),f.a.createElement(m.a,null,f.a.createElement(l.a,{span:24,className:"tr"},f.a.createElement(X.a,{type:"default",size:"large",onClick:Object(s.a)(T.a.mark(function gt(){return T.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:qt(!1);case 1:case"end":return Ht.stop()}},gt)}))},"\u53D6\u6D88"),f.a.createElement(X.a,{type:"primary",size:"large",className:"ml20",onClick:Object(s.a)(T.a.mark(function gt(){var jt;return T.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(At==="")){Wt.next=4;break}u.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Wt.next=8;break;case 4:return Wt.next=6,Object(Ae.f)({comment:At,userId:rt.userId,score_id:$e.score_id});case 6:jt=Wt.sent,jt.status===0&&(u.b.success("\u64CD\u4F5C\u6210\u529F"),qt(!1),Gn());case 8:case"end":return Wt.stop()}},gt)}))},"\u4FDD\u5B58")))))),f.a.createElement(L.a,null))}))),f.a.createElement(ve,null),f.a.createElement(k,null),f.a.createElement(M.a,null),f.a.createElement(D.a,{title:"\u786E\u8BA4\u6253\u56DE\u91CD\u505A",visible:Ar,destroyOnClose:!0,forceRender:!0,onCancel:function(){kn(!1)},onOk:Object(s.a)(T.a.mark(function $e(){var Ot;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(vr){gt.next=3;break}return u.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),gt.abrupt("return");case 3:return gt.next=5,Object(Ce.a)("/api/student_works/".concat(rt.userId,"/redo_modal.json"),{method:"post",body:{comment:vr,id:rt.userId}});case 5:Ot=gt.sent,(Ot==null?void 0:Ot.status)===0&&(u.b.info("\u6253\u56DE\u91CD\u505A\u6210\u529F"),kn(!1),Gn());case 7:case"end":return gt.stop()}},$e)})),width:700},f.a.createElement("div",{style:{padding:"32px"}},f.a.createElement("span",null,"\u786E\u8BA4\u5C06",We==null?void 0:We.author_name,"\u7684\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417"),f.a.createElement("div",{style:{marginTop:"20px"}},f.a.createElement("label",null,f.a.createElement("span",{style:{marginRight:"5px",color:"red"}},"*"),"\u8BC4\u8BED\uFF1A"),f.a.createElement(I.a,{className:G.a.MdEditor,onChange:function(Ot){return Fn(Ot)},defaultValue:"",height:250})))),nr)},ge=Ee.default=Object(_.a)(function(_e){var Se=_e.shixunHomeworks,Pe=_e.loading,Ue=_e.user,He=_e.globalSetting;return{shixunHomeworks:Se,globalSetting:He,user:Ue,loading:Pe.effects}})(ue)},"T/ev":function(Je,Ee,J){Je.exports={flex_box_center:"flex_box_center___YeRn8",flex_space_between:"flex_space_between___1Koq4",flex_box_vertical_center:"flex_box_vertical_center___iwltW",flex_box_center_end:"flex_box_center_end___Wt8Ci",flex_box_column:"flex_box_column___1_Hpq",bg:"bg___DLoEi",title:"title___Rt3xF",replyList:"replyList___1-Na2",leader:"leader___2AO79",buttonFixed:"buttonFixed___LfzzJ",exitComment:"exitComment___1F28w",nextComment:"nextComment___3Jkyg",modal:"modal___1isyX",MdEditor:"MdEditor___3xy6-"}},T8No:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return K}),J.d(Ee,"e",function(){return z}),J.d(Ee,"c",function(){return T}),J.d(Ee,"b",function(){return d}),J.d(Ee,"d",function(){return f}),J.d(Ee,"f",function(){return j});var le=J("MNsG"),Y=J("N0LK"),N=J("Cg/j");let X=le.k||"";const H=new Map;H.set("false",!1),H.set("true",!0),H.set("isMac",le.f),H.set("isLinux",le.d),H.set("isWindows",le.i),H.set("isWeb",le.h),H.set("isMacNative",le.f&&!le.h),H.set("isEdge",X.indexOf("Edg/")>=0),H.set("isFirefox",X.indexOf("Firefox")>=0),H.set("isChrome",X.indexOf("Chrome")>=0),H.set("isSafari",X.indexOf("Safari")>=0);const P=Object.prototype.hasOwnProperty;class K{static has(w){return m.create(w)}static equals(w,M){return g.create(w,M)}static regex(w,M){return S.create(w,M)}static not(w){return o.create(w)}static and(...w){return A.create(w,null)}static or(...w){return C.create(w,null,!0)}static deserialize(w,M=!1){return w?this._deserializeOrExpression(w,M):void 0}static _deserializeOrExpression(w,M){let I=w.split("||");return C.create(I.map(v=>this._deserializeAndExpression(v,M)),null,!0)}static _deserializeAndExpression(w,M){let I=w.split("&&");return A.create(I.map(v=>this._deserializeOne(v,M)),null)}static _deserializeOne(w,M){if(w=w.trim(),w.indexOf("!=")>=0){let I=w.split("!=");return p.create(I[0].trim(),this._deserializeValue(I[1],M))}if(w.indexOf("==")>=0){let I=w.split("==");return g.create(I[0].trim(),this._deserializeValue(I[1],M))}if(w.indexOf("=~")>=0){let I=w.split("=~");return S.create(I[0].trim(),this._deserializeRegexValue(I[1],M))}if(w.indexOf(" in ")>=0){let I=w.split(" in ");return l.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const I=w.split(">=");return a.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const I=w.split(">");return s.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const I=w.split("<=");return x.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const I=w.split("<");return R.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(w)?o.create(w.substr(1).trim()):m.create(w)}static _deserializeValue(w,M){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let I=/^'([^']*)'$/.exec(w);return I?I[1].trim():w}static _deserializeRegexValue(w,M){if(Object(Y.C)(w)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=w.indexOf("/"),v=w.lastIndexOf("/");if(I===v||I<0){if(M)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let W=w.slice(I+1,v),Z=w[v+1]==="i"?"i":"";try{return new RegExp(W,Z)}catch(oe){if(M)throw new Error(`bad regexp-value '${w}', parse error: ${oe}`);return console.warn(`bad regexp-value '${w}', parse error: ${oe}`),null}}}function z(w,M){const I=w?w.substituteConstants():void 0,v=M?M.substituteConstants():void 0;return!I&&!v?!0:!I||!v?!1:I.equals(v)}function n(w,M){return w.cmp(M)}class L{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}L.INSTANCE=new L;class y{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}y.INSTANCE=new y;class m{constructor(w,M){this.key=w,this.negated=M,this.type=2}static create(w,M=null){const I=H.get(w);return typeof I=="boolean"?I?y.INSTANCE:L.INSTANCE:new m(w,M)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=H.get(this.key);return typeof w=="boolean"?w?y.INSTANCE:L.INSTANCE:this}evaluate(w){return!!w.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 g{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=4}static create(w,M,I=null){if(typeof M=="boolean")return M?m.create(w,I):o.create(w,I);const v=H.get(w);if(typeof v=="boolean"){const W=v?"true":"false";return M===W?y.INSTANCE:L.INSTANCE}return new g(w,M,I)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=H.get(this.key);if(typeof w=="boolean"){const M=w?"true":"false";return this.value===M?y.INSTANCE:L.INSTANCE}return this}evaluate(w){return w.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 l{constructor(w,M){this.key=w,this.valueKey=M,this.type=10,this.negated=null}static create(w,M){return new l(w,M)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const M=w.getValue(this.valueKey),I=w.getValue(this.key);return Array.isArray(M)?M.indexOf(I)>=0:typeof I=="string"&&typeof M=="object"&&M!==null?P.call(M,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=h.create(this)),this.negated}}class h{constructor(w){this._actual=w,this.type=11}static create(w){return new h(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=5}static create(w,M,I=null){if(typeof M=="boolean")return M?o.create(w,I):m.create(w,I);const v=H.get(w);if(typeof v=="boolean"){const W=v?"true":"false";return M===W?L.INSTANCE:y.INSTANCE}return new p(w,M,I)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=H.get(this.key);if(typeof w=="boolean"){const M=w?"true":"false";return this.value===M?L.INSTANCE:y.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class o{constructor(w,M){this.key=w,this.negated=M,this.type=3}static create(w,M=null){const I=H.get(w);return typeof I=="boolean"?I?L.INSTANCE:y.INSTANCE:new o(w,M)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=H.get(this.key);return typeof w=="boolean"?w?L.INSTANCE:y.INSTANCE:this}evaluate(w){return!w.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(w,M){if(typeof w=="string"){const I=parseFloat(w);isNaN(I)||(w=I)}return typeof w=="string"||typeof w=="number"?M(w):L.INSTANCE}class s{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=12}static create(w,M,I=null){return u(M,v=>new s(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class a{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=13}static create(w,M,I=null){return u(M,v=>new a(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=14}static create(w,M,I=null){return u(M,v=>new R(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class x{constructor(w,M,I){this.key=w,this.value=M,this.negated=I,this.type=15}static create(w,M,I=null){return u(M,v=>new x(w,v,I))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.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 S{constructor(w,M){this.key=w,this.regexp=M,this.type=7,this.negated=null}static create(w,M){return new S(w,M)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const M=this.regexp?this.regexp.source:"",I=w.regexp?w.regexp.source:"";return M<I?-1:M>I?1:0}equals(w){if(w.type===this.type){const M=this.regexp?this.regexp.source:"",I=w.regexp?w.regexp.source:"";return this.key===w.key&&M===I}return!1}substituteConstants(){return this}evaluate(w){let M=w.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this)),this.negated}}class D{constructor(w){this._actual=w,this.type=8}static create(w){return new D(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(w){let M=null;for(let I=0,v=w.length;I<v;I++){const W=w[I].substituteConstants();if(w[I]!==W&&M===null){M=[];for(let Z=0;Z<I;Z++)M[Z]=w[Z]}M!==null&&(M[I]=W)}return M===null?w:M}class A{constructor(w,M){this.expr=w,this.negated=M,this.type=6}static create(w,M){return A._normalizeArr(w,M)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const v=n(this.expr[M],w.expr[M]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(w.expr[M]))return!1;return!0}return!1}substituteConstants(){const w=O(this.expr);return w===this.expr?this:A.create(w,this.negated)}evaluate(w){for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].evaluate(w))return!1;return!0}static _normalizeArr(w,M){const I=[];let v=!1;for(const W of w){if(!W)continue;if(W.type===1){v=!0;continue}if(W.type===0)return L.INSTANCE;if(W.type===6){I.push(...W.expr);continue}I.push(W)}if(I.length===0&&v)return y.INSTANCE;if(I.length===0)return;if(I.length===1)return I[0];I.sort(n);for(let W=1;W<I.length;W++)I[W-1].equals(I[W])&&(I.splice(W,1),W--);if(I.length===1)return I[0];for(;I.length>1;){const W=I[I.length-1];if(W.type!==9)break;I.pop();const Z=I.pop(),oe=I.length===0,fe=C.create(W.expr.map(Ae=>A.create([Ae,Z],null)),null,oe);fe&&(I.push(fe),I.sort(n))}return I.length===1?I[0]:new A(I,M)}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let M of this.expr)w.push(...M.keys());return w}negate(){if(!this.negated){const w=[];for(let M of this.expr)w.push(M.negate());this.negated=C.create(w,this,!0)}return this.negated}}class C{constructor(w,M){this.expr=w,this.negated=M,this.type=9}static create(w,M,I){return C._normalizeArr(w,M,I)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let M=0,I=this.expr.length;M<I;M++){const v=n(this.expr[M],w.expr[M]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let M=0,I=this.expr.length;M<I;M++)if(!this.expr[M].equals(w.expr[M]))return!1;return!0}return!1}substituteConstants(){const w=O(this.expr);return w===this.expr?this:C.create(w,this.negated,!1)}evaluate(w){for(let M=0,I=this.expr.length;M<I;M++)if(this.expr[M].evaluate(w))return!0;return!1}static _normalizeArr(w,M,I){let v=[],W=!1;if(w){for(let Z=0,oe=w.length;Z<oe;Z++){const fe=w[Z];if(!fe)continue;if(fe.type===0){W=!0;continue}if(fe.type===1)return y.INSTANCE;if(fe.type===9){v=v.concat(fe.expr);continue}v.push(fe)}if(v.length===0&&W)return L.INSTANCE;v.sort(n)}if(v.length===0)return;if(v.length===1)return v[0];for(let Z=1;Z<v.length;Z++)v[Z-1].equals(v[Z])&&(v.splice(Z,1),Z--);if(v.length===1)return v[0];if(I){for(let Z=0;Z<v.length;Z++)for(let oe=Z+1;oe<v.length;oe++)j(v[Z],v[oe])&&(v.splice(oe,1),oe--);if(v.length===1)return v[0]}return new C(v,M)}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let M of this.expr)w.push(...M.keys());return w}negate(){if(!this.negated){let w=[];for(let M of this.expr)w.push(M.negate());for(;w.length>1;){const M=w.shift(),I=w.shift(),v=[];for(const Z of U(M))for(const oe of U(I))v.push(A.create([Z,oe],null));const W=w.length===0;w.unshift(C.create(v,null,W))}this.negated=w[0]}return this.negated}}class T extends m{constructor(w,M,I){super(w,null);this._defaultValue=M,typeof I=="object"?T._info.push(Object.assign(Object.assign({},I),{key:w})):I!==!0&&T._info.push({key:w,description:I,type:M!=null?typeof M:void 0})}static all(){return T._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return g.create(this.key,w)}}T._info=[];const d=Object(N.c)("contextKeyService"),f="setContext";function b(w,M){return w<M?-1:w>M?1:0}function _(w,M,I,v){return w<I?-1:w>I?1:M<v?-1:M>v?1:0}function j(w,M){if(M.type===6&&w.type!==9&&w.type!==6){for(const W of M.expr)if(w.equals(W))return!0}const I=w.negate(),v=U(I).concat(U(M));v.sort(n);for(let W=0;W<v.length;W++){const Z=v[W],oe=Z.negate();for(let fe=W+1;fe<v.length;fe++){const Ae=v[fe];if(oe.equals(Ae))return!0}}return!1}function U(w){return w.type===9?w.expr:[w]}},TXwP:function(Je,Ee,J){var le,Y;(function(){var N;(function(){"use strict";var H=[,,function(n){function L(g){this.__parent=g,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=[]}L.prototype.clone_empty=function(){var g=new L(this.__parent);return g.set_indent(this.__indent_count,this.__alignment_count),g},L.prototype.item=function(g){return g<0?this.__items[this.__items.length+g]:this.__items[g]},L.prototype.has_match=function(g){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(g))return!0;return!1},L.prototype.set_indent=function(g,l){this.is_empty()&&(this.__indent_count=g||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var g=this.__parent.current_line;return g.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),g.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),g.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,g.__items[0]===" "&&(g.__items.splice(0,1),g.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(g){this.__items.push(g);var l=g.lastIndexOf(`
`);l!==-1?this.__character_count=g.length-l:this.__character_count+=g.length},L.prototype.pop=function(){var g=null;return this.is_empty()||(g=this.__items.pop(),this.__character_count-=g.length),g},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var g="";return this.is_empty()?this.__parent.indent_empty_lines&&(g=this.__parent.get_indent_string(this.__indent_count)):(g=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),g+=this.__items.join("")),g};function y(g,l){this.__cache=[""],this.__indent_size=g.indent_size,this.__indent_string=g.indent_char,g.indent_with_tabs||(this.__indent_string=new Array(g.indent_size+1).join(g.indent_char)),l=l||"",g.indent_level>0&&(l=new Array(g.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}y.prototype.get_indent_size=function(g,l){var h=this.__base_string_length;return l=l||0,g<0&&(h=0),h+=g*this.__indent_size,h+=l,h},y.prototype.get_indent_string=function(g,l){var h=this.__base_string;return l=l||0,g<0&&(g=0,h=""),l+=g*this.__indent_size,this.__ensure_cache(l),h+=this.__cache[l],h},y.prototype.__ensure_cache=function(g){for(;g>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var g=this.__cache.length,l=0,h="";this.__indent_size&&g>=this.__indent_size&&(l=Math.floor(g/this.__indent_size),g-=l*this.__indent_size,h=new Array(l+1).join(this.__indent_string)),g&&(h+=new Array(g+1).join(" ")),this.__cache.push(h)};function m(g,l){this.__indent_cache=new y(g,l),this.raw=!1,this._end_with_newline=g.end_with_newline,this.indent_size=g.indent_size,this.wrap_line_length=g.wrap_line_length,this.indent_empty_lines=g.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(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(g,l){return this.__indent_cache.get_indent_string(g,l)},m.prototype.get_indent_size=function(g,l){return this.__indent_cache.get_indent_size(g,l)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(g){return this.is_empty()||!g&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(g){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var h=this.__lines.join(`
`);return g!==`
`&&(h=h.replace(/[\n]/g,g)),h},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(g,l){return g=g||0,l=l||0,this.next_line.set_indent(g,l),this.__lines.length>1?(this.current_line.set_indent(g,l),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(g){for(var l=0;l<g.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(g.whitespace_before),this.current_line.push(g.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(g){this.__add_space_before_token(),this.current_line.push(g),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(g){for(var l=this.__lines.length;g<l;)this.__lines[g]._remove_indent(),g++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(g){for(g=g===void 0?!1:g,this.current_line.trim();g&&this.__lines.length>1&&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(g,l){for(var h=this.__lines.length-2;h>=0;){var p=this.__lines[h];if(p.is_empty())break;if(p.item(0).indexOf(g)!==0&&p.item(-1)!==l){this.__lines.splice(h+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}h--}},n.exports.Output=m},,,,function(n){function L(g,l){this.raw_options=y(g,l),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"])}L.prototype._get_array=function(g,l){var h=this.raw_options[g],p=l||[];return typeof h=="object"?h!==null&&typeof h.concat=="function"&&(p=h.concat()):typeof h=="string"&&(p=h.split(/[^a-zA-Z0-9_\/\-]+/)),p},L.prototype._get_boolean=function(g,l){var h=this.raw_options[g],p=h===void 0?!!l:!!h;return p},L.prototype._get_characters=function(g,l){var h=this.raw_options[g],p=l||"";return typeof h=="string"&&(p=h.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},L.prototype._get_number=function(g,l){var h=this.raw_options[g];l=parseInt(l,10),isNaN(l)&&(l=0);var p=parseInt(h,10);return isNaN(p)&&(p=l),p},L.prototype._get_selection=function(g,l,h){var p=this._get_selection_list(g,l,h);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+g+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[g]+"'");return p[0]},L.prototype._get_selection_list=function(g,l,h){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(h=h||[l[0]],!this._is_valid_selection(h,l))throw new Error("Invalid Default Value!");var p=this._get_array(g,h);if(!this._is_valid_selection(p,l))throw new Error("Invalid Option Value: The option '"+g+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[g]+"'");return p},L.prototype._is_valid_selection=function(g,l){return g.length&&l.length&&!g.some(function(h){return l.indexOf(h)===-1})};function y(g,l){var h={};g=m(g);var p;for(p in g)p!==l&&(h[p]=g[p]);if(l&&g[l])for(p in g[l])h[p]=g[l][p];return h}function m(g){var l={},h;for(h in g){var p=h.replace(/-/g,"_");l[p]=g[h]}return l}n.exports.Options=L,n.exports.normalizeOpts=m,n.exports.mergeOpts=y},,function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var g=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(g=this.__input.charAt(m)),g},y.prototype.__match=function(m,g){m.lastIndex=g;var l=m.exec(this.__input);return l&&!(L&&m.sticky)&&(l.index!==g&&(l=null)),l},y.prototype.test=function(m,g){return g=g||0,g+=this.__position,g>=0&&g<this.__input_length?!!this.__match(m,g):!1},y.prototype.testChar=function(m,g){var l=this.peek(g);return m.lastIndex=0,l!==null&&m.test(l)},y.prototype.match=function(m){var g=this.__match(m,this.__position);return g?this.__position+=g[0].length:g=null,g},y.prototype.read=function(m,g,l){var h="",p;return m&&(p=this.match(m),p&&(h+=p[0])),g&&(p||!m)&&(h+=this.readUntil(g,l)),h},y.prototype.readUntil=function(m,g){var l="",h=this.__position;m.lastIndex=this.__position;var p=m.exec(this.__input);return p?(h=p.index,g&&(h+=p[0].length)):h=this.__input_length,l=this.__input.substring(this.__position,h),this.__position=h,l},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,g){var l=null,h="g";return g&&L&&(h="y"),typeof m=="string"&&m!==""?l=new RegExp(m,h):m&&(l=new RegExp(m.source,h)),l},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var g=this.__position,l=this.readUntilAfter(m);return this.__position=g,l},y.prototype.lookBack=function(m){var g=this.__position-1;return g>=m.length&&this.__input.substring(g-m.length,g).toLowerCase()===m},n.exports.InputScanner=y},,,,,function(n){function L(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}L.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var g=this.__directive_pattern.exec(y);g;)m[g[1]]=g[2],g=this.__directive_pattern.exec(y);return m},L.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=L},,function(n,L,y){var m=y(16).Beautifier,g=y(17).Options;function l(h,p){var o=new m(h,p);return o.beautify()}n.exports=l,n.exports.defaultOptions=function(){return new g}},function(n,L,y){var m=y(17).Options,g=y(2).Output,l=y(8).InputScanner,h=y(13).Directives,p=new h(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,a=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(D,O){this._source_text=D||"",this._options=new m(O),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"]}S.prototype.eatString=function(D){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(D){for(var O=s.test(this._input.peek()),A=0;s.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((A===0||A<this._options.max_preserve_newlines)&&(A++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var D=0,O=1,A=this._input.peek(O);A;){if(A==="{")return!0;if(A==="(")D+=1;else if(A===")"){if(D===0)return!1;D-=1}else if(A===";"||A==="}")return!1;O++,A=this._input.peek(O)}return!1},S.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},S.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,D&&o.test(D||"")&&(O=D.match(o)[0])),D=D.replace(u,`
`);var A=D.match(/^[\t ]*/)[0];this._output=new g(this._options,A),this._input=new l(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,T=!1,d=!1,f=!1,b=!1,_=!1,j=!1,U=this._ch,w=!1,M,I,v;M=this._input.read(a),I=M!=="",v=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(R),Z=p.get_directives(W);Z&&Z.ignore==="start"&&(W+=p.readIgnored(this._input)),this.print_string(W),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(x)),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 oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?b=!0:oe==="import"&&(_=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(f=!0)):!T&&C===0&&oe.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()),f?(f=!1,T=this._indentLevel>=this._nestedLevel):T=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&T&&(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)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),_=!1,b=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),T=!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 fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){w=!0;break}(T||f)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&C===0?(this.print_string(":"),d||(d=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var Ae=v==='"'||v==="'";this.preserveSingleSpace(Ae||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")w=!1,C===0?(d&&(this.outdent(),d=!1),b=!1,_=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),C++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),C&&(C--,this.outdent()));else{var be=!1;this._input.lookBack("with")&&(be=!0),this.preserveSingleSpace(I||be),this.print_string(this._ch),d&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!d||j)&&C===0&&!_&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||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 Re=v==='"'||v==="'";this.preserveSingleSpace(Re||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&w&&this._output.add_new_line()}var Ce=this._output.get_code(O);return Ce},n.exports.Beautifier=S},function(n,L,y){var m=y(6).Options;function g(l){m.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var h=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||h;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<p.length;o++)p[o]!=="expand"?this.brace_style="collapse":this.brace_style=p[o]}g.prototype=new m,n.exports.Options=g}],P={};function K(n){var L=P[n];if(L!==void 0)return L.exports;var y=P[n]={exports:{}};return H[n](y,y.exports,K),y.exports}var z=K(15);N=z})();var X=N;!(le=[],Y=function(){return{css_beautify:X}}.apply(Ee,le),Y!==void 0&&(Je.exports=Y))})()},UZu5:function(Je,Ee,J){},Vhoy:function(Je,Ee,J){"use strict";J.d(Ee,"d",function(){return X}),J.d(Ee,"e",function(){return H}),J.d(Ee,"c",function(){return P}),J.d(Ee,"b",function(){return K}),J.d(Ee,"a",function(){return z});var le=J("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new le.b}add(n){const L=this._icons.get(n.id);L?n.description?L.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const N=new Y,X=N;function H(n,L){return new K(n,L)}function P(n){return n?n.replace(/\$\((.*?)\)/g,(L,y)=>` ${y} `).trim():""}class K{constructor(n,L,y){this.id=n,this.definition=L,this.description=y,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var z;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function y(l){if(l instanceof K)return["codicon","codicon-"+l.id];const h=L.exec(l.id);if(!h)return y(K.error);let[,p,o]=h;const u=["codicon","codicon-"+p];return o&&u.push("codicon-modifier-"+o.substr(1)),u}n.asClassNameArray=y;function m(l){return y(l).join(" ")}n.asClassName=m;function g(l){return"."+y(l).join(".")}n.asCSSSelector=g})(z||(z={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Je,Ee,J){(function(le,Y){Je.exports=Y()})(this,function(){"use strict";var le=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(le),X=/MSIE \d/.test(le),H=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(le),P=/Edge\/(\d+)/.exec(le),K=X||H||P,z=K&&(X?document.documentMode||6:+(P||H)[1]),n=!P&&/WebKit\//.test(le),L=n&&/Qt\/\d+\.\d+/.test(le),y=!P&&/Chrome\//.test(le),m=/Opera\//.test(le),g=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(le),h=/PhantomJS/.test(le),p=!P&&/AppleWebKit/.test(le)&&/Mobile\/\w+/.test(le),o=/Android/.test(le),u=p||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(le),s=p||/Mac/.test(Y),a=/\bCrOS\b/.test(le),R=/win/i.test(Y),x=m&&le.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(m=!1,n=!0);var S=s&&(L||m&&(x==null||x<12.11)),D=N||K&&z>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A=function(e,t){var i=e.className,r=O(t).exec(i);if(r){var c=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(c?r[1]+c:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return C(e).appendChild(t)}function d(e,t,i,r){var c=document.createElement(e);if(i&&(c.className=i),r&&(c.style.cssText=r),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var F=0;F<t.length;++F)c.appendChild(t[F]);return c}function f(e,t,i,r){var c=d(e,t,i,r);return c.setAttribute("role","presentation"),c}var b;document.createRange?b=function(e,t,i,r){var c=document.createRange();return c.setEnd(r||e,i),c.setStart(e,t),c}:b=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(c){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function _(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var i=e.className;O(t).test(i)||(e.className+=(i?" ":"")+t)}function w(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!O(i[r]).test(t)&&(t+=" "+i[r]);return t}var M=function(e){e.select()};p?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(M=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function v(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function W(e,t,i,r,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=r||0,V=c||0;;){var q=e.indexOf(" ",F);if(q<0||q>=t)return V+(t-F);V+=q-F,V+=i-V%i,F=q+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function oe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var fe=50,Ae={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Re={origin:"*mouse"},Ce={origin:"+move"};function Le(e,t,i){for(var r=0,c=0;;){var F=e.indexOf(" ",r);F==-1&&(F=e.length);var V=F-r;if(F==e.length||c+V>=t)return r+Math.min(V,t-c);if(c+=F-r,c+=i-c%i,r=F+1,c>=t)return r}}var ve=[""];function $(e){for(;ve.length<=e;)ve.push(E(ve)+" ");return ve[e]}function E(e){return e[e.length-1]}function k(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function B(e,t,i){for(var r=0,c=i(t);r<e.length&&i(e[r])<=c;)r++;e.splice(r,0,t)}function Q(){}function G(e,t){var i;return Object.create?i=Object.create(e):(Q.prototype=e,i=new Q),t&&v(t,i),i}var he=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||he.test(e))}function Ie(e,t){return t?t.source.indexOf("\\w")>-1&&xe(e)?!0:t.test(e):xe(e)}function ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ge=/[\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 _e(e){return e.charCodeAt(0)>=768&&ge.test(e)}function Se(e,t,i){for(;(i<0?t>0:t<e.length)&&_e(e.charAt(t));)t+=i;return t}function Pe(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var c=(t+i)/2,F=r<0?Math.ceil(c):Math.floor(c);if(F==t)return e(F)?t:i;e(F)?i=F:t=F+r}}function Ue(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var c=!1,F=0;F<e.length;++F){var V=e[F];(V.from<i&&V.to>t||t==i&&V.to==t)&&(r(Math.max(V.from,t),Math.min(V.to,i),V.level==1?"rtl":"ltr",F),c=!0)}c||r(t,i,"ltr")}var He=null;function Be(e,t,i){var r;He=null;for(var c=0;c<e.length;++c){var F=e[c];if(F.from<t&&F.to>t)return c;F.to==t&&(F.from!=F.to&&i=="before"?r=c:He=c),F.from==t&&(F.from!=F.to&&i!="before"?r=c:He=c)}return r!=null?r:He}var Qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,F=/[LRr]/,V=/[Lb1n]/,q=/[1n]/;function te(ie,ye,we){this.level=ie,this.from=ye,this.to=we}return function(ie,ye){var we=ye=="ltr"?"L":"R";if(ie.length==0||ye=="ltr"&&!r.test(ie))return!1;for(var ke=ie.length,De=[],Fe=0;Fe<ke;++Fe)De.push(i(ie.charCodeAt(Fe)));for(var je=0,Xe=we;je<ke;++je){var qe=De[je];qe=="m"?De[je]=Xe:Xe=qe}for(var st=0,et=we;st<ke;++st){var lt=De[st];lt=="1"&&et=="r"?De[st]="n":F.test(lt)&&(et=lt,lt=="r"&&(De[st]="R"))}for(var vt=1,ct=De[0];vt<ke-1;++vt){var Ct=De[vt];Ct=="+"&&ct=="1"&&De[vt+1]=="1"?De[vt]="1":Ct==","&&ct==De[vt+1]&&(ct=="1"||ct=="n")&&(De[vt]=ct),ct=Ct}for(var Xt=0;Xt<ke;++Xt){var cn=De[Xt];if(cn==",")De[Xt]="N";else if(cn=="%"){var en=void 0;for(en=Xt+1;en<ke&&De[en]=="%";++en);for(var Mn=Xt&&De[Xt-1]=="!"||en<ke&&De[en]=="1"?"1":"N",On=Xt;On<en;++On)De[On]=Mn;Xt=en-1}}for(var an=0,Ln=we;an<ke;++an){var gn=De[an];Ln=="L"&&gn=="1"?De[an]="L":F.test(gn)&&(Ln=gn)}for(var ln=0;ln<ke;++ln)if(c.test(De[ln])){var sn=void 0;for(sn=ln+1;sn<ke&&c.test(De[sn]);++sn);for(var tn=(ln?De[ln-1]:we)=="L",In=(sn<ke?De[sn]:we)=="L",si=tn==In?tn?"L":"R":we,Cr=ln;Cr<sn;++Cr)De[Cr]=si;ln=sn-1}for(var _n=[],tr,dn=0;dn<ke;)if(V.test(De[dn])){var Va=dn;for(++dn;dn<ke&&V.test(De[dn]);++dn);_n.push(new te(0,Va,dn))}else{var cr=dn,jr=_n.length,Hr=ye=="rtl"?1:0;for(++dn;dn<ke&&De[dn]!="L";++dn);for(var xn=cr;xn<dn;)if(q.test(De[xn])){cr<xn&&(_n.splice(jr,0,new te(1,cr,xn)),jr+=Hr);var oi=xn;for(++xn;xn<dn&&q.test(De[xn]);++xn);_n.splice(jr,0,new te(2,oi,xn)),jr+=Hr,cr=xn}else++xn;cr<dn&&_n.splice(jr,0,new te(1,cr,dn))}return ye=="ltr"&&(_n[0].level==1&&(tr=ie.match(/^\s+/))&&(_n[0].from=tr[0].length,_n.unshift(new te(0,0,tr[0].length))),E(_n).level==1&&(tr=ie.match(/\s+$/))&&(E(_n).to-=tr[0].length,_n.push(new te(0,ke-tr[0].length,ke)))),ye=="rtl"?_n.reverse():_n}}();function ze(e,t){var i=e.order;return i==null&&(i=e.order=Qe(e.text,t)),i}var Ye=[],Me=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ye).concat(i)}};function it(e,t){return e._handlers&&e._handlers[t]||Ye}function Ze(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,c=r&&r[t];if(c){var F=oe(c,i);F>-1&&(r[t]=c.slice(0,F).concat(c.slice(F+1)))}}}function ce(e,t){var i=it(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),c=0;c<i.length;++c)i[c].apply(null,r)}function ee(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ce(e,i||t.type,e,t),pe(t)||t.codemirrorIgnore}function ne(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(i,t[r])==-1&&i.push(t[r])}function ae(e,t){return it(e,t).length>0}function de(e){e.prototype.on=function(t,i){Me(this,t,i)},e.prototype.off=function(t,i){Ze(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){re(e),se(e)}function Te(e){return e.target||e.srcElement}function Oe(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 Ne=function(){if(K&&z<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Ke;function nt(e){if(Ke==null){var t=d("span","\u200B");T(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&z<8))}var i=Ke?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var at;function xt(e){if(at!=null)return at;var t=T(e,document.createTextNode("A\u062EA")),i=b(t,0,1).getBoundingClientRect(),r=b(t,1,2).getBoundingClientRect();return C(e),!i||i.left==i.right?!1:at=r.right-i.right<3}var ut=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var c=e.indexOf(`
`,t);c==-1&&(c=e.length);var F=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),V=F.indexOf("\r");V!=-1?(i.push(F.slice(0,V)),t+=V+1):(i.push(F),t=c+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ot=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},Tt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),St=null;function rt(e){if(St!=null)return St;var t=T(e,d("span","x")),i=t.getBoundingClientRect(),r=b(t,0,1).getBoundingClientRect();return St=Math.abs(i.left-r.left)>1}var Gt={},Lt={};function rn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gt[e]=t}function We(e,t){Lt[e]=t}function Pt(e){if(typeof e=="string"&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&typeof e.name=="string"&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];typeof t=="string"&&(t={name:t}),e=G(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Pt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Pt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Yt(e,t){t=Pt(t);var i=Gt[t.name];if(!i)return Yt(e,"text/plain");var r=i(e,t);if(pt.hasOwnProperty(t.name)){var c=pt[t.name];for(var F in c){if(!c.hasOwnProperty(F))continue;r.hasOwnProperty(F)&&(r["_"+F]=r[F]),r[F]=c[F]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)r[V]=t.modeProps[V];return r}var pt={};function Et(e,t){var i=pt.hasOwnProperty(e)?pt[e]:pt[e]={};v(t,i)}function wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var c=t[r];c instanceof Array&&(c=c.concat([])),i[r]=c}return i}function Zt(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 vn(e,t,i){return e.startState?e.startState(t,i):!0}var Bt=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};Bt.prototype.eol=function(){return this.pos>=this.string.length},Bt.prototype.sol=function(){return this.pos==this.lineStart},Bt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Bt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Bt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Bt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Bt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Bt.prototype.skipToEnd=function(){this.pos=this.string.length},Bt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Bt.prototype.backUp=function(e){this.pos-=e},Bt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Bt.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Bt.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(V){return i?V.toLowerCase():V},c=this.string.substr(this.pos,e.length);if(r(c)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var F=this.string.slice(this.pos).match(e);return F&&F.index>0?null:(F&&t!==!1&&(this.pos+=F[0].length),F)}},Bt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Bt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Bt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Bt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function tt(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 r=0;;++r){var c=i.children[r],F=c.chunkSize();if(t<F){i=c;break}t-=F}return i.lines[t]}function At(e,t,i){var r=[],c=t.line;return e.iter(t.line,i.line+1,function(F){var V=F.text;c==i.line&&(V=V.slice(0,i.ch)),c==t.line&&(V=V.slice(t.ch)),r.push(V),++c}),r}function kt(e,t,i){var r=[];return e.iter(t,i,function(c){r.push(c.text)}),r}function ft(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function yt(e){if(e.parent==null)return null;for(var t=e.parent,i=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var c=0;!(r.children[c]==t);++c)i+=r.children[c].chunkSize();return i+t.first}function Rt(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var c=e.children[r],F=c.height;if(t<F){e=c;continue e}t-=F,i+=c.chunkSize()}return i}while(!e.lines);for(var V=0;V<e.lines.length;++V){var q=e.lines[V],te=q.height;if(t<te)break;t-=te}return i+V}function qt(e,t){return t>=e.first&&t<e.first+e.size}function $t(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ge(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ge))return new Ge(e,t,i);this.line=e,this.ch=t,this.sticky=i}function mt(e,t){return e.line-t.line||e.ch-t.ch}function nr(e,t){return e.sticky==t.sticky&&mt(e,t)==0}function dr(e){return Ge(e.line,e.ch)}function fr(e,t){return mt(e,t)<0?t:e}function Hn(e,t){return mt(e,t)<0?e:t}function pr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function bt(e,t){if(t.line<e.first)return Ge(e.first,0);var i=e.first+e.size-1;return t.line>i?Ge(i,tt(e,i).text.length):Dn(t,tt(e,t.line).text.length)}function Dn(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(e.line,0):e}function Ve(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=bt(e,t[r]);return i}var mr=function(e,t){this.state=e,this.lookAhead=t},Tn=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Tn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Tn.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}},Tn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Tn.fromSaved=function(e,t,i){return t instanceof mr?new Tn(e,wt(e.mode,t.state),i,t.lookAhead):new Tn(e,wt(e.mode,t),i)},Tn.prototype.save=function(e){var t=e!==!1?wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mr(t,this.maxLookAhead):t};function wn(e,t,i,r){var c=[e.state.modeGen],F={};Fn(e,t.text,e.doc.mode,i,function(ie,ye){return c.push(ie,ye)},F,r);for(var V=i.state,q=function(ie){i.baseTokens=c;var ye=e.state.overlays[ie],we=1,ke=0;i.state=!0,Fn(e,t.text,ye.mode,i,function(De,Fe){for(var je=we;ke<De;){var Xe=c[we];Xe>De&&c.splice(we,1,De,c[we+1],Xe),we+=2,ke=Math.min(De,Xe)}if(!Fe)return;if(ye.opaque)c.splice(je,we-je,De,"overlay "+Fe),we=je+2;else for(;je<we;je+=2){var qe=c[je+1];c[je+1]=(qe?qe+" ":"")+"overlay "+Fe}},F),i.state=V,i.baseTokens=null,i.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:c,classes:F.bgClass||F.textClass?F:null}}function Jn(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Nn(e,yt(t)),c=t.text.length>e.options.maxHighlightLength&&wt(e.doc.mode,r.state),F=wn(e,t,r);c&&(r.state=c),t.stateAfter=r.save(!c),t.styles=F.styles,F.classes?t.styleClasses=F.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 Nn(e,t,i){var r=e.doc,c=e.display;if(!r.mode.startState)return new Tn(r,!0,t);var F=Gn(e,t,i),V=F>r.first&&tt(r,F-1).stateAfter,q=V?Tn.fromSaved(r,V,F):new Tn(r,vn(r.mode),F);return r.iter(F,t,function(te){gr(e,te.text,q);var ie=q.line;te.stateAfter=ie==t-1||ie%5==0||ie>=c.viewFrom&&ie<c.viewTo?q.save():null,q.nextLine()}),i&&(r.modeFrontier=q.line),q}function gr(e,t,i,r){var c=e.doc.mode,F=new Bt(t,e.options.tabSize,i);for(F.start=F.pos=r||0,t==""&&Ar(c,i.state);!F.eol();)kn(c,F,i.state),F.start=F.pos}function Ar(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Zt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function kn(e,t,i,r){for(var c=0;c<10;c++){r&&(r[0]=Zt(e,i).mode);var F=e.token(t,i);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var Rr=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Or(e,t,i,r){var c=e.doc,F=c.mode,V;t=bt(c,t);var q=tt(c,t.line),te=Nn(e,t.line,i),ie=new Bt(q.text,e.options.tabSize,te),ye;for(r&&(ye=[]);(r||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,V=kn(F,ie,te.state),r&&ye.push(new Rr(ie,V,wt(c.mode,te.state)));return r?ye:new Rr(ie,V,te.state)}function vr(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Fn(e,t,i,r,c,F,V){var q=i.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,ie=null,ye=new Bt(t,e.options.tabSize,r),we,ke=e.options.addModeClass&&[null];for(t==""&&vr(Ar(i,r.state),F);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(q=!1,V&&gr(e,t,r,ye.pos),ye.pos=t.length,we=null):we=vr(kn(i,ye,r.state,ke),F),ke){var De=ke[0].name;De&&(we="m-"+(we?De+" "+we:De))}if(!q||ie!=we){for(;te<ye.start;)te=Math.min(ye.start,te+5e3),c(te,ie);ie=we}ye.start=ye.pos}for(;te<ye.pos;){var Fe=Math.min(ye.pos,te+5e3);c(Fe,ie),te=Fe}}function Gn(e,t,i){for(var r,c,F=e.doc,V=i?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>V;--q){if(q<=F.first)return F.first;var te=tt(F,q-1),ie=te.stateAfter;if(ie&&(!i||q+(ie instanceof mr?ie.lookAhead:0)<=F.modeFrontier))return q;var ye=W(te.text,null,e.options.tabSize);(c==null||r>ye)&&(c=q-1,r=ye)}return c}function li(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var c=tt(e,r).stateAfter;if(c&&(!(c instanceof mr)||r+c.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var rr=!1,fn=!1;function zn(){rr=!0}function ui(){fn=!0}function Kn(e,t,i){this.marker=e,this.from=t,this.to=i}function $e(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Ot(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function Jt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function gt(e,t,i){var r;if(e)for(var c=0;c<e.length;++c){var F=e[c],V=F.marker,q=F.from==null||(V.inclusiveLeft?F.from<=t:F.from<t);if(q||F.from==t&&V.type=="bookmark"&&(!i||!F.marker.insertLeft)){var te=F.to==null||(V.inclusiveRight?F.to>=t:F.to>t);(r||(r=[])).push(new Kn(V,F.from,te?null:F.to))}}return r}function jt(e,t,i){var r;if(e)for(var c=0;c<e.length;++c){var F=e[c],V=F.marker,q=F.to==null||(V.inclusiveRight?F.to>=t:F.to>t);if(q||F.from==t&&V.type=="bookmark"&&(!i||F.marker.insertLeft)){var te=F.from==null||(V.inclusiveLeft?F.from<=t:F.from<t);(r||(r=[])).push(new Kn(V,te?null:F.from-t,F.to==null?null:F.to-t))}}return r}function Ht(e,t){if(t.full)return null;var i=qt(e,t.from.line)&&tt(e,t.from.line).markedSpans,r=qt(e,t.to.line)&&tt(e,t.to.line).markedSpans;if(!i&&!r)return null;var c=t.from.ch,F=t.to.ch,V=mt(t.from,t.to)==0,q=gt(i,c,V),te=jt(r,F,V),ie=t.text.length==1,ye=E(t.text).length+(ie?c:0);if(q)for(var we=0;we<q.length;++we){var ke=q[we];if(ke.to==null){var De=$e(te,ke.marker);De?ie&&(ke.to=De.to==null?null:De.to+ye):ke.to=c}}if(te)for(var Fe=0;Fe<te.length;++Fe){var je=te[Fe];if(je.to!=null&&(je.to+=ye),je.from==null){var Xe=$e(q,je.marker);Xe||(je.from=ye,ie&&(q||(q=[])).push(je))}else je.from+=ye,ie&&(q||(q=[])).push(je)}q&&(q=Wt(q)),te&&te!=q&&(te=Wt(te));var qe=[q];if(!ie){var st=t.text.length-2,et;if(st>0&&q)for(var lt=0;lt<q.length;++lt)q[lt].to==null&&(et||(et=[])).push(new Kn(q[lt].marker,null,null));for(var vt=0;vt<st;++vt)qe.push(et);qe.push(te)}return qe}function Wt(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Kt(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(De){if(De.markedSpans)for(var Fe=0;Fe<De.markedSpans.length;++Fe){var je=De.markedSpans[Fe].marker;je.readOnly&&(!r||oe(r,je)==-1)&&(r||(r=[])).push(je)}}),!r)return null;for(var c=[{from:t,to:i}],F=0;F<r.length;++F)for(var V=r[F],q=V.find(0),te=0;te<c.length;++te){var ie=c[te];if(mt(ie.to,q.from)<0||mt(ie.from,q.to)>0)continue;var ye=[te,1],we=mt(ie.from,q.from),ke=mt(ie.to,q.to);(we<0||!V.inclusiveLeft&&!we)&&ye.push({from:ie.from,to:q.from}),(ke>0||!V.inclusiveRight&&!ke)&&ye.push({from:q.to,to:ie.to}),c.splice.apply(c,ye),te+=ye.length-3}return c}function ir(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function pn(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Zn(e){return e.inclusiveLeft?-1:0}function Lr(e){return e.inclusiveRight?1:0}function Wr(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),c=t.find(),F=mt(r.from,c.from)||Zn(e)-Zn(t);if(F)return-F;var V=mt(r.to,c.to)||Lr(e)-Lr(t);return V||t.id-e.id}function ar(e,t){var i=fn&&e.markedSpans,r;if(i)for(var c=void 0,F=0;F<i.length;++F)c=i[F],c.marker.collapsed&&(t?c.from:c.to)==null&&(!r||Wr(r,c.marker)<0)&&(r=c.marker);return r}function sr(e){return ar(e,!0)}function or(e){return ar(e,!1)}function Gr(e,t){var i=fn&&e.markedSpans,r;if(i)for(var c=0;c<i.length;++c){var F=i[c];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!r||Wr(r,F.marker)<0)&&(r=F.marker)}return r}function Ui(e,t,i,r,c){var F=tt(e,t),V=fn&&F.markedSpans;if(V)for(var q=0;q<V.length;++q){var te=V[q];if(!te.marker.collapsed)continue;var ie=te.marker.find(0),ye=mt(ie.from,i)||Zn(te.marker)-Zn(c),we=mt(ie.to,r)||Lr(te.marker)-Lr(c);if(ye>=0&&we<=0||ye<=0&&we>=0)continue;if(ye<=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?mt(ie.to,i)>=0:mt(ie.to,i)>0)||ye>=0&&(te.marker.inclusiveRight&&c.inclusiveLeft?mt(ie.from,r)<=0:mt(ie.from,r)<0))return!0}}function Un(e){for(var t;t=sr(e);)e=t.find(-1,!0).line;return e}function Bi(e){for(var t;t=or(e);)e=t.find(1,!0).line;return e}function zr(e){for(var t,i;t=or(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function hi(e,t){var i=tt(e,t),r=Un(i);return i==r?t:yt(r)}function yr(e,t){if(t>e.lastLine())return t;var i=tt(e,t),r;if(!Qn(e,i))return t;for(;r=or(i);)i=r.find(1,!0).line;return yt(i)+1}function Qn(e,t){var i=fn&&t.markedSpans;if(i)for(var r=void 0,c=0;c<i.length;++c){if(r=i[c],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&ci(e,t,r))return!0}}function ci(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return ci(e,r.line,$e(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var c=void 0,F=0;F<t.markedSpans.length;++F)if(c=t.markedSpans[F],c.marker.collapsed&&!c.marker.widgetNode&&c.from==i.to&&(c.to==null||c.to!=i.from)&&(c.marker.inclusiveLeft||i.marker.inclusiveRight)&&ci(e,t,c))return!0}function Vn(e){e=Un(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var c=i.lines[r];if(c==e)break;t+=c.height}for(var F=i.parent;F;i=F,F=i.parent)for(var V=0;V<F.children.length;++V){var q=F.children[V];if(q==i)break;t+=q.height}return t}function di(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=sr(r);){var c=i.find(0,!0);r=c.from.line,t+=c.from.ch-c.to.ch}for(r=e;i=or(r);){var F=i.find(0,!0);t-=r.text.length-F.from.ch,r=F.to.line,t+=r.text.length-F.to.ch}return t}function ji(e){var t=e.display,i=e.doc;t.maxLine=tt(i,i.first),t.maxLineLength=di(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var c=di(r);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=r)})}var Ir=function(e,t,i){this.text=e,pn(this,t),this.height=i?i(this):1};Ir.prototype.lineNo=function(){return yt(this)},de(Ir);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ir(e),pn(e,i);var c=r?r(e):1;c!=e.height&&ft(e,c)}function ht(e){e.parent=null,ir(e)}var _t={},dt={};function It(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?dt:_t;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Nt(e,t){var i=f("span",null,null,n?"padding-right: .1px":null),r={pre:f("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 F=c?t.rest[c-1]:t.line,V=void 0;r.pos=0,r.addToken=Mt,xt(e.display.measure)&&(V=ze(F,e.doc.direction))&&(r.addToken=Sn(r.addToken,V)),r.map=[];var q=t!=e.display.externalMeasured&&yt(F);lr(F,r,Jn(e,F,q)),F.styleClasses&&(F.styleClasses.bgClass&&(r.bgClass=w(F.styleClasses.bgClass,r.bgClass||"")),F.styleClasses.textClass&&(r.textClass=w(F.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(nt(e.display.measure))),c==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var te=r.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=w(r.pre.className,r.textClass||"")),r}function Vt(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 Mt(e,t,i,r,c,F,V){if(!t)return;var q=e.splitSpaces?on(t,e.trailingSpace):t,te=e.cm.state.specialChars,ie=!1,ye;if(!te.test(t))e.col+=t.length,ye=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,ye),K&&z<9&&(ie=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var we=0;;){te.lastIndex=we;var ke=te.exec(t),De=ke?ke.index-we:t.length-we;if(De){var Fe=document.createTextNode(q.slice(we,we+De));K&&z<9?ye.appendChild(d("span",[Fe])):ye.appendChild(Fe),e.map.push(e.pos,e.pos+De,Fe),e.col+=De,e.pos+=De}if(!ke)break;we+=De+1;var je=void 0;if(ke[0]==" "){var Xe=e.cm.options.tabSize,qe=Xe-e.col%Xe;je=ye.appendChild(d("span",$(qe),"cm-tab")),je.setAttribute("role","presentation"),je.setAttribute("cm-text"," "),e.col+=qe}else ke[0]=="\r"||ke[0]==`
`?(je=ye.appendChild(d("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),je.setAttribute("cm-text",ke[0]),e.col+=1):(je=e.cm.options.specialCharPlaceholder(ke[0]),je.setAttribute("cm-text",ke[0]),K&&z<9?ye.appendChild(d("span",[je])):ye.appendChild(je),e.col+=1);e.map.push(e.pos,e.pos+1,je),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,i||r||c||ie||F||V){var st=i||"";r&&(st+=r),c&&(st+=c);var et=d("span",[ye],st,F);if(V)for(var lt in V)V.hasOwnProperty(lt)&&lt!="style"&&lt!="class"&&et.setAttribute(lt,V[lt]);return e.content.appendChild(et)}e.content.appendChild(ye)}function on(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",c=0;c<e.length;c++){var F=e.charAt(c);F==" "&&i&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(F="\xA0"),r+=F,i=F==" "}return r}function Sn(e,t){return function(i,r,c,F,V,q,te){c=c?c+" cm-force-border":"cm-force-border";for(var ie=i.pos,ye=ie+r.length;;){for(var we=void 0,ke=0;ke<t.length&&!(we=t[ke],we.to>ie&&we.from<=ie);ke++);if(we.to>=ye)return e(i,r,c,F,V,q,te);e(i,r.slice(0,we.to-ie),c,F,null,q,te),F=null,r=r.slice(we.to-ie),ie=we.to}}}function Dt(e,t,i,r){var c=!r&&i.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!r&&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 lr(e,t,i){var r=e.markedSpans,c=e.text,F=0;if(!r){for(var V=1;V<i.length;V+=2)t.addToken(t,c.slice(F,F=i[V]),It(i[V+1],t.cm.options));return}for(var q=c.length,te=0,ie=1,ye="",we,ke,De=0,Fe,je,Xe,qe,st;;){if(De==te){Fe=je=Xe=ke="",st=null,qe=null,De=Infinity;for(var et=[],lt=void 0,vt=0;vt<r.length;++vt){var ct=r[vt],Ct=ct.marker;if(Ct.type=="bookmark"&&ct.from==te&&Ct.widgetNode)et.push(Ct);else if(ct.from<=te&&(ct.to==null||ct.to>te||Ct.collapsed&&ct.to==te&&ct.from==te)){if(ct.to!=null&&ct.to!=te&&De>ct.to&&(De=ct.to,je=""),Ct.className&&(Fe+=" "+Ct.className),Ct.css&&(ke=(ke?ke+";":"")+Ct.css),Ct.startStyle&&ct.from==te&&(Xe+=" "+Ct.startStyle),Ct.endStyle&&ct.to==De&&(lt||(lt=[])).push(Ct.endStyle,ct.to),Ct.title&&((st||(st={})).title=Ct.title),Ct.attributes)for(var Xt in Ct.attributes)(st||(st={}))[Xt]=Ct.attributes[Xt];Ct.collapsed&&(!qe||Wr(qe.marker,Ct)<0)&&(qe=ct)}else ct.from>te&&De>ct.from&&(De=ct.from)}if(lt)for(var cn=0;cn<lt.length;cn+=2)lt[cn+1]==De&&(je+=" "+lt[cn]);if(!qe||qe.from==te)for(var en=0;en<et.length;++en)Dt(t,0,et[en]);if(qe&&(qe.from||0)==te){if(Dt(t,(qe.to==null?q+1:qe.to)-te,qe.marker,qe.from==null),qe.to==null)return;qe.to==te&&(qe=!1)}}if(te>=q)break;for(var Mn=Math.min(q,De);;){if(ye){var On=te+ye.length;if(!qe){var an=On>Mn?ye.slice(0,Mn-te):ye;t.addToken(t,an,we?we+Fe:Fe,Xe,te+an.length==De?je:"",ke,st)}if(On>=Mn){ye=ye.slice(Mn-te),te=Mn;break}te=On,Xe=""}ye=c.slice(F,F=i[ie++]),we=It(i[ie++],t.cm.options)}}}function Ft(e,t,i){this.line=t,this.rest=zr(t),this.size=this.rest?yt(E(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Qn(e,t)}function Cn(e,t,i){for(var r=[],c,F=t;F<i;F=c){var V=new Ft(e.doc,tt(e.doc,F),F);c=F+V.size,r.push(V)}return r}var yn=null;function Wn(e){yn?yn.ops.push(e):e.ownsGroup=yn={ops:[e],delayedCallbacks:[]}}function Lo(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var c=e.ops[r];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(i<t.length)}function Io(e,t){var i=e.ownsGroup;if(!i)return;try{Lo(i)}finally{yn=null,t(i)}}var fi=null;function mn(e,t){var i=it(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),c;yn?c=yn.delayedCallbacks:fi?c=fi:(c=fi=[],setTimeout(Do,0));for(var F=function(q){c.push(function(){return i[q].apply(null,r)})},V=0;V<i.length;++V)F(V)}function Do(){var e=fi;fi=null;for(var t=0;t<e.length;++t)e[t]()}function Ya(e,t,i,r){for(var c=0;c<t.changes.length;c++){var F=t.changes[c];F=="text"?Po(e,t):F=="gutter"?Ja(e,t,i,r):F=="class"?ha(e,t):F=="widget"&&Mo(e,t,r)}t.changes=null}function pi(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&z<8&&(e.node.style.zIndex=2)),e.node}function ko(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=pi(t);t.background=r.insertBefore(d("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Nt(e,t)}function Po(e,t){var i=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ha(e,t)):i&&(t.text.className=i)}function ha(e,t){ko(e,t),t.line.wrapClass?pi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ja(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var c=pi(t);t.gutterBackground=d("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var V=pi(t),q=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),V.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(d("div",$t(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var te=0;te<e.display.gutterSpecs.length;++te){var ie=e.display.gutterSpecs[te].className,ye=F.hasOwnProperty(ie)&&F[ie];ye&&q.appendChild(d("div",[ye],"CodeMirror-gutter-elt","left: "+r.gutterLeft[ie]+"px; width: "+r.gutterWidth[ie]+"px"))}}}function Mo(e,t,i){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),c=t.node.firstChild,F=void 0;c;c=F)F=c.nextSibling,r.test(c.className)&&t.node.removeChild(c);Za(e,t,i)}function No(e,t,i,r){var c=$a(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),ha(e,t),Ja(e,t,i,r),Za(e,t,r),t.node}function Za(e,t,i){if(Qa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)Qa(e,t.rest[r],t,i,!1)}function Qa(e,t,i,r,c){if(!t.widgets)return;for(var F=pi(i),V=0,q=t.widgets;V<q.length;++V){var te=q[V],ie=d("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Fo(te,ie,i,r),e.display.input.setUneditable(ie),c&&te.above?F.insertBefore(ie,i.gutter||i.text):F.appendChild(ie),mn(te,"redraw")}}function Fo(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var c=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(c-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function mi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,d("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function ur(e,t){for(var i=Te(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function ca(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,d("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function qn(e){return fe-e.display.nativeBarWidth}function Dr(e){return e.display.scroller.clientWidth-qn(e)-e.display.barWidth}function da(e){return e.display.scroller.clientHeight-qn(e)-e.display.barHeight}function Uo(e,t,i){var r=e.options.lineWrapping,c=r&&Dr(e);if(!t.measure.heights||r&&t.measure.width!=c){var F=t.measure.heights=[];if(r){t.measure.width=c;for(var V=t.text.firstChild.getClientRects(),q=0;q<V.length-1;q++){var te=V[q],ie=V[q+1];Math.abs(te.bottom-ie.bottom)>2&&F.push((te.bottom+ie.top)/2-i.top)}}F.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 r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var c=0;c<e.rest.length;c++)if(yt(e.rest[c])>i)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Bo(e,t){t=Un(t);var i=yt(t),r=e.display.externalMeasured=new Ft(e.doc,t,i);r.lineN=i;var c=r.built=Nt(e,r);return r.text=c.pre,T(e.display.lineMeasure,c.pre),r}function ts(e,t,i,r){return er(e,Kr(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Mr(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Kr(e,t){var i=yt(t),r=fa(e,i);r&&!r.text?r=null:r&&r.changes&&(Ya(e,r,i,ba(e)),e.curOp.forceUpdate=!0),r||(r=Bo(e,t));var c=es(r,t,i);return{line:t,view:r,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function er(e,t,i,r,c){t.before&&(i=-1);var F=i+(r||""),V;return t.cache.hasOwnProperty(F)?V=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Uo(e,t.view,t.rect),t.hasHeights=!0),V=Ho(e,t,i,r),V.bogus||(t.cache[F]=V)),{left:V.left,right:V.right,top:c?V.rtop:V.top,bottom:c?V.rbottom:V.bottom}}var ns={left:0,right:0,top:0,bottom:0};function rs(e,t,i){for(var r,c,F,V,q,te,ie=0;ie<e.length;ie+=3)if(q=e[ie],te=e[ie+1],t<q?(c=0,F=1,V="left"):t<te?(c=t-q,F=c+1):(ie==e.length-3||t==te&&e[ie+3]>t)&&(F=te-q,c=F-1,t>=te&&(V="right")),c!=null){if(r=e[ie+2],q==te&&i==(r.insertLeft?"left":"right")&&(V=i),i=="left"&&c==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)r=e[(ie-=3)+2],V="left";if(i=="right"&&c==te-q)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)r=e[(ie+=3)+2],V="right";break}return{node:r,start:c,end:F,collapse:V,coverStart:q,coverEnd:te}}function jo(e,t){var i=ns;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var c=e.length-1;c>=0&&!((i=e[c]).left!=i.right);c--);return i}function Ho(e,t,i,r){var c=rs(t.map,i,r),F=c.node,V=c.start,q=c.end,te=c.collapse,ie;if(F.nodeType==3){for(var ye=0;ye<4;ye++){for(;V&&_e(t.line.text.charAt(c.coverStart+V));)--V;for(;c.coverStart+q<c.coverEnd&&_e(t.line.text.charAt(c.coverStart+q));)++q;if(K&&z<9&&V==0&&q==c.coverEnd-c.coverStart?ie=F.parentNode.getBoundingClientRect():ie=jo(b(F,V,q).getClientRects(),r),ie.left||ie.right||V==0)break;q=V,V=V-1,te="right"}K&&z<11&&(ie=Wo(e.display.measure,ie))}else{V>0&&(te=r="right");var we;e.options.lineWrapping&&(we=F.getClientRects()).length>1?ie=we[r=="right"?we.length-1:0]:ie=F.getBoundingClientRect()}if(K&&z<9&&!V&&(!ie||!ie.left&&!ie.right)){var ke=F.parentNode.getClientRects()[0];ke?ie={left:ke.left,right:ke.left+Xr(e.display),top:ke.top,bottom:ke.bottom}:ie=ns}for(var De=ie.top-t.rect.top,Fe=ie.bottom-t.rect.top,je=(De+Fe)/2,Xe=t.view.measure.heights,qe=0;qe<Xe.length-1&&!(je<Xe[qe]);qe++);var st=qe?Xe[qe-1]:0,et=Xe[qe],lt={left:(te=="right"?ie.right:ie.left)-t.rect.left,right:(te=="left"?ie.left:ie.right)-t.rect.left,top:st,bottom:et};return!ie.left&&!ie.right&&(lt.bogus=!0),e.options.singleCursorHeightPerLine||(lt.rtop=De,lt.rbottom=Fe),lt}function Wo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!rt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function is(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function as(e){e.display.externalMeasure=null,C(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)is(e.display.view[t])}function gi(e){as(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ss(){return y&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function os(){return y&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=mi(e.widgets[i]));return t}function Wi(e,t,i,r,c){if(!c){var F=pa(t);i.top+=F,i.bottom+=F}if(r=="line")return i;r||(r="local");var V=Vn(t);if(r=="local"?V+=Hi(e.display):V-=e.display.viewOffset,r=="page"||r=="window"){var q=e.display.lineSpace.getBoundingClientRect();V+=q.top+(r=="window"?0:os());var te=q.left+(r=="window"?0:ss());i.left+=te,i.right+=te}return i.top+=V,i.bottom+=V,i}function ls(e,t,i){if(i=="div")return t;var r=t.left,c=t.top;if(i=="page")r-=ss(),c-=os();else if(i=="local"||!i){var F=e.display.sizer.getBoundingClientRect();r+=F.left,c+=F.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:r-V.left,top:c-V.top}}function ma(e,t,i,r,c){return r||(r=tt(e.doc,t.line)),Wi(e,r,ts(e,r,t.ch,c),i)}function Xn(e,t,i,r,c,F){r=r||tt(e.doc,t.line),c||(c=Kr(e,r));function V(Fe,je){var Xe=er(e,c,Fe,je?"right":"left",F);return je?Xe.left=Xe.right:Xe.right=Xe.left,Wi(e,r,Xe,i)}var q=ze(r,e.doc.direction),te=t.ch,ie=t.sticky;if(te>=r.text.length?(te=r.text.length,ie="before"):te<=0&&(te=0,ie="after"),!q)return V(ie=="before"?te-1:te,ie=="before");function ye(Fe,je,Xe){var qe=q[je],st=qe.level==1;return V(Xe?Fe-1:Fe,st!=Xe)}var we=Be(q,te,ie),ke=He,De=ye(te,we,ie=="before");return ke!=null&&(De.other=ye(te,ke,ie!="before")),De}function us(e,t){var i=0;t=bt(e.doc,t),e.options.lineWrapping||(i=Xr(e.display)*t.ch);var r=tt(e.doc,t.line),c=Vn(r)+Hi(e.display);return{left:i,right:i,top:c,bottom:c+r.height}}function ga(e,t,i,r,c){var F=Ge(e,t,i);return F.xRel=c,r&&(F.outside=r),F}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var c=Rt(r,i),F=r.first+r.size-1;if(c>F)return ga(r.first+r.size-1,tt(r,F).text.length,null,1,1);t<0&&(t=0);for(var V=tt(r,c);;){var q=Go(e,V,c,t,i),te=Gr(V,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var ie=te.find(1);if(ie.line==c)return ie;V=tt(r,c=ie.line)}}function hs(e,t,i,r){r-=pa(t);var c=t.text.length,F=Pe(function(V){return er(e,i,V-1).bottom<=r},c,0);return c=Pe(function(V){return er(e,i,V).top>r},F,c),{begin:F,end:c}}function cs(e,t,i,r){i||(i=Kr(e,t));var c=Wi(e,t,er(e,i,r),"line").top;return hs(e,t,i,c)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Go(e,t,i,r,c){c-=Vn(t);var F=Kr(e,t),V=pa(t),q=0,te=t.text.length,ie=!0,ye=ze(t,e.doc.direction);if(ye){var we=(e.options.lineWrapping?Ko:zo)(e,t,i,F,ye,r,c);ie=we.level!=1,q=ie?we.from:we.to-1,te=ie?we.to:we.from-1}var ke=null,De=null,Fe=Pe(function(vt){var ct=er(e,F,vt);return ct.top+=V,ct.bottom+=V,ya(ct,r,c,!1)?(ct.top<=c&&ct.left<=r&&(ke=vt,De=ct),!0):!1},q,te),je,Xe,qe=!1;if(De){var st=r-De.left<De.right-r,et=st==ie;Fe=ke+(et?0:1),Xe=et?"after":"before",je=st?De.left:De.right}else{!ie&&(Fe==te||Fe==q)&&Fe++,Xe=Fe==0?"after":Fe==t.text.length?"before":er(e,F,Fe-(ie?1:0)).bottom+V<=c==ie?"after":"before";var lt=Xn(e,Ge(i,Fe,Xe),"line",t,F);je=lt.left,qe=c<lt.top?-1:c>=lt.bottom?1:0}return Fe=Se(t.text,Fe,1),ga(i,Fe,Xe,qe,r-je)}function zo(e,t,i,r,c,F,V){var q=Pe(function(we){var ke=c[we],De=ke.level!=1;return ya(Xn(e,Ge(i,De?ke.to:ke.from,De?"before":"after"),"line",t,r),F,V,!0)},0,c.length-1),te=c[q];if(q>0){var ie=te.level!=1,ye=Xn(e,Ge(i,ie?te.from:te.to,ie?"after":"before"),"line",t,r);ya(ye,F,V,!0)&&ye.top>V&&(te=c[q-1])}return te}function Ko(e,t,i,r,c,F,V){var q=hs(e,t,r,V),te=q.begin,ie=q.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var ye=null,we=null,ke=0;ke<c.length;ke++){var De=c[ke];if(De.from>=ie||De.to<=te)continue;var Fe=De.level!=1,je=er(e,r,Fe?Math.min(ie,De.to)-1:Math.max(te,De.from)).right,Xe=je<F?F-je+1e9:je-F;(!ye||we>Xe)&&(ye=De,we=Xe)}return ye||(ye=c[c.length-1]),ye.from<te&&(ye={from:te,to:ye.to,level:ye.level}),ye.to>ie&&(ye={from:ye.from,to:ie,level:ye.level}),ye}var kr;function Vr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(kr==null){kr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)kr.appendChild(document.createTextNode("x")),kr.appendChild(d("br"));kr.appendChild(document.createTextNode("x"))}T(e.measure,kr);var i=kr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),C(e.measure),i||1}function Xr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),i=d("pre",[t],"CodeMirror-line-like");T(e.measure,i);var r=t.getBoundingClientRect(),c=(r.right-r.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function ba(e){for(var t=e.display,i={},r={},c=t.gutters.clientLeft,F=t.gutters.firstChild,V=0;F;F=F.nextSibling,++V){var q=e.display.gutterSpecs[V].className;i[q]=F.offsetLeft+F.clientLeft+c,r[q]=F.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ds(e){var t=Vr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Xr(e.display)-3);return function(c){if(Qn(e.doc,c))return 0;var F=0;if(c.widgets)for(var V=0;V<c.widgets.length;V++)c.widgets[V].height&&(F+=c.widgets[V].height);return i?F+(Math.ceil(c.text.length/r)||1)*t:F+t}}function Ea(e){var t=e.doc,i=ds(e);t.iter(function(r){var c=i(r);c!=r.height&&ft(r,c)})}function Pr(e,t,i,r){var c=e.display;if(!i&&Te(t).getAttribute("cm-not-content")=="true")return null;var F,V,q=c.lineSpace.getBoundingClientRect();try{F=t.clientX-q.left,V=t.clientY-q.top}catch(we){return null}var te=va(e,F,V),ie;if(r&&te.xRel>0&&(ie=tt(e.doc,te.line).text).length==te.ch){var ye=W(ie,ie.length,e.options.tabSize)-ie.length;te=Ge(te.line,Math.max(0,Math.round((F-qa(e.display).left)/Xr(e.display))-ye))}return te}function Mr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function An(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var c=e.display;if(r&&i<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)fn&&hi(e.doc,t)<c.viewTo&&_r(e);else if(i<=c.viewFrom)fn&&yr(e.doc,i+r)>c.viewFrom?_r(e):(c.viewFrom+=r,c.viewTo+=r);else if(t<=c.viewFrom&&i>=c.viewTo)_r(e);else if(t<=c.viewFrom){var F=Gi(e,i,i+r,1);F?(c.view=c.view.slice(F.index),c.viewFrom=F.lineN,c.viewTo+=r):_r(e)}else if(i>=c.viewTo){var V=Gi(e,t,t,-1);V?(c.view=c.view.slice(0,V.index),c.viewTo=V.lineN):_r(e)}else{var q=Gi(e,t,t,-1),te=Gi(e,i,i+r,1);q&&te?(c.view=c.view.slice(0,q.index).concat(Cn(e,q.lineN,te.lineN)).concat(c.view.slice(te.index)),c.viewTo+=r):_r(e)}var ie=c.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=r:t<ie.lineN+ie.size&&(c.externalMeasured=null))}function br(e,t,i){e.curOp.viewChanged=!0;var r=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var F=r.view[Mr(e,t)];if(F.node==null)return;var V=F.changes||(F.changes=[]);oe(V,i)==-1&&V.push(i)}function _r(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,i,r){var c=Mr(e,t),F,V=e.display.view;if(!fn||i==e.doc.first+e.doc.size)return{index:c,lineN:i};for(var q=e.display.viewFrom,te=0;te<c;te++)q+=V[te].size;if(q!=t){if(r>0){if(c==V.length-1)return null;F=q+V[c].size-t,c++}else F=q-t;t+=F,i+=F}for(;hi(e.doc,i)!=i;){if(c==(r<0?0:V.length-1))return null;i+=r*V[c-(r<0?1:0)].size,c+=r}return{index:c,lineN:i}}function Vo(e,t,i){var r=e.display,c=r.view;c.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Cn(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Cn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Mr(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Cn(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,Mr(e,i)))),r.viewTo=i}function fs(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var c=t[r];!c.hidden&&(!c.node||c.changes)&&++i}return i}function vi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ps(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},c=r.cursors=document.createDocumentFragment(),F=r.selection=document.createDocumentFragment(),V=0;V<i.sel.ranges.length;V++){if(!t&&V==i.sel.primIndex)continue;var q=i.sel.ranges[V];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&ms(e,q.head,c),te||Xo(e,q,F)}return r}function ms(e,t,i){var r=Xn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=i.appendChild(d("div","\xA0","CodeMirror-cursor"));if(c.style.left=r.left+"px",c.style.top=r.top+"px",c.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var F=i.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=r.other.left+"px",F.style.top=r.other.top+"px",F.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function zi(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,i){var r=e.display,c=e.doc,F=document.createDocumentFragment(),V=qa(e.display),q=V.left,te=Math.max(r.sizerWidth,Dr(e)-r.sizer.offsetLeft)-V.right,ie=c.direction=="ltr";function ye(et,lt,vt,ct){lt<0&&(lt=0),lt=Math.round(lt),ct=Math.round(ct),F.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+et+`px;
top: `+lt+"px; width: "+(vt==null?te-et:vt)+`px;
height: `+(ct-lt)+"px"))}function we(et,lt,vt){var ct=tt(c,et),Ct=ct.text.length,Xt,cn;function en(an,Ln){return ma(e,Ge(et,an),"div",ct,Ln)}function Mn(an,Ln,gn){var ln=cs(e,ct,null,an),sn=Ln=="ltr"==(gn=="after")?"left":"right",tn=gn=="after"?ln.begin:ln.end-(/\s/.test(ct.text.charAt(ln.end-1))?2:1);return en(tn,sn)[sn]}var On=ze(ct,c.direction);return Ue(On,lt||0,vt==null?Ct:vt,function(an,Ln,gn,ln){var sn=gn=="ltr",tn=en(an,sn?"left":"right"),In=en(Ln-1,sn?"right":"left"),si=lt==null&&an==0,Cr=vt==null&&Ln==Ct,_n=ln==0,tr=!On||ln==On.length-1;if(In.top-tn.top<=3){var dn=(ie?si:Cr)&&_n,Va=(ie?Cr:si)&&tr,cr=dn?q:(sn?tn:In).left,jr=Va?te:(sn?In:tn).right;ye(cr,tn.top,jr-cr,tn.bottom)}else{var Hr,xn,oi,Xa;sn?(Hr=ie&&si&&_n?q:tn.left,xn=ie?te:Mn(an,gn,"before"),oi=ie?q:Mn(Ln,gn,"after"),Xa=ie&&Cr&&tr?te:In.right):(Hr=ie?Mn(an,gn,"before"):q,xn=!ie&&si&&_n?te:tn.right,oi=!ie&&Cr&&tr?q:In.left,Xa=ie?Mn(Ln,gn,"after"):te),ye(Hr,tn.top,xn-Hr,tn.bottom),tn.bottom<In.top&&ye(q,tn.bottom,null,In.top),ye(oi,In.top,Xa-oi,In.bottom)}(!Xt||zi(tn,Xt)<0)&&(Xt=tn),zi(In,Xt)<0&&(Xt=In),(!cn||zi(tn,cn)<0)&&(cn=tn),zi(In,cn)<0&&(cn=In)}),{start:Xt,end:cn}}var ke=t.from(),De=t.to();if(ke.line==De.line)we(ke.line,ke.ch,De.ch);else{var Fe=tt(c,ke.line),je=tt(c,De.line),Xe=Un(Fe)==Un(je),qe=we(ke.line,ke.ch,Xe?Fe.text.length+1:null).end,st=we(De.line,Xe?0:null,De.ch).start;Xe&&(qe.top<st.top-2?(ye(qe.right,qe.top,null,qe.bottom),ye(q,st.top,st.left,st.bottom)):ye(qe.right,qe.top,st.left-qe.right,qe.bottom)),qe.bottom<st.top&&ye(q,qe.bottom,null,st.top)}i.appendChild(F)}function xa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Yr(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,Yr(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ce(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Yr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ce(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 Ki(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var c=t.view[r],F=e.options.lineWrapping,V=void 0,q=0;if(c.hidden)continue;if(K&&z<8){var te=c.node.offsetTop+c.node.offsetHeight;V=te-i,i=te}else{var ie=c.node.getBoundingClientRect();V=ie.bottom-ie.top,!F&&c.text.firstChild&&(q=c.text.firstChild.getBoundingClientRect().right-ie.left-1)}var ye=c.line.height-V;if((ye>.005||ye<-.005)&&(ft(c.line,V),ys(c.line),c.rest))for(var we=0;we<c.rest.length;we++)ys(c.rest[we]);if(q>e.display.sizerWidth){var ke=Math.ceil(q/Xr(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Vi(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Hi(e));var c=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,F=Rt(t,r),V=Rt(t,c);if(i&&i.ensure){var q=i.ensure.from.line,te=i.ensure.to.line;q<F?(F=q,V=Rt(t,Vn(tt(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=V&&(F=Rt(t,Vn(tt(t,te))-e.wrapper.clientHeight),V=te)}return{from:F,to:Math.max(V,F+1)}}function Yo(e,t){if(ee(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),c=null;if(t.top+r.top<0?c=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!h){var F=d("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Hi(e.display))+`px;
height: `+(t.bottom-t.top+qn(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(c),e.display.lineSpace.removeChild(F)}}function $o(e,t,i,r){r==null&&(r=0);var c;!e.options.lineWrapping&&t==i&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var V=!1,q=Xn(e,t),te=!i||i==t?q:Xn(e,i);c={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-r,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+r};var ie=wa(e,c),ye=e.doc.scrollTop,we=e.doc.scrollLeft;if(ie.scrollTop!=null&&(bi(e,ie.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(V=!0)),ie.scrollLeft!=null&&(Nr(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&(V=!0)),!V)break}return c}function Jo(e,t){var i=wa(e,t);i.scrollTop!=null&&bi(e,i.scrollTop),i.scrollLeft!=null&&Nr(e,i.scrollLeft)}function wa(e,t){var i=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,F=da(e),V={};t.bottom-t.top>F&&(t.bottom=t.top+F);var q=e.doc.height+ca(i),te=t.top<r,ie=t.bottom>q-r;if(t.top<c)V.scrollTop=te?0:t.top;else if(t.bottom>c+F){var ye=Math.min(t.top,(ie?q:t.bottom)-F);ye!=c&&(V.scrollTop=ye)}var we=e.options.fixedGutter?0:i.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-we,De=Dr(e)-i.gutters.offsetWidth,Fe=t.right-t.left>De;return Fe&&(t.right=t.left+De),t.left<10?V.scrollLeft=0:t.left<ke?V.scrollLeft=Math.max(0,t.left+we-(Fe?0:10)):t.right>De+ke-3&&(V.scrollLeft=t.right+(Fe?0:10)-De),V}function Sa(e,t){if(t==null)return;Xi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function $r(e){Xi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function yi(e,t,i){(t!=null||i!=null)&&Xi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zo(e,t){Xi(e),e.curOp.scrollToPos=t}function Xi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=us(e,t.from),r=us(e,t.to);bs(e,i,r,t.margin)}}function bs(e,t,i,r){var c=wa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});yi(e,c.scrollLeft,c.scrollTop)}function bi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Aa(e,{top:t}),_s(e,t,!0),N&&Aa(e),xi(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 Nr(e,t,i,r){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)&&!r)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function _i(e){var t=e.display,i=t.gutters.offsetWidth,r=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:r,scrollHeight:r+qn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fr=function(e,t,i){this.cm=i;var r=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");r.tabIndex=c.tabIndex=-1,e(r),e(c),Me(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Me(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&z<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var c=e.viewHeight-(t?r: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?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Fr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fr.prototype.zeroWidthHack=function(){var e=s&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},Fr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var c=e.getBoundingClientRect(),F=i=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Fr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ei=function(){};Ei.prototype.update=function(){return{bottom:0,right:0}},Ei.prototype.setScrollLeft=function(){},Ei.prototype.setScrollTop=function(){},Ei.prototype.clear=function(){};function Jr(e,t){t||(t=_i(e));var i=e.display.barWidth,r=e.display.barHeight;Es(e,t);for(var c=0;c<4&&i!=e.display.barWidth||r!=e.display.barHeight;c++)i!=e.display.barWidth&&e.options.lineWrapping&&Ki(e),Es(e,_i(e)),i=e.display.barWidth,r=e.display.barHeight}function Es(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var xs={native:Fr,null:Ei};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),Me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Nr(e,t):bi(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function Ur(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},Wn(e.curOp)}function Br(e){var t=e.curOp;t&&Io(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;qo(i)})}function qo(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var c=0;c<t.length;c++)nl(t[c]);for(var F=0;F<t.length;F++)rl(t[F]);for(var V=0;V<t.length;V++)il(t[V])}function el(e){var t=e.cm,i=t.display;sl(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ki(t),e.barMeasure=_i(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+qn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Dr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Jr(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&xa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&gs(e.cm)}function il(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&ws(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&_s(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$o(t,bt(r,e.scrollToPos.from),bt(r,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,c)}var F=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(F)for(var q=0;q<F.length;++q)F[q].lines.length||ce(F[q],"hide");if(V)for(var te=0;te<V.length;++te)V[te].lines.length&&ce(V[te],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Pn(e,t){if(e.curOp)return t();Ur(e);try{return t()}finally{Br(e)}}function un(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ur(e);try{return t.apply(e,arguments)}finally{Br(e)}}}function En(e){return function(){if(this.curOp)return e.apply(this,arguments);Ur(this);try{return e.apply(this,arguments)}finally{Br(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ur(t);try{return e.apply(this,arguments)}finally{Br(t)}}}function xi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Nn(e,t.highlightFrontier),c=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(r.line>=e.display.viewFrom){var V=F.styles,q=F.text.length>e.options.maxHighlightLength?wt(t.mode,r.state):null,te=wn(e,F,r,!0);q&&(r.state=q),F.styles=te.styles;var ie=F.styleClasses,ye=te.classes;ye?F.styleClasses=ye:ie&&(F.styleClasses=null);for(var we=!V||V.length!=F.styles.length||ie!=ye&&(!ie||!ye||ie.bgClass!=ye.bgClass||ie.textClass!=ye.textClass),ke=0;!we&&ke<V.length;++ke)we=V[ke]!=F.styles[ke];we&&c.push(r.line),F.stateAfter=r.save(),r.nextLine()}else F.text.length<=e.options.maxHighlightLength&&gr(e,F.text,r),F.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return xi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),c.length&&Pn(e,function(){for(var F=0;F<c.length;F++)br(e,c[F],"text")})}var Yi=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Vi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Dr(e),this.force=i,this.dims=ba(e),this.events=[]};Yi.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ce.apply(null,this.events[e])};function sl(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=qn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=qn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=j();if(!t||!_(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ca(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return _r(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&fs(e)==0)return!1;Cs(e)&&(_r(e),t.dims=ba(e));var c=r.first+r.size,F=Math.max(t.visible.from-e.options.viewportMargin,r.first),V=Math.min(c,t.visible.to+e.options.viewportMargin);i.viewFrom<F&&F-i.viewFrom<20&&(F=Math.max(r.first,i.viewFrom)),i.viewTo>V&&i.viewTo-V<20&&(V=Math.min(c,i.viewTo)),fn&&(F=hi(e.doc,F),V=yr(e.doc,V));var q=F!=i.viewFrom||V!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vo(e,F,V),i.viewOffset=Vn(tt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var te=fs(e);if(!q&&te==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=ol(e);return te>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),te>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(ie),C(i.cursorDiv),C(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,q&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,xi(e,400)),i.updateLineNumbers=null,!0}function ws(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Dr(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 r&&(t.visible=Vi(e.display,e.doc,i));if(!Ca(e,t))break;Ki(e);var c=_i(e);vi(e),Jr(e,c),Oa(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 Yi(e,t);if(Ca(e,i)){Ki(e),ws(e,i);var r=_i(e);vi(e),Jr(e,r),Oa(e,r),i.finish()}}function ul(e,t,i){var r=e.display,c=e.options.lineNumbers,F=r.lineDiv,V=F.firstChild;function q(Fe){var je=Fe.nextSibling;return n&&s&&e.display.currentWheelTarget==Fe?Fe.style.display="none":Fe.parentNode.removeChild(Fe),je}for(var te=r.view,ie=r.viewFrom,ye=0;ye<te.length;ye++){var we=te[ye];if(!we.hidden)if(!we.node||we.node.parentNode!=F){var ke=No(e,we,ie,i);F.insertBefore(ke,V)}else{for(;V!=we.node;)V=q(V);var De=c&&t!=null&&t<=ie&&we.lineNumber;we.changes&&(oe(we.changes,"gutter")>-1&&(De=!1),Ya(e,we,ie,i)),De&&(C(we.lineNumber),we.lineNumber.appendChild(document.createTextNode($t(e.options,ie)))),V=we.node.nextSibling}ie+=we.size}for(;V;)V=q(V)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(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+qn(e)+"px"}function Ss(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,F=r+"px",V=0;V<i.length;V++)if(!i[V].hidden){e.options.fixedGutter&&(i[V].gutter&&(i[V].gutter.style.left=F),i[V].gutterBackground&&(i[V].gutterBackground.style.left=F));var q=i[V].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=r+c+"px")}function Cs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=$t(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var c=r.measure.appendChild(d("div",[d("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=c.firstChild.offsetWidth,V=c.offsetWidth-F;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(F,r.lineGutter.offsetWidth-V)+1,r.lineNumWidth=r.lineNumInnerWidth+V,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ra(e.display),!0}return!1}function La(e,t){for(var i=[],r=!1,c=0;c<e.length;c++){var F=e[c],V=null;if(typeof F!="string"&&(V=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:F,style:V})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function As(e){var t=e.gutters,i=e.gutterSpecs;C(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var c=i[r],F=c.className,V=c.style,q=t.appendChild(d("div",null,"CodeMirror-gutter "+F));V&&(q.style.cssText=V),F=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ra(e)}function Ti(e){As(e.display),An(e),Ss(e)}function hl(e,t,i,r){var c=this;this.input=i,c.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=f("div",null,"CodeMirror-code"),c.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=d("div",null,"CodeMirror-cursors"),c.measure=d("div",null,"CodeMirror-measure"),c.lineMeasure=d("div",null,"CodeMirror-measure"),c.lineSpace=f("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var F=f("div",[c.lineSpace],"CodeMirror-lines");c.mover=d("div",[F],null,"position: relative"),c.sizer=d("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=d("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),c.gutters=d("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=d("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=d("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),K&&z<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!n&&!(N&&u)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=La(r.gutters,r.lineNumbers),As(c),i.init(c)}var $i=0,Bn=null;K?Bn=-.53:N?Bn=15:y?Bn=-.7:g&&(Bn=-1/3);function Rs(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Rs(e);return t.x*=Bn,t.y*=Bn,t}function Os(e,t){var i=Rs(t),r=i.x,c=i.y,F=e.display,V=F.scroller,q=V.scrollWidth>V.clientWidth,te=V.scrollHeight>V.clientHeight;if(!(r&&q||c&&te))return;if(c&&s&&n){e:for(var ie=t.target,ye=F.view;ie!=V;ie=ie.parentNode)for(var we=0;we<ye.length;we++)if(ye[we].node==ie){e.display.currentWheelTarget=ie;break e}}if(r&&!N&&!m&&Bn!=null){c&&te&&bi(e,Math.max(0,V.scrollTop+c*Bn)),Nr(e,Math.max(0,V.scrollLeft+r*Bn)),(!c||c&&te)&&re(t),F.wheelStartX=null;return}if(c&&Bn!=null){var ke=c*Bn,De=e.doc.scrollTop,Fe=De+F.wrapper.clientHeight;ke<0?De=Math.max(0,De+ke-50):Fe=Math.min(e.doc.height,Fe+ke+50),Aa(e,{top:De,bottom:Fe})}$i<20&&(F.wheelStartX==null?(F.wheelStartX=V.scrollLeft,F.wheelStartY=V.scrollTop,F.wheelDX=r,F.wheelDY=c,setTimeout(function(){if(F.wheelStartX==null)return;var je=V.scrollLeft-F.wheelStartX,Xe=V.scrollTop-F.wheelStartY,qe=Xe&&F.wheelDY&&Xe/F.wheelDY||je&&F.wheelDX&&je/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!qe)return;Bn=(Bn*$i+qe)/($i+1),++$i},200)):(F.wheelDX+=r,F.wheelDY+=c))}var jn=function(e,t){this.ranges=e,this.primIndex=t};jn.prototype.primary=function(){return this.ranges[this.primIndex]},jn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!nr(i.anchor,r.anchor)||!nr(i.head,r.head))return!1}return!0},jn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ut(dr(this.ranges[t].anchor),dr(this.ranges[t].head));return new jn(e,this.primIndex)},jn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},jn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(mt(t,r.from())>=0&&mt(e,r.to())<=0)return i}return-1};var Ut=function(e,t){this.anchor=e,this.head=t};Ut.prototype.from=function(){return Hn(this.anchor,this.head)},Ut.prototype.to=function(){return fr(this.anchor,this.head)},Ut.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yn(e,t,i){var r=e&&e.options.selectionsMayTouch,c=t[i];t.sort(function(ke,De){return mt(ke.from(),De.from())}),i=oe(t,c);for(var F=1;F<t.length;F++){var V=t[F],q=t[F-1],te=mt(q.to(),V.from());if(r&&!V.empty()?te>0:te>=0){var ie=Hn(q.from(),V.from()),ye=fr(q.to(),V.to()),we=q.empty()?V.from()==V.head:q.from()==q.head;F<=i&&--i,t.splice(--F,2,new Ut(we?ye:ie,we?ie:ye))}}return new jn(t,i)}function Er(e,t){return new jn([new Ut(e,t||e)],0)}function xr(e){return e.text?Ge(e.from.line+e.text.length-1,E(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(mt(e,t.from)<0)return e;if(mt(e,t.to)<=0)return xr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=xr(t).ch-t.to.ch),Ge(i,r)}function Ia(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var c=e.sel.ranges[r];i.push(new Ut(Ls(c.anchor,t),Ls(c.head,t)))}return Yn(e.cm,i,e.sel.primIndex)}function Is(e,t,i){return e.line==t.line?Ge(i.line,e.ch-t.ch+i.ch):Ge(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var r=[],c=Ge(e.first,0),F=c,V=0;V<t.length;V++){var q=t[V],te=Is(q.from,c,F),ie=Is(xr(q),c,F);if(c=q.to,F=ie,i=="around"){var ye=e.sel.ranges[V],we=mt(ye.head,ye.anchor)<0;r[V]=new Ut(we?ie:te,we?te:ie)}else r[V]=new Ut(te,te)}return new jn(r,e.sel.primIndex)}function Da(e){e.doc.mode=Yt(e.options,e.doc.modeOption),wi(e)}function wi(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,xi(e,100),e.state.modeGen++,e.curOp&&An(e)}function Ds(e,t){return t.from.ch==0&&t.to.ch==0&&E(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ka(e,t,i,r){function c(st){return i?i[st]:null}function F(st,et,lt){ua(st,et,lt,r),mn(st,"change",st,t)}function V(st,et){for(var lt=[],vt=st;vt<et;++vt)lt.push(new Ir(ie[vt],c(vt),r));return lt}var q=t.from,te=t.to,ie=t.text,ye=tt(e,q.line),we=tt(e,te.line),ke=E(ie),De=c(ie.length-1),Fe=te.line-q.line;if(t.full)e.insert(0,V(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(Ds(e,t)){var je=V(0,ie.length-1);F(we,we.text,De),Fe&&e.remove(q.line,Fe),je.length&&e.insert(q.line,je)}else if(ye==we)if(ie.length==1)F(ye,ye.text.slice(0,q.ch)+ke+ye.text.slice(te.ch),De);else{var Xe=V(1,ie.length-1);Xe.push(new Ir(ke+ye.text.slice(te.ch),De,r)),F(ye,ye.text.slice(0,q.ch)+ie[0],c(0)),e.insert(q.line+1,Xe)}else if(ie.length==1)F(ye,ye.text.slice(0,q.ch)+ie[0]+we.text.slice(te.ch),c(0)),e.remove(q.line+1,Fe);else{F(ye,ye.text.slice(0,q.ch)+ie[0],c(0)),F(we,ke+we.text.slice(te.ch),De);var qe=V(1,ie.length-1);Fe>1&&e.remove(q.line+1,Fe-1),e.insert(q.line+1,qe)}mn(e,"change",e,t)}function Tr(e,t,i){function r(c,F,V){if(c.linked)for(var q=0;q<c.linked.length;++q){var te=c.linked[q];if(te.doc==F)continue;var ie=V&&te.sharedHist;if(i&&!ie)continue;t(te.doc,ie),r(te.doc,c,ie)}}r(e,null,!0)}function ks(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Da(e),Ps(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,An(e)}function Ps(e){(e.doc.direction=="rtl"?U:A)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Pn(e,function(){Ps(e),An(e)})}function Ji(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Pa(e,t){var i={from:dr(t.from),to:xr(t),text:At(e,t.from,t.to)};return Fs(e,i,t.from.line,t.to.line+1),Tr(e,function(r){return Fs(r,i,t.from.line,t.to.line+1)},!0),i}function Ms(e){for(;e.length;){var t=E(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ms(e.done),E(e.done);if(e.done.length&&!E(e.done).ranges)return E(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),E(e.done)}function Ns(e,t,i,r){var c=e.history;c.undone.length=0;var F=+new Date,V,q;if((c.lastOp==r||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(c,c.lastOp==r)))q=E(V.changes),mt(t.from,t.to)==0&&mt(t.from,q.to)==0?q.to=xr(t):V.changes.push(Pa(e,t));else{var te=E(c.done);for((!te||!te.ranges)&&Zi(e.sel,c.done),V={changes:[Pa(e,t)],generation:c.generation},c.done.push(V);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=F,c.lastOp=c.lastSelOp=r,c.lastOrigin=c.lastSelOrigin=t.origin,q||ce(e,"historyAdded")}function ml(e,t,i,r){var c=t.charAt(0);return c=="*"||c=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var c=e.history,F=r&&r.origin;i==c.lastSelOp||F&&c.lastSelOrigin==F&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==F||ml(e,F,E(c.done),t))?c.done[c.done.length-1]=t:Zi(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=F,c.lastSelOp=i,r&&r.clearRedo!==!1&&Ms(c.undone)}function Zi(e,t){var i=E(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fs(e,t,i,r){var c=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(V){V.markedSpans&&((c||(c=t["spans_"+e.id]={}))[F]=V.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],c=0;c<t.text.length;++c)r.push(vl(i[c]));return r}function Us(e,t){var i=yl(e,t),r=Ht(e,t);if(!i)return r;if(!r)return i;for(var c=0;c<i.length;++c){var F=i[c],V=r[c];if(F&&V){e:for(var q=0;q<V.length;++q){for(var te=V[q],ie=0;ie<F.length;++ie)if(F[ie].marker==te.marker)continue e;F.push(te)}}else V&&(i[c]=V)}return i}function Zr(e,t,i){for(var r=[],c=0;c<e.length;++c){var F=e[c];if(F.ranges){r.push(i?jn.prototype.deepCopy.call(F):F);continue}var V=F.changes,q=[];r.push({changes:q});for(var te=0;te<V.length;++te){var ie=V[te],ye=void 0;if(q.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var we in ie)(ye=we.match(/^spans_(\d+)$/))&&(oe(t,Number(ye[1]))>-1&&(E(q)[we]=ie[we],delete ie[we]))}}return r}function Ma(e,t,i,r){if(r){var c=e.anchor;if(i){var F=mt(t,c)<0;F!=mt(i,c)<0?(c=t,t=i):F!=mt(t,i)<0&&(t=i)}return new Ut(c,t)}else return new Ut(i||t,t)}function Qi(e,t,i,r,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),bn(e,new jn([Ma(e.sel.primary(),t,i,c)],0),r)}function Bs(e,t,i){for(var r=[],c=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)r[F]=Ma(e.sel.ranges[F],t[F],null,c);var V=Yn(e.cm,r,e.sel.primIndex);bn(e,V,i)}function Na(e,t,i,r){var c=e.sel.ranges.slice(0);c[t]=i,bn(e,Yn(e.cm,c,e.sel.primIndex),r)}function js(e,t,i,r){bn(e,Er(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(c){this.ranges=[];for(var F=0;F<c.length;F++)this.ranges[F]=new Ut(bt(e,c[F].anchor),bt(e,c[F].head))},origin:i&&i.origin};return ce(e,"beforeSelectionChange",e,r),e.cm&&ce(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Yn(e.cm,r.ranges,r.ranges.length-1):t}function Hs(e,t,i){var r=e.history.done,c=E(r);c&&c.ranges?(r[r.length-1]=t,qi(e,t,i)):bn(e,t,i)}function bn(e,t,i){qi(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qi(e,t,i){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(mt(t.primary().head,e.sel.primary().head)<0?-1:1);Ws(e,zs(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&$r(e.cm)}function Ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ne(e.cm)),mn(e,"cursorActivity",e)}function Gs(e){Ws(e,zs(e,e.sel,null,!1))}function zs(e,t,i,r){for(var c,F=0;F<t.ranges.length;F++){var V=t.ranges[F],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],te=ea(e,V.anchor,q&&q.anchor,i,r),ie=ea(e,V.head,q&&q.head,i,r);(c||te!=V.anchor||ie!=V.head)&&(c||(c=t.ranges.slice(0,F)),c[F]=new Ut(te,ie))}return c?Yn(e.cm,c,t.primIndex):t}function Qr(e,t,i,r,c){var F=tt(e,t.line);if(F.markedSpans)for(var V=0;V<F.markedSpans.length;++V){var q=F.markedSpans[V],te=q.marker,ie="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,ye="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(ie?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(ye?q.to>=t.ch:q.to>t.ch))){if(c&&(ce(te,"beforeCursorEnter"),te.explicitlyCleared))if(F.markedSpans){--V;continue}else break;if(!te.atomic)continue;if(i){var we=te.find(r<0?1:-1),ke=void 0;if((r<0?ye:ie)&&(we=Ks(e,we,-r,we&&we.line==t.line?F:null)),we&&we.line==t.line&&(ke=mt(we,i))&&(r<0?ke<0:ke>0))return Qr(e,we,t,r,c)}var De=te.find(r<0?-1:1);return(r<0?ie:ye)&&(De=Ks(e,De,r,De.line==t.line?F:null)),De?Qr(e,De,t,r,c):null}}return t}function ea(e,t,i,r,c){var F=r||1,V=Qr(e,t,i,F,c)||!c&&Qr(e,t,i,F,!0)||Qr(e,t,i,-F,c)||!c&&Qr(e,t,i,-F,!0);return V||(e.cantEdit=!0,Ge(e.first,0))}function Ks(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?bt(e,Ge(t.line-1)):null:i>0&&t.ch==(r||tt(e,t.line)).text.length?t.line<e.first+e.size-1?Ge(t.line+1,0):null:new Ge(t.line,t.ch+i)}function Vs(e){e.setSelection(Ge(e.firstLine(),0),Ge(e.lastLine()),be)}function Xs(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(c,F,V,q){c&&(r.from=bt(e,c)),F&&(r.to=bt(e,F)),V&&(r.text=V),q!==void 0&&(r.origin=q)}),ce(e,"beforeChange",e,r),e.cm&&ce(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function qr(e,t,i){if(e.cm){if(!e.cm.curOp)return un(e.cm,qr)(e,t,i);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=Xs(e,t,!0),!t))return;var r=rr&&!i&&Kt(e,t.from,t.to);if(r)for(var c=r.length-1;c>=0;--c)Ys(e,{from:r[c].from,to:r[c].to,text:c?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&mt(t.from,t.to)==0)return;var i=Ia(e,t);Ns(e,t,i,e.cm?e.cm.curOp.id:NaN),Si(e,t,i,Ht(e,t));var r=[];Tr(e,function(c,F){!F&&oe(r,c.history)==-1&&(Qs(c.history,t),r.push(c.history)),Si(c,t,null,Ht(c,t))})}function ta(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var c=e.history,F,V=e.sel,q=t=="undo"?c.done:c.undone,te=t=="undo"?c.undone:c.done,ie=0;ie<q.length&&!(F=q[ie],i?F.ranges&&!F.equals(e.sel):!F.ranges);ie++);if(ie==q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(F=q.pop(),F.ranges){if(Zi(F,te),i&&!F.equals(e.sel)){bn(e,F,{clearRedo:!1});return}V=F}else if(r){q.push(F);return}else break;var ye=[];Zi(V,te),te.push({changes:ye,generation:c.generation}),c.generation=F.generation||++c.maxGeneration;for(var we=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),ke=function(je){var Xe=F.changes[je];if(Xe.origin=t,we&&!Xs(e,Xe,!1))return q.length=0,{};ye.push(Pa(e,Xe));var qe=je?Ia(e,Xe):E(q);Si(e,Xe,qe,Us(e,Xe)),!je&&e.cm&&e.cm.scrollIntoView({from:Xe.from,to:xr(Xe)});var st=[];Tr(e,function(et,lt){!lt&&oe(st,et.history)==-1&&(Qs(et.history,Xe),st.push(et.history)),Si(et,Xe,null,Us(et,Xe))})},De=F.changes.length-1;De>=0;--De){var Fe=ke(De);if(Fe)return Fe.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new jn(k(e.sel.ranges,function(c){return new Ut(Ge(c.anchor.line+t,c.anchor.ch),Ge(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){An(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)br(e.cm,r,"gutter")}}function Si(e,t,i,r){if(e.cm&&!e.cm.curOp)return un(e.cm,Si)(e,t,i,r);if(t.to.line<e.first){$s(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var c=t.text.length-1-(e.first-t.from.line);$s(e,c),t={from:Ge(e.first,0),to:Ge(t.to.line+c,t.to.ch),text:[E(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:Ge(F,tt(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=At(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?_l(e.cm,t,r):ka(e,t,r),qi(e,i,be),e.cantEdit&&ea(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var r=e.doc,c=e.display,F=t.from,V=t.to,q=!1,te=F.line;e.options.lineWrapping||(te=yt(Un(tt(r,F.line))),r.iter(te,V.line+1,function(De){if(De==c.maxLine)return q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ne(e),ka(r,t,i,ds(e)),e.options.lineWrapping||(r.iter(te,F.line+t.text.length,function(De){var Fe=di(De);Fe>c.maxLineLength&&(c.maxLine=De,c.maxLineLength=Fe,c.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),li(r,F.line),xi(e,400);var ie=t.text.length-(V.line-F.line)-1;t.full?An(e):F.line==V.line&&t.text.length==1&&!Ds(e.doc,t)?br(e,F.line,"text"):An(e,F.line,V.line+1,ie);var ye=ae(e,"changes"),we=ae(e,"change");if(we||ye){var ke={from:F,to:V,text:t.text,removed:t.removed,origin:t.origin};we&&mn(e,"change",e,ke),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function ei(e,t,i,r,c){var F;r||(r=i),mt(r,i)<0&&(F=[r,i],i=F[0],r=F[1]),typeof t=="string"&&(t=e.splitLines(t)),qr(e,{from:i,to:r,text:t,origin:c})}function Js(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Zs(e,t,i,r){for(var c=0;c<e.length;++c){var F=e[c],V=!0;if(F.ranges){F.copied||(F=e[c]=F.deepCopy(),F.copied=!0);for(var q=0;q<F.ranges.length;q++)Js(F.ranges[q].anchor,t,i,r),Js(F.ranges[q].head,t,i,r);continue}for(var te=0;te<F.changes.length;++te){var ie=F.changes[te];if(i<ie.from.line)ie.from=Ge(ie.from.line+r,ie.from.ch),ie.to=Ge(ie.to.line+r,ie.to.ch);else if(t<=ie.to.line){V=!1;break}}V||(e.splice(0,c+1),c=0)}}function Qs(e,t){var i=t.from.line,r=t.to.line,c=t.text.length-(r-i)-1;Zs(e.done,i,r,c),Zs(e.undone,i,r,c)}function Ci(e,t,i,r){var c=t,F=t;return typeof t=="number"?F=tt(e,pr(e,t)):c=yt(t),c==null?null:(r(F,c)&&e.cm&&br(e.cm,c,i),F)}function Ai(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ai.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var c=this.lines[i];this.height-=c.height,ht(c),mn(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function Ri(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var c=e[r];t+=c.chunkSize(),i+=c.height,c.parent=this}this.size=t,this.height=i,this.parent=null}Ri.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],c=r.chunkSize();if(e<c){var F=Math.min(t,c-e),V=r.height;if(r.removeInner(e,F),this.height-=V-r.height,c==F&&(this.children.splice(i--,1),r.parent=null),(t-=F)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ai))){var q=[];this.collapse(q),this.children=[new Ai(q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var c=this.children[r],F=c.chunkSize();if(e<=F){if(c.insertInner(e,t,i),c.lines&&c.lines.length>50){for(var V=c.lines.length%25+25,q=V;q<c.lines.length;){var te=new Ai(c.lines.slice(q,q+=25));c.height-=te.height,this.children.splice(++r,0,te),te.parent=this}c.lines=c.lines.slice(0,V),this.maybeSpill()}break}e-=F}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Ri(t);if(e.parent){e.size-=i.size,e.height-=i.height;var c=oe(e.parent.children,e);e.parent.children.splice(c+1,0,i)}else{var r=new Ri(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var c=this.children[r],F=c.chunkSize();if(e<F){var V=Math.min(t,F-e);if(c.iterN(e,V,i))return!0;if((t-=V)==0)break;e=0}else e-=F}}};var Oi=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};Oi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=yt(i);if(r==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(i.widgets=null);var F=mi(this);ft(i,Math.max(0,i.height-F)),e&&(Pn(e,function(){qs(e,i,-F),br(e,r,"widget")}),mn(e,"lineWidgetCleared",e,this,r))},Oi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var c=mi(this)-t;if(!c)return;Qn(this.doc,r)||ft(r,r.height+c),i&&Pn(i,function(){i.curOp.forceUpdate=!0,qs(i,r,c),mn(i,"lineWidgetChanged",i,e,yt(r))})},de(Oi);function qs(e,t,i){Vn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,i)}function El(e,t,i,r){var c=new Oi(e,i,r),F=e.cm;return F&&c.noHScroll&&(F.display.alignWidgets=!0),Ci(e,t,"widget",function(V){var q=V.widgets||(V.widgets=[]);if(c.insertAt==null?q.push(c):q.splice(Math.min(q.length-1,Math.max(0,c.insertAt)),0,c),c.line=V,F&&!Qn(e,V)){var te=Vn(V)<e.scrollTop;ft(V,V.height+mi(c)),te&&Sa(F,c.height),F.curOp.forceUpdate=!0}return!0}),F&&mn(F,"lineWidgetAdded",F,c,typeof t=="number"?t:yt(t)),c}var eo=0,wr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++eo};wr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ur(e),ae(this,"clear")){var i=this.find();i&&mn(this,"clear",i.from,i.to)}for(var r=null,c=null,F=0;F<this.lines.length;++F){var V=this.lines[F],q=$e(V.markedSpans,this);e&&!this.collapsed?br(e,yt(V),"text"):e&&(q.to!=null&&(c=yt(V)),q.from!=null&&(r=yt(V))),V.markedSpans=Ot(V.markedSpans,q),q.from==null&&this.collapsed&&!Qn(this.doc,V)&&e&&ft(V,Vr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var ie=Un(this.lines[te]),ye=di(ie);ye>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&An(e,r,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&mn(e,"markerCleared",e,this,r,c),t&&Br(e),this.parent&&this.parent.clear()},wr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,c=0;c<this.lines.length;++c){var F=this.lines[c],V=$e(F.markedSpans,this);if(V.from!=null&&(i=Ge(t?F:yt(F),V.from),e==-1))return i;if(V.to!=null&&(r=Ge(t?F:yt(F),V.to),e==1))return r}return i&&{from:i,to:r}},wr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;Pn(r,function(){var c=t.line,F=yt(t.line),V=fa(r,F);if(V&&(is(V),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Qn(i.doc,c)&&i.height!=null){var q=i.height;i.height=null;var te=mi(i)-q;te&&ft(c,c.height+te)}mn(r,"markerChanged",r,e)})},wr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},wr.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},de(wr);function ti(e,t,i,r,c){if(r&&r.shared)return xl(e,t,i,r,c);if(e.cm&&!e.cm.curOp)return un(e.cm,ti)(e,t,i,r,c);var F=new wr(e,c),V=mt(t,i);if(r&&v(r,F,!1),V>0||V==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=f("span",[F.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(Ui(e,t.line,t,i,F)||t.line!=i.line&&Ui(e,i.line,t,i,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");ui()}F.addToHistory&&Ns(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,ie;if(e.iter(q,i.line+1,function(we){te&&F.collapsed&&!te.options.lineWrapping&&Un(we)==te.display.maxLine&&(ie=!0),F.collapsed&&q!=t.line&&ft(we,0),Jt(we,new Kn(F,q==t.line?t.ch:null,q==i.line?i.ch:null)),++q}),F.collapsed&&e.iter(t.line,i.line+1,function(we){Qn(e,we)&&ft(we,0)}),F.clearOnEnter&&Me(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(zn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++eo,F.atomic=!0),te){if(ie&&(te.curOp.updateMaxLine=!0),F.collapsed)An(te,t.line,i.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var ye=t.line;ye<=i.line;ye++)br(te,ye,"text");F.atomic&&Gs(te.doc),mn(te,"markerAdded",te,F)}return F}var Li=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Li.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();mn(this,"clear")},Li.prototype.find=function(e,t){return this.primary.find(e,t)},de(Li);function xl(e,t,i,r,c){r=v(r),r.shared=!1;var F=[ti(e,t,i,r,c)],V=F[0],q=r.widgetNode;return Tr(e,function(te){q&&(r.widgetNode=q.cloneNode(!0)),F.push(ti(te,bt(te,t),bt(te,i),r,c));for(var ie=0;ie<te.linked.length;++ie)if(te.linked[ie].isParent)return;V=E(F)}),new Li(F,V)}function to(e){return e.findMarks(Ge(e.first,0),e.clipPos(Ge(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var r=t[i],c=r.find(),F=e.clipPos(c.from),V=e.clipPos(c.to);if(mt(F,V)){var q=ti(e,F,V,r.primary,r.primary.type);r.markers.push(q),q.parent=r}}}function wl(e){for(var t=function(r){var c=e[r],F=[c.primary.doc];Tr(c.primary.doc,function(te){return F.push(te)});for(var V=0;V<c.markers.length;V++){var q=c.markers[V];oe(F,q.doc)==-1&&(q.parent=null,c.markers.splice(V--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Rn=function(e,t,i,r,c){if(!(this instanceof Rn))return new Rn(e,t,i,r,c);i==null&&(i=0),Ri.call(this,[new Ai([new Ir("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var F=Ge(i,0);this.sel=Er(F),this.history=new Ji(null),this.id=++Sl,this.modeOption=t,this.lineSep=r,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ka(this,{from:F,to:F,text:e}),bn(this,Er(F),be)};Rn.prototype=G(Ri.prototype,{constructor:Rn,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=kt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:hn(function(e){var t=Ge(this.first,0),i=this.first+this.size-1;qr(this,{from:t,to:Ge(i,tt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&yi(this.cm,0,0),bn(this,Er(t),be)}),replaceRange:function(e,t,i,r){t=bt(this,t),i=i?bt(this,i):t,ei(this,e,t,i,r)},getRange:function(e,t,i){var r=At(this,bt(this,e),bt(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(qt(this,e))return tt(this,e)},getLineNumber:function(e){return yt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=tt(this,e)),Un(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return bt(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hn(function(e,t,i){js(this,bt(this,typeof e=="number"?Ge(e,t||0):e),null,i)}),setSelection:hn(function(e,t,i){js(this,bt(this,e),bt(this,t||e),i)}),extendSelection:hn(function(e,t,i){Qi(this,bt(this,e),t&&bt(this,t),i)}),extendSelections:hn(function(e,t){Bs(this,Ve(this,e),t)}),extendSelectionsBy:hn(function(e,t){var i=k(this.sel.ranges,e);Bs(this,Ve(this,i),t)}),setSelections:hn(function(e,t,i){if(!e.length)return;for(var r=[],c=0;c<e.length;c++)r[c]=new Ut(bt(this,e[c].anchor),bt(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),bn(this,Yn(this.cm,r,t),i)}),addSelection:hn(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Ut(bt(this,e),bt(this,t||e))),bn(this,Yn(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var c=At(this,t[r].from(),t[r].to());i=i?i.concat(c):c}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var c=At(this,i[r].from(),i[r].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[r]=c}return t},replaceSelection:function(e,t,i){for(var r=[],c=0;c<this.sel.ranges.length;c++)r[c]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:hn(function(e,t,i){for(var r=[],c=this.sel,F=0;F<c.ranges.length;F++){var V=c.ranges[F];r[F]={from:V.from(),to:V.to(),text:this.splitLines(e[F]),origin:i}}for(var q=t&&t!="end"&&dl(this,r,t),te=r.length-1;te>=0;te--)qr(this,r[te]);q?Hs(this,q):this.cm&&$r(this.cm)}),undo:hn(function(){ta(this,"undo")}),redo:hn(function(){ta(this,"redo")}),undoSelection:hn(function(){ta(this,"undo",!0)}),redoSelection:hn(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,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ji(this.history.maxGeneration),Tr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Zr(this.history.done),undone:Zr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ji(this.history.maxGeneration);t.done=Zr(e.done.slice(0),null,!0),t.undone=Zr(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,i){return Ci(this,e,"gutter",function(r){var c=r.gutterMarkers||(r.gutterMarkers={});return c[t]=i,!i&&ue(c)&&(r.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ci(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ue(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!qt(this,e))return null;if(t=e,e=tt(this,e),!e)return null}else if(t=yt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:hn(function(e,t,i){return Ci(this,e,t=="gutter"?"gutter":"class",function(r){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[c])r[c]=i;else{if(O(i).test(r[c]))return!1;r[c]+=" "+i}return!0})}),removeLineClass:hn(function(e,t,i){return Ci(this,e,t=="gutter"?"gutter":"class",function(r){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=r[c];if(F)if(i==null)r[c]=null;else{var V=F.match(O(i));if(!V)return!1;var q=V.index+V[0].length;r[c]=F.slice(0,V.index)+(!V.index||q==F.length?"":" ")+F.slice(q)||null}else return!1;return!0})}),addLineWidget:hn(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ti(this,bt(this,e),bt(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=bt(this,e),ti(this,e,e,i,"bookmark")},findMarksAt:function(e){e=bt(this,e);var t=[],i=tt(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var c=i[r];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,i){e=bt(this,e),t=bt(this,t);var r=[],c=e.line;return this.iter(e.line,t.line+1,function(F){var V=F.markedSpans;if(V)for(var q=0;q<V.length;q++){var te=V[q];!(te.to!=null&&c==e.line&&e.ch>=te.to||te.from==null&&c!=e.line||te.from!=null&&c==t.line&&te.from>=t.ch)&&(!i||i(te.marker))&&r.push(te.marker.parent||te.marker)}++c}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(c){var F=c.text.length+r;if(F>e)return t=e,!0;e-=F,++i}),bt(this,Ge(i,t))},indexFromPos:function(e){e=bt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new Rn(kt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new Rn(kt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,to(this)),r},unlinkDoc:function(e){if(e instanceof Qt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(to(this));break}if(e.history==this.history){var r=[e.id];Tr(e,function(c){return r.push(c.id)},!0),e.history=new Ji(null),e.history.done=Zr(this.history.done,r),e.history.undone=Zr(this.history.undone,r)}},iterLinkedDocs:function(e){Tr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ut(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:hn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Rn.prototype.eachLine=Rn.prototype.iter;var no=0;function Cl(e){var t=this;if(ro(t),ee(t,e)||ur(t.display,e))return;re(e),K&&(no=+new Date);var i=Pr(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var c=r.length,F=Array(c),V=0,q=function(){++V==c&&un(t,function(){i=bt(t.doc,i);var De={from:i,to:i,text:t.doc.splitLines(F.filter(function(Fe){return Fe!=null}).join(t.doc.lineSeparator())),origin:"paste"};qr(t.doc,De),Hs(t.doc,Er(bt(t.doc,i),bt(t.doc,xr(De))))})()},te=function(De,Fe){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,De.type)==-1){q();return}var je=new FileReader;je.onerror=function(){return q()},je.onload=function(){var Xe=je.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Xe)){q();return}F[Fe]=Xe,q()},je.readAsText(De)},ie=0;ie<r.length;ie++)te(r[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),qi(t.doc,Er(i,i)),we)for(var ke=0;ke<we.length;++ke)ei(t.doc,"",we[ke].anchor,we[ke].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(De){}}}function Al(e,t){if(K&&(!e.state.draggingText||+new Date-no<100)){me(t);return}if(ee(e,t)||ur(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!g){var i=d("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Rl(e,t){var i=Pr(e,t);if(!i)return;var r=document.createDocumentFragment();ms(e,i,r),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var c=t[r].CodeMirror;c&&i.push(c)}i.length&&i[0].operation(function(){for(var F=0;F<i.length;F++)e(i[F])})}var ao=!1;function Ol(){if(ao)return;Ll(),ao=!0}function Ll(){var e;Me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,io(Il)},100))}),Me(window,"blur",function(){return io(Yr)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Sr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ii=0;Ii<10;Ii++)Sr[Ii+48]=Sr[Ii+96]=String(Ii);for(var na=65;na<=90;na++)Sr[na]=String.fromCharCode(na);for(var Di=1;Di<=12;Di++)Sr[Di+111]=Sr[Di+63235]="F"+Di;var hr={};hr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},hr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},hr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},hr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},hr.default=s?hr.macDefault:hr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,c,F,V=0;V<t.length-1;V++){var q=t[V];if(/^(cmd|meta|m)$/i.test(q))F=!0;else if(/^a(lt)?$/i.test(q))i=!0;else if(/^(c|ctrl|control)$/i.test(q))r=!0;else if(/^s(hift)?$/i.test(q))c=!0;else throw new Error("Unrecognized modifier name: "+q)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function kl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var c=k(i.split(" "),Dl),F=0;F<c.length;F++){var V=void 0,q=void 0;F==c.length-1?(q=c.join(" "),V=r):(q=c.slice(0,F+1).join(" "),V="...");var te=t[q];if(!te)t[q]=V;else if(te!=V)throw new Error("Inconsistent bindings for "+q)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function ni(e,t,i,r){t=ra(t);var c=t.call?t.call(e,r):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&i(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ni(e,t.fallthrough,i,r);for(var F=0;F<t.fallthrough.length;F++){var V=ni(e,t.fallthrough[F],i,r);if(V)return V}}}function so(e){var t=typeof e=="string"?e:Sr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function oo(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function lo(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=Sr[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),oo(i,e,t))}function ra(e){return typeof e=="string"?hr[e]:e}function ri(e,t){for(var i=e.doc.sel.ranges,r=[],c=0;c<i.length;c++){for(var F=t(i[c]);r.length&&mt(F.from,E(r).to)<=0;){var V=r.pop();if(mt(V.from,F.from)<0){F.from=V.from;break}}r.push(F)}Pn(e,function(){for(var q=r.length-1;q>=0;q--)ei(e.doc,"",r[q].from,r[q].to,"+delete");$r(e)})}function Fa(e,t,i){var r=Se(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ua(e,t,i){var r=Fa(e,t.ch,i);return r==null?null:new Ge(t.line,r,i<0?"after":"before")}function Ba(e,t,i,r,c){if(e){t.doc.direction=="rtl"&&(c=-c);var F=ze(i,t.doc.direction);if(F){var V=c<0?E(F):F[0],q=c<0==(V.level==1),te=q?"after":"before",ie;if(V.level>0||t.doc.direction=="rtl"){var ye=Kr(t,i);ie=c<0?i.text.length-1:0;var we=er(t,ye,ie).top;ie=Pe(function(ke){return er(t,ye,ke).top==we},c<0==(V.level==1)?V.from:V.to-1,ie),te=="before"&&(ie=Fa(i,ie,1))}else ie=c<0?V.to:V.from;return new Ge(r,ie,te)}}return new Ge(r,c<0?i.text.length:0,c<0?"before":"after")}function Pl(e,t,i,r){var c=ze(t,e.doc.direction);if(!c)return Ua(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var F=Be(c,i.ch,i.sticky),V=c[F];if(e.doc.direction=="ltr"&&V.level%2==0&&(r>0?V.to>i.ch:V.from<i.ch))return Ua(t,i,r);var q=function(qe,st){return Fa(t,qe instanceof Ge?qe.ch:qe,st)},te,ie=function(qe){return e.options.lineWrapping?(te=te||Kr(e,t),cs(e,t,te,qe)):{begin:0,end:t.text.length}},ye=ie(i.sticky=="before"?q(i,-1):i.ch);if(e.doc.direction=="rtl"||V.level==1){var we=V.level==1==r<0,ke=q(i,we?1:-1);if(ke!=null&&(we?ke<=V.to&&ke<=ye.end:ke>=V.from&&ke>=ye.begin)){var De=we?"before":"after";return new Ge(i.line,ke,De)}}var Fe=function(qe,st,et){for(var lt=function(Xt,cn){return cn?new Ge(i.line,q(Xt,1),"before"):new Ge(i.line,Xt,"after")};qe>=0&&qe<c.length;qe+=st){var vt=c[qe],ct=st>0==(vt.level!=1),Ct=ct?et.begin:q(et.end,-1);if(vt.from<=Ct&&Ct<vt.to)return lt(Ct,ct);if(Ct=ct?vt.from:q(vt.to,-1),et.begin<=Ct&&Ct<et.end)return lt(Ct,ct)}},je=Fe(F+r,r,ye);if(je)return je;var Xe=r>0?ye.end:q(ye.begin,-1);return Xe!=null&&!(r>0&&Xe==t.text.length)&&(je=Fe(r>0?0:c.length-1,r,ie(Xe)),je)?je:null}var ki={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return ri(e,function(t){if(t.empty()){var i=tt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ge(t.head.line+1,0)}:{from:t.head,to:Ge(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ri(e,function(t){return{from:Ge(t.from().line,0),to:bt(e.doc,Ge(t.to().line+1,0))}})},delLineLeft:function(e){return ri(e,function(t){return{from:Ge(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ri(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ri(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ge(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ge(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return uo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ho(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?ho(e,t.head):r},Ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,c=0;c<i.length;c++){var F=i[c].from(),V=W(e.getLine(F.line),F.ch,r);t.push($(r-V%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pn(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var c=t[r].head,F=tt(e.doc,c.line).text;if(F){if(c.ch==F.length&&(c=new Ge(c.line,c.ch-1)),c.ch>0)c=new Ge(c.line,c.ch+1),e.replaceRange(F.charAt(c.ch-1)+F.charAt(c.ch-2),Ge(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var V=tt(e.doc,c.line-1).text;V&&(c=new Ge(c.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),Ge(c.line-1,V.length-1),c,"+transpose"))}}i.push(new Ut(c,c))}e.setSelections(i)})},newlineAndIndent:function(e){return Pn(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 r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);$r(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function uo(e,t){var i=tt(e.doc,t),r=Un(i);return r!=i&&(t=yt(r)),Ba(!0,e,r,t,1)}function Ml(e,t){var i=tt(e.doc,t),r=Bi(i);return r!=i&&(t=yt(r)),Ba(!0,e,i,t,-1)}function ho(e,t){var i=uo(e,t.line),r=tt(e.doc,i.line),c=ze(r,e.doc.direction);if(!c||c[0].level==0){var F=Math.max(i.ch,r.text.search(/\S/)),V=t.line==i.line&&t.ch<=F&&t.ch;return Ge(i.line,V?0:F,i.sticky)}return i}function ia(e,t,i){if(typeof t=="string"&&(t=ki[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),c=t(e)!=Ae}finally{e.display.shift=r,e.state.suppressEdits=!1}return c}function Nl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var c=ni(t,e.state.keyMaps[r],i,e);if(c)return c}return e.options.extraKeys&&ni(t,e.options.extraKeys,i,e)||ni(t,e.options.keyMap,i,e)}var Fl=new Z;function Pi(e,t,i,r){var c=e.state.keySeq;if(c){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),co(e,c+" "+t,i,r))return!0}return co(e,t,i,r)}function co(e,t,i,r){var c=Nl(e,t,r);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&mn(e,"keyHandled",e,t,i),(c=="handled"||c=="multi")&&(re(i),xa(e)),!!c}function fo(e,t){var i=lo(t,!0);return i?t.shiftKey&&!e.state.keySeq?Pi(e,"Shift-"+i,t,function(r){return ia(e,r,!0)})||Pi(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ia(e,r)}):Pi(e,i,t,function(r){return ia(e,r)}):!1}function Ul(e,t,i){return Pi(e,"'"+i+"'",t,function(r){return ia(e,r,!0)})}var ja=null;function po(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),ee(t,e))return;K&&z<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=fo(t,e);m&&(ja=r?i:null,!r&&i==88&&!Tt&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!s&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(A(t,"CodeMirror-crosshair"),Ze(document,"keyup",i),Ze(document,"mouseover",i))}Me(document,"keyup",i),Me(document,"mouseover",i)}function mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),ee(this,e)}function go(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ur(t.display,e)||ee(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(m&&i==ja){ja=null,re(e);return}if(m&&(!e.which||e.which<10)&&fo(t,e))return;var c=String.fromCharCode(r==null?i:r);if(c=="\b")return;if(Ul(t,e,c))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ha.prototype.compare=function(e,t,i){return this.time+jl>e&&mt(t,this.pos)==0&&i==this.button};var Mi,Ni;function Hl(e,t){var i=+new Date;return Ni&&Ni.compare(i,e,t)?(Mi=Ni=null,"triple"):Mi&&Mi.compare(i,e,t)?(Ni=new Ha(i,e,t),Mi=null,"double"):(Mi=new Ha(i,e,t),Ni=null,"single")}function vo(e){var t=this,i=t.display;if(ee(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ur(i,e)){n||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Wa(t,e))return;var r=Pr(t,e),c=Oe(e),F=r?Hl(r,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),r&&Wl(t,c,r,F,e))return;c==1?r?zl(t,r,F,e):Te(e)==i.scroller&&re(e):c==2?(r&&Qi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):c==3&&(D?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,i,r,c){var F="Click";return r=="double"?F="Double"+F:r=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,Pi(e,oo(F,c),c,function(V){if(typeof V=="string"&&(V=ki[V]),!V)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=V(e,i)!=Ae}finally{e.state.suppressEdits=!1}return q})}function Gl(e,t,i){var r=e.getOption("configureMouse"),c=r?r(e,t,i):{};if(c.unit==null){var F=a?i.shiftKey&&i.metaKey:i.altKey;c.unit=F?"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 zl(e,t,i,r){K?setTimeout(I(gs,e),0):e.curOp.focus=j();var c=Gl(e,i,r),F=e.doc.sel,V;e.options.dragDrop&&Ne&&!e.isReadOnly()&&i=="single"&&(V=F.contains(t))>-1&&(mt((V=F.ranges[V]).from(),t)<0||t.xRel>0)&&(mt(V.to(),t)>0||t.xRel<0)?Kl(e,r,t,c):Vl(e,r,t,c)}function Kl(e,t,i,r){var c=e.display,F=!1,V=un(e,function(ie){n&&(c.scroller.draggable=!1),e.state.draggingText=!1,Ze(c.wrapper.ownerDocument,"mouseup",V),Ze(c.wrapper.ownerDocument,"mousemove",q),Ze(c.scroller,"dragstart",te),Ze(c.scroller,"drop",V),F||(re(ie),r.addNew||Qi(e.doc,i,null,null,r.extend),n&&!g||K&&z==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),q=function(ie){F=F||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},te=function(){return F=!0};n&&(c.scroller.draggable=!0),e.state.draggingText=V,V.copy=!r.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),Me(c.wrapper.ownerDocument,"mouseup",V),Me(c.wrapper.ownerDocument,"mousemove",q),Me(c.scroller,"dragstart",te),Me(c.scroller,"drop",V),vs(e),setTimeout(function(){return c.input.focus()},20)}function yo(e,t,i){if(i=="char")return new Ut(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ut(Ge(t.line,0),bt(e.doc,Ge(t.line+1,0)));var r=i(e,t);return new Ut(r.from,r.to)}function Vl(e,t,i,r){var c=e.display,F=e.doc;re(t);var V,q,te=F.sel,ie=te.ranges;if(r.addNew&&!r.extend?(q=F.sel.contains(i),q>-1?V=ie[q]:V=new Ut(i,i)):(V=F.sel.primary(),q=F.sel.primIndex),r.unit=="rectangle")r.addNew||(V=new Ut(i,i)),i=Pr(e,t,!0,!0),q=-1;else{var ye=yo(e,i,r.unit);r.extend?V=Ma(V,ye.anchor,ye.head,r.extend):V=ye}r.addNew?q==-1?(q=ie.length,bn(F,Yn(e,ie.concat([V]),q),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[q].empty()&&r.unit=="char"&&!r.extend?(bn(F,Yn(e,ie.slice(0,q).concat(ie.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=F.sel):Na(F,q,V,Re):(q=0,bn(F,new jn([V],0),Re),te=F.sel);var we=i;function ke(et){if(mt(we,et)==0)return;if(we=et,r.unit=="rectangle"){for(var lt=[],vt=e.options.tabSize,ct=W(tt(F,i.line).text,i.ch,vt),Ct=W(tt(F,et.line).text,et.ch,vt),Xt=Math.min(ct,Ct),cn=Math.max(ct,Ct),en=Math.min(i.line,et.line),Mn=Math.min(e.lastLine(),Math.max(i.line,et.line));en<=Mn;en++){var On=tt(F,en).text,an=Le(On,Xt,vt);Xt==cn?lt.push(new Ut(Ge(en,an),Ge(en,an))):On.length>an&&lt.push(new Ut(Ge(en,an),Ge(en,Le(On,cn,vt))))}lt.length||lt.push(new Ut(i,i)),bn(F,Yn(e,te.ranges.slice(0,q).concat(lt),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(et)}else{var Ln=V,gn=yo(e,et,r.unit),ln=Ln.anchor,sn;mt(gn.anchor,ln)>0?(sn=gn.head,ln=Hn(Ln.from(),gn.anchor)):(sn=gn.anchor,ln=fr(Ln.to(),gn.head));var tn=te.ranges.slice(0);tn[q]=Xl(e,new Ut(bt(F,ln),sn)),bn(F,Yn(e,tn,q),Re)}}var De=c.wrapper.getBoundingClientRect(),Fe=0;function je(et){var lt=++Fe,vt=Pr(e,et,!0,r.unit=="rectangle");if(!vt)return;if(mt(vt,we)!=0){e.curOp.focus=j(),ke(vt);var ct=Vi(c,F);(vt.line>=ct.to||vt.line<ct.from)&&setTimeout(un(e,function(){Fe==lt&&je(et)}),150)}else{var Ct=et.clientY<De.top?-20:et.clientY>De.bottom?20:0;Ct&&setTimeout(un(e,function(){if(Fe!=lt)return;c.scroller.scrollTop+=Ct,je(et)}),50)}}function Xe(et){e.state.selectingText=!1,Fe=Infinity,et&&(re(et),c.input.focus()),Ze(c.wrapper.ownerDocument,"mousemove",qe),Ze(c.wrapper.ownerDocument,"mouseup",st),F.history.lastSelOrigin=null}var qe=un(e,function(et){et.buttons===0||!Oe(et)?Xe(et):je(et)}),st=un(e,Xe);e.state.selectingText=st,Me(c.wrapper.ownerDocument,"mousemove",qe),Me(c.wrapper.ownerDocument,"mouseup",st)}function Xl(e,t){var i=t.anchor,r=t.head,c=tt(e.doc,i.line);if(mt(i,r)==0&&i.sticky==r.sticky)return t;var F=ze(c);if(!F)return t;var V=Be(F,i.ch,i.sticky),q=F[V];if(q.from!=i.ch&&q.to!=i.ch)return t;var te=V+(q.from==i.ch==(q.level!=1)?0:1);if(te==0||te==F.length)return t;var ie;if(r.line!=i.line)ie=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=Be(F,r.ch,r.sticky),we=ye-V||(r.ch-i.ch)*(q.level==1?-1:1);ye==te-1||ye==te?ie=we<0:ie=we>0}var ke=F[te+(ie?-1:0)],De=ie==(ke.level==1),Fe=De?ke.from:ke.to,je=De?"after":"before";return i.ch==Fe&&i.sticky==je?t:new Ut(new Ge(i.line,Fe,je),r)}function bo(e,t,i,r){var c,F;if(t.touches)c=t.touches[0].clientX,F=t.touches[0].clientY;else try{c=t.clientX,F=t.clientY}catch(ke){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&re(t);var V=e.display,q=V.lineDiv.getBoundingClientRect();if(F>q.bottom||!ae(e,i))return pe(t);F-=q.top-V.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var ie=V.gutters.childNodes[te];if(ie&&ie.getBoundingClientRect().right>=c){var ye=Rt(e.doc,F),we=e.display.gutterSpecs[te];return ce(e,i,e,ye,we.className,t),pe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(ur(e.display,t)||Yl(e,t))return;if(ee(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return ae(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-"),gi(e)}var ii={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function i(r,c,F,V){e.defaults[r]=c,F&&(t[r]=V?function(q,te,ie){ie!=ii&&F(q,te,ie)}:F)}e.defineOption=i,e.Init=ii,i("value","",function(r,c){return r.setValue(c)},!0),i("mode",null,function(r,c){r.doc.modeOption=c,Da(r)},!0),i("indentUnit",2,Da,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){wi(r),gi(r),An(r)},!0),i("lineSeparator",null,function(r,c){if(r.doc.lineSep=c,!c)return;var F=[],V=r.doc.first;r.doc.iter(function(te){for(var ie=0;;){var ye=te.text.indexOf(c,ie);if(ye==-1)break;ie=ye+c.length,F.push(Ge(V,ye))}V++});for(var q=F.length-1;q>=0;q--)ei(r.doc,c,F[q],Ge(F[q].line,F[q].ch+c.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,c,F){r.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),F!=ii&&r.refresh()}),i("specialCharPlaceholder",Vt,function(r){return r.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(r,c){return r.getInputField().spellcheck=c},!0),i("autocorrect",!1,function(r,c){return r.getInputField().autocorrect=c},!0),i("autocapitalize",!1,function(r,c){return r.getInputField().autocapitalize=c},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Eo(r),Ti(r)},!0),i("keyMap","default",function(r,c,F){var V=ra(c),q=F!=ii&&ra(F);q&&q.detach&&q.detach(r,V),V.attach&&V.attach(r,q||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,c){r.display.gutterSpecs=La(c,r.options.lineNumbers),Ti(r)},!0),i("fixedGutter",!0,function(r,c){r.display.gutters.style.left=c?_a(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Jr(r)},!0),i("scrollbarStyle","native",function(r){Ts(r),Jr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,c){r.display.gutterSpecs=La(r.options.gutters,c),Ti(r)},!0),i("firstLineNumber",1,Ti,!0),i("lineNumberFormatter",function(r){return r},Ti,!0),i("showCursorWhenSelecting",!1,vi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,c){c=="nocursor"&&(Yr(r),r.display.input.blur()),r.display.input.readOnlyChanged(c)}),i("screenReaderLabel",null,function(r,c){c=c===""?null:c,r.display.input.screenReaderLabelChanged(c)}),i("disableInput",!1,function(r,c){c||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,vi,!0),i("singleCursorHeightPerLine",!0,vi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wi,!0),i("addModeClass",!1,wi,!0),i("pollInterval",100),i("undoDepth",200,function(r,c){return r.doc.history.undoDepth=c}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,wi,!0),i("moveInputWithCursor",!0,function(r,c){c||r.display.input.resetPosition()}),i("tabindex",null,function(r,c){return r.display.input.getField().tabIndex=c||""}),i("autofocus",null),i("direction","ltr",function(r,c){return r.doc.setDirection(c)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=ii;if(!t!=!r){var c=e.display.dragFunctions,F=t?Me:Ze;F(e.display.scroller,"dragstart",c.start),F(e.display.scroller,"dragenter",c.enter),F(e.display.scroller,"dragover",c.over),F(e.display.scroller,"dragleave",c.leave),F(e.display.scroller,"drop",c.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(A(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ea(e),An(e),gi(e),setTimeout(function(){return Jr(e)},100)}function Qt(e,t){var i=this;if(!(this instanceof Qt))return new Qt(e,t);this.options=t=t?v(t):{},v(xo,t,!1);var r=t.value;typeof r=="string"?r=new Rn(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var c=new Qt.inputStyles[t.inputStyle](this),F=this.display=new hl(e,r,c,t);F.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 Z,keySeq:null,specialChars:null},t.autofocus&&!u&&F.input.focus(),K&&z<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ol(),Ur(this),this.curOp.forceUpdate=!0,ks(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ta(i)},20):Yr(this);for(var V in aa)aa.hasOwnProperty(V)&&aa[V](this,t[V],ii);Cs(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ga.length;++q)Ga[q](this);Br(this),n&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}Qt.defaults=xo,Qt.optionHandlers=aa;function Ql(e){var t=e.display;Me(t.scroller,"mousedown",un(e,vo)),K&&z<11?Me(t.scroller,"dblclick",un(e,function(te){if(ee(e,te))return;var ie=Pr(e,te);if(!ie||Wa(e,te)||ur(e.display,te))return;re(te);var ye=e.findWordAt(ie);Qi(e.doc,ye.anchor,ye.head)})):Me(t.scroller,"dblclick",function(te){return ee(e,te)||re(te)}),Me(t.scroller,"contextmenu",function(te){return _o(e,te)}),Me(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||_o(e,te)});var i,r={end:0};function c(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function F(te){if(te.touches.length!=1)return!1;var ie=te.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function V(te,ie){if(ie.left==null)return!0;var ye=ie.left-te.left,we=ie.top-te.top;return ye*ye+we*we>20*20}Me(t.scroller,"touchstart",function(te){if(!ee(e,te)&&!F(te)&&!Wa(e,te)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-r.end<=300?r:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Me(t.scroller,"touchend",function(te){var ie=t.activeTouch;if(ie&&!ur(t,te)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var ye=e.coordsChar(t.activeTouch,"page"),we;!ie.prev||V(ie,ie.prev)?we=new Ut(ye,ye):!ie.prev.prev||V(ie,ie.prev.prev)?we=e.findWordAt(ye):we=new Ut(Ge(ye.line,0),bt(e.doc,Ge(ye.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),re(te)}c()}),Me(t.scroller,"touchcancel",c),Me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(bi(e,t.scroller.scrollTop),Nr(e,t.scroller.scrollLeft,!0),ce(e,"scroll",e))}),Me(t.scroller,"mousewheel",function(te){return Os(e,te)}),Me(t.scroller,"DOMMouseScroll",function(te){return Os(e,te)}),Me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){ee(e,te)||me(te)},over:function(te){ee(e,te)||(Rl(e,te),me(te))},start:function(te){return Al(e,te)},drop:un(e,Cl),leave:function(te){ee(e,te)||ro(e)}};var q=t.input.getField();Me(q,"keyup",function(te){return mo.call(e,te)}),Me(q,"keydown",un(e,po)),Me(q,"keypress",un(e,go)),Me(q,"focus",function(te){return Ta(e,te)}),Me(q,"blur",function(te){return Yr(e,te)})}var Ga=[];Qt.defineInitHook=function(e){return Ga.push(e)};function Fi(e,t,i,r){var c=e.doc,F;i==null&&(i="add"),i=="smart"&&(c.mode.indent?F=Nn(e,t).state:i="prev");var V=e.options.tabSize,q=tt(c,t),te=W(q.text,null,V);q.stateAfter&&(q.stateAfter=null);var ie=q.text.match(/^\s*/)[0],ye;if(!r&&!/\S/.test(q.text))ye=0,i="not";else if(i=="smart"&&(ye=c.mode.indent(F,q.text.slice(ie.length),q.text),ye==Ae||ye>150)){if(!r)return;i="prev"}i=="prev"?t>c.first?ye=W(tt(c,t-1).text,null,V):ye=0:i=="add"?ye=te+e.options.indentUnit:i=="subtract"?ye=te-e.options.indentUnit:typeof i=="number"&&(ye=te+i),ye=Math.max(0,ye);var we="",ke=0;if(e.options.indentWithTabs)for(var De=Math.floor(ye/V);De;--De)ke+=V,we+=" ";if(ke<ye&&(we+=$(ye-ke)),we!=ie)return ei(c,we,Ge(t,0),Ge(t,ie.length),"+input"),q.stateAfter=null,!0;for(var Fe=0;Fe<c.sel.ranges.length;Fe++){var je=c.sel.ranges[Fe];if(je.head.line==t&&je.head.ch<ie.length){var Xe=Ge(t,ie.length);Na(c,Fe,new Ut(Xe,Xe));break}}}var $n=null;function sa(e){$n=e}function za(e,t,i,r,c){var F=e.doc;e.display.shift=!1,r||(r=F.sel);var V=+new Date-200,q=c=="paste"||e.state.pasteIncoming>V,te=ut(t),ie=null;if(q&&r.ranges.length>1)if($n&&$n.text.join(`
`)==t){if(r.ranges.length%$n.text.length==0){ie=[];for(var ye=0;ye<$n.text.length;ye++)ie.push(F.splitLines($n.text[ye]))}}else te.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(ie=k(te,function(qe){return[qe]}));for(var we=e.curOp.updateInput,ke=r.ranges.length-1;ke>=0;ke--){var De=r.ranges[ke],Fe=De.from(),je=De.to();De.empty()&&(i&&i>0?Fe=Ge(Fe.line,Fe.ch-i):e.state.overwrite&&!q?je=Ge(je.line,Math.min(tt(F,je.line).text.length,je.ch+E(te).length)):q&&$n&&$n.lineWise&&$n.text.join(`
`)==te.join(`
`)&&(Fe=je=Ge(Fe.line,0)));var Xe={from:Fe,to:je,text:ie?ie[ke%ie.length]:te,origin:c||(q?"paste":e.state.cutIncoming>V?"cut":"+input")};qr(e.doc,Xe),mn(e,"inputRead",e,Xe)}t&&!q&&wo(e,t),$r(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),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&&Pn(t,function(){return za(t,i,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var c=i.ranges[r];if(c.head.ch>100||r&&i.ranges[r-1].head.line==c.head.line)continue;var F=e.getModeAt(c.head),V=!1;if(F.electricChars){for(var q=0;q<F.electricChars.length;q++)if(t.indexOf(F.electricChars.charAt(q))>-1){V=Fi(e,c.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(tt(e.doc,c.head.line).text.slice(0,c.head.ch))&&(V=Fi(e,c.head.line,"smart")));V&&mn(e,"electricInput",e,c.head.line)}}function So(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var c=e.doc.sel.ranges[r].head.line,F={anchor:Ge(c,0),head:Ge(c+1,0)};i.push(F),t.push(e.getRange(F.anchor,F.head))}return{text:t,ranges:i}}function Co(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ao(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),Co(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,c){var F=this.options,V=F[r];if(F[r]==c&&r!="mode")return;F[r]=c,t.hasOwnProperty(r)&&un(this,t[r])(this,c,V),ce(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,c){this.state.keyMaps[c?"push":"unshift"](ra(r))},removeKeyMap:function(r){for(var c=this.state.keyMaps,F=0;F<c.length;++F)if(c[F]==r||c[F].name==r)return c.splice(F,1),!0},addOverlay:En(function(r,c){var F=r.token?r:e.getMode(this.options,r);if(F.startState)throw new Error("Overlays may not be stateful.");B(this.state.overlays,{mode:F,modeSpec:r,opaque:c&&c.opaque,priority:c&&c.priority||0},function(V){return V.priority}),this.state.modeGen++,An(this)}),removeOverlay:En(function(r){for(var c=this.state.overlays,F=0;F<c.length;++F){var V=c[F].modeSpec;if(V==r||typeof r=="string"&&V.name==r){c.splice(F,1),this.state.modeGen++,An(this);return}}}),indentLine:En(function(r,c,F){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),qt(this.doc,r)&&Fi(this,r,c,F)}),indentSelection:En(function(r){for(var c=this.doc.sel.ranges,F=-1,V=0;V<c.length;V++){var q=c[V];if(q.empty())q.head.line>F&&(Fi(this,q.head.line,r,!0),F=q.head.line,V==this.doc.sel.primIndex&&$r(this));else{var te=q.from(),ie=q.to(),ye=Math.max(F,te.line);F=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var we=ye;we<F;++we)Fi(this,we,r);var ke=this.doc.sel.ranges;te.ch==0&&c.length==ke.length&&ke[V].from().ch>0&&Na(this.doc,V,new Ut(te,ke[V].to()),be)}}}),getTokenAt:function(r,c){return Or(this,r,c)},getLineTokens:function(r,c){return Or(this,Ge(r),c,!0)},getTokenTypeAt:function(r){r=bt(this.doc,r);var c=Jn(this,tt(this.doc,r.line)),F=0,V=(c.length-1)/2,q=r.ch,te;if(q==0)te=c[2];else for(;;){var ie=F+V>>1;if((ie?c[ie*2-1]:0)>=q)V=ie;else if(c[ie*2+1]<q)F=ie+1;else{te=c[ie*2+2];break}}var ye=te?te.indexOf("overlay "):-1;return ye<0?te:ye==0?null:te.slice(0,ye-1)},getModeAt:function(r){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(r).state).mode:c},getHelper:function(r,c){return this.getHelpers(r,c)[0]},getHelpers:function(r,c){var F=[];if(!i.hasOwnProperty(c))return F;var V=i[c],q=this.getModeAt(r);if(typeof q[c]=="string")V[q[c]]&&F.push(V[q[c]]);else if(q[c])for(var te=0;te<q[c].length;te++){var ie=V[q[c][te]];ie&&F.push(ie)}else q.helperType&&V[q.helperType]?F.push(V[q.helperType]):V[q.name]&&F.push(V[q.name]);for(var ye=0;ye<V._global.length;ye++){var we=V._global[ye];we.pred(q,this)&&oe(F,we.val)==-1&&F.push(we.val)}return F},getStateAfter:function(r,c){var F=this.doc;return r=pr(F,r==null?F.first+F.size-1:r),Nn(this,r+1,c).state},cursorCoords:function(r,c){var F,V=this.doc.sel.primary();return r==null?F=V.head:typeof r=="object"?F=bt(this.doc,r):F=r?V.from():V.to(),Xn(this,F,c||"page")},charCoords:function(r,c){return ma(this,bt(this.doc,r),c||"page")},coordsChar:function(r,c){return r=ls(this,r,c||"page"),va(this,r.left,r.top)},lineAtHeight:function(r,c){return r=ls(this,{top:r,left:0},c||"page").top,Rt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,c,F){var V=!1,q;if(typeof r=="number"){var te=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>te&&(r=te,V=!0),q=tt(this.doc,r)}else q=r;return Wi(this,q,{top:0,left:0},c||"page",F||V).top+(V?this.doc.height-Vn(q):0)},defaultTextHeight:function(){return Vr(this.display)},defaultCharWidth:function(){return Xr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,c,F,V,q){var te=this.display;r=Xn(this,bt(this.doc,r));var ie=r.bottom,ye=r.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),te.sizer.appendChild(c),V=="over")ie=r.top;else if(V=="above"||V=="near"){var we=Math.max(te.wrapper.clientHeight,this.doc.height),ke=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(V=="above"||r.bottom+c.offsetHeight>we)&&r.top>c.offsetHeight?ie=r.top-c.offsetHeight:r.bottom+c.offsetHeight<=we&&(ie=r.bottom),ye+c.offsetWidth>ke&&(ye=ke-c.offsetWidth)}c.style.top=ie+"px",c.style.left=c.style.right="",q=="right"?(ye=te.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(q=="left"?ye=0:q=="middle"&&(ye=(te.sizer.clientWidth-c.offsetWidth)/2),c.style.left=ye+"px"),F&&Jo(this,{left:ye,top:ie,right:ye+c.offsetWidth,bottom:ie+c.offsetHeight})},triggerOnKeyDown:En(po),triggerOnKeyPress:En(go),triggerOnKeyUp:mo,triggerOnMouseDown:En(vo),execCommand:function(r){if(ki.hasOwnProperty(r))return ki[r].call(null,this)},triggerElectric:En(function(r){wo(this,r)}),findPosH:function(r,c,F,V){var q=1;c<0&&(q=-1,c=-c);for(var te=bt(this.doc,r),ie=0;ie<c&&!(te=Ka(this.doc,te,q,F,V),te.hitSide);++ie);return te},moveH:En(function(r,c){var F=this;this.extendSelectionsBy(function(V){return F.display.shift||F.doc.extend||V.empty()?Ka(F.doc,V.head,r,c,F.options.rtlMoveVisually):r<0?V.from():V.to()},Ce)}),deleteH:En(function(r,c){var F=this.doc.sel,V=this.doc;F.somethingSelected()?V.replaceSelection("",null,"+delete"):ri(this,function(q){var te=Ka(V,q.head,r,c,!1);return r<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(r,c,F,V){var q=1,te=V;c<0&&(q=-1,c=-c);for(var ie=bt(this.doc,r),ye=0;ye<c;++ye){var we=Xn(this,ie,"div");if(te==null?te=we.left:we.left=te,ie=Ro(this,we,q,F),ie.hitSide)break}return ie},moveV:En(function(r,c){var F=this,V=this.doc,q=[],te=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(ye){if(te)return r<0?ye.from():ye.to();var we=Xn(F,ye.head,"div");ye.goalColumn!=null&&(we.left=ye.goalColumn),q.push(we.left);var ke=Ro(F,we,r,c);return c=="page"&&ye==V.sel.primary()&&Sa(F,ma(F,ke,"div").top-we.top),ke},Ce),q.length)for(var ie=0;ie<V.sel.ranges.length;ie++)V.sel.ranges[ie].goalColumn=q[ie]}),findWordAt:function(r){var c=this.doc,F=tt(c,r.line).text,V=r.ch,q=r.ch;if(F){var te=this.getHelper(r,"wordChars");(r.sticky=="before"||q==F.length)&&V?--V:++q;for(var ie=F.charAt(V),ye=Ie(ie,te)?function(we){return Ie(we,te)}:/\s/.test(ie)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!Ie(we)};V>0&&ye(F.charAt(V-1));)--V;for(;q<F.length&&ye(F.charAt(q));)++q}return new Ut(Ge(r.line,V),Ge(r.line,q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):A(this.display.cursorDiv,"CodeMirror-overwrite"),ce(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:En(function(r,c){yi(this,r,c)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-qn(this)-this.display.barHeight,width:r.scrollWidth-qn(this)-this.display.barWidth,clientHeight:da(this),clientWidth:Dr(this)}},scrollIntoView:En(function(r,c){r==null?(r={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Ge(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=c||0,r.from.line!=null?Zo(this,r):bs(this,r.from,r.to,r.margin)}),setSize:En(function(r,c){var F=this,V=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};r!=null&&(this.display.wrapper.style.width=V(r)),c!=null&&(this.display.wrapper.style.height=V(c)),this.options.lineWrapping&&as(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var ie=0;ie<te.widgets.length;ie++)if(te.widgets[ie].noHScroll){br(F,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,ce(this,"refresh",this)}),operation:function(r){return Pn(this,r)},startOperation:function(){return Ur(this)},endOperation:function(){return Br(this)},refresh:En(function(){var r=this.display.cachedTextHeight;An(this),this.curOp.forceUpdate=!0,gi(this),yi(this,this.doc.scrollLeft,this.doc.scrollTop),Ra(this.display),(r==null||Math.abs(r-Vr(this.display))>.5||this.options.lineWrapping)&&Ea(this),ce(this,"refresh",this)}),swapDoc:En(function(r){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,r),gi(this),this.display.input.reset(),yi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,mn(this,"swapDoc",this,c),c}),phrase:function(r){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,r)?c[r]:r},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}},de(e),e.registerHelper=function(r,c,F){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][c]=F},e.registerGlobalHelper=function(r,c,F,V){e.registerHelper(r,c,V),i[r]._global.push({pred:F,val:V})}}function Ka(e,t,i,r,c){var F=t,V=i,q=tt(e,t.line),te=c&&e.direction=="rtl"?-i:i;function ie(){var st=t.line+te;return st<e.first||st>=e.first+e.size?!1:(t=new Ge(st,t.ch,t.sticky),q=tt(e,st))}function ye(st){var et;if(r=="codepoint"){var lt=q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(lt)?et=null:et=new Ge(t.line,Math.max(0,Math.min(q.text.length,t.ch+i*(lt>=55296&&lt<56320?2:1))),-i)}else c?et=Pl(e.cm,q,t,i):et=Ua(q,t,i);if(et==null)if(!st&&ie())t=Ba(c,e.cm,q,t.line,te);else return!1;else t=et;return!0}if(r=="char"||r=="codepoint")ye();else if(r=="column")ye(!0);else if(r=="word"||r=="group")for(var we=null,ke=r=="group",De=e.cm&&e.cm.getHelper(t,"wordChars"),Fe=!0;!(i<0&&!ye(!Fe));Fe=!1){var je=q.text.charAt(t.ch)||`
`,Xe=Ie(je,De)?"w":ke&&je==`
`?"n":!ke||/\s/.test(je)?null:"p";if(ke&&!Fe&&!Xe&&(Xe="s"),we&&we!=Xe){i<0&&(i=1,ye(),t.sticky="after");break}if(Xe&&(we=Xe),i>0&&!ye(!Fe))break}var qe=ea(e,t,F,V,!0);return nr(F,qe)&&(qe.hitSide=!0),qe}function Ro(e,t,i,r){var c=e.doc,F=t.left,V;if(r=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*Vr(e.display),3);V=(i>0?t.bottom:t.top)+i*te}else r=="line"&&(V=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=va(e,F,V),!ie.outside);){if(i<0?V<=0:V>=c.height){ie.hitSide=!0;break}V+=i*5}return ie}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,i=this,r=i.cm,c=i.div=e.lineDiv;Co(c,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function F(q){for(var te=q.target;te;te=te.parentNode){if(te==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Me(c,"paste",function(q){if(!F(q)||ee(r,q)||To(q,r))return;z<=11&&setTimeout(un(r,function(){return t.updateFromDOM()}),20)}),Me(c,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Me(c,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Me(c,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Me(c,"touchstart",function(){return i.forceCompositionEnd()}),Me(c,"input",function(){t.composing||t.readFromDOMSoon()});function V(q){if(!F(q)||ee(r,q))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()}),q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var te=So(r);sa({lineWise:!0,text:te.text}),q.type=="cut"&&r.operation(function(){r.setSelections(te.ranges,0,be),r.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var ie=$n.text.join(`
`);if(q.clipboardData.setData("Text",ie),q.clipboardData.getData("Text")==ie){q.preventDefault();return}}var ye=Ao(),we=ye.firstChild;r.display.lineSpace.insertBefore(ye,r.display.lineSpace.firstChild),we.value=$n.text.join(`
`);var ke=document.activeElement;M(we),setTimeout(function(){r.display.lineSpace.removeChild(ye),ke.focus(),ke==c&&i.showPrimarySelection()},50)}Me(c,"copy",V),Me(c,"cut",V)},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(),r=i.from(),c=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var F=oa(t,e.anchorNode,e.anchorOffset),V=oa(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&V&&!V.bad&&mt(Hn(F,V),r)==0&&mt(fr(F,V),c)==0)return;var q=t.display.view,te=r.line>=t.display.viewFrom&&Oo(t,r)||{node:q[0].measure.map[2],offset:0},ie=c.line<t.display.viewTo&&Oo(t,c);if(!ie){var ye=q[q.length-1].measure,we=ye.maps?ye.maps[ye.maps.length-1]:ye.map;ie={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!te||!ie){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),De;try{De=b(te.node,te.offset,ie.offset,ie.node)}catch(Fe){}De&&(!N&&t.state.focused?(e.collapse(te.node,te.offset),De.collapsed||(e.removeAllRanges(),e.addRange(De))):(e.removeAllRanges(),e.addRange(De)),ke&&e.anchorNode==null?e.addRange(ke):N&&this.startGracePeriod()),this.rememberSelection()},zt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},zt.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},zt.prototype.blur=function(){this.div.blur()},zt.prototype.getField=function(){return this.div},zt.prototype.supportsTouch=function(){return!0},zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Pn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=oa(t,e.anchorNode,e.anchorOffset),r=oa(t,e.focusNode,e.focusOffset);i&&r&&Pn(t,function(){bn(t.doc,Er(i,r),be),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},zt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),c=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Ge(r.line-1,tt(e.doc,r.line-1).length)),c.ch==tt(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=Ge(c.line+1,0)),r.line<t.viewFrom||c.line>t.viewTo-1)return!1;var F,V,q;r.line==t.viewFrom||(F=Mr(e,r.line))==0?(V=yt(t.view[0].line),q=t.view[0].node):(V=yt(t.view[F].line),q=t.view[F-1].node.nextSibling);var te=Mr(e,c.line),ie,ye;if(te==t.view.length-1?(ie=t.viewTo-1,ye=t.lineDiv.lastChild):(ie=yt(t.view[te+1].line)-1,ye=t.view[te+1].node.previousSibling),!q)return!1;for(var we=e.doc.splitLines(tu(e,q,ye,V,ie)),ke=At(e.doc,Ge(V,0),Ge(ie,tt(e.doc,ie).text.length));we.length>1&&ke.length>1;)if(E(we)==E(ke))we.pop(),ke.pop(),ie--;else if(we[0]==ke[0])we.shift(),ke.shift(),V++;else break;for(var De=0,Fe=0,je=we[0],Xe=ke[0],qe=Math.min(je.length,Xe.length);De<qe&&je.charCodeAt(De)==Xe.charCodeAt(De);)++De;for(var st=E(we),et=E(ke),lt=Math.min(st.length-(we.length==1?De:0),et.length-(ke.length==1?De:0));Fe<lt&&st.charCodeAt(st.length-Fe-1)==et.charCodeAt(et.length-Fe-1);)++Fe;if(we.length==1&&ke.length==1&&V==r.line)for(;De&&De>r.ch&&st.charCodeAt(st.length-Fe-1)==et.charCodeAt(et.length-Fe-1);)De--,Fe++;we[we.length-1]=st.slice(0,st.length-Fe).replace(/^\u200b+/,""),we[0]=we[0].slice(De).replace(/\u200b+$/,"");var vt=Ge(V,De),ct=Ge(ie,ke.length?E(ke).length-Fe:0);if(we.length>1||we[0]||mt(vt,ct))return ei(e.doc,we,vt,ct,"+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())&&Pn(this.cm,function(){return An(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()||un(this.cm,za)(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 Oo(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=tt(e.doc,t.line),c=es(i,r,t.line),F=ze(r,e.doc.direction),V="left";if(F){var q=Be(F,t.ch);V=q%2?"right":"left"}var te=rs(c.map,t.ch,V);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ai(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,c){var F="",V=!1,q=e.doc.lineSeparator(),te=!1;function ie(De){return function(Fe){return Fe.id==De}}function ye(){V&&(F+=q,te&&(F+=q),V=te=!1)}function we(De){De&&(ye(),F+=De)}function ke(De){if(De.nodeType==1){var Fe=De.getAttribute("cm-text");if(Fe){we(Fe);return}var je=De.getAttribute("cm-marker"),Xe;if(je){var qe=e.findMarks(Ge(r,0),Ge(c+1,0),ie(+je));qe.length&&(Xe=qe[0].find(0))&&we(At(e.doc,Xe.from,Xe.to).join(q));return}if(De.getAttribute("contenteditable")=="false")return;var st=/^(pre|div|p|li|table|br)$/i.test(De.nodeName);if(!/^br$/i.test(De.nodeName)&&De.textContent.length==0)return;st&&ye();for(var et=0;et<De.childNodes.length;et++)ke(De.childNodes[et]);/^(pre|p)$/i.test(De.nodeName)&&(te=!0),st&&(V=!0)}else De.nodeType==3&&we(De.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==i);)t=t.nextSibling,te=!1;return F}function oa(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return ai(e.clipPos(Ge(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var F=e.display.view[c];if(F.node==r)return nu(F,t,i)}}function nu(e,t,i){var r=e.text.firstChild,c=!1;if(!t||!_(r,t))return ai(Ge(yt(e.line),0),!0);if(t==r&&(c=!0,t=r.childNodes[i],i=0,!t)){var F=e.rest?E(e.rest):e.line;return ai(Ge(yt(F),F.text.length),c)}var V=t.nodeType==3?t:null,q=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,i&&(i=V.nodeValue.length));q.parentNode!=r;)q=q.parentNode;var te=e.measure,ie=te.maps;function ye(Xe,qe,st){for(var et=-1;et<(ie?ie.length:0);et++)for(var lt=et<0?te.map:ie[et],vt=0;vt<lt.length;vt+=3){var ct=lt[vt+2];if(ct==Xe||ct==qe){var Ct=yt(et<0?e.line:e.rest[et]),Xt=lt[vt]+st;return(st<0||ct!=Xe)&&(Xt=lt[vt+(st?1:0)]),Ge(Ct,Xt)}}}var we=ye(V,q,i);if(we)return ai(we,c);for(var ke=q.nextSibling,De=V?V.nodeValue.length-i:0;ke;ke=ke.nextSibling){if(we=ye(ke,ke.firstChild,0),we)return ai(Ge(we.line,we.ch-De),c);De+=ke.textContent.length}for(var Fe=q.previousSibling,je=i;Fe;Fe=Fe.previousSibling){if(we=ye(Fe,Fe.firstChild,-1),we)return ai(Ge(we.line,we.ch+je),c);je+=Fe.textContent.length}}var nn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};nn.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(c.style.width="0px"),Me(c,"input",function(){K&&z>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Me(c,"paste",function(V){if(ee(r,V)||To(V,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function F(V){if(ee(r,V))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var q=So(r);sa({lineWise:!0,text:q.text}),V.type=="cut"?r.setSelections(q.ranges,null,be):(i.prevInput="",c.value=q.text.join(`
`),M(c))}else return;V.type=="cut"&&(r.state.cutIncoming=+new Date)}Me(c,"cut",F),Me(c,"copy",F),Me(e.scroller,"paste",function(V){if(ur(e,V)||ee(r,V))return;if(!c.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var q=new Event("paste");q.clipboardData=V.clipboardData,c.dispatchEvent(q)}),Me(e.lineSpace,"selectstart",function(V){ur(e,V)||re(V)}),Me(c,"compositionstart",function(){var V=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:V,range:r.markText(V,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Me(c,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},nn.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},nn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ps(e);if(e.options.moveInputWithCursor){var c=Xn(e,i.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+V.top-F.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+V.left-F.left))}return r},nn.prototype.showSelection=function(e){var t=this.cm,i=t.display;T(i.cursorDiv,e.cursors),T(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},nn.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&&z>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&z>=9&&(this.hasSelection=null))},nn.prototype.getField=function(){return this.textarea},nn.prototype.supportsTouch=function(){return!1},nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},nn.prototype.blur=function(){this.textarea.blur()},nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nn.prototype.receivedFocus=function(){this.slowPoll()},nn.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()})},nn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},nn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=i.value;if(c==r&&!t.somethingSelected())return!1;if(K&&z>=9&&this.hasSelection===c||s&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=c.charCodeAt(0);if(F==8203&&!r&&(r="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,q=Math.min(r.length,c.length);V<q&&r.charCodeAt(V)==c.charCodeAt(V);)++V;return Pn(t,function(){za(t,c.slice(V),r.length-V,null,e.composing?"*compose":null),c.length>1e3||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},nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nn.prototype.onKeyPress=function(){K&&z>=9&&(this.hasSelection=null),this.fastPoll()},nn.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=Pr(i,e),V=r.scroller.scrollTop;if(!F||m)return;var q=i.options.resetSelectionOnContextMenu;q&&i.doc.sel.contains(F)==-1&&un(i,bn)(i.doc,Er(F),be);var te=c.style.cssText,ie=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.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 we;n&&(we=window.scrollY),r.input.focus(),n&&window.scrollTo(null,we),r.input.reset(),i.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=De,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function ke(){if(c.selectionStart!=null){var je=i.somethingSelected(),Xe="\u200B"+(je?c.value:"");c.value="\u21DA",c.value=Xe,t.prevInput=je?"":"\u200B",c.selectionStart=1,c.selectionEnd=Xe.length,r.selForContextMenu=i.doc.sel}}function De(){if(t.contextMenuPending!=De)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,c.style.cssText=te,K&&z<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=V),c.selectionStart!=null){(!K||K&&z<9)&&ke();var je=0,Xe=function(){r.selForContextMenu==i.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?un(i,Vs)(i):je++<10?r.detectingSelectAll=setTimeout(Xe,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Xe,200)}}if(K&&z>=9&&ke(),D){me(e);var Fe=function(){Ze(window,"mouseup",Fe),setTimeout(De,20)};Me(window,"mouseup",Fe)}else setTimeout(De,50)},nn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nn.prototype.setUneditable=function(){},nn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?v(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=j();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=q.getValue()}var c;if(e.form&&(Me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var F=e.form;c=F.submit;try{var V=F.submit=function(){r(),F.submit=c,F.submit(),F.submit=V}}catch(te){}}t.finishInit=function(te){te.save=r,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,r(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var q=Qt(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=Ze,e.on=Me,e.wheelEventPixels=cl,e.Doc=Rn,e.splitLines=ut,e.countColumn=W,e.findColumn=Le,e.isWordChar=xe,e.Pass=Ae,e.signal=ce,e.Line=Ir,e.changeEnd=xr,e.scrollbarModel=xs,e.Pos=Ge,e.cmpPos=mt,e.modes=Gt,e.mimeModes=Lt,e.resolveMode=Pt,e.getMode=Yt,e.modeExtensions=pt,e.extendMode=Et,e.copyState=wt,e.startState=vn,e.innerMode=Zt,e.commands=ki,e.keyMap=hr,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ni,e.normalizeKeyMap=kl,e.StringStream=Bt,e.SharedTextMarker=Li,e.TextMarker=wr,e.LineWidget=Oi,e.e_preventDefault=re,e.e_stopPropagation=se,e.e_stop=me,e.addClass=U,e.contains=_,e.rmClass=A,e.keyNames=Sr}$l(Qt),ql(Qt);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Rn.prototype)Rn.prototype.hasOwnProperty(la)&&oe(au,la)<0&&(Qt.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rn.prototype[la]));return de(Rn),Qt.inputStyles={textarea:nn,contenteditable:zt},Qt.defineMode=function(e){!Qt.defaults.mode&&e!="null"&&(Qt.defaults.mode=e),rn.apply(this,arguments)},Qt.defineMIME=We,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){Rn.prototype[e]=t},Qt.fromTextArea=ru,iu(Qt),Qt.version="5.58.2",Qt})},Y1PL:function(Je,Ee,J){"use strict";J.r(Ee),J.d(Ee,"ResizableTextArea",function(){return oe});var le=J("wx14"),Y=J("1OyB"),N=J("vuIU"),X=J("Ji7U"),H=J("LK+K"),P=J("q1tI"),K=J("VTBJ"),z=J("rePB"),n=J("Zm9Q"),L=J("Kwbf"),y=J("c+Xe"),m=J("m+aA"),g=J("bdgK"),l=new Map;function h(be){be.forEach(function(Re){var Ce,Le=Re.target;(Ce=l.get(Le))===null||Ce===void 0||Ce.forEach(function(ve){return ve(Le)})})}var p=new g.default(h),o=null,u=null;function s(be,Re){l.has(be)||(l.set(be,new Set),p.observe(be)),l.get(be).add(Re)}function a(be,Re){l.has(be)&&(l.get(be).delete(Re),l.get(be).size||(p.unobserve(be),l.delete(be)))}var R=function(be){Object(X.a)(Ce,be);var Re=Object(H.a)(Ce);function Ce(){return Object(Y.a)(this,Ce),Re.apply(this,arguments)}return Object(N.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(P.Component),x=P.createContext(null);function S(be){var Re=be.children,Ce=be.onBatchResize,Le=P.useRef(0),ve=P.useRef([]),$=P.useContext(x),E=P.useCallback(function(k,B,Q){Le.current+=1;var G=Le.current;ve.current.push({size:k,element:B,data:Q}),Promise.resolve().then(function(){G===Le.current&&(Ce==null||Ce(ve.current),ve.current=[])}),$==null||$(k,B,Q)},[Ce,$]);return P.createElement(x.Provider,{value:E},Re)}function D(be){var Re=be.children,Ce=be.disabled,Le=P.useRef(null),ve=P.useRef(null),$=P.useContext(x),E=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),k=P.isValidElement(Re)&&Object(y.c)(Re),B=k?Re.ref:null,Q=P.useMemo(function(){return Object(y.a)(B,Le)},[B,Le]),G=P.useRef(be);G.current=be;var he=P.useCallback(function(xe){var Ie=G.current,ue=Ie.onResize,ge=Ie.data,_e=xe.getBoundingClientRect(),Se=_e.width,Pe=_e.height,Ue=xe.offsetWidth,He=xe.offsetHeight,Be=Math.floor(Se),Qe=Math.floor(Pe);if(E.current.width!==Be||E.current.height!==Qe||E.current.offsetWidth!==Ue||E.current.offsetHeight!==He){var ze={width:Be,height:Qe,offsetWidth:Ue,offsetHeight:He};E.current=ze;var Ye=Ue===Math.round(Se)?Se:Ue,Me=He===Math.round(Pe)?Pe:He,it=Object(K.a)(Object(K.a)({},ze),{},{offsetWidth:Ye,offsetHeight:Me});$==null||$(it,xe,ge),ue&&Promise.resolve().then(function(){ue(it,xe)})}},[]);return P.useEffect(function(){var xe=Object(m.a)(Le.current)||Object(m.a)(ve.current);return xe&&!Ce&&s(xe,he),function(){return a(xe,he)}},[Le.current,Ce]),P.createElement(R,{ref:ve},k?P.cloneElement(Re,{ref:Q}):Re)}var O="rc-observer-key";function A(be){var Re=be.children,Ce=Object(n.a)(Re);return Ce.map(function(Le,ve){var $=(Le==null?void 0:Le.key)||"".concat(O,"-").concat(ve);return P.createElement(D,Object(le.a)({},be,{key:$}),Le)})}A.Collection=S;var C=A,T=J("bT9E"),d=J("TSYQ"),f=J.n(d),b=`
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
`,_=["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"],j={},U;function w(be){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Re&&j[Ce])return j[Ce];var Le=window.getComputedStyle(be),ve=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),$=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),E=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),k=_.map(function(Q){return"".concat(Q,":").concat(Le.getPropertyValue(Q))}).join(";"),B={sizingStyle:k,paddingSize:$,borderSize:E,boxSizing:ve};return Re&&Ce&&(j[Ce]=B),B}function M(be){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),be.getAttribute("wrap")?U.setAttribute("wrap",be.getAttribute("wrap")):U.removeAttribute("wrap");var ve=w(be,Re),$=ve.paddingSize,E=ve.borderSize,k=ve.boxSizing,B=ve.sizingStyle;U.setAttribute("style","".concat(B,";").concat(b)),U.value=be.value||be.placeholder||"";var Q=Number.MIN_SAFE_INTEGER,G=Number.MAX_SAFE_INTEGER,he=U.scrollHeight,xe;if(k==="border-box"?he+=E:k==="content-box"&&(he-=$),Ce!==null||Le!==null){U.value=" ";var Ie=U.scrollHeight-$;Ce!==null&&(Q=Ie*Ce,k==="border-box"&&(Q=Q+$+E),he=Math.max(Q,he)),Le!==null&&(G=Ie*Le,k==="border-box"&&(G=G+$+E),xe=he>G?"":"hidden",he=Math.min(G,he))}return{height:he,minHeight:Q,maxHeight:G,overflowY:xe,resize:"none"}}var I=J("Gytx"),v=J.n(I),W;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(W||(W={}));var Z=function(be){Object(X.a)(Ce,be);var Re=Object(H.a)(Ce);function Ce(Le){var ve;return Object(Y.a)(this,Ce),ve=Re.call(this,Le),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function($){ve.textArea=$},ve.handleResize=function($){var E=ve.state.resizeStatus,k=ve.props,B=k.autoSize,Q=k.onResize;if(E!==W.NONE)return;typeof Q=="function"&&Q($),B&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var $=ve.props.autoSize;if(!$||!ve.textArea)return;var E=$.minRows,k=$.maxRows,B=M(ve.textArea,!1,E,k);ve.setState({textareaStyles:B,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:W.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:W.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var $=ve.props,E=$.prefixCls,k=E===void 0?"rc-textarea":E,B=$.autoSize,Q=$.onResize,G=$.className,he=$.disabled,xe=ve.state,Ie=xe.textareaStyles,ue=xe.resizeStatus,ge=Object(T.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),_e=f()(k,G,Object(z.a)({},"".concat(k,"-disabled"),he));"value"in ge&&(ge.value=ge.value||"");var Se=Object(K.a)(Object(K.a)(Object(K.a)({},ve.props.style),Ie),ue===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(C,{onResize:ve.handleResize,disabled:!(B||Q)},P.createElement("textarea",Object(le.a)({},ge,{className:_e,style:Se,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:W.NONE},ve}return Object(N.a)(Ce,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!v()(ve.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 ve=this.textArea.selectionStart,$=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,$)}}catch(E){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(P.Component),oe=Z,fe=function(be){Object(X.a)(Ce,be);var Re=Object(H.a)(Ce);function Ce(Le){var ve;Object(Y.a)(this,Ce),ve=Re.call(this,Le),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(E){ve.resizableTextArea=E},ve.handleChange=function(E){var k=ve.props.onChange;ve.setValue(E.target.value,function(){ve.resizableTextArea.resizeTextarea()}),k&&k(E)},ve.handleKeyDown=function(E){var k=ve.props,B=k.onPressEnter,Q=k.onKeyDown;E.keyCode===13&&B&&B(E),Q&&Q(E)};var $=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ve.state={value:$},ve}return Object(N.a)(Ce,[{key:"setValue",value:function(ve,$){"value"in this.props||this.setState({value:ve},$)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(oe,Object(le.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Ce}(P.Component),Ae=Ee.default=fe},ZW9T:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return I});var le=J("k1fw"),Y=J("oBTY"),N=J("miYZ"),X=J("tsqr"),H=J("rAM+"),P=J("tJVT"),K=J("PpiC"),z=J("q1tI"),n=J.n(z),L=J("bdgK"),y=J("9og8"),m=J("WmNS"),g=J.n(m),l={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"]},h={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"]},p={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 <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].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=J("5VLF"),s=J.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"]}},R=function(W,Z){return Z.map(function(oe){return{label:oe,kind:W.languages.CompletionItemKind.Keyword,insertText:oe}})},x=function(W){return Object.keys(a.tables).map(function(Z){return{label:Z,kind:W.languages.CompletionItemKind.Variable,insertText:Z}})},S=function(W,Z){var oe=a.tables[W];return oe?oe.map(function(fe){return{label:fe,kind:Z.languages.CompletionItemKind.Field,insertText:fe}}):[]};function D(v,W,Z,oe,fe){var Ae=W.getWordUntilPosition(Z),be={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:Ae.startColumn,endColumn:Ae.endColumn},Re=oe.map(function(Ce){return{label:Ce,kind:v.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return fe.map(function(Ce){Re.push(Object(le.a)(Object(le.a)({},Ce),{},{range:be}))}),Re}var O=function(v){a.languages.map(function(fe){return v.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(be,Re,Ce){return Object(y.a)(g.a.mark(function Le(){var ve;return g.a.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return ve=s()(be.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}),E.abrupt("return",[{range:be.getFullModelRange(),text:ve}]);case 2:case"end":return E.stop()}},Le)}))()}}),fe});var W=p.quickKey.map(function(fe){return{label:fe.label,kind:v.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=o.quickKey.map(function(fe){return{label:fe.label,kind:v.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=h.quickKey.map(function(fe){return{label:fe.label,kind:v.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}});v.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ae,be){var Re=Ae.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Le=Ae.getLineContent(be.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(Y.a)(p.keywords.map(function(ve){return{label:ve,kind:v.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(p.quickKey.map(function(ve){return{label:ve.label,kind:v.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Le.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),v.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ae,be){var Re=Ae.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn};return{suggestions:Object(Y.a)(l.keywords.map(function(Le){return{label:Le,kind:v.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}}))}}}),v.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ae,be){var Re=Ae.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Le=Ae.getLineContent(be.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(Y.a)(h.keywords.map(function(ve){return{label:ve,kind:v.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(h.quickKey.map(function(ve){return{label:ve.label,kind:v.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Le.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),v.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ae,be){var Re=Ae.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Le=Ae.getLineContent(be.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(Y.a)(o.keywords.map(function(ve){return{label:ve,kind:v.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(Y.a)(o.quickKey.map(function(ve){return{label:ve.label,kind:v.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Le.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}})},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=J("fjLI"),T=J("LvDl"),d=J("+ua5");function f(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function b(){}var _=!1,j={"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 U(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=v;if(Array.isArray(v)){for(var Z=0;Z<v.length;Z++){var oe=j[v[Z]];if(oe)return oe}return W[0]}return j[W]||W}var w=null,M=Ee.b=function(v){var W=v.width,Z=W===void 0?"100%":W,oe=v.height,fe=oe===void 0?"100%":oe,Ae=v.value,be=v.language,Re=be===void 0?"javascript":be,Ce=v.style,Le=Ce===void 0?{}:Ce,ve=v.options,$=ve===void 0?{}:ve,E=v.overrideServices,k=E===void 0?{}:E,B=v.theme,Q=B===void 0?"vs-dark":B,G=v.onEditBlur,he=v.onSave,xe=v.autoHeight,Ie=xe===void 0?!1:xe,ue=v.forbidCopy,ge=ue===void 0?!1:ue,_e=v.onChange,Se=_e===void 0?b:_e,Pe=v.editorDidMount,Ue=Pe===void 0?b:Pe,He=v.onFocus,Be=He===void 0?b:He,Qe=v.filename,ze=Qe===void 0?"educoder.txt":Qe,Ye=v.errorLine,Me=v.errorContent,it=Me===void 0?"":Me,Ze=Object(K.a)(v,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ce=Object(z.useRef)(),ee=Object(z.useRef)({}),ne=Object(z.useRef)(),ae=Object(z.useRef)(),de=Object(z.useRef)(!1),re=Object(z.useRef)(),se=Object(z.useState)(!1),pe=Object(P.a)(se,2),me=pe[0],Te=pe[1];function Oe(){var pt;return ce.current&&(pt=new L.default(function(Et){var wt=Object(H.a)(Et),Zt;try{for(wt.s();!(Zt=wt.n()).done;){var vn=Zt.value;(vn.target.offsetHeight>0||vn.target.offsetWidth>0)&&ee.current.instance.layout()}}catch(Bt){wt.e(Bt)}finally{wt.f()}}),pt.observe(ce.current)),pt}function Ne(){X.b.warn(decodeURIComponent(A))}var Ke=function(){var Et=ee.current.instance;if(Ae!=null&&Et&&me){var wt=Et.getModel();wt&&Ae!==wt.getValue()&&(_=!0,wt.setValue(Ae),Et.layout(),_=!1)}};Object(z.useEffect)(function(){ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){Ke()},500)},[Ae,me,ee.current]),Object(z.useEffect)(function(){if(Ye&&ee.current&&ee.current.instance){var pt=ee.current.instance;pt.changeViewZones(function(wt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=it,wt.addZone({afterLineNumber:Ye||11,heightInLines:3,domNode:Zt})});var Et={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}};pt.addOverlayWidget(Et),pt.revealPositionInCenter({lineNumber:20,column:1})}},[Ye,ee.current,me]);function nt(){var pt=ee.current.instance;if(pt){var Et=pt.getSelection(),wt=ee.current.pastePos||{},Zt=new w.Range(wt.startLineNumber||Et.endLineNumber,wt.startColumn||Et.endColumn,wt.endLineNumber||Et.endLineNumber,wt.endColumn||Et.endColumn);setTimeout(function(){pt.executeEdits("",[{range:Zt,text:""}])},300)}}function at(pt){(window.navigator.platform.match("Mac")?pt.metaKey:pt.ctrlKey)&&pt.keyCode==83&&(pt.preventDefault(),he())}var xt=function(){if(Ie&&ee.current.instance){var Et=ee.current.instance.getContentHeight();Pt(Et<fe?fe:Et)}else Pt(fe)};function ut(pt){var Et=document.createEvent("MouseEvents");Et.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),pt.dispatchEvent(Et)}function ot(pt,Et){var wt=window.URL||window.webkitURL||window,Zt=new Blob([Et]),vn=document.createElementNS("http://www.w3.org/1999/xhtml","a");vn.href=wt.createObjectURL(Zt),vn.download=pt,ut(vn)}Object(z.useEffect)(function(){xt()},[xt]),Object(z.useEffect)(function(){ce.current&&!me&&Promise.all([J.e(18),J.e(29)]).then(J.t.bind(null,"M/lh",7)).then(function(pt){try{w=pt,ee.current.instance=w.editor.create(ce.current,{value:Ae,language:U(Re),theme:Q,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},k);var Et=ee.current.instance,wt=C.d._menuItems,Zt=Object(Y.a)(wt).find(function(kt){return kt[0]._debugName=="EditorContext"}),vn=Zt[1],Bt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],tt=function(ft,yt){var Rt=ft._first;do{var qt,$t,Ge=yt.includes((qt=Rt.element)===null||qt===void 0||(($t=qt.command)===null||$t===void 0)?void 0:$t.id);Ge&&ft._remove(Rt)}while(Rt=Rt.next)};if(Ue(Et,w),setTimeout(function(){xt(),ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ot(ze||"educoder.txt",Et.getValue())}}),Et.getDomNode().addEventListener("input",function(){ne.current.autoFormat&&Et.getAction("editor.action.formatDocument").run()})},500),ee.current.subscription=Et.onDidChangeModelContent(function(kt){de.current?clearTimeout(re.current):(xt(),Se(Et.getValue(),kt)),re.current=setTimeout(function(){de.current=!1},500)}),window.Monaco||O(w,U(Re)),ge&&(tt(vn,Bt),ce.current.classList.add("noCopyPaste"),Et.onKeyDown(function(kt){var ft=kt.keyCode,yt=kt.ctrlKey,Rt=kt.metaKey;(ft===33||ft===52)&&(Rt||yt)&&(Ne(),kt.preventDefault())})),window.Monaco=w,G&&Et.onDidBlurEditorWidget(function(){G(Et.getValue())}),Be&&Et.onDidFocusEditorText(function(){Be(Et.getValue())}),ge){Et.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return Ne(),null}),Et.onDidPaste(function(kt){ee.current.pastePos=kt});try{window.addEventListener("paste",nt)}catch(kt){}}var At=Oe();return Te(!0),function(){var kt=ee.current.instance;kt.dispose();var ft=kt.getModel();ft&&ft.dispose(),ee.current.subscription&&ee.current.subscription.dispose(),ge&&window.removeEventListener("paste",nt),At.unobserve(ce.current)}}catch(kt){}})},[]),Object(z.useEffect)(function(){var pt=ee.current.instance;if(pt&&me)return document.addEventListener("keydown",at,!1),function(){document.removeEventListener("keydown",at)}},[he,me]),Object(z.useEffect)(function(){var pt=ee.current.instance;if(pt&&me){var Et=U(Re);w.editor.setModelLanguage(pt.getModel(),Et),console.log("language:",Re,pt.getModel(),Et)}},[Re,me]),Object(z.useEffect)(function(){var pt=ee.current.instance;pt&&me&&w.editor.setTheme(Q)},[Q,me]),Object(z.useEffect)(function(){var pt=ee.current.instance;ne.current=$,pt&&me&&(pt.updateOptions(Object(le.a)({},$)),setTimeout(function(){pt.getModel().updateOptions(Object(le.a)({},$))},200))},[JSON.stringify($),me]),Object(z.useEffect)(function(){var pt=ee.current.instance;pt&&me&&pt.layout()},[Z,fe,me]);var Tt=Object(z.useState)(f(Z)),St=Object(P.a)(Tt,2),rt=St[0],Gt=St[1],Lt=Object(z.useState)(f(fe)),rn=Object(P.a)(Lt,2),We=rn[0],Pt=rn[1],Yt=Object(le.a)(Object(le.a)({},Le),{},{width:rt,height:We});return n.a.createElement("div",{className:"my-monaco-editor",ref:ce,style:Yt})};function I(v){var W=v.width,Z=W===void 0?"100%":W,oe=v.height,fe=oe===void 0?"100%":oe,Ae=v.original,be=v.modified,Re=v.language,Ce=v.options,Le=Ce===void 0?{}:Ce,ve=Object(z.useRef)(),$=Object(z.useState)(null),E=Object(P.a)($,2),k=E[0],B=E[1];function Q(Ie){var ue;return ve.current&&(ue=new L.default(function(ge){var _e=Object(H.a)(ge),Se;try{for(_e.s();!(Se=_e.n()).done;){var Pe=Se.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&Ie.layout()}}catch(Ue){_e.e(Ue)}finally{_e.f()}}),ue.observe(ve.current)),ue}Object(z.useEffect)(function(){ve.current&&Promise.all([J.e(18),J.e(29)]).then(J.t.bind(null,"M/lh",7)).then(function(Ie){w=Ie;var ue=w.editor.createDiffEditor(ve.current,Object(le.a)(Object(le.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}));B(ue);var ge=Q(ue);return function(){ue.dispose();var _e=ue.getModel();_e&&_e.dispose(),ge.unobserve(ve.current)}})},[]),Object(z.useEffect)(function(){k&&k.setModel({original:w.editor.createModel(Ae,Re),modified:w.editor.createModel(be,Re)})},[Ae,be,Re,k]);var G=f(Z),he=f(fe),xe={width:G,height:he};return n.a.createElement("div",{className:"my-diff-editor",ref:ve,style:xe})}},Zss7:function(Je,Ee,J){var le;(function(Y){var N=/^\s+/,X=/\s+$/,H=0,P=Y.round,K=Y.min,z=Y.max,n=Y.random;function L(E,k){if(E=E||"",k=k||{},E instanceof L)return E;if(!(this instanceof L))return new L(E,k);var B=y(E);this._originalInput=E,this._r=B.r,this._g=B.g,this._b=B.b,this._a=B.a,this._roundA=P(100*this._a)/100,this._format=k.format||B.format,this._gradientType=k.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=B.ok,this._tc_id=H++}L.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 E=this.toRgb();return(E.r*299+E.g*587+E.b*114)/1e3},getLuminance:function(){var E=this.toRgb(),k,B,Q,G,he,xe;return k=E.r/255,B=E.g/255,Q=E.b/255,k<=.03928?G=k/12.92:G=Y.pow((k+.055)/1.055,2.4),B<=.03928?he=B/12.92:he=Y.pow((B+.055)/1.055,2.4),Q<=.03928?xe=Q/12.92:xe=Y.pow((Q+.055)/1.055,2.4),.2126*G+.7152*he+.0722*xe},setAlpha:function(E){return this._a=M(E),this._roundA=P(100*this._a)/100,this},toHsv:function(){var E=h(this._r,this._g,this._b);return{h:E.h*360,s:E.s,v:E.v,a:this._a}},toHsvString:function(){var E=h(this._r,this._g,this._b),k=P(E.h*360),B=P(E.s*100),Q=P(E.v*100);return this._a==1?"hsv("+k+", "+B+"%, "+Q+"%)":"hsva("+k+", "+B+"%, "+Q+"%, "+this._roundA+")"},toHsl:function(){var E=g(this._r,this._g,this._b);return{h:E.h*360,s:E.s,l:E.l,a:this._a}},toHslString:function(){var E=g(this._r,this._g,this._b),k=P(E.h*360),B=P(E.s*100),Q=P(E.l*100);return this._a==1?"hsl("+k+", "+B+"%, "+Q+"%)":"hsla("+k+", "+B+"%, "+Q+"%, "+this._roundA+")"},toHex:function(E){return o(this._r,this._g,this._b,E)},toHexString:function(E){return"#"+this.toHex(E)},toHex8:function(E){return u(this._r,this._g,this._b,this._a,E)},toHex8String:function(E){return"#"+this.toHex8(E)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(I(this._r,255)*100)+"%",g:P(I(this._g,255)*100)+"%",b:P(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%)":"rgba("+P(I(this._r,255)*100)+"%, "+P(I(this._g,255)*100)+"%, "+P(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(E){var k="#"+s(this._r,this._g,this._b,this._a),B=k,Q=this._gradientType?"GradientType = 1, ":"";if(E){var G=L(E);B="#"+s(G._r,G._g,G._b,G._a)}return"progid:DXImageTransform.Microsoft.gradient("+Q+"startColorstr="+k+",endColorstr="+B+")"},toString:function(E){var k=!!E;E=E||this._format;var B=!1,Q=this._a<1&&this._a>=0,G=!k&&Q&&(E==="hex"||E==="hex6"||E==="hex3"||E==="hex4"||E==="hex8"||E==="name");return G?E==="name"&&this._a===0?this.toName():this.toRgbString():(E==="rgb"&&(B=this.toRgbString()),E==="prgb"&&(B=this.toPercentageRgbString()),(E==="hex"||E==="hex6")&&(B=this.toHexString()),E==="hex3"&&(B=this.toHexString(!0)),E==="hex4"&&(B=this.toHex8String(!0)),E==="hex8"&&(B=this.toHex8String()),E==="name"&&(B=this.toName()),E==="hsl"&&(B=this.toHslString()),E==="hsv"&&(B=this.toHsvString()),B||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(E,k){var B=E.apply(null,[this].concat([].slice.call(k)));return this._r=B._r,this._g=B._g,this._b=B._b,this.setAlpha(B._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(O,arguments)},desaturate:function(){return this._applyModification(a,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(x,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(E,k){return E.apply(null,[this].concat([].slice.call(k)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(f,arguments)},triad:function(){return this._applyCombination(T,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},L.fromRatio=function(E,k){if(typeof E=="object"){var B={};for(var Q in E)E.hasOwnProperty(Q)&&(Q==="a"?B[Q]=E[Q]:B[Q]=Ae(E[Q]));E=B}return L(E,k)};function y(E){var k={r:0,g:0,b:0},B=1,Q=null,G=null,he=null,xe=!1,Ie=!1;return typeof E=="string"&&(E=ve(E)),typeof E=="object"&&(Le(E.r)&&Le(E.g)&&Le(E.b)?(k=m(E.r,E.g,E.b),xe=!0,Ie=String(E.r).substr(-1)==="%"?"prgb":"rgb"):Le(E.h)&&Le(E.s)&&Le(E.v)?(Q=Ae(E.s),G=Ae(E.v),k=p(E.h,Q,G),xe=!0,Ie="hsv"):Le(E.h)&&Le(E.s)&&Le(E.l)&&(Q=Ae(E.s),he=Ae(E.l),k=l(E.h,Q,he),xe=!0,Ie="hsl"),E.hasOwnProperty("a")&&(B=E.a)),B=M(B),{ok:xe,format:E.format||Ie,r:K(255,z(k.r,0)),g:K(255,z(k.g,0)),b:K(255,z(k.b,0)),a:B}}function m(E,k,B){return{r:I(E,255)*255,g:I(k,255)*255,b:I(B,255)*255}}function g(E,k,B){E=I(E,255),k=I(k,255),B=I(B,255);var Q=z(E,k,B),G=K(E,k,B),he,xe,Ie=(Q+G)/2;if(Q==G)he=xe=0;else{var ue=Q-G;xe=Ie>.5?ue/(2-Q-G):ue/(Q+G);switch(Q){case E:he=(k-B)/ue+(k<B?6:0);break;case k:he=(B-E)/ue+2;break;case B:he=(E-k)/ue+4;break}he/=6}return{h:he,s:xe,l:Ie}}function l(E,k,B){var Q,G,he;E=I(E,360),k=I(k,100),B=I(B,100);function xe(ge,_e,Se){return Se<0&&(Se+=1),Se>1&&(Se-=1),Se<1/6?ge+(_e-ge)*6*Se:Se<1/2?_e:Se<2/3?ge+(_e-ge)*(2/3-Se)*6:ge}if(k===0)Q=G=he=B;else{var Ie=B<.5?B*(1+k):B+k-B*k,ue=2*B-Ie;Q=xe(ue,Ie,E+1/3),G=xe(ue,Ie,E),he=xe(ue,Ie,E-1/3)}return{r:Q*255,g:G*255,b:he*255}}function h(E,k,B){E=I(E,255),k=I(k,255),B=I(B,255);var Q=z(E,k,B),G=K(E,k,B),he,xe,Ie=Q,ue=Q-G;if(xe=Q===0?0:ue/Q,Q==G)he=0;else{switch(Q){case E:he=(k-B)/ue+(k<B?6:0);break;case k:he=(B-E)/ue+2;break;case B:he=(E-k)/ue+4;break}he/=6}return{h:he,s:xe,v:Ie}}function p(E,k,B){E=I(E,360)*6,k=I(k,100),B=I(B,100);var Q=Y.floor(E),G=E-Q,he=B*(1-k),xe=B*(1-G*k),Ie=B*(1-(1-G)*k),ue=Q%6,ge=[B,xe,he,he,Ie,B][ue],_e=[Ie,B,B,xe,he,he][ue],Se=[he,he,Ie,B,B,xe][ue];return{r:ge*255,g:_e*255,b:Se*255}}function o(E,k,B,Q){var G=[fe(P(E).toString(16)),fe(P(k).toString(16)),fe(P(B).toString(16))];return Q&&G[0].charAt(0)==G[0].charAt(1)&&G[1].charAt(0)==G[1].charAt(1)&&G[2].charAt(0)==G[2].charAt(1)?G[0].charAt(0)+G[1].charAt(0)+G[2].charAt(0):G.join("")}function u(E,k,B,Q,G){var he=[fe(P(E).toString(16)),fe(P(k).toString(16)),fe(P(B).toString(16)),fe(be(Q))];return G&&he[0].charAt(0)==he[0].charAt(1)&&he[1].charAt(0)==he[1].charAt(1)&&he[2].charAt(0)==he[2].charAt(1)&&he[3].charAt(0)==he[3].charAt(1)?he[0].charAt(0)+he[1].charAt(0)+he[2].charAt(0)+he[3].charAt(0):he.join("")}function s(E,k,B,Q){var G=[fe(be(Q)),fe(P(E).toString(16)),fe(P(k).toString(16)),fe(P(B).toString(16))];return G.join("")}L.equals=function(E,k){return!E||!k?!1:L(E).toRgbString()==L(k).toRgbString()},L.random=function(){return L.fromRatio({r:n(),g:n(),b:n()})};function a(E,k){k=k===0?0:k||10;var B=L(E).toHsl();return B.s-=k/100,B.s=v(B.s),L(B)}function R(E,k){k=k===0?0:k||10;var B=L(E).toHsl();return B.s+=k/100,B.s=v(B.s),L(B)}function x(E){return L(E).desaturate(100)}function S(E,k){k=k===0?0:k||10;var B=L(E).toHsl();return B.l+=k/100,B.l=v(B.l),L(B)}function D(E,k){k=k===0?0:k||10;var B=L(E).toRgb();return B.r=z(0,K(255,B.r-P(255*-(k/100)))),B.g=z(0,K(255,B.g-P(255*-(k/100)))),B.b=z(0,K(255,B.b-P(255*-(k/100)))),L(B)}function O(E,k){k=k===0?0:k||10;var B=L(E).toHsl();return B.l-=k/100,B.l=v(B.l),L(B)}function A(E,k){var B=L(E).toHsl(),Q=(B.h+k)%360;return B.h=Q<0?360+Q:Q,L(B)}function C(E){var k=L(E).toHsl();return k.h=(k.h+180)%360,L(k)}function T(E){var k=L(E).toHsl(),B=k.h;return[L(E),L({h:(B+120)%360,s:k.s,l:k.l}),L({h:(B+240)%360,s:k.s,l:k.l})]}function d(E){var k=L(E).toHsl(),B=k.h;return[L(E),L({h:(B+90)%360,s:k.s,l:k.l}),L({h:(B+180)%360,s:k.s,l:k.l}),L({h:(B+270)%360,s:k.s,l:k.l})]}function f(E){var k=L(E).toHsl(),B=k.h;return[L(E),L({h:(B+72)%360,s:k.s,l:k.l}),L({h:(B+216)%360,s:k.s,l:k.l})]}function b(E,k,B){k=k||6,B=B||30;var Q=L(E).toHsl(),G=360/B,he=[L(E)];for(Q.h=(Q.h-(G*k>>1)+720)%360;--k;)Q.h=(Q.h+G)%360,he.push(L(Q));return he}function _(E,k){k=k||6;for(var B=L(E).toHsv(),Q=B.h,G=B.s,he=B.v,xe=[],Ie=1/k;k--;)xe.push(L({h:Q,s:G,v:he})),he=(he+Ie)%1;return xe}L.mix=function(E,k,B){B=B===0?0:B||50;var Q=L(E).toRgb(),G=L(k).toRgb(),he=B/100,xe={r:(G.r-Q.r)*he+Q.r,g:(G.g-Q.g)*he+Q.g,b:(G.b-Q.b)*he+Q.b,a:(G.a-Q.a)*he+Q.a};return L(xe)},L.readability=function(E,k){var B=L(E),Q=L(k);return(Y.max(B.getLuminance(),Q.getLuminance())+.05)/(Y.min(B.getLuminance(),Q.getLuminance())+.05)},L.isReadable=function(E,k,B){var Q=L.readability(E,k),G,he;he=!1,G=$(B);switch(G.level+G.size){case"AAsmall":case"AAAlarge":he=Q>=4.5;break;case"AAlarge":he=Q>=3;break;case"AAAsmall":he=Q>=7;break}return he},L.mostReadable=function(E,k,B){var Q=null,G=0,he,xe,Ie,ue;B=B||{},xe=B.includeFallbackColors,Ie=B.level,ue=B.size;for(var ge=0;ge<k.length;ge++)he=L.readability(E,k[ge]),he>G&&(G=he,Q=L(k[ge]));return L.isReadable(E,Q,{level:Ie,size:ue})||!xe?Q:(B.includeFallbackColors=!1,L.mostReadable(E,["#fff","#000"],B))};var j=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=L.hexNames=w(j);function w(E){var k={};for(var B in E)E.hasOwnProperty(B)&&(k[E[B]]=B);return k}function M(E){return E=parseFloat(E),(isNaN(E)||E<0||E>1)&&(E=1),E}function I(E,k){Z(E)&&(E="100%");var B=oe(E);return E=K(k,z(0,parseFloat(E))),B&&(E=parseInt(E*k,10)/100),Y.abs(E-k)<1e-6?1:E%k/parseFloat(k)}function v(E){return K(1,z(0,E))}function W(E){return parseInt(E,16)}function Z(E){return typeof E=="string"&&E.indexOf(".")!=-1&&parseFloat(E)===1}function oe(E){return typeof E=="string"&&E.indexOf("%")!=-1}function fe(E){return E.length==1?"0"+E:""+E}function Ae(E){return E<=1&&(E=E*100+"%"),E}function be(E){return Y.round(parseFloat(E)*255).toString(16)}function Re(E){return W(E)/255}var Ce=function(){var E="[-\\+]?\\d+%?",k="[-\\+]?\\d*\\.\\d+%?",B="(?:"+k+")|(?:"+E+")",Q="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",G="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?";return{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+Q),rgba:new RegExp("rgba"+G),hsl:new RegExp("hsl"+Q),hsla:new RegExp("hsla"+G),hsv:new RegExp("hsv"+Q),hsva:new RegExp("hsva"+G),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(E){return!!Ce.CSS_UNIT.exec(E)}function ve(E){E=E.replace(N,"").replace(X,"").toLowerCase();var k=!1;if(j[E])E=j[E],k=!0;else if(E=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var B;return(B=Ce.rgb.exec(E))?{r:B[1],g:B[2],b:B[3]}:(B=Ce.rgba.exec(E))?{r:B[1],g:B[2],b:B[3],a:B[4]}:(B=Ce.hsl.exec(E))?{h:B[1],s:B[2],l:B[3]}:(B=Ce.hsla.exec(E))?{h:B[1],s:B[2],l:B[3],a:B[4]}:(B=Ce.hsv.exec(E))?{h:B[1],s:B[2],v:B[3]}:(B=Ce.hsva.exec(E))?{h:B[1],s:B[2],v:B[3],a:B[4]}:(B=Ce.hex8.exec(E))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),a:Re(B[4]),format:k?"name":"hex8"}:(B=Ce.hex6.exec(E))?{r:W(B[1]),g:W(B[2]),b:W(B[3]),format:k?"name":"hex"}:(B=Ce.hex4.exec(E))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),a:Re(B[4]+""+B[4]),format:k?"name":"hex8"}:(B=Ce.hex3.exec(E))?{r:W(B[1]+""+B[1]),g:W(B[2]+""+B[2]),b:W(B[3]+""+B[3]),format:k?"name":"hex"}:!1}function $(E){var k,B;return E=E||{level:"AA",size:"small"},k=(E.level||"AA").toUpperCase(),B=(E.size||"small").toLowerCase(),k!=="AA"&&k!=="AAA"&&(k="AA"),B!=="small"&&B!=="large"&&(B="small"),{level:k,size:B}}Je.exports?Je.exports=L:!(le=function(){return L}.call(Ee,J,Ee,Je),le!==void 0&&(Je.exports=le))})(Math)},bT9E:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return Y});var le=J("VTBJ");function Y(N,X){var H=Object(le.a)({},N);return Array.isArray(X)&&X.forEach(function(P){delete H[P]}),H}},c5Ni:function(Je,Ee,J){},dejd:function(Je,Ee,J){},dmUQ:function(Je,Ee,J){"use strict";var le=J("Ff2n"),Y=J("rePB"),N=J("1OyB"),X=J("vuIU"),H=J("Ji7U"),P=J("md7G"),K=J("foSv"),z=J("q1tI"),n=J.n(z),L=J("TSYQ"),y=J.n(L),m=J("4IlW");function g(T,d){var f=Object.keys(T);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(T);d&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(T,_).enumerable})),f.push.apply(f,b)}return f}function l(T){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?g(Object(f),!0).forEach(function(b){Object(Y.a)(T,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(f)):g(Object(f)).forEach(function(b){Object.defineProperty(T,b,Object.getOwnPropertyDescriptor(f,b))})}return T}function h(T){var d=p();return function(){var b=Object(K.a)(T),_;if(d){var j=Object(K.a)(this).constructor;_=Reflect.construct(b,arguments,j)}else _=b.apply(this,arguments);return Object(P.a)(this,_)}}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}function o(){}function u(T){T.preventDefault()}var s=function(d){return d.replace(/[^\w.-]+/g,"")},a=200,R=600,x=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(d){return d!=null},D=function(d,f){return f===d||typeof f=="number"&&typeof d=="number"&&isNaN(f)&&isNaN(d)},O=function(T){Object(H.a)(f,T);var d=h(f);function f(b){var _;Object(N.a)(this,f),_=d.call(this,b),_.onKeyDown=function(w){var M=_.props,I=M.onKeyDown,v=M.onPressEnter;if(w.keyCode===m.a.UP){var W=_.getRatio(w);_.up(w,W,null),_.stop()}else if(w.keyCode===m.a.DOWN){var Z=_.getRatio(w);_.down(w,Z,null),_.stop()}else w.keyCode===m.a.ENTER&&v&&v(w);if(_.recordCursorPosition(),_.lastKeyCode=w.keyCode,I){for(var oe=arguments.length,fe=new Array(oe>1?oe-1:0),Ae=1;Ae<oe;Ae++)fe[Ae-1]=arguments[Ae];I.apply(void 0,[w].concat(fe))}},_.onKeyUp=function(w){var M=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),M){for(var I=arguments.length,v=new Array(I>1?I-1:0),W=1;W<I;W++)v[W-1]=arguments[W];M.apply(void 0,[w].concat(v))}},_.onChange=function(w){var M=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(w)),_.setState({inputValue:_.rawInput}),M(_.toNumber(_.rawInput))},_.onMouseUp=function(){var w=_.props.onMouseUp;_.recordCursorPosition(),w&&w.apply(void 0,arguments)},_.onFocus=function(){var w;_.setState({focused:!0}),(w=_.props).onFocus.apply(w,arguments)},_.onBlur=function(){var w=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var M=_.getCurrentValidValue(_.state.inputValue),I=_.setValue(M,o);if(w){var v=_.input.value,W=_.getInputDisplayValue({focus:!1,value:I});_.input.value=W&&Number(W),w.apply(void 0,arguments),_.input.value=v}},_.getRatio=function(w){var M=1;return w.metaKey||w.ctrlKey?M=.1:w.shiftKey&&(M=10),M},_.getFullNum=function(w){return isNaN(w)?w:/e/i.test(String(w))?Number(w).toFixed(18).replace(/\.?0+$/,""):w},_.getPrecision=function(w){if(S(_.props.precision))return _.props.precision;var M=String(w);if(M.indexOf("e-")>=0)return parseInt(M.slice(M.indexOf("e-")+2),10);var I=0;return M.indexOf(".")>=0&&(I=M.length-M.indexOf(".")-1),I},_.getInputDisplayValue=function(w){var M=w||_.state,I=M.focused,v=M.inputValue,W=M.value,Z;I?Z=v:Z=_.toPrecisionAsStep(W),Z==null&&(Z="");var oe=_.formatWrapper(Z);return S(_.props.decimalSeparator)&&(oe=oe.toString().replace(".",_.props.decimalSeparator)),oe},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(w){}},_.restoreByAfter=function(w){if(w===void 0)return!1;var M=_.input.value,I=M.lastIndexOf(w);if(I===-1)return!1;var v=_.cursorBefore.length;return _.lastKeyCode===m.a.DELETE&&_.cursorBefore.charAt(v-1)===w[0]?(_.fixCaret(v,v),!0):I+w.length===M.length?(_.fixCaret(I,I),!0):!1},_.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(M,I){var v=w.substring(I);return _.restoreByAfter(v)})},_.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(w,M,I){_.pressingUpOrDown=!0,_.step("down",w,M,I)},_.up=function(w,M,I){_.pressingUpOrDown=!0,_.step("up",w,M,I)},_.saveInput=function(w){_.input=w};var j=b.value;j===void 0&&(j=b.defaultValue),_.state={focused:b.autoFocus};var U=_.getValidValue(_.toNumber(j));return _.state=l(l({},_.state),{},{inputValue:_.toPrecisionAsStep(U),value:U}),_}return Object(X.a)(f,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var j=this.props,U=j.value,w=j.onChange,M=j.max,I=j.min,v=this.state.focused;if(_){if(!D(_.value,U)||!D(_.max,M)||!D(_.min,I)){var W=v?U:this.getValidValue(U),Z;this.pressingUpOrDown?Z=W:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:Z})}var oe="value"in this.props?U:this.state.value;"max"in this.props&&_.max!==M&&typeof oe=="number"&&oe>M&&w&&w(M),"min"in this.props&&_.min!==I&&typeof oe=="number"&&oe<I&&w&&w(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ae){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var j=_;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(_){var j=_.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,w=parseFloat(_);return isNaN(w)?_:(w<j&&(w=j),w>U&&(w=U),w)}},{key:"setValue",value:function(_,j){var U=this.props.precision,w=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),M=this.state.value,I=M===void 0?null:M,v=this.state.inputValue,W=v===void 0?null:v,Z=typeof w=="number"?w.toFixed(U):"".concat(w),oe=w!==I||Z!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},j)):this.setState({value:w,inputValue:this.toPrecisionAsStep(_)},j),oe&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,w=U.precision,M=U.step;if(S(w))return w;var I=this.getPrecision(j),v=this.getPrecision(M),W=this.getPrecision(_);return _?Math.max(W,I+v):I+v}},{key:"getPrecisionFactor",value:function(_){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(_,j);return Math.pow(10,U)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var j=Math.abs(this.getMaxPrecision(_));return isNaN(j)?_.toString():Number(_).toFixed(j)}},{key:"toNumber",value:function(_){var j=this.props.precision,U=this.state.focused,w=_&&_.length>16&&U;return this.isNotCompleteNumber(_)||w?_:S(j)?Math.round(_*Math.pow(10,j))/Math.pow(10,j):Number(_)}},{key:"upStep",value:function(_,j){var U=this.props.step,w=this.getPrecisionFactor(_,j),M=Math.abs(this.getMaxPrecision(_,j)),I=((w*_+w*U*j)/w).toFixed(M);return this.toNumber(I)}},{key:"downStep",value:function(_,j){var U=this.props.step,w=this.getPrecisionFactor(_,j),M=Math.abs(this.getMaxPrecision(_,j)),I=((w*_-w*U*j)/w).toFixed(M);return this.toNumber(I)}},{key:"step",value:function(_,j){var U=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var I=this.props;if(I.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var W=this["".concat(_,"Step")](v,w),Z=W>I.max||W<I.min;if(W>I.max?W=I.max:W<I.min&&(W=I.min),this.setValue(W,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){U[_](j,w,!0)},M?a:R)}},{key:"fixCaret",value:function(_,j){if(_===void 0||j===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,w=this.input.selectionEnd;(_!==U||j!==w)&&this.input.setSelectionRange(_,j)}catch(M){}}},{key:"render",value:function(){var _,j=this.props,U=j.prefixCls,w=j.disabled,M=j.readOnly,I=j.useTouch,v=j.autoComplete,W=j.upHandler,Z=j.downHandler,oe=j.className,fe=j.max,Ae=j.min,be=j.style,Re=j.title,Ce=j.onMouseEnter,Le=j.onMouseLeave,ve=j.onMouseOver,$=j.onMouseOut,E=j.required,k=j.onClick,B=j.tabIndex,Q=j.type,G=j.placeholder,he=j.id,xe=j.inputMode,Ie=j.pattern,ue=j.step,ge=j.maxLength,_e=j.autoFocus,Se=j.name,Pe=j.onPaste,Ue=j.onInput,He=Object(le.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Be=this.state,Qe=Be.value,ze=Be.focused,Ye=y()(U,(_={},Object(Y.a)(_,oe,!!oe),Object(Y.a)(_,"".concat(U,"-disabled"),w),Object(Y.a)(_,"".concat(U,"-focused"),ze),_)),Me={};Object.keys(He).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Me[me]=He[me])});var it=!M&&!w,Ze=this.getInputDisplayValue(null),ce=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)>=fe),ee=(Qe||Qe===0)&&(isNaN(Qe)||Number(Qe)<=Ae),ne=ce||w||M,ae=ee||w||M,de=y()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Y.a)({},"".concat(U,"-handler-up-disabled"),ne)),re=y()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Y.a)({},"".concat(U,"-handler-down-disabled"),ae)),se=I?{onTouchStart:ne?o:this.up,onTouchEnd:this.stop}:{onMouseDown:ne?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=I?{onTouchStart:ae?o:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ye,style:be,title:Re,onMouseEnter:Ce,onMouseLeave:Le,onMouseOver:ve,onMouseOut:$,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(U,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Increase Value","aria-disabled":ne,className:de}),W||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:re}),Z||n.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(U,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ae,"aria-valuemax":fe,"aria-valuenow":Qe,required:E,type:Q,placeholder:G,onPaste:Pe,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:B,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:o,onKeyUp:it?this.onKeyUp:o,autoFocus:_e,maxLength:ge,readOnly:M,disabled:w,max:fe,min:Ae,step:ue,name:Se,title:Re,id:he,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:Ie,inputMode:xe,onInput:Ue},Me))))}}]),f}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var A=O,C=Ee.a=A},fjLI:function(Je,Ee,J){"use strict";J.d(Ee,"f",function(){return g}),J.d(Ee,"b",function(){return l}),J.d(Ee,"a",function(){return h}),J.d(Ee,"d",function(){return p}),J.d(Ee,"e",function(){return o}),J.d(Ee,"c",function(){return u});var le=J("8HAY"),Y=J("Vhoy"),N=J("MI8n"),X=J("JYp7"),H=J("pmY6"),P=J("24hK"),K=J("nnTU"),z=J("T8No"),n=J("Cg/j"),L=J("t9D7"),y=function(s,a,R,x){var S=arguments.length,D=S<3?a:x===null?x=Object.getOwnPropertyDescriptor(a,R):x,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(s,a,R,x);else for(var A=s.length-1;A>=0;A--)(O=s[A])&&(D=(S<3?O(D):S>3?O(a,R,D):O(a,R))||D);return S>3&&D&&Object.defineProperty(a,R,D),D},m=function(s,a){return function(R,x){a(R,x,s)}};function g(s){return s.command!==void 0}class l{constructor(s){this.id=l._idPool++,this._debugName=s}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const h=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===l.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(H.i)(()=>{let a=!1;for(const R of s)a=this._commands.delete(R.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,R)=>s.set(R,a)),s}appendMenuItem(s,a){return this.appendMenuItems(X.a.single({id:s,item:a}))}appendMenuItems(s){const a=new Set,R=new P.a;for(const{id:x,item:S}of s){let D=this._menuItems.get(x);D||(D=new P.a,this._menuItems.set(x,D)),R.push(D.push(S)),a.add(x)}return this._onDidChangeMenu.fire(a),Object(H.i)(()=>{if(R.size>0){for(let x of R)x();this._onDidChangeMenu.fire(a),R.clear()}})}getMenuItems(s){let a;return this._menuItems.has(s)?a=[...this._menuItems.get(s)]:a=[],s===l.CommandPalette&&this._appendImplicitItems(a),a}_appendImplicitItems(s){const a=new Set;for(const R of s)g(R)&&(a.add(R.command.id),R.alt&&a.add(R.alt.id));this._commands.forEach((R,x)=>{a.has(x)||s.push({command:R})})}};class o extends le.e{constructor(s,a,R,x){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=a,this._contextKeyService=R,this._options=x}get actions(){const s=[],a=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=a.getActions(this._options);a.dispose();for(const[,x]of R)x.length>0&&(s.push(...x),s.push(new le.d));return s.length&&s.pop(),s}}let u=class s{constructor(a,R,x,S,D){var O,A;if(this._commandService=D,this.id=a.id,this.label=(x==null?void 0:x.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:(O=a.tooltip)===null||O===void 0?void 0:O.value)!==null&&A!==void 0?A:"",this.enabled=!a.precondition||S.contextMatchesRules(a.precondition),this.checked=void 0,a.toggled){const C=a.toggled.condition?a.toggled:{condition:a.toggled};this.checked=S.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=R?new s(R,void 0,x,S,D):void 0,this._options=x,L.d.isThemeIcon(a.icon)&&(this.class=Y.a.asClassName(a.icon))}dispose(){}run(...a){var R,x;let S=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(S=[...S,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(S=[...S,...a]),this._commandService.executeCommand(this.id,...S)}};u=y([m(3,z.b),m(4,K.b)],u)},h78n:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return _});var le=J("q1tI"),Y=J.n(le),N=J("TSYQ"),X=J.n(N),H={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},P=function(w){var M=w.map(function(){return Object(le.useRef)()}),I=Object(le.useRef)();return Object(le.useEffect)(function(){var v=Date.now(),W=!1;Object.keys(M).forEach(function(Z){var oe=M[Z].current;if(!oe)return;W=!0;var fe=oe.style;fe.transitionDuration=".3s, .3s, .3s, .06s",I.current&&v-I.current<100&&(fe.transitionDuration="0s, 0s")}),W&&(I.current=Date.now())}),[M]};function K(){return K=Object.assign||function(U){for(var w=1;w<arguments.length;w++){var M=arguments[w];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(U[I]=M[I])}return U},K.apply(this,arguments)}function z(U,w){return g(U)||m(U,w)||L(U,w)||n()}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L(U,w){if(!U)return;if(typeof U=="string")return y(U,w);var M=Object.prototype.toString.call(U).slice(8,-1);if(M==="Object"&&U.constructor&&(M=U.constructor.name),M==="Map"||M==="Set")return Array.from(U);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return y(U,w)}function y(U,w){(w==null||w>U.length)&&(w=U.length);for(var M=0,I=new Array(w);M<w;M++)I[M]=U[M];return I}function m(U,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var M=[],I=!0,v=!1,W=void 0;try{for(var Z=U[Symbol.iterator](),oe;!(I=(oe=Z.next()).done)&&!(M.push(oe.value),w&&M.length===w);I=!0);}catch(fe){v=!0,W=fe}finally{try{!I&&Z.return!=null&&Z.return()}finally{if(v)throw W}}return M}function g(U){if(Array.isArray(U))return U}function l(U,w){if(U==null)return{};var M=h(U,w),I,v;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(v=0;v<W.length;v++){if(I=W[v],w.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;M[I]=U[I]}}return M}function h(U,w){if(U==null)return{};var M={},I=Object.keys(U),v,W;for(W=0;W<I.length;W++){if(v=I[W],w.indexOf(v)>=0)continue;M[v]=U[v]}return M}var p=function(w){var M=w.className,I=w.percent,v=w.prefixCls,W=w.strokeColor,Z=w.strokeLinecap,oe=w.strokeWidth,fe=w.style,Ae=w.trailColor,be=w.trailWidth,Re=w.transition,Ce=l(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ce.gapPosition;var Le=Array.isArray(I)?I:[I],ve=Array.isArray(W)?W:[W],$=P(Le),E=z($,1),k=E[0],B=oe/2,Q=100-oe/2,G="M ".concat(Z==="round"?B:0,",").concat(B,`
L `).concat(Z==="round"?Q:100,",").concat(B),he="0 0 100 ".concat(oe),xe=0;return Y.a.createElement("svg",K({className:X()("".concat(v,"-line"),M),viewBox:he,preserveAspectRatio:"none",style:fe},Ce),Y.a.createElement("path",{className:"".concat(v,"-line-trail"),d:G,strokeLinecap:Z,stroke:Ae,strokeWidth:be||oe,fillOpacity:"0"}),Le.map(function(Ie,ue){var ge={strokeDasharray:"".concat(Ie,"px, 100px"),strokeDashoffset:"-".concat(xe,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},_e=ve[ue]||ve[ve.length-1];return xe+=Ie,Y.a.createElement("path",{key:ue,className:"".concat(v,"-line-path"),d:G,strokeLinecap:Z,stroke:_e,strokeWidth:oe,fillOpacity:"0",ref:k[ue],style:ge})}))};p.defaultProps=H;var o=p;function u(){return u=Object.assign||function(U){for(var w=1;w<arguments.length;w++){var M=arguments[w];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(U[I]=M[I])}return U},u.apply(this,arguments)}function s(U,w){return D(U)||S(U,w)||R(U,w)||a()}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(U,w){if(!U)return;if(typeof U=="string")return x(U,w);var M=Object.prototype.toString.call(U).slice(8,-1);if(M==="Object"&&U.constructor&&(M=U.constructor.name),M==="Map"||M==="Set")return Array.from(U);if(M==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(M))return x(U,w)}function x(U,w){(w==null||w>U.length)&&(w=U.length);for(var M=0,I=new Array(w);M<w;M++)I[M]=U[M];return I}function S(U,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var M=[],I=!0,v=!1,W=void 0;try{for(var Z=U[Symbol.iterator](),oe;!(I=(oe=Z.next()).done)&&!(M.push(oe.value),w&&M.length===w);I=!0);}catch(fe){v=!0,W=fe}finally{try{!I&&Z.return!=null&&Z.return()}finally{if(v)throw W}}return M}function D(U){if(Array.isArray(U))return U}function O(U,w){if(U==null)return{};var M=A(U,w),I,v;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(v=0;v<W.length;v++){if(I=W[v],w.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;M[I]=U[I]}}return M}function A(U,w){if(U==null)return{};var M={},I=Object.keys(U),v,W;for(W=0;W<I.length;W++){if(v=I[W],w.indexOf(v)>=0)continue;M[v]=U[v]}return M}var C=0;function T(U){return+U.replace("%","")}function d(U){return Array.isArray(U)?U:[U]}function f(U,w,M,I){var v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,Z=50-I/2,oe=0,fe=-Z,Ae=0,be=-2*Z;switch(W){case"left":oe=-Z,fe=0,Ae=2*Z,be=0;break;case"right":oe=Z,fe=0,Ae=-2*Z,be=0;break;case"bottom":fe=Z,be=2*Z;break;default:}var Re="M 50,50 m ".concat(oe,",").concat(fe,`
a `).concat(Z,",").concat(Z," 0 1 1 ").concat(Ae,",").concat(-be,`
a `).concat(Z,",").concat(Z," 0 1 1 ").concat(-Ae,",").concat(be),Ce=Math.PI*2*Z,Le={stroke:M,strokeDasharray:"".concat(w/100*(Ce-v),"px ").concat(Ce,"px"),strokeDashoffset:"-".concat(v/2+U/100*(Ce-v),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Le}}var b=function(w){var M=w.prefixCls,I=w.strokeWidth,v=w.trailWidth,W=w.gapDegree,Z=w.gapPosition,oe=w.trailColor,fe=w.strokeLinecap,Ae=w.style,be=w.className,Re=w.strokeColor,Ce=w.percent,Le=O(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ve=Object(le.useMemo)(function(){return C+=1,C},[]),$=f(0,100,oe,I,W,Z),E=$.pathString,k=$.pathStyle,B=d(Ce),Q=d(Re),G=Q.find(function(ge){return Object.prototype.toString.call(ge)==="[object Object]"}),he=P(B),xe=s(he,1),Ie=xe[0],ue=function(){var _e=0;return B.map(function(Se,Pe){var Ue=Q[Pe]||Q[Q.length-1],He=Object.prototype.toString.call(Ue)==="[object Object]"?"url(#".concat(M,"-gradient-").concat(ve,")"):"",Be=f(_e,Se,Ue,I,W,Z);return _e+=Se,Y.a.createElement("path",{key:Pe,className:"".concat(M,"-circle-path"),d:Be.pathString,stroke:He,strokeLinecap:fe,strokeWidth:I,opacity:Se===0?0:1,fillOpacity:"0",style:Be.pathStyle,ref:Ie[Pe]})})};return Y.a.createElement("svg",u({className:X()("".concat(M,"-circle"),be),viewBox:"0 0 100 100",style:Ae},Le),G&&Y.a.createElement("defs",null,Y.a.createElement("linearGradient",{id:"".concat(M,"-gradient-").concat(ve),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(G).sort(function(ge,_e){return T(ge)-T(_e)}).map(function(ge,_e){return Y.a.createElement("stop",{key:_e,offset:ge,stopColor:G[ge]})}))),Y.a.createElement("path",{className:"".concat(M,"-circle-trail"),d:E,stroke:oe,strokeLinecap:fe,strokeWidth:v||I,fillOpacity:"0",style:k}),ue().reverse())};b.defaultProps=H;var _=b,j={Line:o,Circle:_}},ic2d:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return X});var le=J("FWmy"),Y=J("746U");class N{constructor(){this.data=new Map}add(H,P){le.a(Y.l(H)),le.a(Y.k(P)),le.a(!this.data.has(H),"There is already an extension with this id"),this.data.set(H,P)}as(H){return this.data.get(H)||null}}const X=new N},kSUc:function(Je,Ee,J){},"kaH+":function(Je,Ee,J){"use strict";var le=J("+L6B"),Y=J("2/Rp"),N=J("tJVT"),X=J("q1tI"),H=J.n(X),P=J("UZu5"),K=J.n(P),z=J("dhSg"),n=J("rLCj"),L=J("dF/Y"),y=J("4i/N");Ee.a=function(){var m=Object(X.useState)(""),g=Object(N.a)(m,2),l=g[0],h=g[1],p=Object(X.useState)(0),o=Object(N.a)(p,2),u=o[0],s=o[1],a=Object(X.useRef)("");Object(X.useEffect)(function(){var C=z.a.subscribe("preview-image",function(T){h(T),document.body.style.overflow="hidden"});return C},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",R),function(){document.removeEventListener("keydown",R)}},[]),Object(X.useEffect)(function(){a.current=l},[l]);function R(C){C.keyCode==27&&a.current&&x()}function x(){document.body.style.overflow="auto",h("")}function S(){s(u+90)}var D=Object(X.useRef)(),O=Object(X.useRef)(),A=function(T){(T.nativeEvent.target===D.current||T.nativeEvent.target===O.current)&&x()};return H.a.createElement(X.Fragment,null,l?H.a.createElement("div",{className:"image-preview-container",ref:D,onClick:A},H.a.createElement("div",{className:"button-group"},H.a.createElement(Y.a,{onClick:S},"\u65CB\u8F6C",H.a.createElement(n.a,null)),H.a.createElement(Y.a,{href:l},"\u4E0B\u8F7D",H.a.createElement(L.a,null)),H.a.createElement(Y.a,{onClick:x},"\u5173\u95ED",H.a.createElement(y.a,null))),H.a.createElement("div",{className:"preview-wrp-group",ref:O},H.a.createElement("img",{className:"image-preview",src:l,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(u,"deg)")}}))):null)}},lZu9:function(Je,Ee,J){(function(le){le(J("VrN/"),J("1eCo"),J("8EBN"))})(function(le){"use strict";le.defineMode("markdown",function(Y,N){var X=le.getMode(Y,"text/html"),H=X.name=="null";function P(I){if(le.findModeByName){var v=le.findModeByName(I);v&&(I=v.mime||v.mimes[0])}var W=le.getMode(Y,I);return W.name=="null"?null:W}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.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 z in K)K.hasOwnProperty(z)&&N.tokenTypeOverrides[z]&&(K[z]=N.tokenTypeOverrides[z]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,m=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,g=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\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,v,W){return v.f=v.inline=W,W(I,v)}function a(I,v,W){return v.f=v.block=W,W(I,v)}function R(I){return!I||!/\S/.test(I.string)}function x(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 v=H;if(!v){var W=le.innerMode(X,I.htmlState);v=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}v&&(I.f=T,I.block=S,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function S(I,v){var W=I.column()===v.indentation,Z=R(v.prevLine.stream),oe=v.indentedCode,fe=v.prevLine.hr,Ae=v.list!==!1,be=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var Re=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,Ae)){for(v.list=null;Re<v.listStack[v.listStack.length-1];)v.listStack.pop(),v.listStack.length?v.indentation=v.listStack[v.listStack.length-1]:v.list=!1;v.list!==!1&&(v.indentationDiff=Re-v.listStack[v.listStack.length-1])}var Ce=!Z&&!fe&&!v.prevLine.header&&(!Ae||!oe)&&!v.prevLine.fencedCodeEnd,Le=(v.list===!1||fe||Z)&&v.indentation<=be&&I.match(n),ve=null;if(v.indentationDiff>=4&&(oe||v.prevLine.fencedCodeEnd||v.prevLine.header||Z))return I.skipToEnd(),v.indentedCode=!0,K.code;if(I.eatSpace())return null;if(W&&v.indentation<=be&&(ve=I.match(m))&&ve[1].length<=6)return v.quote=0,v.header=ve[1].length,v.thisLine.header=!0,N.highlightFormatting&&(v.formatting="header"),v.f=v.inline,A(v);if(v.indentation<=be&&I.eat(">"))return v.quote=W?1:v.quote+1,N.highlightFormatting&&(v.formatting="quote"),I.eatSpace(),A(v);if(!Le&&!v.setext&&W&&v.indentation<=be&&(ve=I.match(L))){var $=ve[1]?"ol":"ul";return v.indentation=Re+I.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,N.taskLists&&I.match(y,!1)&&(v.taskList=!0),v.f=v.inline,N.highlightFormatting&&(v.formatting=["list","list-"+$]),A(v)}else{if(W&&v.indentation<=be&&(ve=I.match(h,!0)))return v.quote=0,v.fencedEndRE=new RegExp(ve[1]+"+ *$"),v.localMode=N.fencedCodeBlockHighlighting&&P(ve[2]||N.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=le.startState(v.localMode)),v.f=v.block=O,N.highlightFormatting&&(v.formatting="code-block"),v.code=-1,A(v);if(v.setext||(!Ce||!Ae)&&!v.quote&&v.list===!1&&!v.code&&!Le&&!p.test(I.string)&&(ve=I.lookAhead(1))&&(ve=ve.match(g)))return v.setext?(v.header=v.setext,v.setext=0,I.skipToEnd(),N.highlightFormatting&&(v.formatting="header")):(v.header=ve[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,A(v);if(Le)return I.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,K.hr;if(I.peek()==="[")return s(I,v,j)}return s(I,v,v.inline)}function D(I,v){var W=X.token(I,v.htmlState);if(!H){var Z=le.innerMode(X,v.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||v.md_inside&&I.current().indexOf(">")>-1)&&(v.f=T,v.block=S,v.htmlState=null)}return W}function O(I,v){var W=v.listStack[v.listStack.length-1]||0,Z=v.indentation<W,oe=W+3;if(v.fencedEndRE&&v.indentation<=oe&&(Z||I.match(v.fencedEndRE))){N.highlightFormatting&&(v.formatting="code-block");var fe;return Z||(fe=A(v)),v.localMode=v.localState=null,v.block=S,v.f=T,v.fencedEndRE=null,v.code=0,v.thisLine.fencedCodeEnd=!0,Z?a(I,v,v.block):fe}else return v.localMode?v.localMode.token(I,v.localState):(I.skipToEnd(),K.code)}function A(I){var v=[];if(I.formatting){v.push(K.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var W=0;W<I.formatting.length;W++)v.push(K.formatting+"-"+I.formatting[W]),I.formatting[W]==="header"&&v.push(K.formatting+"-"+I.formatting[W]+"-"+I.header),I.formatting[W]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?v.push(K.formatting+"-"+I.formatting[W]+"-"+I.quote):v.push("error"))}if(I.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(I.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(I.linkHref?v.push(K.linkHref,"url"):(I.strong&&v.push(K.strong),I.em&&v.push(K.em),I.strikethrough&&v.push(K.strikethrough),I.emoji&&v.push(K.emoji),I.linkText&&v.push(K.linkText),I.code&&v.push(K.code),I.image&&v.push(K.image),I.imageAltText&&v.push(K.imageAltText,"link"),I.imageMarker&&v.push(K.imageMarker)),I.header&&v.push(K.header,K.header+"-"+I.header),I.quote&&(v.push(K.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=I.quote?v.push(K.quote+"-"+I.quote):v.push(K.quote+"-"+N.maxBlockquoteDepth)),I.list!==!1){var Z=(I.listStack.length-1)%3;Z?Z===1?v.push(K.list2):v.push(K.list3):v.push(K.list1)}return I.trailingSpaceNewLine?v.push("trailing-space-new-line"):I.trailingSpace&&v.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function C(I,v){return I.match(l,!0)?A(v):void 0}function T(I,v){var W=v.text(I,v);if(typeof W!="undefined")return W;if(v.list)return v.list=null,A(v);if(v.taskList){var Z=I.match(y,!0)[1]===" ";return Z?v.taskOpen=!0:v.taskClosed=!0,N.highlightFormatting&&(v.formatting="task"),v.taskList=!1,A(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&I.match(/^#+$/,!0))return N.highlightFormatting&&(v.formatting="header"),A(v);var oe=I.next();if(v.linkTitle){v.linkTitle=!1;var fe=oe;oe==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(I.match(new RegExp(Ae),!0))return K.linkHref}if(oe==="`"){var be=v.formatting;N.highlightFormatting&&(v.formatting="code"),I.eatWhile("`");var Re=I.current().length;if(v.code==0&&(!v.quote||Re==1))return v.code=Re,A(v);if(Re==v.code){var Ce=A(v);return v.code=0,Ce}else return v.formatting=be,A(v)}else if(v.code)return A(v);if(oe==="\\"&&(I.next(),N.highlightFormatting)){var Le=A(v),ve=K.formatting+"-escape";return Le?Le+" "+ve:ve}if(oe==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,N.highlightFormatting&&(v.formatting="image"),A(v);if(oe==="["&&v.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,N.highlightFormatting&&(v.formatting="image"),A(v);if(oe==="]"&&v.imageAltText){N.highlightFormatting&&(v.formatting="image");var Le=A(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=f,Le}if(oe==="["&&!v.image)return v.linkText&&I.match(/^.*?\]/)||(v.linkText=!0,N.highlightFormatting&&(v.formatting="link")),A(v);if(oe==="]"&&v.linkText){N.highlightFormatting&&(v.formatting="link");var Le=A(v);return v.linkText=!1,v.inline=v.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?f:T,Le}if(oe==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var Le=A(v);return Le?Le+=" ":Le="",Le+K.linkInline}if(oe==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=d,N.highlightFormatting&&(v.formatting="link");var Le=A(v);return Le?Le+=" ":Le="",Le+K.linkEmail}if(N.xml&&oe==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var $=I.string.indexOf(">",I.pos);if($!=-1){var E=I.string.substring(I.start,$);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(E)&&(v.md_inside=!0)}return I.backUp(1),v.htmlState=le.startState(X),a(I,v,D)}if(N.xml&&oe==="<"&&I.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var k=1,B=I.pos==1?" ":I.string.charAt(I.pos-2);k<3&&I.eat(oe);)k++;var Q=I.peek()||" ",G=!/\s/.test(Q)&&(!o.test(Q)||/\s/.test(B)||o.test(B)),he=!/\s/.test(B)&&(!o.test(B)||/\s/.test(Q)||o.test(Q)),xe=null,Ie=null;if(k%2&&(!v.em&&G&&(oe==="*"||!he||o.test(B))?xe=!0:v.em==oe&&he&&(oe==="*"||!G||o.test(Q))&&(xe=!1)),k>1&&(!v.strong&&G&&(oe==="*"||!he||o.test(B))?Ie=!0:v.strong==oe&&he&&(oe==="*"||!G||o.test(Q))&&(Ie=!1)),Ie!=null||xe!=null){N.highlightFormatting&&(v.formatting=xe==null?"strong":Ie==null?"em":"strong em"),xe===!0&&(v.em=oe),Ie===!0&&(v.strong=oe);var Ce=A(v);return xe===!1&&(v.em=!1),Ie===!1&&(v.strong=!1),Ce}}else if(oe===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return A(v);I.backUp(1)}if(N.strikethrough){if(oe==="~"&&I.eatWhile(oe)){if(v.strikethrough){N.highlightFormatting&&(v.formatting="strikethrough");var Ce=A(v);return v.strikethrough=!1,Ce}else if(I.match(/^[^\s]/,!1))return v.strikethrough=!0,N.highlightFormatting&&(v.formatting="strikethrough"),A(v)}else if(oe===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return A(v);I.backUp(2)}}if(N.emoji&&oe===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,N.highlightFormatting&&(v.formatting="emoji");var ue=A(v);return v.emoji=!1,ue}return oe===" "&&(I.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),A(v)}function d(I,v){var W=I.next();if(W===">"){v.f=v.inline=T,N.highlightFormatting&&(v.formatting="link");var Z=A(v);return Z?Z+=" ":Z="",Z+K.linkInline}return I.match(/^[^>]+/,!0),K.linkInline}function f(I,v){if(I.eatSpace())return null;var W=I.next();return W==="("||W==="["?(v.f=v.inline=_(W==="("?")":"]"),N.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,A(v)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(I){return function(v,W){var Z=v.next();if(Z===I){W.f=W.inline=T,N.highlightFormatting&&(W.formatting="link-string");var oe=A(W);return W.linkHref=!1,oe}return v.match(b[I]),W.linkHref=!0,A(W)}}function j(I,v){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=U,I.next(),N.highlightFormatting&&(v.formatting="link"),v.linkText=!0,A(v)):s(I,v,T)}function U(I,v){if(I.match(/^\]:/,!0)){v.f=v.inline=w,N.highlightFormatting&&(v.formatting="link");var W=A(v);return v.linkText=!1,W}return I.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function w(I,v){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?v.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=T,K.linkHref+" url")}var M={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:T,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&&le.copyState(X,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?le.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,v){if(v.formatting=!1,I!=v.thisLine.stream){if(v.header=0,v.hr=!1,I.match(/^\s*$/,!0))return x(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:I},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=D)){var W=I.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(v.indentation=W,v.indentationDiff=null,W>0)return null}}return v.f(I,v)},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,v,W){return I.block==D&&X.indent?X.indent(I.htmlState,v,W):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,v,W):le.Pass},blankLine:x,getType:A,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return M},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},nEHx:function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return le});var le;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(le||(le={}))},nnTU:function(Je,Ee,J){"use strict";J.d(Ee,"b",function(){return K}),J.d(Ee,"a",function(){return z});var le=J("MI8n"),Y=J("JYp7"),N=J("pmY6"),X=J("24hK"),H=J("746U"),P=J("Cg/j");const K=Object(P.c)("commandService"),z=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new le.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,L){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:n,handler:L})}if(n.description){const h=[];for(let o of n.description.args)h.push(o.constraint);const p=n.handler;n.handler=function(o,...u){return Object(H.o)(u,h),p(o,...u)}}const{id:y}=n;let m=this._commands.get(y);m||(m=new X.a,this._commands.set(y,m));let g=m.unshift(n),l=Object(N.i)(()=>{g();const h=this._commands.get(y);(h==null?void 0:h.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),l}registerCommandAlias(n,L){return z.registerCommand(n,(y,...m)=>y.get(K).executeCommand(L,...m))}getCommand(n){const L=this._commands.get(n);return!L||L.isEmpty()?void 0:Y.a.first(L)}getCommands(){const n=new Map;for(const L of this._commands.keys()){const y=this.getCommand(L);y&&n.set(L,y)}return n}};z.registerCommand("noop",()=>{})},osHv:function(Je,Ee,J){(function(le){le(J("VrN/"))})(function(le){"use strict";var Y=le.Pos;function N(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",H=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+X+"]["+H+"]*)","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 z(o,u){var s=o.cm.getTokenTypeAt(Y(o.line,u));return s&&/\btag\b/.test(s)}function n(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function L(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function y(o){for(;;){var u=o.text.indexOf(">",o.ch);if(u==-1){if(n(o))continue;return}if(!z(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(L(o))continue;return}if(!z(o,u+1)){o.ch=u;continue}P.lastIndex=u,o.ch=u;var s=P.exec(o.text);if(s&&s.index==u)return s}}function g(o){for(;;){P.lastIndex=o.ch;var u=P.exec(o.text);if(!u){if(n(o))continue;return}if(!z(o,u.index+1)){o.ch=u.index+1;continue}return o.ch=u.index+u[0].length,u}}function l(o){for(;;){var u=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(u==-1){if(L(o))continue;return}if(!z(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 h(o,u){for(var s=[];;){var a=g(o),R,x=o.line,S=o.ch-(a?a[0].length:0);if(!a||!(R=y(o)))return;if(R=="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:Y(x,S),to:Y(o.line,o.ch)}}else s.push(a[2])}}function p(o,u){for(var s=[];;){var a=l(o);if(!a)return;if(a=="selfClose"){m(o);continue}var R=o.line,x=o.ch,S=m(o);if(!S)return;if(S[1])s.push(S[2]);else{for(var D=s.length-1;D>=0;--D)if(s[D]==S[2]){s.length=D;break}if(D<0&&(!u||u==S[2]))return{tag:S[2],from:Y(o.line,o.ch),to:Y(R,x)}}}}le.registerHelper("fold","xml",function(o,u){for(var s=new K(o,u.line,0);;){var a=g(s);if(!a||s.line!=u.line)return;var R=y(s);if(!R)return;if(!a[1]&&R!="selfClose"){var x=Y(s.line,s.ch),S=h(s,a[2]);return S&&N(S.from,x)>0?{from:x,to:S.from}:null}}}),le.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 R=y(a),x=R&&Y(a.line,a.ch),S=R&&m(a);if(!R||!S||N(a,u)>0)return;var D={from:Y(a.line,a.ch),to:x,tag:S[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:S[1]?{open:p(a,S[2]),close:D,at:"close"}:(a=new K(o,x.line,x.ch,s),{open:D,close:h(a,S[2]),at:"open"})},le.findEnclosingTag=function(o,u,s,a){for(var R=new K(o,u.line,u.ch,s);;){var x=p(R,a);if(!x)break;var S=new K(o,u.line,u.ch,s),D=h(S,x.tag);if(D)return{open:x,close:D}}},le.scanForClosingTag=function(o,u,s,a){var R=new K(o,u.line,u.ch,a?{from:0,to:a}:null);return h(R,s)}})},p5ED:function(Je,Ee,J){"use strict";var le=J("+L6B"),Y=J("2/Rp"),N=J("5Dmo"),X=J("3S7+"),H=J("k1fw"),P=J("9og8"),K=J("tJVT"),z=J("WmNS"),n=J.n(z),L=J("q1tI"),y=J.n(L),m=J("vHTk"),g=J.n(m),l=J("yEEn"),h=J("ZW9T"),p=J("1vsH"),o=J("V0Rq"),u=J("m3rI");Ee.a=function(s){var a,R,x,S,D,O,A,C=s.editOffice,T=C===void 0?"view":C,d=s.data,f=s.theme,b=s.type,_=s.filename,j=s.monacoEditor,U=s.className,w=s.style,M=s.close,I=s.onClose,v=s.hasMask,W=s.disabledDownload,Z=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(K.a)(Z,2),fe=oe[0],Ae=oe[1],be=Object(L.useState)(""),Re=Object(K.a)(be,2),Ce=Re[0],Le=Re[1],ve=Object(L.useState)(),$=Object(K.a)(ve,2),E=$[0],k=$[1],B=window.ENV==="build"?"/react/build":"",Q=u.a.PROXY_SERVER||location.origin,G,he=1024*1024,xe=10*he,Ie=Object(L.useRef)();(a=d)!==null&&a!==void 0&&a.startsWith("/api")&&b!=="txt"&&(d=(u.a.API_SERVER||location.origin)+d),b==="office"&&(G=Object(p.T)(d).filesize,G>xe&&(b="other")),_&&j&&(j.filename=_),Object(L.useEffect)(function(){var Se,Pe,Ue=(Se=document.cookie)===null||Se===void 0||((Pe=Se.replace(/\s/g,""))===null||Pe===void 0)?void 0:Pe.split(";");Ue==null||Ue.map(function(He){var Be=He.split("=");Be[0]==="_educoder_session"&&Le(Be[1])})},[]),Object(L.useEffect)(function(){b==="office"&&ue()},[b,d]);var ue=function(){var Se=Object(P.a)(n.a.mark(function Pe(){var Ue,He,Be;return n.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return console.log("data:",d),Ue=d,d.startsWith("http")||(Ue=location.origin+Ue),He=new URL(Ue).pathname.split("/").pop(),ze.next=6,Object(o.V)({attachment_id:He});case 6:Be=ze.sent,k(Be);case 8:case"end":return ze.stop()}},Pe)}));return function(){return Se.apply(this,arguments)}}(),ge=function(){if(d.startsWith("http")||d.startsWith("blob:")){_e();return}Object(p.z)(_||"educoder",d,_)},_e=function(){Object(p.x)(_||"educoder",decodeURIComponent(d))};return y.a.createElement("div",{style:Object(H.a)({},w||{}),className:"".concat(v&&g.a.bgBlack," ").concat(b?g.a.wrp:"hide")},M&&y.a.createElement("div",{className:g.a.close,ref:Ie},!W&&y.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ie.current}},y.a.createElement("span",{onClick:_e},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ie.current}},y.a.createElement("span",{className:"",onClick:I},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(g.a[U]," ").concat(U," ").concat(g.a.monaco," ").concat(b==="txt"?"show":"hide")},b==="txt"&&y.a.createElement(h.b,j)),b==="audio"&&y.a.createElement("audio",{src:"".concat(((R=d)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((x=d)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),b==="video"&&y.a.createElement(y.a.Fragment,null,((S=d)===null||S===void 0?void 0:S.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),b==="office"&&E&&y.a.createElement("iframe",{src:"".concat(B,"/office.html?key=").concat(E.key,"&url=").concat(Q+E.url,"&callbackUrl=").concat(Q+E.callbackUrl,"&fileType=").concat(E.fileType,"&title=").concat(E.title,"&model=").concat(T,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),b==="html"&&y.a.createElement("iframe",{src:d+"&disposition=inline"}),b==="pdf"&&y.a.createElement("iframe",{src:"".concat(B,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!W)}),b==="image"&&y.a.createElement("img",{src:"".concat(((D=d)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((O=d)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(A=d)!==null&&A!==void 0&&A.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),b==="other"&&y.a.createElement("div",null,y.a.createElement(Y.a,{type:"primary",size:"large",onClick:ge},y.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),b==="download"&&y.a.createElement(Y.a,{type:"primary",size:"large",onClick:ge},y.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Je,Ee,J){},pmY6:function(Je,Ee,J){"use strict";J.d(Ee,"h",function(){return L}),J.d(Ee,"g",function(){return m}),J.d(Ee,"f",function(){return g}),J.d(Ee,"e",function(){return l}),J.d(Ee,"i",function(){return h}),J.d(Ee,"b",function(){return p}),J.d(Ee,"a",function(){return o}),J.d(Ee,"d",function(){return u}),J.d(Ee,"c",function(){return s});var le=J("C/vA"),Y=J("JYp7");const N=!1;let X=null;function H(a){X=a}if(N){const a="__is_disposable_tracked__";H(new class{trackDisposable(R){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[a]||console.log(x)},3e3)}setParent(R,x){if(R&&R!==o.None)try{R[a]=!0}catch(S){}}markAsDisposed(R){if(R&&R!==o.None)try{R[a]=!0}catch(x){}}markAsSingleton(R){}})}function P(a){return X==null||X.trackDisposable(a),a}function K(a){X==null||X.markAsDisposed(a)}function z(a,R){X==null||X.setParent(a,R)}function n(a,R){if(!X)return;for(const x of a)X.setParent(x,R)}function L(a){return X==null||X.markAsSingleton(a),a}class y 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 g(a){if(Y.a.is(a)){let R=[];for(const x of a)if(x)try{x.dispose()}catch(S){R.push(S)}if(R.length===1)throw R[0];if(R.length>1)throw new y(R);return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function l(...a){const R=h(()=>g(a));return n(a,R),R}function h(a){const R=P({dispose:Object(le.a)(()=>{K(R),a()})});return R}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,P(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{g(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 z(a,this),this._isDisposed?p.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}}p.DISABLE_DISPOSED_WARNING=!1;class o{constructor(){this._store=new p,P(this),z(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,P(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){var R;if(this._isDisposed||a===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),a&&z(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&&z(a,null),a}}class s{constructor(a){this.object=a}dispose(){}}},psGv:function(Je,Ee,J){var le,Y;(function(){var N;(function(){"use strict";var K=[,,function(y){function m(h){this.__parent=h,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 h=new m(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},m.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},m.prototype.has_match=function(h){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(h))return!0;return!1},m.prototype.set_indent=function(h,p){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=p||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var p=h.lastIndexOf(`
`);p!==-1?this.__character_count=h.length-p:this.__character_count+=h.length},m.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function g(h,p){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),p=p||"",h.indent_level>0&&(p=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}g.prototype.get_indent_size=function(h,p){var o=this.__base_string_length;return p=p||0,h<0&&(o=0),o+=h*this.__indent_size,o+=p,o},g.prototype.get_indent_string=function(h,p){var o=this.__base_string;return p=p||0,h<0&&(h=0,o=""),p+=h*this.__indent_size,this.__ensure_cache(p),o+=this.__cache[p],o},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,p=0,o="";this.__indent_size&&h>=this.__indent_size&&(p=Math.floor(h/this.__indent_size),h-=p*this.__indent_size,o=new Array(p+1).join(this.__indent_string)),h&&(o+=new Array(h+1).join(" ")),this.__cache.push(o)};function l(h,p){this.__indent_cache=new g(h,p),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(h,p){return this.__indent_cache.get_indent_string(h,p)},l.prototype.get_indent_size=function(h,p){return this.__indent_cache.get_indent_size(h,p)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(h){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return h!==`
`&&(o=o.replace(/[\n]/g,h)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(h,p){return h=h||0,p=p||0,this.next_line.set_indent(h,p),this.__lines.length>1?(this.current_line.set_indent(h,p),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(h){for(var p=0;p<h.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(h){for(var p=this.__lines.length;h<p;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&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},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(h,p){for(var o=this.__lines.length-2;o>=0;){var u=this.__lines[o];if(u.is_empty())break;if(u.item(0).indexOf(h)!==0&&u.item(-1)!==p){this.__lines.splice(o+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},y.exports.Output=l},function(y){function m(g,l,h,p){this.type=g,this.text=l,this.comments_before=null,this.newlines=h||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=m},,,function(y){function m(h,p){this.raw_options=g(h,p),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(h,p){var o=this.raw_options[h],u=p||[];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(h,p){var o=this.raw_options[h],u=o===void 0?!!p:!!o;return u},m.prototype._get_characters=function(h,p){var o=this.raw_options[h],u=p||"";return typeof o=="string"&&(u=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},m.prototype._get_number=function(h,p){var o=this.raw_options[h];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(o,10);return isNaN(u)&&(u=p),u},m.prototype._get_selection=function(h,p,o){var u=this._get_selection_list(h,p,o);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[h]+"'");return u[0]},m.prototype._get_selection_list=function(h,p,o){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[p[0]],!this._is_valid_selection(o,p))throw new Error("Invalid Default Value!");var u=this._get_array(h,o);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[h]+"'");return u},m.prototype._is_valid_selection=function(h,p){return h.length&&p.length&&!h.some(function(o){return p.indexOf(o)===-1})};function g(h,p){var o={};h=l(h);var u;for(u in h)u!==p&&(o[u]=h[u]);if(p&&h[p])for(u in h[p])o[u]=h[p][u];return o}function l(h){var p={},o;for(o in h){var u=o.replace(/-/g,"_");p[u]=h[o]}return p}y.exports.Options=m,y.exports.normalizeOpts=l,y.exports.mergeOpts=g},,function(y){var m=RegExp.prototype.hasOwnProperty("sticky");function g(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},g.prototype.peek=function(l){var h=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(h=this.__input.charAt(l)),h},g.prototype.__match=function(l,h){l.lastIndex=h;var p=l.exec(this.__input);return p&&!(m&&l.sticky)&&(p.index!==h&&(p=null)),p},g.prototype.test=function(l,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(l,h):!1},g.prototype.testChar=function(l,h){var p=this.peek(h);return l.lastIndex=0,p!==null&&l.test(p)},g.prototype.match=function(l){var h=this.__match(l,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(l,h,p){var o="",u;return l&&(u=this.match(l),u&&(o+=u[0])),h&&(u||!l)&&(o+=this.readUntil(h,p)),o},g.prototype.readUntil=function(l,h){var p="",o=this.__position;l.lastIndex=this.__position;var u=l.exec(this.__input);return u?(o=u.index,h&&(o+=u[0].length)):o=this.__input_length,p=this.__input.substring(this.__position,o),this.__position=o,p},g.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},g.prototype.get_regexp=function(l,h){var p=null,o="g";return h&&m&&(o="y"),typeof l=="string"&&l!==""?p=new RegExp(l,o):l&&(p=new RegExp(l.source,o)),p},g.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(l){var h=this.__position,p=this.readUntilAfter(l);return this.__position=h,p},g.prototype.lookBack=function(l){var h=this.__position-1;return h>=l.length&&this.__input.substring(h-l.length,h).toLowerCase()===l},y.exports.InputScanner=g},function(y,m,g){var l=g(8).InputScanner,h=g(3).Token,p=g(10).TokenStream,o=g(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(a,R){this._input=new l(a),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var a,R=new h(u.START,""),x=null,S=[],D=new p;R.type!==u.EOF;){for(a=this._get_next_token(R,x);this._is_comment(a);)D.add(a),a=this._get_next_token(R,x);D.isEmpty()||(a.comments_before=D,D=new p),a.parent=x,this._is_opening(a)?(S.push(x),x=a):x&&this._is_closing(a,x)&&(a.opened=x,x.closed=a,x=S.pop(),a.parent=x),a.previous=R,R.next=a,this.__tokens.add(a),R=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,R){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(u.RAW,x):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,R){return!1},s.prototype._create_token=function(a,R){var x=new h(a,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=s,y.exports.TOKEN=u},function(y){function m(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},m.prototype.peek=function(g){var l=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(l=this.__tokens[g]),l},m.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},y.exports.TokenStream=m},function(y,m,g){var l=g(12).Pattern;function h(p,o){l.call(this,p,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new l,h.prototype.__set_whitespace_patterns=function(p,o){p+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var o=this.__split(this._newline_regexp,p);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return p},h.prototype.matching=function(p,o){var u=this._create();return u.__set_whitespace_patterns(p,o),u._update(),u},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(p,o){p.lastIndex=0;for(var u=0,s=[],a=p.exec(o);a;)s.push(o.substring(u,a.index)),u=a.index+a[0].length,a=p.exec(o);return u<o.length?s.push(o.substring(u,o.length)):s.push(""),s},y.exports.WhitespacePattern=h},function(y){function m(g,l){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}m.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(g){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(g),l._update(),l},m.prototype.until=function(g){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(g),l._update(),l},m.prototype.starting_with=function(g){var l=this._create();return l._starting_pattern=this._input.get_regexp(g,!0),l._update(),l},m.prototype.matching=function(g){var l=this._create();return l._match_pattern=this._input.get_regexp(g,!0),l._update(),l},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},y.exports.Pattern=m},function(y){function m(g,l){g=typeof g=="string"?g:g.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+l,"g")}m.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(g);h;)l[h[1]]=h[2],h=this.__directive_pattern.exec(g);return l},m.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=m},function(y,m,g){var l=g(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(o,u){l.call(this,o,u),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new l(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),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}/)}}p.prototype=new l,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(o){var u=this._create();return u._disabled[o]=!0,u._update(),u},p.prototype.read_options=function(o){var u=this._create();for(var s in h)u._disabled[s]=o.templating.indexOf(s)===-1;return u._update(),u},p.prototype.exclude=function(o){var u=this._create();return u._excluded[o]=!0,u._update(),u},p.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},p.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("|")+")")},p.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},y.exports.TemplatablePattern=p},,,,function(y,m,g){var l=g(19).Beautifier,h=g(20).Options;function p(o,u,s,a){var R=new l(o,u,s,a);return R.beautify()}y.exports=p,y.exports.defaultOptions=function(){return new h}},function(y,m,g){var l=g(20).Options,h=g(2).Output,p=g(21).Tokenizer,o=g(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,a=function(f,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=f.max_preserve_newlines,this.preserve_newlines=f.preserve_newlines,this._output=new h(f,b)};a.prototype.current_line_has_match=function(f){return this._output.current_line.has_match(f)},a.prototype.set_space_before_token=function(f,b){this._output.space_before_token=f,this._output.non_breaking_space=b},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(f){this._output.add_raw_token(f)},a.prototype.print_preserved_newlines=function(f){var b=0;f.type!==o.TEXT&&f.previous.type!==o.TEXT&&(b=f.newlines?1:0),this.preserve_newlines&&(b=f.newlines<this.max_preserve_newlines+1?f.newlines:this.max_preserve_newlines+1);for(var _=0;_<b;_++)this.print_newline(_>0);return b!==0},a.prototype.traverse_whitespace=function(f){return f.whitespace_before||f.newlines?(this.print_preserved_newlines(f)||(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(f){this._output.add_new_line(f)},a.prototype.print_token=function(f){f.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(f.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.get_full_indent=function(f){return f=this.indent_level+(f||0),f<1?"":this._output.get_indent_string(f)};var R=function(f){for(var b=null,_=f.next;_.type!==o.EOF&&f.closed!==_;){if(_.type===o.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===o.EQUALS&&_.next.next&&_.next.next.type===o.VALUE&&(b=_.next.next.text);break}_=_.next}return b},x=function(f,b){var _=null,j=null;return b.closed?(f==="script"?_="text/javascript":f==="style"&&(_="text/css"),_=R(b)||_,_.search("text/css")>-1?j="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":_.search(/test\/null/)>-1&&(j="null"),j):null};function S(f,b){return b.indexOf(f)!==-1}function D(f,b,_){this.parent=f||null,this.tag=b?b.tag_name:"",this.indent_level=_||0,this.parser_token=b||null}function O(f){this._printer=f,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(f){var b=new D(this._current_frame,f,this._printer.indent_level);this._current_frame=b},O.prototype._try_pop_frame=function(f){var b=null;return f&&(b=f.parser_token,this._printer.indent_level=f.indent_level,this._current_frame=f.parent),b},O.prototype._get_frame=function(f,b){for(var _=this._current_frame;_&&!(f.indexOf(_.tag)!==-1);){if(b&&b.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},O.prototype.try_pop=function(f,b){var _=this._get_frame([f],b);return this._try_pop_frame(_)},O.prototype.indent_to_tag=function(f){var b=this._get_frame(f);b&&(this._printer.indent_level=b.indent_level)};function A(f,b,_,j){this._source_text=f||"",b=b||{},this._js_beautify=_,this._css_beautify=j,this._tag_stack=null;var U=new l(b,"html");this._options=U,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 f=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
`,f&&u.test(f)&&(b=f.match(u)[0])),f=f.replace(s,`
`);var _=f.match(/^[\t ]*/)[0],j={text:"",type:""},U=new C,w=new a(this._options,_),M=new p(f,this._options).tokenize();this._tag_stack=new O(w);for(var I=null,v=M.next();v.type!==o.EOF;)v.type===o.TAG_OPEN||v.type===o.COMMENT?(I=this._handle_tag_open(w,v,U,j),U=I):v.type===o.ATTRIBUTE||v.type===o.EQUALS||v.type===o.VALUE||v.type===o.TEXT&&!U.tag_complete?I=this._handle_inside_tag(w,v,U,M):v.type===o.TAG_CLOSE?I=this._handle_tag_close(w,v,U):v.type===o.TEXT?I=this._handle_text(w,v,U):w.add_raw_token(v),j=I,v=M.next();var W=w._output.get_code(b);return W},A.prototype._handle_tag_close=function(f,b,_){var j={text:b.text,type:b.type};return f.alignment_size=0,_.tag_complete=!0,f.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),_.is_unformatted?f.add_raw_token(b):(_.tag_start_char==="<"&&(f.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&f.print_newline(!1)),f.print_token(b)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(f.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&f.set_wrap_point(),j},A.prototype._handle_inside_tag=function(f,b,_,j){var U=_.has_wrapped_attrs,w={text:b.text,type:b.type};if(f.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),_.is_unformatted)f.add_raw_token(b);else if(_.tag_start_char==="{"&&b.type===o.TEXT)f.print_preserved_newlines(b)?(b.newlines=0,f.add_raw_token(b)):f.print_token(b);else{if(b.type===o.ATTRIBUTE?(f.set_space_before_token(!0),_.attr_count+=1):(b.type===o.EQUALS||b.type===o.VALUE&&b.previous.type===o.EQUALS)&&f.set_space_before_token(!1),b.type===o.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(f.traverse_whitespace(b),U=U||b.newlines!==0),this._is_wrap_attributes_force)){var M=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var I=!0,v=0,W;do{if(W=j.peek(v),W.type===o.ATTRIBUTE){I=!1;break}v+=1}while(v<4&&W.type!==o.EOF&&W.type!==o.TAG_CLOSE);M=!I}M&&(f.print_newline(!1),U=!0)}f.print_token(b),U=U||f.previous_token_wrapped(),_.has_wrapped_attrs=U}return w},A.prototype._handle_text=function(f,b,_){var j={text:b.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(f,b,_):_.is_unformatted||_.is_content_unformatted?f.add_raw_token(b):(f.traverse_whitespace(b),f.print_token(b)),j},A.prototype._print_custom_beatifier_text=function(f,b,_){var j=this;if(b.text!==""){var U=b.text,w,M=1,I="",v="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:_.custom_beautifier_name==="html"&&(w=function(be,Re){var Ce=new A(be,Re,j._js_beautify,j._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-f.indent_level);var W=f.get_full_indent(M);if(U=U.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!Z){f.add_raw_token(b);return}I=W+Z[1]+`
`,U=Z[4],Z[5]&&(v=W+Z[5]),U=U.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(b.whitespace_before=Z[0]))}if(U)if(w){var oe=function(){this.eol=`
`};oe.prototype=this._options.raw_options;var fe=new oe;U=w(W+U,fe)}else{var Ae=b.whitespace_before;Ae&&(U=U.replace(new RegExp(`
(`+Ae+")?","g"),`
`)),U=W+U.replace(/\n/g,`
`+W)}I&&(U?U=I+U+`
`+v:U=I+v),f.print_newline(!1),U&&(b.text=U,b.whitespace_before="",b.newlines=0,f.add_raw_token(b),f.print_newline(!0))}},A.prototype._handle_tag_open=function(f,b,_,j){var U=this._get_tag_open_token(b);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&b.type===o.TAG_OPEN&&b.text.indexOf("</")===0?(f.add_raw_token(b),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(f.traverse_whitespace(b),this._set_tag_position(f,b,U,_,j),U.is_inline_element||f.set_wrap_point(),f.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=b.text.length+1),!U.tag_complete&&!U.is_unformatted&&(f.alignment_size=U.alignment_size),U};var C=function(f,b){if(this.parent=f||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!b)this.tag_complete=!0;else{var _;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(_=b.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.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||b.closed&&b.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};A.prototype._get_tag_open_token=function(f){var b=new C(this._tag_stack.get_parser_token(),f);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||S(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&S(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&S(b.tag_check,this._options.content_unformatted),b.is_inline_element=S(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},A.prototype._set_tag_position=function(f,b,_,j,U){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||f.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=x(_.tag_check,b)))),S(_.tag_check,this._options.extra_liners)&&(f.print_newline(!1),f._output.just_added_blankline()||f.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var w=f.current_line_has_match(/{{#if/);w||f.print_newline(!1)}_.tag_name==="!--"&&U.type===o.TAG_CLOSE&&j.is_end_tag&&_.text.indexOf(`
`)===-1||(_.is_inline_element||_.is_unformatted||f.print_newline(!1),this._calcluate_parent_multiline(f,_))}else if(_.is_end_tag){var M=!1;M=_.start_tag_token&&_.start_tag_token.multiline_content,M=M||!_.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(U.type===o.TAG_CLOSE&&_.start_tag_token===j)&&U.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(M=!1),M&&f.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(U.type!=="TK_CONTENT"||_.is_content_unformatted)&&f.print_newline(!1),this._calcluate_parent_multiline(f,_)},A.prototype._calcluate_parent_multiline=function(f,b){b.parent&&f._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.parent.multiline_content=!0)};var T=["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(f){var b=null;if(f.is_empty_element||!f.is_start_tag||!f.parent)return;if(f.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(f.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(f.tag_name==="dd"||f.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(f.parent.tag_name==="p"&&T.indexOf(f.tag_name)!==-1){var _=f.parent.parent;(!_||d.indexOf(_.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else f.tag_name==="rp"||f.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):f.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):f.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):f.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):f.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):f.tag_name==="tbody"||f.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):f.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(f.tag_name==="th"||f.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return f.parent=this._tag_stack.get_parser_token(),b},y.exports.Beautifier=A},function(y,m,g){var l=g(6).Options;function h(p){l.call(this,p,"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"])}h.prototype=new l,y.exports.Options=h},function(y,m,g){var l=g(9).Tokenizer,h=g(9).TOKEN,p=g(13).Directives,o=g(14).TemplatablePattern,u=g(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:h.START,RAW:h.RAW,EOF:h.EOF},a=new p(/<\!--/,/-->/),R=function(x,S){l.call(this,x,S),this._current_tag_name="";var D=new o(this._input).read_options(this._options),O=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:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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=O.matching(A).until_after(A)}};R.prototype=new l,R.prototype._is_comment=function(x){return!1},R.prototype._is_opening=function(x){return x.type===s.TAG_OPEN},R.prototype._is_closing=function(x,S){return x.type===s.TAG_CLOSE&&S&&((x.text===">"||x.text==="/>")&&S.text[0]==="<"||x.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(x,S){var D=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(D=D||this._read_open_handlebars(O,S),D=D||this._read_attribute(O,x,S),D=D||this._read_close(O,S),D=D||this._read_raw_content(O,x,S),D=D||this._read_content_word(O),D=D||this._read_comment_or_cdata(O),D=D||this._read_processing(O),D=D||this._read_open(O,S),D=D||this._create_token(s.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(x){var S=null,D=null,O=null;if(x==="<"){var A=this._input.peek(1);A==="!"&&(D=this.__patterns.comment.read(),D?(O=a.get_directives(D),O&&O.ignore==="start"&&(D+=a.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=O)}return S},R.prototype._read_processing=function(x){var S=null,D=null,O=null;if(x==="<"){var A=this._input.peek(1);(A==="!"||A==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(S=this._create_token(s.COMMENT,D),S.directives=O)}return S},R.prototype._read_open=function(x,S){var D=null,O=null;return S||x==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,D)),O},R.prototype._read_open_handlebars=function(x,S){var D=null,O=null;return S||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,D))),O},R.prototype._read_close=function(x,S){var D=null,O=null;return S&&(S.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(D=this._input.next(),x==="/"&&(D+=this._input.next()),O=this._create_token(s.TAG_CLOSE,D)):S.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},R.prototype._read_attribute=function(x,S,D){var O=null,A="";if(D&&D.text[0]==="<")if(x==="=")O=this._create_token(s.EQUALS,this._input.next());else if(x==='"'||x==="'"){var C=this._input.next();x==='"'?C+=this.__patterns.double_quote.read():C+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,C)}else A=this.__patterns.attribute.read(),A&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,A):O=this._create_token(s.ATTRIBUTE,A));return O},R.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},R.prototype._read_raw_content=function(x,S,D){var O="";if(D&&D.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var A=S.opened.text.substr(1).toLowerCase();if(A==="script"||A==="style"){var C=this._read_comment_or_cdata(x);if(C)return C.type=s.TEXT,C;O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(A)&&(O=this._input.readUntil(new RegExp("</"+A+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},R.prototype._read_content_word=function(x){var S="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},y.exports.Tokenizer=R,y.exports.TOKEN=s}],z={};function n(y){var m=z[y];if(m!==void 0)return m.exports;var g=z[y]={exports:{}};return K[y](g,g.exports,n),g.exports}var L=n(18);N=L})();var X=N;if(!0)!(le=[J,J("6UM0"),J("TXwP")],Y=function(K){var z=J("6UM0"),n=J("TXwP");return{html_beautify:function(L,y){return X(L,y,z.js_beautify,n.css_beautify)}}}.apply(Ee,le),Y!==void 0&&(Je.exports=Y));else var H,P})()},"rAM+":function(Je,Ee,J){"use strict";J.d(Ee,"a",function(){return Y});var le=J("Qw5x");function Y(N,X){var H;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(H=Object(le.a)(N))||X&&N&&typeof N.length=="number"){H&&(N=H);var P=0,K=function(){};return{s:K,n:function(){return P>=N.length?{done:!0}:{done:!1,value:N[P++]}},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 z=!0,n=!1,L;return{s:function(){H=N[Symbol.iterator]()},n:function(){var m=H.next();return z=m.done,m},e:function(m){n=!0,L=m},f:function(){try{!z&&H.return!=null&&H.return()}finally{if(n)throw L}}}}},rUJ1:function(Je,Ee){const J=/[&<>"']/,le=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,X={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},H=O=>X[O];function P(O,A){if(A){if(J.test(O))return O.replace(le,H)}else if(Y.test(O))return O.replace(N,H);return O}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function z(O){return O.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 n=/(^|[^\[])\^/g;function L(O,A){O=O.source||O,A=A||"";const C={replace:(T,d)=>(d=d.source||d,d=d.replace(n,"$1"),O=O.replace(T,d),C),getRegex:()=>new RegExp(O,A)};return C}const y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(O,A,C){if(O){let T;try{T=decodeURIComponent(z(C)).replace(y,"").toLowerCase()}catch(d){return null}if(T.indexOf("javascript:")===0||T.indexOf("vbscript:")===0||T.indexOf("data:")===0)return null}A&&!m.test(C)&&(C=u(A,C));try{C=encodeURI(C).replace(/%25/g,"%")}catch(T){return null}return C}const l={},h=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,A){l[" "+O]||(h.test(O)?l[" "+O]=O+"/":l[" "+O]=x(O,"/",!0)),O=l[" "+O];const C=O.indexOf(":")===-1;return A.substring(0,2)==="//"?C?A:O.replace(p,"$1")+A:A.charAt(0)==="/"?C?A:O.replace(o,"$1")+A:O+A}const s={exec:function(){}};function a(O){let A=1,C,T;for(;A<arguments.length;A++){C=arguments[A];for(T in C)Object.prototype.hasOwnProperty.call(C,T)&&(O[T]=C[T])}return O}function R(O,A){const C=O.replace(/\|/g,(f,b,_)=>{let j=!1,U=b;for(;--U>=0&&_[U]==="\\";)j=!j;return j?"|":" |"}),T=C.split(/ \|/);let d=0;if(T.length>A)T.splice(A);else for(;T.length<A;)T.push("");for(;d<T.length;d++)T[d]=T[d].trim().replace(/\\\|/g,"|");return T}function x(O,A,C){const T=O.length;if(T===0)return"";let d=0;for(;d<T;){const f=O.charAt(T-d-1);if(f===A&&!C)d++;else if(f!==A&&C)d++;else break}return O.substr(0,T-d)}function S(O,A){if(O.indexOf(A[1])===-1)return-1;const C=O.length;let T=0,d=0;for(;d<C;d++)if(O[d]==="\\")d++;else if(O[d]===A[0])T++;else if(O[d]===A[1]&&(T--,T<0))return d;return-1}function D(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Je.exports={escape:P,unescape:z,edit:L,cleanUrl:g,resolveUrl:u,noopTest:s,merge:a,splitCells:R,rtrim:x,findClosingBracket:S,checkSanitizeDeprecation:D}},t9D7:function(Je,Ee,J){"use strict";J.d(Ee,"b",function(){return K}),J.d(Ee,"g",function(){return n}),J.d(Ee,"d",function(){return L}),J.d(Ee,"e",function(){return y}),J.d(Ee,"a",function(){return m}),J.d(Ee,"f",function(){return h}),J.d(Ee,"c",function(){return p});var le=J("Vhoy"),Y=J("MI8n"),N=J("pmY6"),X=J("Cg/j"),H=J("ic2d"),P=J("nEHx");const K=Object(X.c)("themeService");var z;(function(o){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}o.isThemeColor=u})(z||(z={}));function n(o){return{id:o}}var L;(function(o){function u(D){return D&&typeof D=="object"&&typeof D.id=="string"&&(typeof D.color=="undefined"||z.isThemeColor(D.color))}o.isThemeIcon=u;const s=new RegExp(`^\\$\\((${le.a.iconNameExpression}(?:${le.a.iconModifierExpression})?)\\)$`);function a(D){const O=s.exec(D);if(!O)return;let[,A]=O;return{id:A}}o.fromString=a;function R(D,O){let A=D.id;const C=A.lastIndexOf("~");return C!==-1&&(A=A.substring(0,C)),O&&(A=`${A}~${O}`),{id:A}}o.modify=R;function x(D,O){var A,C;return D.id===O.id&&((A=D.color)===null||A===void 0?void 0:A.id)===((C=O.color)===null||C===void 0?void 0:C.id)}o.isEqual=x;function S(D,O){return{id:D.id,color:O?n(O):void 0}}o.asThemeIcon=S,o.asClassNameArray=le.a.asClassNameArray,o.asClassName=le.a.asClassName,o.asCSSSelector=le.a.asCSSSelector})(L||(L={}));function y(o){switch(o){case P.a.DARK:return"vs-dark";case P.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class g{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(o){return this.themingParticipants.push(o),this.onThemingParticipantAddedEmitter.fire(o),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(o);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new g;H.a.add(m.ThemingContribution,l);function h(o){return l.onColorThemeChange(o)}class p extends N.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(Je,Ee,J){typeof window!="undefined"&&function(Y,N){Je.exports=N()}(this,function(){return function(le){var Y={};function N(X){if(Y[X])return Y[X].exports;var H=Y[X]={i:X,l:!1,exports:{}};return le[X].call(H.exports,H,H.exports,N),H.l=!0,H.exports}return N.m=le,N.c=Y,N.d=function(X,H,P){N.o(X,H)||Object.defineProperty(X,H,{enumerable:!0,get:P})},N.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},N.t=function(X,H){if(H&1&&(X=N(X)),H&8)return X;if(H&4&&typeof X=="object"&&X&&X.__esModule)return X;var P=Object.create(null);if(N.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:X}),H&2&&typeof X!="string")for(var K in X)N.d(P,K,function(z){return X[z]}.bind(null,K));return P},N.n=function(X){var H=X&&X.__esModule?function(){return X.default}:function(){return X};return N.d(H,"a",H),H},N.o=function(X,H){return Object.prototype.hasOwnProperty.call(X,H)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,Y,N){"use strict";var X=Object.prototype.hasOwnProperty,H="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(H=!1));function K(y,m,g){this.fn=y,this.context=m,this.once=g||!1}function z(y,m,g,l,h){if(typeof g!="function")throw new TypeError("The listener must be a function");var p=new K(g,l||y,h),o=H?H+m:m;return y._events[o]?y._events[o].fn?y._events[o]=[y._events[o],p]:y._events[o].push(p):(y._events[o]=p,y._eventsCount++),y}function n(y,m){--y._eventsCount===0?y._events=new P:delete y._events[m]}function L(){this._events=new P,this._eventsCount=0}L.prototype.eventNames=function(){var m=[],g,l;if(this._eventsCount===0)return m;for(l in g=this._events)X.call(g,l)&&m.push(H?l.slice(1):l);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(g)):m},L.prototype.listeners=function(m){var g=H?H+m:m,l=this._events[g];if(!l)return[];if(l.fn)return[l.fn];for(var h=0,p=l.length,o=new Array(p);h<p;h++)o[h]=l[h].fn;return o},L.prototype.listenerCount=function(m){var g=H?H+m:m,l=this._events[g];return l?l.fn?1:l.length:0},L.prototype.emit=function(m,g,l,h,p,o){var u=H?H+m:m;if(!this._events[u])return!1;var s=this._events[u],a=arguments.length,R,x;if(s.fn){s.once&&this.removeListener(m,s.fn,void 0,!0);switch(a){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,g),!0;case 3:return s.fn.call(s.context,g,l),!0;case 4:return s.fn.call(s.context,g,l,h),!0;case 5:return s.fn.call(s.context,g,l,h,p),!0;case 6:return s.fn.call(s.context,g,l,h,p,o),!0}for(x=1,R=new Array(a-1);x<a;x++)R[x-1]=arguments[x];s.fn.apply(s.context,R)}else{var S=s.length,D;for(x=0;x<S;x++){s[x].once&&this.removeListener(m,s[x].fn,void 0,!0);switch(a){case 1:s[x].fn.call(s[x].context);break;case 2:s[x].fn.call(s[x].context,g);break;case 3:s[x].fn.call(s[x].context,g,l);break;case 4:s[x].fn.call(s[x].context,g,l,h);break;default:if(!R)for(D=1,R=new Array(a-1);D<a;D++)R[D-1]=arguments[D];s[x].fn.apply(s[x].context,R)}}}return!0},L.prototype.on=function(m,g,l){return z(this,m,g,l,!1)},L.prototype.once=function(m,g,l){return z(this,m,g,l,!0)},L.prototype.removeListener=function(m,g,l,h){var p=H?H+m:m;if(!this._events[p])return this;if(!g)return n(this,p),this;var o=this._events[p];if(o.fn)o.fn===g&&(!h||o.once)&&(!l||o.context===l)&&n(this,p);else{for(var u=0,s=[],a=o.length;u<a;u++)(o[u].fn!==g||h&&!o[u].once||l&&o[u].context!==l)&&s.push(o[u]);s.length?this._events[p]=s.length===1?s[0]:s:n(this,p)}return this},L.prototype.removeAllListeners=function(m){var g;return m?(g=H?H+m:m,this._events[g]&&n(this,g)):(this._events=new P,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=H,L.EventEmitter=L,le.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(le,Y,N){(function(X){var H=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,z=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(L,y,m){if(m=m||{},L=L.trim(),y=y.trim(),!y){if(!m.alwaysNormalize)return L;var g=n.parseURL(L);if(!g)throw new Error("Error trying to parse base URL.");return g.path=n.normalizePath(g.path),n.buildURLFromParts(g)}var l=n.parseURL(y);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return m.alwaysNormalize?(l.path=n.normalizePath(l.path),n.buildURLFromParts(l)):y;var h=n.parseURL(L);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var p=P.exec(h.path);h.netLoc=p[1],h.path=p[2]}h.netLoc&&!h.path&&(h.path="/");var o={scheme:h.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(o.netLoc=h.netLoc,l.path[0]!=="/"))if(!l.path)o.path=h.path,l.params||(o.params=h.params,l.query||(o.query=h.query));else{var u=h.path,s=u.substring(0,u.lastIndexOf("/")+1)+l.path;o.path=n.normalizePath(s)}return o.path===null&&(o.path=m.alwaysNormalize?n.normalizePath(l.path):l.path),n.buildURLFromParts(o)},parseURL:function(L){var y=H.exec(L);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(K,"");L.length!==(L=L.replace(z,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};le.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(le,Y,N){function X(m){var g={};function l(p){if(g[p])return g[p].exports;var o=g[p]={i:p,l:!1,exports:{}};return m[p].call(o.exports,o,o.exports,l),o.l=!0,o.exports}l.m=m,l.c=g,l.i=function(p){return p},l.d=function(p,o,u){l.o(p,o)||Object.defineProperty(p,o,{configurable:!1,enumerable:!0,get:u})},l.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},l.n=function(p){var o=p&&p.__esModule?function(){return p.default}:function(){return p};return l.d(o,"a",o),o},l.o=function(p,o){return Object.prototype.hasOwnProperty.call(p,o)},l.p="/",l.oe=function(p){throw console.error(p),p};var h=l(l.s=ENTRY_MODULE);return h.default||h}var H="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+H+").*?\\)";function K(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function z(m){return!isNaN(1*m)}function n(m,g,l){var h={};h[l]=[];var p=g.toString(),o=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return h;for(var u=o[1],s=new RegExp("(\\\\n|\\W)"+K(u)+P,"g"),a;a=s.exec(p);){if(a[3]==="dll-reference")continue;h[l].push(a[3])}for(s=new RegExp("\\("+K(u)+'\\("(dll-reference\\s('+H+'))"\\)\\)'+P,"g");a=s.exec(p);)m[a[2]]||(h[l].push(a[1]),m[a[2]]=N(a[1]).m),h[a[2]]=h[a[2]]||[],h[a[2]].push(a[4]);for(var R=Object.keys(h),x=0;x<R.length;x++)for(var S=0;S<h[R[x]].length;S++)z(h[R[x]][S])&&(h[R[x]][S]=1*h[R[x]][S]);return h}function L(m){var g=Object.keys(m);return g.reduce(function(l,h){return l||m[h].length>0},!1)}function y(m,g){for(var l={main:[g]},h={main:[]},p={main:{}};L(l);)for(var o=Object.keys(l),u=0;u<o.length;u++){var s=o[u],a=l[s],R=a.pop();if(p[s]=p[s]||{},p[s][R]||!m[s][R])continue;p[s][R]=!0,h[s]=h[s]||[],h[s].push(R);for(var x=n(m,m[s][R],s),S=Object.keys(x),D=0;D<S.length;D++)l[S[D]]=l[S[D]]||[],l[S[D]]=l[S[D]].concat(x[S[D]])}return h}le.exports=function(m,g){g=g||{};var l={main:N.m},h=g.all?{main:Object.keys(l.main)}:y(l,m),p="";Object.keys(h).filter(function(R){return R!=="main"}).forEach(function(R){for(var x=0;h[R][x];)x++;h[R].push(x),l[R][x]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+R+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(x))+")({"+h[R].map(function(S){return""+JSON.stringify(S)+": "+l[R][S].toString()}).join(",")+`});
`}),p=p+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+h.main.map(function(R){return""+JSON.stringify(R)+": "+l.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([p],{type:"text/javascript"});if(g.bare)return o;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(o),a=new window.Worker(s);return a.objectURL=s,a}},"./src/config.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"hlsDefaultConfig",function(){return D}),N.d(Y,"mergeConfig",function(){return A}),N.d(Y,"enableStreamingMode",function(){return C});var X=N("./src/controller/abr-controller.ts"),H=N("./src/controller/audio-stream-controller.ts"),P=N("./src/controller/audio-track-controller.ts"),K=N("./src/controller/subtitle-stream-controller.ts"),z=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),L=N("./src/controller/timeline-controller.ts"),y=N("./src/controller/cap-level-controller.ts"),m=N("./src/controller/fps-controller.ts"),g=N("./src/controller/eme-controller.ts"),l=N("./src/controller/cmcd-controller.ts"),h=N("./src/utils/xhr-loader.ts"),p=N("./src/utils/fetch-loader.ts"),o=N("./src/utils/cues.ts"),u=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function a(){return a=Object.assign||function(T){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(T[b]=f[b])}return T},a.apply(this,arguments)}function R(T,d){var f=Object.keys(T);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(T);d&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(T,_).enumerable})),f.push.apply(f,b)}return f}function x(T){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?R(Object(f),!0).forEach(function(b){S(T,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(f)):R(Object(f)).forEach(function(b){Object.defineProperty(T,b,Object.getOwnPropertyDescriptor(f,b))})}return T}function S(T,d,f){return d in T?Object.defineProperty(T,d,{value:f,enumerable:!0,configurable:!0,writable:!0}):T[d]=f,T}var D=x(x({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:h.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:n.default,capLevelController:y.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:z.default,timelineController:L.TimelineController,audioStreamController:H.default,audioTrackController:P.default,emeController:g.default,cmcdController:l.default});function O(){return{cueHandler:o.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function A(T,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return a({},T,d)}function C(T){var d=T.loader;if(d!==p.default&&d!==h.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),T.progressive=!1;else{var f=Object(p.fetchSupported)();f&&(T.loader=p.default,T.progressive=!0,T.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/polyfills/number.ts"),H=N("./src/utils/ewma-bandwidth-estimator.ts"),P=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),z=N("./src/errors.ts"),n=N("./src/types/loader.ts"),L=N("./src/utils/logger.ts");function y(l,h){for(var p=0;p<h.length;p++){var o=h[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function m(l,h,p){return h&&y(l.prototype,h),p&&y(l,p),l}var g=function(){function l(p){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=p;var o=p.config;this.bwEstimator=new H.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var h=l.prototype;return h.registerListeners=function(){var o=this.hls;o.on(P.Events.FRAG_LOADING,this.onFragLoading,this),o.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(P.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(P.Events.FRAG_LOADING,this.onFragLoading,this),o.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(P.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},h.onFragLoading=function(o,u){var s=u.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var a;this.fragCurrent=s,this.partCurrent=(a=u.part)!=null?a:null,this.timer=self.setInterval(this.onCheck,100)}},h.onLevelLoaded=function(o,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var o=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.autoLevelEnabled,R=s.config,x=s.media;if(!o||!x)return;var S=u?u.stats:o.stats,D=u?u.duration:o.duration;if(S.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!a||x.paused||!x.playbackRate||!x.readyState)return;var O=performance.now()-S.loading.start,A=Math.abs(x.playbackRate);if(O<=500*D/A)return;var C=s.levels,T=s.minAutoLevel,d=C[o.level],f=S.total||Math.max(S.loaded,Math.round(D*d.maxBitrate/8)),b=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),_=(f-S.loaded)/b,j=x.currentTime,U=(K.BufferHelper.bufferInfo(x,j,R.maxBufferHole).end-j)/A;if(U>=2*D/A||_<=U)return;var w=Number.POSITIVE_INFINITY,M;for(M=o.level-1;M>T;M--){var I=C[M].maxBitrate;if(w=D*I/(8*.8*b),w<U)break}if(w>=_)return;var v=this.bwEstimator.getEstimate();L.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)(v)?(v/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+_.toFixed(3)+` s
Estimated load time for the next fragment: `+w.toFixed(3)+` s
Time to underbuffer: `+U.toFixed(3)+" s"),s.nextLoadLevel=M,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:S})},h.onFragLoaded=function(o,u){var s=u.frag,a=u.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var R=a?a.stats:s.stats,x=a?a.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],D=(S.loaded?S.loaded.bytes:0)+R.loaded,O=(S.loaded?S.loaded.duration:0)+x;S.loaded={bytes:D,duration:O},S.realBitrate=Math.round(8*D/O)}if(s.bitrateTest){var A={stats:R,frag:s,part:a,id:s.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,A),s.bitrateTest=!1}}},h.onFragBuffered=function(o,u){var s=u.frag,a=u.part,R=a?a.stats:s.stats;if(R.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var x=R.parsing.end-R.loading.start;this.bwEstimator.sample(x,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},h.onError=function(o,u){switch(u.details){case z.ErrorDetails.FRAG_LOAD_ERROR:case z.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var o=this.fragCurrent,u=this.partCurrent,s=this.hls,a=s.maxAutoLevel,R=s.config,x=s.minAutoLevel,S=s.media,D=u?u.duration:o?o.duration:0,O=S?S.currentTime:0,A=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,C=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,T=(K.BufferHelper.bufferInfo(S,O,R.maxBufferHole).end-O)/A,d=this.findBestLevel(C,x,a,T,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(d>=0)return d;L.logger.trace((T?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var f=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,b=R.abrBandWidthFactor,_=R.abrBandWidthUpFactor;if(!T){var j=this.bitrateTestDelay;if(j){var U=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;f=U-j,L.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*f)+" ms"),b=_=1}}return d=this.findBestLevel(C,x,a,T+f,b,_),Math.max(d,0)},h.findBestLevel=function(o,u,s,a,R,x){for(var S,D=this.fragCurrent,O=this.partCurrent,A=this.lastLoadedFragLevel,C=this.hls.levels,T=C[A],d=!!(T!=null&&(S=T.details)!==null&&S!==void 0&&S.live),f=T==null?void 0:T.codecSet,b=O?O.duration:D?D.duration:0,_=s;_>=u;_--){var j=C[_];if(!j||f&&j.codecSet!==f)continue;var U=j.details,w=(O?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||b,M=void 0;_<=A?M=R*o:M=x*o;var I=C[_].maxBitrate,v=I*w/M;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(M)+"/"+I+"/"+w+"/"+a+"/"+v),M>I&&(!v||d&&!this.bitrateTestDelay||v<a))return _}return-1},m(l,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,u=this.bwEstimator;if(o!==-1&&(!u||!u.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),l}();Y.default=g},"./src/controller/audio-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),P=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),z=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),L=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),m=N("./src/demux/chunk-cache.ts"),g=N("./src/demux/transmuxer-interface.ts"),l=N("./src/types/transmuxer.ts"),h=N("./src/controller/fragment-finders.ts"),p=N("./src/utils/discontinuities.ts"),o=N("./src/errors.ts"),u=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},s.apply(this,arguments)}function a(D,O){D.prototype=Object.create(O.prototype),D.prototype.constructor=D,R(D,O)}function R(D,O){return R=Object.setPrototypeOf||function(C,T){return C.__proto__=T,C},R(D,O)}var x=100,S=function(D){a(O,D);function O(C,T){var d;return d=D.call(this,C,T,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var A=O.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var T=this.hls;T.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.on(P.Events.ERROR,this.onError,this),T.on(P.Events.BUFFER_RESET,this.onBufferReset,this),T.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),T.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var T=this.hls;T.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),T.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),T.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),T.off(P.Events.ERROR,this.onError,this),T.off(P.Events.BUFFER_RESET,this.onBufferReset,this),T.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),T.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),T.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),T.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onInitPtsFound=function(T,d){var f=d.frag,b=d.id,_=d.initPTS;if(b==="main"){var j=f.cc;this.initPTS[f.cc]=_,this.log("InitPTS for cc: "+j+" found from main: "+_),this.videoTrackCC=j,this.state===H.State.WAITING_INIT_PTS&&this.tick()}},A.startLoad=function(T){if(!this.levels){this.startPosition=T,this.state=H.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(x),this.fragLoadError=0,d>0&&T===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=H.State.IDLE):(this.loadedmetadata=!1,this.state=H.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()},A.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_TRACK:{var T,d=this.levels,f=this.trackId,b=d==null||((T=d[f])===null||T===void 0)?void 0:T.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=H.State.WAITING_INIT_PTS}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var _,j=performance.now(),U=this.retryDate;(!U||j>=U||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=H.State.IDLE);break}case H.State.WAITING_INIT_PTS:{var w=this.waitingData;if(w){var M=w.frag,I=w.part,v=w.cache,W=w.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.FRAG_LOADING;var Z=v.flush(),oe={frag:M,part:I,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(oe),W&&D.prototype._handleFragmentLoadComplete.call(this,oe)}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 fe=this.getLoadPosition(),Ae=K.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),be=Object(h.fragmentWithinToleranceTest)(Ae.end,this.config.maxFragLookUpTolerance,M);be<0&&(u.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Ae.end+" is needed"),this.clearWaitingFragment())}}else this.state=H.State.IDLE}}this.onTickEnd()},A.clearWaitingFragment=function(){var T=this.waitingData;T&&(this.fragmentTracker.removeFragment(T.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=H.State.IDLE)},A.onTickEnd=function(){var T=this.media;if(!T||!T.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:T,f=d.buffered;!this.loadedmetadata&&f.length&&(this.loadedmetadata=!0),this.lastCurrentTime=T.currentTime},A.doTickIdle=function(){var T,d,f=this.hls,b=this.levels,_=this.media,j=this.trackId,U=f.config;if(!b||!b[j])return;if(!_&&(this.startFragRequested||!U.startFragPrefetch))return;var w=b[j],M=w.details;if(!M||M.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(M)){this.state=H.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var v=I.len,W=this.getMaxBufferLength(),Z=this.audioSwitch;if(v>=W&&!Z)return;if(!Z&&this._streamEnded(I,M)){f.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=H.State.ENDED;return}var oe=M.fragments,fe=oe[0].start,Ae=I.end;if(Z){var be=this.getLoadPosition();Ae=be,M.PTSKnown&&be<fe&&((I.end>fe||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=fe+.05))}var Re=this.getNextFragment(Ae,M);if(!Re){this.bufferFlushed=!0;return}((T=Re.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((d=Re.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Re,M):this.loadFragment(Re,M,Ae)},A.getMaxBufferLength=function(){var T=D.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return d===null?T:Math.max(T,d.len)},A.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},A.onAudioTracksUpdated=function(T,d){var f=d.audioTracks;this.resetTransmuxer(),this.levels=f.map(function(b){return new n.Level(b)})},A.onAudioTrackSwitching=function(T,d){var f=!!d.url;this.trackId=d.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),f?this.setInterval(x):this.resetTransmuxer(),f?(this.audioSwitch=!0,this.state=H.State.IDLE):this.state=H.State.STOPPED,this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},A.onLevelLoaded=function(T,d){this.mainDetails=d.details},A.onAudioTrackLoaded=function(T,d){var f,b=this.levels,_=d.details,j=d.id;if(!b){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var U=b[j],w=0;if(_.live||(f=U.details)!==null&&f!==void 0&&f.live){var M=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!M)return;!U.details&&_.hasProgramDateTime&&M.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(_,M),w=_.fragments[0].start):w=this.alignPlaylists(_,U.details)}U.details=_,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(U.details,w),this.state===H.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=H.State.IDLE),this.tick()},A._handleFragmentLoadProgress=function(T){var d,f=T.frag,b=T.part,_=T.payload,j=this.config,U=this.trackId,w=this.levels;if(!w){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var M=w[U];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 v=j.defaultAudioCodec||M.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new g.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[f.cc],oe=(d=f.initSegment)===null||d===void 0?void 0:d.data;if(Z!==void 0){var fe=!1,Ae=b?b.index:-1,be=Ae!==-1,Re=new l.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,_.byteLength,Ae,be);W.push(_,oe,v,"",f,b,I.totalduration,fe,Re,Z)}else{u.logger.log("Unknown video PTS for cc "+f.cc+", waiting for video PTS before demuxing audio frag "+f.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+U);var Ce=this.waitingData=this.waitingData||{frag:f,part:b,cache:new m.default,complete:!1},Le=Ce.cache;Le.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=H.State.WAITING_INIT_PTS}},A._handleFragmentLoadComplete=function(T){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,T)},A.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},A.onBufferCreated=function(T,d){var f=d.tracks.audio;f&&(this.mediaBuffer=f.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},A.onFragBuffered=function(T,d){var f=d.frag,b=d.part;if(f.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(b?" p: "+b.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}f.sn!=="initSegment"&&(this.fragPrevious=f,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(f,b)},A.onError=function(T,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(L.PlaylistLevelType.AUDIO,d);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==H.State.ERROR&&this.state!==H.State.STOPPED&&(this.state=d.fatal?H.State.ERROR:H.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===H.State.PARSING||this.state===H.State.PARSED)){var f=!0,b=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);b&&b.len>.5&&(f=!this.reduceMaxBufferLength(b.len)),f&&(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(T,d){var f=d.type;f===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},A._handleTransmuxComplete=function(T){var d,f="audio",b=this.hls,_=T.remuxResult,j=T.chunkMeta,U=this.getCurrentContext(j);if(!U){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var w=U.frag,M=U.part,I=_.audio,v=_.text,W=_.id3,Z=_.initSegment;if(this.fragContextChanged(w))return;if(this.state=H.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,w,j),b.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:f,tracks:Z.tracks})),I){var oe=I.startPTS,fe=I.endPTS,Ae=I.startDTS,be=I.endDTS;M&&(M.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:fe,startDTS:Ae,endDTS:be}),w.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,oe,fe,Ae,be),this.bufferFragmentData(I,w,M,j)}if(W!=null&&(d=W.samples)!==null&&d!==void 0&&d.length){var Re=s({frag:w,id:f},W);b.trigger(P.Events.FRAG_PARSING_METADATA,Re)}if(v){var Ce=s({frag:w,id:f},v);b.trigger(P.Events.FRAG_PARSING_USERDATA,Ce)}},A._bufferInitSegment=function(T,d,f){if(this.state!==H.State.PARSING)return;T.video&&delete T.video;var b=T.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,T);var _=b.initSegment;if(_!=null&&_.byteLength){var j={type:"audio",frag:d,part:null,chunkMeta:f,parent:d.type,data:_};this.hls.trigger(P.Events.BUFFER_APPENDING,j)}this.tick()},A.loadFragment=function(T,d,f){var b=this.fragmentTracker.getState(T);this.fragCurrent=T,(this.audioSwitch||b===z.FragmentState.NOT_LOADED||b===z.FragmentState.PARTIAL)&&(T.sn==="initSegment"?this._loadInitSegment(T):d.live&&!Object(X.isFiniteNumber)(this.initPTS[T.cc])?(this.log("Waiting for video PTS in continuity counter "+T.cc+" of live stream before loading audio fragment "+T.sn+" of level "+this.trackId),this.state=H.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,T,d,f)))},A.completeAudioSwitch=function(){var T=this.hls,d=this.media,f=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,T.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:f})},O}(H.default);Y.default=S},"./src/controller/audio-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function z(g,l){for(var h=0;h<l.length;h++){var p=l[h];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(g,p.key,p)}}function n(g,l,h){return l&&z(g.prototype,l),h&&z(g,h),g}function L(g,l){g.prototype=Object.create(l.prototype),g.prototype.constructor=g,y(g,l)}function y(g,l){return y=Object.setPrototypeOf||function(p,o){return p.__proto__=o,p},y(g,l)}var m=function(g){L(l,g);function l(p){var o;return o=g.call(this,p,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var h=l.prototype;return h.registerListeners=function(){var o=this.hls;o.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(X.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var o=this.hls;o.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(X.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,g.prototype.destroy.call(this)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},h.onManifestParsed=function(o,u){this.tracks=u.audioTracks||[]},h.onAudioTrackLoaded=function(o,u){var s=u.id,a=u.details,R=this.tracksInGroup[s];if(!R){this.warn("Invalid audio track id "+s);return}var x=R.details;R.details=u.details,this.log("audioTrack "+s+" loaded ["+a.startSN+"-"+a.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,x))},h.onLevelLoading=function(o,u){this.switchLevel(u.level)},h.onLevelSwitching=function(o,u){this.switchLevel(u.level)},h.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var a=this.tracks.filter(function(x){return!s||x.groupId===s});this.selectDefaultTrack&&!a.some(function(x){return x.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=a;var R={audioTracks:a};this.log("Updating audio tracks, "+a.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},h.onError=function(o,u){if(g.prototype.onError.call(this,o,u),u.fatal||!u.context)return;u.context.type===K.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},h.setAudioTrack=function(o){var u=this.tracksInGroup;if(o<0||o>=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],R=a.id,x=a.groupId,S=x===void 0?"":x,D=a.name,O=a.type,A=a.url;if(this.trackId=o,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:S,name:D,type:O,url:A}),a.details&&!a.details.live)return;var C=this.switchParams(a.url,s==null?void 0:s.details);this.loadPlaylist(C)},h.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:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(o){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var a=u[s];if((!this.selectDefaultTrack||a.default)&&(!o||o===a.name))return a.id}return-1},h.loadPlaylist=function(o){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,a=u.groupId,R=u.url;if(o)try{R=o.addDirectives(R)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:R,id:s,groupId:a,deliveryDirectives:o||null})}},n(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),l}(P.default);Y.default=m},"./src/controller/base-playlist-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var X=N("./src/polyfills/number.ts"),H=N("./src/types/level.ts"),P=N("./src/controller/level-helper.ts"),K=N("./src/utils/logger.ts"),z=N("./src/errors.ts"),n=function(){function L(m,g){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,g+":"),this.warn=K.logger.warn.bind(K.logger,g+":"),this.hls=m}var y=L.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(g,l){l.fatal&&l.type===z.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(g,l){var h=l==null?void 0:l.renditionReports;if(h)for(var p=0;p<h.length;p++){var o=h[p],u=""+o.URI;if(u===g.substr(-u.length)){var s=parseInt(o["LAST-MSN"]),a=parseInt(o["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var R=Math.min(l.age-l.partTarget,l.targetduration);a!==void 0&&R>l.partTarget&&(a+=1)}if(Object(X.isFiniteNumber)(s))return new H.HlsUrlParameters(s,Object(X.isFiniteNumber)(a)?a:void 0,H.HlsSkip.No)}}},y.loadPlaylist=function(g){},y.shouldLoadTrack=function(g){return this.canLoad&&g&&!!g.url&&(!g.details||g.details.live)},y.playlistLoaded=function(g,l,h){var p=this,o=l.details,u=l.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||h!=null&&h.live){if(o.reloaded(h),h&&this.log("live playlist "+g+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),h&&o.fragments.length>0&&Object(P.mergeDetails)(h,o),!this.canLoad||!o.live)return;var a,R=void 0,x=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var S=this.hls.config.lowLatencyMode,D=o.lastPartSn,O=o.endSN,A=o.lastPartIndex,C=A!==-1,T=D===O,d=S?0:A;C?(R=T?O+1:D,x=T?d:A+1):R=O+1;var f=o.age,b=f+o.ageHeader,_=Math.min(b-o.partTarget,o.targetduration*1.5);if(_>0){if(h&&_>h.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+h.tuneInGoal+" to: "+_+" with playlist age: "+o.age),_=0;else{var j=Math.floor(_/o.targetduration);if(R+=j,x!==void 0){var U=Math.round(_%o.targetduration/o.partTarget);x+=U}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+f.toFixed(2)+"s goal: "+_+" skip sn "+j+" to part "+x)}o.tuneInGoal=_}if(a=this.getDeliveryDirectives(o,l.deliveryDirectives,R,x),S||!T){this.loadPlaylist(a);return}}else a=this.getDeliveryDirectives(o,l.deliveryDirectives,R,x);var w=Object(P.computeReloadInterval)(o,u);R!==void 0&&o.canBlockReload&&(w-=o.partTarget||1),this.log("reload live playlist "+g+" in "+Math.round(w)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(a)},w)}else this.clearTimer()},y.getDeliveryDirectives=function(g,l,h,p){var o=Object(H.getSkipValue)(g,h);return l!=null&&l.skip&&g.deltaUpdateFailed&&(h=l.msn,p=l.part,o=H.HlsSkip.No),new H.HlsUrlParameters(h,p,o)},y.retryLoadingOrFail=function(g){var l=this,h=this.hls.config,p=this.retryCount<h.levelLoadingMaxRetry;if(p){var o;if(this.retryCount++,g.details.indexOf("LoadTimeOut")>-1&&(o=g.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+g.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*h.levelLoadingRetryDelay,h.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+g.details+'"')}}else this.warn('cannot recover from error "'+g.details+'"'),this.clearTimer(),g.fatal=!0;return p},L}()},"./src/controller/base-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return O}),N.d(Y,"default",function(){return A});var X=N("./src/polyfills/number.ts"),H=N("./src/task-loop.ts"),P=N("./src/controller/fragment-tracker.ts"),K=N("./src/utils/buffer-helper.ts"),z=N("./src/utils/logger.ts"),n=N("./src/events.ts"),L=N("./src/errors.ts"),y=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),g=N("./src/utils/discontinuities.ts"),l=N("./src/controller/fragment-finders.ts"),h=N("./src/controller/level-helper.ts"),p=N("./src/loader/fragment-loader.ts"),o=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function a(C,T){for(var d=0;d<T.length;d++){var f=T[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(C,f.key,f)}}function R(C,T,d){return T&&a(C.prototype,T),d&&a(C,d),C}function x(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(C,T){C.prototype=Object.create(T.prototype),C.prototype.constructor=C,D(C,T)}function D(C,T){return D=Object.setPrototypeOf||function(f,b){return f.__proto__=b,f},D(C,T)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},A=function(C){S(T,C);function T(f,b,_){var j;return j=C.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=O.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=_,j.log=z.logger.log.bind(z.logger,_+":"),j.warn=z.logger.warn.bind(z.logger,_+":"),j.hls=f,j.fragmentLoader=new p.default(f.config),j.fragmentTracker=b,j.config=f.config,j.decrypter=new o.default(f,f.config),f.on(n.Events.KEY_LOADED,j.onKeyLoaded,x(j)),j}var d=T.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(b){},d.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},d._streamEnded=function(b,_){var j=this.fragCurrent,U=this.fragmentTracker;if(!_.live&&j&&j.sn===_.endSN&&!b.nextStart){var w=U.getState(j);return w===P.FragmentState.PARTIAL||w===P.FragmentState.OK}return!1},d.onMediaAttached=function(b,_){var j=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(U.startPosition)},d.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var b=this.config,_=this.fragCurrent,j=this.media,U=this.mediaBuffer,w=this.state,M=j?j.currentTime:0,I=K.BufferHelper.bufferInfo(U||j,M,b.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+w),w===O.ENDED)this.resetLoadingState();else if(_&&!I.len){var v=b.maxFragLookUpTolerance,W=_.start-v,Z=_.start+_.duration+v,oe=M>Z;(M<W||oe)&&(oe&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=M),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(b,_){if(this.state!==O.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var j=this.levels[_.frag.level].details;j&&this.loadFragment(_.frag,j,_.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),C.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,C.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(b,_){this.log("Loading key for "+b.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=O.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(n.Events.KEY_LOADING,{frag:b})},d.loadFragment=function(b,_,j){this._loadFragForPlayback(b,_,j)},d._loadFragForPlayback=function(b,_,j){var U=this,w=function(I){if(U.fragContextChanged(b)){U.warn("Fragment "+b.sn+(I.part?" p: "+I.part.index:"")+" of level "+b.level+" was dropped during download."),U.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,U._handleFragmentLoadProgress(I)};this._doFragLoad(b,_,j,w).then(function(M){if(!M)return;U.fragLoadError=0;var I=U.state;if(U.fragContextChanged(b)){(I===O.FRAG_LOADING||I===O.BACKTRACKING||!U.fragCurrent&&I===O.PARSING)&&(U.fragmentTracker.removeFragment(b),U.state=O.IDLE);return}if("payload"in M&&(U.log("Loaded fragment "+b.sn+" of level "+b.level),U.hls.trigger(n.Events.FRAG_LOADED,M),U.state===O.BACKTRACKING)){U.fragmentTracker.backtrack(b,M),U.resetFragmentLoading(b);return}U._handleFragmentLoadComplete(M)}).catch(function(M){U.warn(M),U.resetFragmentLoading(b)})},d.flushMainBuffer=function(b,_,j){if(j===void 0&&(j=null),!(b-_))return;var U={startOffset:b,endOffset:_,type:j};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,U)},d._loadInitSegment=function(b){var _=this;this._doFragLoad(b).then(function(j){if(!j||_.fragContextChanged(b)||!_.levels)throw new Error("init load aborted");return j}).then(function(j){var U=_.hls,w=j.payload,M=b.decryptdata;if(w&&w.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var I=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(w),M.key.buffer,M.iv.buffer).then(function(v){var W=self.performance.now();return U.trigger(n.Events.FRAG_DECRYPTED,{frag:b,payload:v,stats:{tstart:I,tdecrypt:W}}),j.payload=v,j})}return j}).then(function(j){var U=_.fragCurrent,w=_.hls,M=_.levels;if(!M)throw new Error("init load aborted, missing levels");var I=M[b.level].details;console.assert(I,"Level details are defined when init segment is loaded");var v=b.stats;_.state=O.IDLE,_.fragLoadError=0,b.data=new Uint8Array(j.payload),v.parsing.start=v.buffering.start=self.performance.now(),v.parsing.end=v.buffering.end=self.performance.now(),j.frag===U&&w.trigger(n.Events.FRAG_BUFFERED,{stats:v,frag:U,part:null,id:b.type}),_.tick()}).catch(function(j){_.warn(j),_.resetFragmentLoading(b)})},d.fragContextChanged=function(b){var _=this.fragCurrent;return!b||!_||b.level!==_.level||b.sn!==_.sn||b.urlId!==_.urlId},d.fragBufferedComplete=function(b,_){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+u.default.toString(K.BufferHelper.getBuffered(j))),this.state=O.IDLE,this.tick()},d._handleFragmentLoadComplete=function(b){var _=this.transmuxer;if(!_)return;var j=b.frag,U=b.part,w=b.partsLoaded,M=!w||w.length===0||w.some(function(v){return!v}),I=new y.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,U?U.index:-1,!M);_.flush(I)},d._handleFragmentLoadProgress=function(b){},d._doFragLoad=function(b,_,j,U){var w=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(b.start,j||0),this.config.lowLatencyMode&&_){var M=_.partList;if(M&&U){j>b.end&&_.fragmentHint&&(b=_.fragmentHint);var I=this.getNextPart(M,b,j);if(I>-1){var v=M[I];return this.log("Loading part sn: "+b.sn+" p: "+v.index+" cc: "+b.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+I+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,part:M[I],targetBufferTime:j}),this.doFragPartsLoad(b,M,I,U).catch(function(W){return w.handleFragLoadError(W)})}else if(!b.url||this.loadedEndOfParts(M,j))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(j.toFixed(3))),Object(X.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,targetBufferTime:j}),this.fragmentLoader.load(b,U).catch(function(W){return w.handleFragLoadError(W)})},d.doFragPartsLoad=function(b,_,j,U){var w=this;return new Promise(function(M,I){var v=[],W=function Z(oe){var fe=_[oe];w.fragmentLoader.loadPart(b,fe,U).then(function(Ae){v[fe.index]=Ae;var be=Ae.part;w.hls.trigger(n.Events.FRAG_LOADED,Ae);var Re=_[oe+1];if(Re&&Re.fragment===b)Z(oe+1);else return M({frag:b,part:be,partsLoaded:v})}).catch(I)};W(j)})},d.handleFragLoadError=function(b){var _=b.data;return _&&_.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(n.Events.ERROR,_),null},d._handleTransmuxerFlush=function(b){var _=this.getCurrentContext(b);if(!_||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var j=_.frag,U=_.part,w=_.level,M=self.performance.now();j.stats.parsing.end=M,U&&(U.stats.parsing.end=M),this.updateLevelTiming(j,U,w,b.partial)},d.getCurrentContext=function(b){var _=this.levels,j=b.level,U=b.sn,w=b.part;if(!_||!_[j])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+j+". The current chunk will not be buffered."),null;var M=_[j],I=w>-1?Object(h.getPartWith)(M,U,w):null,v=I?I.fragment:Object(h.getFragmentWithSN)(M,U,this.fragCurrent);return v?{frag:v,part:I,level:M}:null},d.bufferFragmentData=function(b,_,j,U){if(!b||this.state!==O.PARSING)return;var w=b.data1,M=b.data2,I=w;if(w&&M&&(I=Object(m.appendUint8Array)(w,M)),!I||!I.length)return;var v={type:b.type,frag:_,part:j,chunkMeta:U,parent:_.type,data:I};this.hls.trigger(n.Events.BUFFER_APPENDING,v),b.dropped&&b.independent&&!j&&this.flushBufferGap(_)},d.flushBufferGap=function(b){var _=this.media;if(!_)return;if(!K.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,b.start);return}var j=_.currentTime,U=K.BufferHelper.bufferInfo(_,j,0),w=b.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,w*.25),I=Math.max(Math.min(b.start-M,U.end-M),j+M);b.start-I>M&&this.flushMainBuffer(I,b.start)},d.getFwdBufferInfo=function(b,_){var j=this.config,U=this.getLoadPosition();if(!Object(X.isFiniteNumber)(U))return null;var w=K.BufferHelper.bufferInfo(b,U,j.maxBufferHole);if(w.len===0&&w.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(U,_);if(M&&w.nextStart<M.end)return K.BufferHelper.bufferInfo(b,U,Math.max(w.nextStart,j.maxBufferHole))}return w},d.getMaxBufferLength=function(b){var _=this.config,j;return b?j=Math.max(8*_.maxBufferSize/b,_.maxBufferLength):j=_.maxBufferLength,Math.min(j,_.maxMaxBufferLength)},d.reduceMaxBufferLength=function(b){var _=this.config,j=b||_.maxBufferLength;return _.maxMaxBufferLength>=j?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(b,_){var j,U,w=_.fragments,M=w.length;if(!M)return null;var I=this.config,v=w[0].start,W;if(_.live){var Z=I.initialLiveManifestSize;if(M<Z)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+Z+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(_,w),this.startPosition=W?this.hls.liveSyncPosition||W.start:b)}else b<=v&&(W=w[0]);if(!W){var oe=I.lowLatencyMode?_.partEnd:_.fragmentEnd;W=this.getFragmentAtPosition(b,oe,_)}return(j=W)!==null&&j!==void 0&&j.initSegment&&!((U=W)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},d.getNextPart=function(b,_,j){for(var U=-1,w=!1,M=!0,I=0,v=b.length;I<v;I++){var W=b[I];if(M=M&&!W.independent,U>-1&&j<W.start)break;var Z=W.loaded;!Z&&(w||W.independent||M)&&W.fragment===_&&(U=I),w=Z}return U},d.loadedEndOfParts=function(b,_){var j=b[b.length-1];return j&&_>j.start&&j.loaded},d.getInitialLiveFragment=function(b,_){var j=this.fragPrevious,U=null;if(j){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),U=Object(l.findFragmentByPDT)(_,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var w=j.sn+1;if(w>=b.startSN&&w<=b.endSN){var M=_[w-b.startSN];j.cc===M.cc&&(U=M,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(l.findFragWithCC)(_,j.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(U=this.getFragmentAtPosition(I,this.bitrateTest?b.fragmentEnd:b.edge,b))}return U},d.getFragmentAtPosition=function(b,_,j){var U=this.config,w=this.fragPrevious,M=j.fragments,I=j.endSN,v=j.fragmentHint,W=U.maxFragLookUpTolerance,Z=!!(U.lowLatencyMode&&j.partList&&v);Z&&v&&!this.bitrateTest&&(M=M.concat(v),I=v.sn);var oe;if(b<_){var fe=b>_-W?0:W;oe=Object(l.findFragmentByPTS)(w,M,b,fe)}else oe=M[M.length-1];if(oe){var Ae=oe.sn-j.startSN,be=w&&oe.level===w.level,Re=M[Ae+1],Ce=this.fragmentTracker.getState(oe);if(Ce===P.FragmentState.BACKTRACKED){oe=null;for(var Le=Ae;M[Le]&&this.fragmentTracker.getState(M[Le])===P.FragmentState.BACKTRACKED;)w?oe=M[Le--]:oe=M[--Le];oe||(oe=Re)}else w&&oe.sn===w.sn&&!Z&&(be&&(oe.sn<I&&this.fragmentTracker.getState(Re)!==P.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Re.sn),oe=Re):oe=null))}return oe},d.synchronizeToLiveEdge=function(b){var _=this.config,j=this.media;if(!j)return;var U=this.hls.liveSyncPosition,w=j.currentTime,M=b.fragments[0].start,I=b.edge,v=w>=M-_.maxFragLookUpTolerance&&w<=I;if(U!==null&&j.duration>U&&(w<U||!v)){var W=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*b.targetduration;(!v&&j.readyState<4||w<I-W)&&(this.loadedmetadata||(this.nextLoadPosition=U),j.readyState&&(this.warn("Playback: "+w.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+U.toFixed(3)),j.currentTime=U))}},d.alignPlaylists=function(b,_){var j=this.levels,U=this.levelLastLoaded,w=this.fragPrevious,M=U!==null?j[U]:null,I=b.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var v=b.fragments[0].start,W=!_,Z=b.alignedSliding&&Object(X.isFiniteNumber)(v);if(W||!Z&&!v){Object(g.alignStream)(w,M,b);var oe=b.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+b.startSN+" prev-sn: "+(w?w.sn:"na")+" fragments: "+I),oe}return v},d.waitForCdnTuneIn=function(b){var _=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*_)},d.setStartPosition=function(b,_){var j=this.startPosition;if(j<_&&(j=-1),j===-1||this.lastCurrentTime===-1){var U=b.startTimeOffset;Object(X.isFiniteNumber)(U)?(j=_+U,U<0&&(j+=b.totalduration),j=Math.min(Math.max(_,j),_+b.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+j),this.startPosition=j):b.live?j=this.hls.liveSyncPosition||_:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},d.getLoadPosition=function(){var b=this.media,_=0;return this.loadedmetadata&&b?_=b.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},d.handleFragLoadAborted=function(b,_){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(_?" part"+_.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},d.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=O.IDLE)},d.onFragmentOrKeyLoadError=function(b,_){if(_.fatal)return;var j=_.frag;if(!j||j.type!==b)return;var U=this.fragCurrent;console.assert(U&&j.sn===U.sn&&j.level===U.level&&j.urlId===U.urlId,"Frag load error must match current frag to retry");var w=this.config;if(this.fragLoadError+1<=w.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*w.fragLoadingRetryDelay,w.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+b+" "+j.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(b===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(z.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},d.afterBufferFlushed=function(b,_,j){if(!b)return;var U=K.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(_,U,j),this.state===O.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},d.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[b].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(b,_,j,U){var w=this,M=j.details;console.assert(!!M,"level.details must be defined");var I=Object.keys(b.elementaryStreams).reduce(function(v,W){var Z=b.elementaryStreams[W];if(Z){var oe=Z.endPTS-Z.startPTS;if(oe<=0)return w.warn("Could not parse fragment "+b.sn+" "+W+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),w.resetTransmuxer(),v||!1;var fe=U?0:Object(h.updateFragPTSDTS)(M,b,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return w.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:M,level:j,drift:fe,type:W,frag:b,start:Z.startPTS,end:Z.endPTS}),!0}return v},!1);I?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:b,part:_})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(T,[{key:"state",get:function(){return this._state},set:function(b){var _=this._state;_!==b&&(this._state=b,this.log(_+"->"+b))}}]),T}(H.default)},"./src/controller/buffer-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var X=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),z=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),L=N("./src/loader/fragment.ts"),y=N("./src/controller/buffer-operation-queue.ts"),m=Object(n.getMediaSource)(),g=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function h(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,R=u.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),a&&(u.updateMediaElementDuration(),s.trigger(H.Events.MEDIA_ATTACHED,{media:a})),R&&R.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var p=h.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var u=this.hls;u.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(H.Events.BUFFER_RESET,this.onBufferReset,this),u.on(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(H.Events.BUFFER_EOS,this.onBufferEos,this),u.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(H.Events.FRAG_PARSED,this.onFragParsed,this),u.on(H.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(H.Events.BUFFER_RESET,this.onBufferReset,this),u.off(H.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(H.Events.BUFFER_EOS,this.onBufferEos,this),u.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(H.Events.FRAG_PARSED,this.onFragParsed,this),u.off(H.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(u,s){var a=2;(s.audio&&!s.video||!s.altAudio)&&(a=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=a,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(u,s){var a=this.media=s.media;if(a&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),a.src=self.URL.createObjectURL(R),this._objectUrl=a.src}},p.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,a=this._objectUrl;if(s){if(P.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(R){P.logger.warn("[buffer-controller]: onMediaDetaching: "+R.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()):P.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(H.Events.MEDIA_DETACHED,void 0)},p.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(R){P.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",R)}}),this._initSourceBuffer()},p.onBufferCodecs=function(u,s){var a=this,R=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(x){if(R){var S=a.tracks[x];if(S&&typeof S.buffer.changeType=="function"){var D=s[x],O=D.codec,A=D.levelCodec,C=D.container,T=(S.levelCodec||S.codec).replace(g,"$1"),d=(A||O).replace(g,"$1");if(T!==d){var f=C+";codecs="+(A||O);a.appendChangeType(x,f)}}}else a.pendingTracks[x]=s[x]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(u,s){var a=this,R=this.operationQueue,x={execute:function(){var D=a.sourceBuffer[u];D&&(P.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),D.changeType(s)),R.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(D){P.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",D)}};R.append(x,u)},p.onBufferAppending=function(u,s){var a=this,R=this.hls,x=this.operationQueue,S=this.tracks,D=s.data,O=s.type,A=s.frag,C=s.part,T=s.chunkMeta,d=T.buffering[O],f=self.performance.now();d.start=f;var b=A.stats.buffering,_=C?C.stats.buffering:null;b.start===0&&(b.start=f),_&&_.start===0&&(_.start=f);var j=S.audio,U=O==="audio"&&T.id===1&&(j==null?void 0:j.container)==="audio/mpeg",w={execute:function(){if(d.executeStart=self.performance.now(),U){var I=a.sourceBuffer[O];if(I){var v=A.start-I.timestampOffset;Math.abs(v)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+A.start+" (delta: "+v+") sn: "+A.sn+")"),I.timestampOffset=A.start)}}a.appendExecutor(D,O)},onStart:function(){},onComplete:function(){var I=self.performance.now();d.executeEnd=d.end=I,b.first===0&&(b.first=I),_&&_.first===0&&(_.first=I);var v=a.sourceBuffer,W={};for(var Z in v)W[Z]=z.BufferHelper.getBuffered(v[Z]);a.appendError=0,a.hls.trigger(H.Events.BUFFER_APPENDED,{type:O,frag:A,part:C,chunkMeta:T,parent:A.type,timeRanges:W})},onError:function(I){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",I);var v={type:K.ErrorTypes.MEDIA_ERROR,parent:A.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?v.details=K.ErrorDetails.BUFFER_FULL_ERROR:(a.appendError++,v.details=K.ErrorDetails.BUFFER_APPEND_ERROR,a.appendError>R.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0)),R.trigger(H.Events.ERROR,v)}};x.append(w,O)},p.onBufferFlushing=function(u,s){var a=this,R=this.operationQueue,x=function(D){return{execute:a.removeExecutor.bind(a,D,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){a.hls.trigger(H.Events.BUFFER_FLUSHED,{type:D})},onError:function(A){P.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",A)}}};s.type?R.append(x(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){R.append(x(S),S)})},p.onFragParsed=function(u,s){var a=this,R=s.frag,x=s.part,S=[],D=x?x.elementaryStreams:R.elementaryStreams;D[L.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(D[L.ElementaryStreamTypes.AUDIO]&&S.push("audio"),D[L.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var C=self.performance.now();R.stats.buffering.end=C,x&&(x.stats.buffering.end=C);var T=x?x.stats:R.stats;a.hls.trigger(H.Events.FRAG_BUFFERED,{frag:R,part:x,stats:T,id:R.type})};S.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(O,S)},p.onFragChanged=function(u,s){this.flushBackBuffer()},p.onBufferEos=function(u,s){var a=this,R=this.getSourceBufferTypes().reduce(function(x,S){var D=a.sourceBuffer[S];return(!s.type||s.type===S)&&(D&&!D.ended&&(D.ended=!0,P.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),x&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var x=a.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},p.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()},p.flushBackBuffer=function(){var u=this.hls,s=this.details,a=this.media,R=this.sourceBuffer;if(!a||s===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(X.isFiniteNumber)(S)||S<0)return;var D=a.currentTime,O=s.levelTargetDuration,A=Math.max(S,O),C=Math.floor(D/O)*O-A;x.forEach(function(T){var d=R[T];if(d){var f=z.BufferHelper.getBuffered(d);f.length>0&&C>f.start(0)&&(u.trigger(H.Events.BACK_BUFFER_REACHED,{bufferEnd:C}),s.live&&u.trigger(H.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:C}),u.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:C,type:T}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,a=this.media,R=this.mediaSource,x=u.fragments[0].start+u.totalduration,S=a.duration,D=Object(X.isFiniteNumber)(R.duration)?R.duration:0;u.live&&s.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(u)):(x>D&&x>S||!Object(X.isFiniteNumber)(S))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),R.duration=x)},p.updateSeekableRange=function(u){var s=this.mediaSource,a=u.fragments,R=a.length;if(R&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var x=Math.max(0,a[0].start),S=Math.max(x,x+u.totalduration);s.setLiveSeekableRange(x,S)}},p.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,a=this.pendingTracks,R=Object.keys(a).length;if(R&&!u||R===2){this.createSourceBuffers(a),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(H.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}x.forEach(function(S){s.executeNext(S)})}},p.createSourceBuffers=function(u){var s=this.sourceBuffer,a=this.mediaSource;if(!a)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var x in u)if(!s[x]){var S=u[x];if(!S)throw Error("source buffer exists for track "+x+", however track does not");var D=S.levelCodec||S.codec,O=S.container+";codecs="+D;P.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var A=s[x]=a.addSourceBuffer(O),C=x;this.addBufferListener(C,"updatestart",this._onSBUpdateStart),this.addBufferListener(C,"updateend",this._onSBUpdateEnd),this.addBufferListener(C,"error",this._onSBUpdateError),this.tracks[x]={buffer:A,codec:D,container:S.container,levelCodec:S.levelCodec,id:S.id},R++}catch(T){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+T.message),this.hls.trigger(H.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:T,mimeType:O})}}R&&this.hls.trigger(H.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(u){var s=this.operationQueue,a=s.current(u);a.onStart()},p._onSBUpdateEnd=function(u){var s=this.operationQueue,a=s.current(u);a.onComplete(),s.shiftAndExecuteNext(u)},p._onSBUpdateError=function(u,s){P.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(H.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)},p.removeExecutor=function(u,s,a){var R=this.media,x=this.mediaSource,S=this.operationQueue,D=this.sourceBuffer,O=D[u];if(!R||!x||!O){P.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var A=Object(X.isFiniteNumber)(R.duration)?R.duration:Infinity,C=Object(X.isFiniteNumber)(x.duration)?x.duration:Infinity,T=Math.max(0,s),d=Math.min(a,A,C);d>T?(P.logger.log("[buffer-controller]: Removing ["+T+","+d+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(T,d)):S.shiftAndExecuteNext(u)},p.appendExecutor=function(u,s){var a=this.operationQueue,R=this.sourceBuffer,x=R[s];if(!x){P.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),a.shiftAndExecuteNext(s);return}x.ended=!1,console.assert(!x.updating,s+" sourceBuffer must not be updating"),x.appendBuffer(u)},p.blockBuffers=function(u,s){var a=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var R=this.operationQueue,x=s.map(function(S){return R.appendBlocker(S)});Promise.all(x).then(function(){u(),s.forEach(function(S){var D=a.sourceBuffer[S];(!D||!D.updating)&&R.shiftAndExecuteNext(S)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(u,s,a){var R=this.sourceBuffer[u];if(!R)return;var x=a.bind(this,u);this.listeners[u].push({event:s,listener:x}),R.addEventListener(s,x)},p.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(a){s.removeEventListener(a.event,a.listener)})},h}()},"./src/controller/buffer-operation-queue.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return H});var X=N("./src/utils/logger.ts"),H=function(){function P(z){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=z}var K=P.prototype;return K.append=function(n,L){var y=this.queues[L];y.push(n),y.length===1&&this.buffers[L]&&this.executeNext(L)},K.insertAbort=function(n,L){var y=this.queues[L];y.unshift(n),this.executeNext(L)},K.appendBlocker=function(n){var L,y=new Promise(function(g){L=g}),m={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,n),y},K.executeNext=function(n){var L=this.buffers,y=this.queues,m=L[n],g=y[n];if(g.length){var l=g[0];try{l.execute()}catch(h){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(h),(!m||!m.updating)&&(g.shift(),this.executeNext(n))}}},K.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},K.current=function(n){return this.queues[n][0]},P}()},"./src/controller/cap-level-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts");function H(z,n){for(var L=0;L<n.length;L++){var y=n[L];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(z,y.key,y)}}function P(z,n,L){return n&&H(z.prototype,n),L&&H(z,L),z}var K=function(){function z(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=z.prototype;return n.setStreamController=function(y){this.streamController=y},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var y=this.hls;y.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var y=this.hls;y.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(y,m){z.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},n.onMediaAttaching=function(y,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},n.onManifestParsed=function(y,m){var g=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,g.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onBufferCodecs=function(y,m){var g=this.hls;g.config.capLevelToPlayerSize&&m.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(y.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},n.getMaxLevel=function(y){var m=this,g=this.hls.levels;if(!g.length)return-1;var l=g.filter(function(h,p){return z.isLevelAllowed(p,m.restrictedLevels)&&p<=y});return this.clientRect=null,z.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,m={width:0,height:0};if(y){var g=y.getBoundingClientRect();m.width=g.width,m.height=g.height,!m.width&&!m.height&&(m.width=g.right-g.left||y.width||0,m.height=g.bottom-g.top||y.height||0)}return this.clientRect=m,m},z.isLevelAllowed=function(y,m){return m===void 0&&(m=[]),m.indexOf(y)===-1},z.getMaxLevelByMediaSize=function(y,m,g){if(!y||!y.length)return-1;for(var l=function(s,a){return a?s.width!==a.width||s.height!==a.height:!0},h=y.length-1,p=0;p<y.length;p+=1){var o=y[p];if((o.width>=m||o.height>=g)&&l(o,y[p+1])){h=p;break}}return h},P(z,[{key:"mediaWidth",get:function(){return this.getDimensions().width*z.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*z.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(m){}return y}}]),z}();Y.default=K},"./src/controller/cmcd-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var X=N("./src/events.ts"),H=N("./src/types/cmcd.ts"),P=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts");function z(h,p){for(var o=0;o<p.length;o++){var u=p[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(h,u.key,u)}}function n(h,p,o){return p&&z(h.prototype,p),o&&z(h,o),h}function L(h,p){var o=typeof Symbol!="undefined"&&h[Symbol.iterator]||h["@@iterator"];if(o)return(o=o.call(h)).next.bind(o);if(Array.isArray(h)||(o=y(h))||p&&h&&typeof h.length=="number"){o&&(h=o);var u=0;return function(){return u>=h.length?{done:!0}:{done:!1,value:h[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 y(h,p){if(!h)return;if(typeof h=="string")return m(h,p);var o=Object.prototype.toString.call(h).slice(8,-1);if(o==="Object"&&h.constructor&&(o=h.constructor.name),o==="Map"||o==="Set")return Array.from(h);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return m(h,p)}function m(h,p){(p==null||p>h.length)&&(p=h.length);for(var o=0,u=new Array(p);o<p;o++)u[o]=h[o];return u}function g(){return g=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var o=arguments[p];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(h[u]=o[u])}return h},g.apply(this,arguments)}var l=function(){function h(o){var u=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(R){try{u.apply(R,{ot:H.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(x){K.logger.warn("Could not generate manifest CMCD data.",x)}},this.applyFragmentData=function(R){try{var x=R.frag,S=u.hls.levels[x.level],D=u.getObjectType(x),O={d:x.duration*1e3,ot:D};(D===H.CMCDObjectType.VIDEO||D===H.CMCDObjectType.AUDIO||D==H.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=u.getTopBandwidth(D),O.bl=u.getBufferLength(D)),u.apply(R,O)}catch(A){K.logger.warn("Could not generate segment CMCD data.",A)}},this.hls=o;var s=this.config=o.config,a=s.cmcd;a!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||h.uuid(),this.cid=a.contentId,this.useHeaders=a.useHeaders===!0,this.registerListeners())}var p=h.prototype;return p.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(u,s){var a,R;this.audioBuffer=(a=s.tracks.audio)===null||a===void 0?void 0:a.buffer,this.videoBuffer=(R=s.tracks.video)===null||R===void 0?void 0:R.buffer},p.createData=function(){var u;return{v:H.CMCDVersion,sf:H.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(u,s){s===void 0&&(s={}),g(s,this.createData());var a=s.ot===H.CMCDObjectType.INIT||s.ot===H.CMCDObjectType.VIDEO||s.ot===H.CMCDObjectType.MUXED;if(this.starved&&a&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var R=h.toHeaders(s);if(!Object.keys(R).length)return;u.headers||(u.headers={}),g(u.headers,R)}else{var x=h.toQuery(s);if(!x)return;u.url=h.appendQueryToUri(u.url,x)}},p.getObjectType=function(u){var s=u.type;return s==="subtitle"?H.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?H.CMCDObjectType.INIT:s==="audio"?H.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?H.CMCDObjectType.VIDEO:H.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(u){for(var s=0,a=u===H.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=L(a),x;!(x=R()).done;){var S=x.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},p.getBufferLength=function(u){var s=this.hls.media,a=u===H.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!a||!s)return NaN;var R=P.BufferHelper.bufferInfo(a,s.currentTime,this.config.maxBufferHole);return R.len*1e3},p.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,a=u||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new a(S)}var x=R.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(D,O,A){s(D),this.loader.load(D,O,A)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},p.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,a=u||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new a(S)}var x=R.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(D,O,A){s(D),this.loader.load(D,O,A)},n(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},h.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},h.serialize=function(u){for(var s=[],a=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},R=function(U){return Math.round(U)},x=function(U){return R(U/100)*100},S=function(U){return encodeURIComponent(U)},D={br:R,d:R,bl:x,dl:x,mtp:x,nor:S,rtp:x,tb:R},O=Object.keys(u||{}).sort(),A=L(O),C;!(C=A()).done;){var T=C.value,d=u[T];if(!a(d))continue;if(T==="v"&&d===1)continue;if(T=="pr"&&d===1)continue;var f=D[T];f&&(d=f(d));var b=typeof d,_=void 0;T==="ot"||T==="sf"||T==="st"?_=T+"="+d:b==="boolean"?_=T:b==="number"?_=T+"="+d:_=T+"="+JSON.stringify(d),s.push(_)}return s.join(",")},h.toHeaders=function(u){for(var s=Object.keys(u),a={},R=["Object","Request","Session","Status"],x=[{},{},{},{}],S={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,O=s;D<O.length;D++){var A=O[D],C=S[A]!=null?S[A]:1;x[C][A]=u[A]}for(var T=0;T<x.length;T++){var d=h.serialize(x[T]);d&&(a["CMCD-"+R[T]]=d)}return a},h.toQuery=function(u){return"CMCD="+encodeURIComponent(h.serialize(u))},h.appendQueryToUri=function(u,s){if(!s)return u;var a=u.includes("?")?"&":"?";return""+u+a+s},h}()},"./src/controller/eme-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),K=N("./src/utils/mediakeys-helper.ts");function z(l,h){for(var p=0;p<h.length;p++){var o=h[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function n(l,h,p){return h&&z(l.prototype,h),p&&z(l,p),l}var L=3,y=function(h,p,o){var u={audioCapabilities:[],videoCapabilities:[]};return h.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),p.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[u]},m=function(h,p,o,u){switch(h){case K.KeySystems.WIDEVINE:return y(p,o,u);default:throw new Error("Unknown key-system: "+h)}},g=function(){function l(p){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=p,this._config=p.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var h=l.prototype;return h.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},h._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h.getLicenseServerUrl=function(o){switch(o){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},h._attemptKeySystemAccess=function(o,u,s){var a=this,R=m(o,u,s,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var x=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=x.then(function(S){return a._onMediaKeySystemAccessObtained(o,S)}),x.catch(function(S){P.logger.error('Failed to obtain key-system "'+o+'" access:',S)})},h._onMediaKeySystemAccessObtained=function(o,u){var s=this;P.logger.log('Access for key-system "'+o+'" obtained');var a={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:o};this._mediaKeysList.push(a);var R=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(x){return a.mediaKeys=x,P.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),x});return R.catch(function(x){P.logger.error("Failed to create media-keys:",x)}),R},h._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),o._onNewMediaKeySession(u.mediaKeysSession))})},h._onNewMediaKeySession=function(o){var u=this;P.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){u._onKeySessionMessage(o,s.message)},!1)},h._onKeySessionMessage=function(o,u){P.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){P.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},h.onMediaEncrypted=function(o){var u=this;if(P.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(R){if(!u._media)return;u._attemptSetMediaKeys(R),u._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},h._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},h._generateRequestWithPreferredKeySession=function(o,u){var s=this,a=this._mediaKeysList[0];if(!a){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var R=a.mediaKeysSession;if(!R){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+o+'" init data type'),a.mediaKeysSessionInitialized=!0,R.generateRequest(o,u).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(x){P.logger.error("Error generating key-session request:",x),s.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},h._createLicenseXhr=function(o,u,s){var a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,a,o,u,s);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,a,o),R=void 0}catch(x){P.logger.error(x)}try{a.readyState||a.open("POST",o,!0),R&&R.call(this.hls,a,o)}catch(x){throw new Error("issue setting up KeySystem license XHR "+x)}return a},h._onLicenseRequestReadyStageChange=function(o,u,s,a){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var R=o.response,x=this._licenseResponseCallback;if(x)try{R=x.call(this.hls,o,u)}catch(D){P.logger.error(D)}a(R)}else{if(P.logger.error("License Request XHR failed ("+u+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=L-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,a)}break}},h._generateLicenseRequestChallenge=function(o,u){switch(o.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},h._requestLicense=function(o,u){P.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(s.mediaKeySystemDomain),R=this._createLicenseXhr(a,o,u);P.logger.log("Sending license request to URL: "+a);var x=this._generateLicenseRequestChallenge(s,o);R.send(x)}catch(S){P.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.KEY_SYSTEM_ERROR,details:H.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},h.onMediaAttached=function(o,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},h.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(){})},h.onManifestParsed=function(o,u){if(!this._emeEnabled)return;var s=u.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),a=u.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,s,a)},n(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();Y.default=g},"./src/controller/fps-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=function(){function K(n){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=n,this.registerListeners()}var z=K.prototype;return z.setStreamController=function(L){this.streamController=L},z.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},z.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},z.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},z.onMediaAttaching=function(L,y){var m=this.hls.config;if(m.capLevelOnFPSDrop){var g=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=g,g&&typeof g.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},z.checkFPS=function(L,y,m){var g=performance.now();if(y){if(this.lastTime){var l=g-this.lastTime,h=m-this.lastDroppedFrames,p=y-this.lastDecodedFrames,o=1e3*h/l,u=this.hls;if(u.trigger(X.Events.FPS_DROP,{currentDropped:h,currentDecoded:p,totalDroppedFrames:m}),o>0&&h>u.config.fpsDroppedMonitoringThreshold*p){var s=u.currentLevel;H.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=g,this.lastDroppedFrames=m,this.lastDecodedFrames=y}},z.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var y=L.getVideoPlaybackQuality();this.checkFPS(L,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},K}();Y.default=P},"./src/controller/fragment-finders.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return P}),N.d(Y,"findFragmentByPTS",function(){return K}),N.d(Y,"fragmentWithinToleranceTest",function(){return z}),N.d(Y,"pdtWithinToleranceTest",function(){return n}),N.d(Y,"findFragWithCC",function(){return L});var X=N("./src/polyfills/number.ts"),H=N("./src/utils/binary-search.ts");function P(y,m,g){if(m===null||!Array.isArray(y)||!y.length||!Object(X.isFiniteNumber)(m))return null;var l=y[0].programDateTime;if(m<(l||0))return null;var h=y[y.length-1].endProgramDateTime;if(m>=(h||0))return null;g=g||0;for(var p=0;p<y.length;++p){var o=y[p];if(n(m,g,o))return o}return null}function K(y,m,g,l){g===void 0&&(g=0),l===void 0&&(l=0);var h=null;if(y?h=m[y.sn-m[0].sn+1]||null:g===0&&m[0].start===0&&(h=m[0]),h&&z(g,l,h)===0)return h;var p=H.default.search(m,z.bind(null,g,l));return p||h}function z(y,m,g){y===void 0&&(y=0),m===void 0&&(m=0);var l=Math.min(m,g.duration+(g.deltaPTS?g.deltaPTS:0));return g.start+g.duration-l<=y?1:g.start-l>y&&g.start?-1:0}function n(y,m,g){var l=Math.min(m,g.duration+(g.deltaPTS?g.deltaPTS:0))*1e3,h=g.endProgramDateTime||0;return h-l>y}function L(y,m){return H.default.search(y,function(g){return g.cc<m?1:g.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return P}),N.d(Y,"FragmentTracker",function(){return K});var X=N("./src/events.ts"),H=N("./src/types/loader.ts"),P;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(P||(P={}));var K=function(){function L(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 y=L.prototype;return y._registerListeners=function(){var g=this.hls;g.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),g.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),g.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var g=this.hls;g.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),g.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),g.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(g,l){if(l===H.PlaylistLevelType.MAIN){var h=this.activeFragment,p=this.activeParts;if(!h)return null;if(p)for(var o=p.length;o--;){var u=p[o],s=u?u.end:h.appendedPTS;if(u.start<=g&&s!==void 0&&g<=s)return o>9&&(this.activeParts=p.slice(o-9)),u}else if(h.start<=g&&h.appendedPTS!==void 0&&g<=h.appendedPTS)return h}return this.getBufferedFrag(g,l)},y.getBufferedFrag=function(g,l){for(var h=this.fragments,p=Object.keys(h),o=p.length;o--;){var u=h[p[o]];if((u==null?void 0:u.body.type)===l&&u.buffered){var s=u.body;if(s.start<=g&&g<=s.end)return s}}return null},y.detectEvictedFragments=function(g,l,h){var p=this;Object.keys(this.fragments).forEach(function(o){var u=p.fragments[o];if(!u)return;if(!u.buffered){u.body.type===h&&p.removeFragment(u.body);return}var s=u.range[g];if(!s)return;s.time.some(function(a){var R=!p.isTimeBuffered(a.startPTS,a.endPTS,l);return R&&p.removeFragment(u.body),R})})},y.detectPartialFragments=function(g){var l=this,h=this.timeRanges,p=g.frag,o=g.part;if(!h||p.sn==="initSegment")return;var u=n(p),s=this.fragments[u];if(!s)return;Object.keys(h).forEach(function(a){var R=p.elementaryStreams[a];if(!R)return;var x=h[a],S=o!==null||R.partial===!0;s.range[a]=l.getBufferedTimes(p,o,S,x)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},y.fragBuffered=function(g){var l=n(g),h=this.fragments[l];h&&(h.backtrack=h.loaded=null,h.buffered=!0)},y.getBufferedTimes=function(g,l,h,p){for(var o={time:[],partial:h},u=l?l.start:g.start,s=l?l.end:g.end,a=g.minEndPTS||s,R=g.maxStartPTS||u,x=0;x<p.length;x++){var S=p.start(x)-this.bufferPadding,D=p.end(x)+this.bufferPadding;if(R>=S&&a<=D){o.time.push({startPTS:Math.max(u,p.start(x)),endPTS:Math.min(s,p.end(x))});break}else if(u<D&&s>S)o.partial=!0,o.time.push({startPTS:Math.max(u,p.start(x)),endPTS:Math.min(s,p.end(x))});else if(s<=S)break}return o},y.getPartialFragment=function(g){var l=null,h,p,o,u=0,s=this.bufferPadding,a=this.fragments;return Object.keys(a).forEach(function(R){var x=a[R];if(!x)return;z(x)&&(p=x.body.start-s,o=x.body.end+s,g>=p&&g<=o&&(h=Math.min(g-p,o-g),u<=h&&(l=x.body,u=h)))}),l},y.getState=function(g){var l=n(g),h=this.fragments[l];return h?h.buffered?z(h)?P.PARTIAL:P.OK:h.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},y.backtrack=function(g,l){var h=n(g),p=this.fragments[h];if(!p||p.backtrack)return null;var o=p.backtrack=l||p.loaded;return p.loaded=null,o},y.getBacktrackData=function(g){var l=n(g),h=this.fragments[l];if(h){var p,o=h.backtrack;if(o!=null&&(p=o.payload)!==null&&p!==void 0&&p.byteLength)return o;this.removeFragment(g)}return null},y.isTimeBuffered=function(g,l,h){for(var p,o,u=0;u<h.length;u++){if(p=h.start(u)-this.bufferPadding,o=h.end(u)+this.bufferPadding,g>=p&&l<=o)return!0;if(l<=p)return!1}return!1},y.onFragLoaded=function(g,l){var h=l.frag,p=l.part;if(h.sn==="initSegment"||h.bitrateTest||p)return;var o=n(h);this.fragments[o]={body:h,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(g,l){var h=this,p=l.frag,o=l.part,u=l.timeRanges;if(p.type===H.PlaylistLevelType.MAIN)if(this.activeFragment=p,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 R=u[a];if(h.detectEvictedFragments(a,R),!o)for(var x=0;x<R.length;x++)p.appendedPTS=Math.max(R.end(x),p.appendedPTS||0)})},y.onFragBuffered=function(g,l){this.detectPartialFragments(l)},y.hasFragment=function(g){var l=n(g);return!!this.fragments[l]},y.removeFragmentsInRange=function(g,l,h){var p=this;Object.keys(this.fragments).forEach(function(o){var u=p.fragments[o];if(!u)return;if(u.buffered){var s=u.body;s.type===h&&s.start<l&&s.end>g&&p.removeFragment(s)}})},y.removeFragment=function(g){var l=n(g);g.stats.loaded=0,g.clearElementaryStreamInfo(),delete this.fragments[l]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function z(L){var y,m;return L.buffered&&(((y=L.range.video)===null||y===void 0?void 0:y.partial)||((m=L.range.audio)===null||m===void 0?void 0:m.partial))}function n(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return z}),N.d(Y,"MAX_START_GAP_JUMP",function(){return n}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return y}),N.d(Y,"default",function(){return m});var X=N("./src/utils/buffer-helper.ts"),H=N("./src/errors.ts"),P=N("./src/events.ts"),K=N("./src/utils/logger.ts"),z=250,n=2,L=.1,y=.05,m=function(){function g(h,p,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=h,this.media=p,this.fragmentTracker=o,this.hls=u}var l=g.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(p){var o=this.config,u=this.media,s=this.stalled,a=u.currentTime,R=u.seeking,x=this.seeking&&!R,S=!this.seeking&&R;if(this.seeking=R,a!==p){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((S||x)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!X.BufferHelper.getBuffered(u).length)return;var O=X.BufferHelper.bufferInfo(u,a,0),A=O.len>0,C=O.nextStart||0;if(!A&&!C)return;if(R){var T=O.len>n,d=!C||C-a>n&&!this.fragmentTracker.getPartialFragment(a);if(T||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var f,b=Math.max(C,O.start||0)-a,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=_==null||((f=_.details)===null||f===void 0)?void 0:f.live,U=j?_.details.targetduration*2:n;if(b>0&&b<=U){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(s===null){this.stalled=w;return}var M=w-s;!R&&M>=z&&this._reportStall(O.len);var I=X.BufferHelper.bufferInfo(u,a,o.maxBufferHole);this._tryFixBufferStall(I,M)},l._tryFixBufferStall=function(p,o){var u=this.config,s=this.fragmentTracker,a=this.media,R=a.currentTime,x=s.getPartialFragment(R);if(x){var S=this._trySkipBufferHole(x);if(S)return}p.len>u.maxBufferHole&&o>u.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(p){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="+p+")"),o.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},l._trySkipBufferHole=function(p){for(var o=this.config,u=this.hls,s=this.media,a=s.currentTime,R=0,x=X.BufferHelper.getBuffered(s),S=0;S<x.length;S++){var D=x.start(S);if(a+o.maxBufferHole>=R&&a<D){var O=Math.max(D+y,s.currentTime+L);return K.logger.warn("skipping hole, adjusting currentTime from "+a+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,p&&u.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+a+" to "+O,frag:p}),O}R=x.end(S)}return 0},l._tryNudgeBuffer=function(){var p=this.config,o=this.hls,u=this.media,s=u.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<p.nudgeMaxRetry){var R=s+a*p.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+s+" to "+R),u.currentTime=R,o.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+p.nudgeMaxRetry+" nudges"),o.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},g}()},"./src/controller/id3-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),P=N("./src/demux/id3.ts"),K=.25,z=function(){function n(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var L=n.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(m,g){this.media=g.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(H.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(m){if(!this.media)return;for(var g=0;g<m.length;g++){var l=m[g];if(l.kind==="metadata"&&l.label==="id3")return Object(H.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(m,g){if(!this.media)return;var l=g.frag,h=g.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<h.length;o++){var u=P.getID3Frames(h[o].data);if(u){var s=h[o].pts,a=o<h.length-1?h[o+1].pts:l.end,R=a-s;R<=0&&(a=s+K);for(var x=0;x<u.length;x++){var S=u[x];if(!P.isTimeStampFrame(S)){var D=new p(s,a,"");D.value=S,this.id3Track.addCue(D)}}}}},L.onBufferFlushing=function(m,g){var l=g.startOffset,h=g.endOffset,p=g.type;if(!p||p==="audio"){var o=this.id3Track;o&&Object(H.removeCuesInRange)(o,l,h)}},n}();Y.default=z},"./src/controller/latency-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var X=N("./src/errors.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts");function K(L,y){for(var m=0;m<y.length;m++){var g=y[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(L,g.key,g)}}function z(L,y,m){return y&&K(L.prototype,y),m&&K(L,m),L}var n=function(){function L(m){var g=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return g.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var y=L.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(H.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(H.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(H.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(H.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(H.Events.ERROR,this.onError)},y.onMediaAttached=function(g,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(g,l){var h=l.details;this.levelDetails=h,h.advanced&&this.timeupdate(),!h.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(g,l){if(l.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var g=this.media,l=this.levelDetails;if(!g||!l)return;this.currentTime=g.currentTime;var h=this.computeLatency();if(h===null)return;this._latency=h;var p=this.config,o=p.lowLatencyMode,u=p.maxLiveSyncPlaybackRate;if(!o||u===1)return;var s=this.targetLatency;if(s===null)return;var a=h-s,R=Math.min(this.maxLatency,s+l.targetduration),x=a<R;if(l.live&&x&&a>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),D=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;g.playbackRate=Math.min(S,Math.max(1,D))}else g.playbackRate!==1&&g.playbackRate!==0&&(g.playbackRate=1)},y.estimateLiveEdge=function(){var g=this.levelDetails;return g===null?null:g.edge+g.age},y.computeLatency=function(){var g=this.estimateLiveEdge();return g===null?null:g-this.currentTime},z(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var g=this.config,l=this.levelDetails;return g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:l?g.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var g=this.levelDetails;if(g===null)return null;var l=g.holdBack,h=g.partHoldBack,p=g.targetduration,o=this.config,u=o.liveSyncDuration,s=o.liveSyncDurationCount,a=o.lowLatencyMode,R=this.hls.userConfig,x=a&&h||l;(R.liveSyncDuration||R.liveSyncDurationCount||x===0)&&(x=u!==void 0?u:s*p);var S=p,D=1;return x+Math.min(this.stallCount*D,S)}},{key:"liveSyncPosition",get:function(){var g=this.estimateLiveEdge(),l=this.targetLatency,h=this.levelDetails;if(g===null||l===null||h===null)return null;var p=h.edge,o=g-l-this.edgeStalled,u=p-h.totalduration,s=p-(this.config.lowLatencyMode&&h.partTarget||h.targetduration);return Math.min(Math.max(u,o),s)}},{key:"drift",get:function(){var g=this.levelDetails;return g===null?1:g.drift}},{key:"edgeStalled",get:function(){var g=this.levelDetails;if(g===null)return 0;var l=(this.config.lowLatencyMode&&g.partTarget||g.targetduration)*3;return Math.max(g.age-l,0)}},{key:"forwardBufferLength",get:function(){var g=this.media,l=this.levelDetails;if(!g||!l)return 0;var h=g.buffered.length;return h?g.buffered.end(h-1):l.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return o});var X=N("./src/types/level.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),K=N("./src/utils/codecs.ts"),z=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),L=N("./src/types/loader.ts");function y(){return y=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var R in a)Object.prototype.hasOwnProperty.call(a,R)&&(u[R]=a[R])}return u},y.apply(this,arguments)}function m(u,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function g(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}function l(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,h(u,s)}function h(u,s){return h=Object.setPrototypeOf||function(R,x){return R.__proto__=x,R},h(u,s)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(u){l(s,u);function s(R){var x;return x=u.call(this,R,"[level-controller]")||this,x._levels=[],x._firstLevel=-1,x._startLevel=void 0,x.currentLevelIndex=-1,x.manualLevelIndex=-1,x.onParsedComplete=void 0,x._registerListeners(),x}var a=s.prototype;return a._registerListeners=function(){var x=this.hls;x.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),x.on(H.Events.ERROR,this.onError,this)},a._unregisterListeners=function(){var x=this.hls;x.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),x.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),x.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),x.off(H.Events.ERROR,this.onError,this)},a.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},a.startLoad=function(){var x=this._levels;x.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},a.onManifestLoaded=function(x,S){var D=[],O=[],A=[],C,T={},d,f=!1,b=!1,_=!1;if(S.levels.forEach(function(M){var I=M.attrs;f=f||!!(M.width&&M.height),b=b||!!M.videoCodec,_=_||!!M.audioCodec,p&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var v=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;d=T[v],d?d.url.push(M.url):(d=new X.Level(M),T[v]=d,D.push(d)),I&&(I.AUDIO&&Object(z.addGroupId)(d,"audio",I.AUDIO),I.SUBTITLES&&Object(z.addGroupId)(d,"text",I.SUBTITLES))}),(f||b)&&_&&(D=D.filter(function(M){var I=M.videoCodec,v=M.width,W=M.height;return!!I||!!(v&&W)})),D=D.filter(function(M){var I=M.audioCodec,v=M.videoCodec;return(!I||Object(K.isCodecSupportedInMp4)(I,"audio"))&&(!v||Object(K.isCodecSupportedInMp4)(v,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(M){return!M.audioCodec||Object(K.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(z.assignTrackIdsByGroup)(O)),S.subtitles&&(A=S.subtitles,Object(z.assignTrackIdsByGroup)(A)),D.length>0){C=D[0].bitrate,D.sort(function(M,I){return M.bitrate-I.bitrate}),this._levels=D;for(var j=0;j<D.length;j++)if(D[j].bitrate===C){this._firstLevel=j,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+C);break}var U=_&&!b,w={levels:D,audioTracks:O,subtitleTracks:A,firstLevel:this._firstLevel,stats:S.stats,audio:_,video:b,altAudio:!U&&O.some(function(M){return!!M.url})};this.hls.trigger(H.Events.MANIFEST_PARSED,w),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(H.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},a.onError=function(x,S){if(u.prototype.onError.call(this,x,S),S.fatal)return;var D=S.context,O=this._levels[this.currentLevelIndex];if(D&&(D.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&D.groupId===O.audioGroupIds[O.urlId]||D.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&D.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var A=!1,C=!0,T;switch(S.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var d=this._levels[S.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(T=S.frag.level)):T=S.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(C=!1),T=D.level),A=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:T=S.level,A=!0;break}T!==void 0&&this.recoverLevel(S,T,A,C)},a.recoverLevel=function(x,S,D,O){var A=x.details,C=this._levels[S];if(C.loadError++,D){var T=this.retryLoadingOrFail(x);if(T)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var d=C.url.length;if(d>1&&C.loadError<d)x.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var f=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==f&&this._levels[f].loadError===0&&(this.warn(A+": switch to "+f),x.levelRetry=!0,this.hls.nextAutoLevel=f)}}},a.redundantFailover=function(x){var S=this._levels[x],D=S.url.length;if(D>1){var O=(S.urlId+1)%D;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(A){A.urlId=O}),this.level=x}},a.onFragLoaded=function(x,S){var D=S.frag;if(D!==void 0&&D.type===L.PlaylistLevelType.MAIN){var O=this._levels[D.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},a.onLevelLoaded=function(x,S){var D,O=S.level,A=S.details,C=this._levels[O];if(!C){var T;this.warn("Invalid level index "+O),(T=S.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(A.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(C.fragmentError===0&&(C.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,C.details)):(D=S.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(A.deltaUpdateFailed=!0)},a.onAudioTrackSwitched=function(x,S){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var O=-1,A=this.hls.audioTracks[S.id].groupId,C=0;C<D.audioGroupIds.length;C++)if(D.audioGroupIds[C]===A){O=C;break}O!==D.urlId&&(D.urlId=O,this.startLoad())}},a.loadPlaylist=function(x){var S=this.currentLevelIndex,D=this._levels[S];if(this.canLoad&&D&&D.url.length>0){var O=D.urlId,A=D.url[O];if(x)try{A=x.addDirectives(A)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Attempt loading level index "+S+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+O+" "+A),this.clearTimer(),this.hls.trigger(H.Events.LEVEL_LOADING,{url:A,level:S,id:O,deliveryDirectives:x||null})}},a.removeLevel=function(x,S){var D=function(C,T){return T!==S},O=this._levels.filter(function(A,C){return C!==x?!0:A.url.length>1&&S!==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 T=A.details;return T!=null&&T.fragments&&T.fragments.forEach(function(d){d.level=C}),A});this._levels=O,this.hls.trigger(H.Events.LEVELS_UPDATED,{levels:O})},g(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var S,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===x&&(S=D[x])!==null&&S!==void 0&&S.details)return;if(x<0||x>=D.length){var O=x<0;if(this.hls.trigger(H.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:O,reason:"invalid level idx"}),O)return;x=Math.min(x,D.length-1)}this.clearTimer();var A=this.currentLevelIndex,C=D[A],T=D[x];this.log("switching to level "+x+" from "+A),this.currentLevelIndex=x;var d=y({},T,{level:x,maxBitrate:T.maxBitrate,uri:T.uri,urlId:T.urlId});delete d._urlId,this.hls.trigger(H.Events.LEVEL_SWITCHING,d);var f=T.details;if(!f||f.live){var b=this.switchParams(T.uri,C==null?void 0:C.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return P}),N.d(Y,"assignTrackIdsByGroup",function(){return K}),N.d(Y,"updatePTS",function(){return z}),N.d(Y,"updateFragPTSDTS",function(){return L}),N.d(Y,"mergeDetails",function(){return y}),N.d(Y,"mapPartIntersection",function(){return m}),N.d(Y,"mapFragmentIntersection",function(){return g}),N.d(Y,"adjustSliding",function(){return l}),N.d(Y,"addSliding",function(){return h}),N.d(Y,"computeReloadInterval",function(){return p}),N.d(Y,"getFragmentWithSN",function(){return o}),N.d(Y,"getPartWith",function(){return u});var X=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts");function P(s,a,R){switch(a){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(R);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(R);break}}function K(s){var a={};s.forEach(function(R){var x=R.groupId||"";R.id=a[x]=a[x]||0,a[x]++})}function z(s,a,R){var x=s[a],S=s[R];n(x,S)}function n(s,a){var R=a.startPTS;if(Object(X.isFiniteNumber)(R)){var x=0,S;a.sn>s.sn?(x=R-s.start,S=s):(x=s.start-R,S=a),S.duration!==x&&(S.duration=x)}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 L(s,a,R,x,S,D){var O=x-R;O<=0&&(H.logger.warn("Fragment should have a positive duration",a),x=R+a.duration,D=S+a.duration);var A=R,C=x,T=a.startPTS,d=a.endPTS;if(Object(X.isFiniteNumber)(T)){var f=Math.abs(T-R);Object(X.isFiniteNumber)(a.deltaPTS)?a.deltaPTS=Math.max(f,a.deltaPTS):a.deltaPTS=f,A=Math.max(R,T),R=Math.min(R,T),S=Math.min(S,a.startDTS),C=Math.min(x,d),x=Math.max(x,d),D=Math.max(D,a.endDTS)}a.duration=x-R;var b=R-a.start;a.appendedPTS=x,a.start=a.startPTS=R,a.maxStartPTS=A,a.startDTS=S,a.endPTS=x,a.minEndPTS=C,a.endDTS=D;var _=a.sn;if(!s||_<s.startSN||_>s.endSN)return 0;var j,U=_-s.startSN,w=s.fragments;for(w[U]=a,j=U;j>0;j--)n(w[j],w[j-1]);for(j=U;j<w.length-1;j++)n(w[j],w[j+1]);return s.fragmentHint&&n(w[w.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,b}function y(s,a){for(var R=null,x=s.fragments,S=x.length-1;S>=0;S--){var D=x[S].initSegment;if(D){R=D;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,A;if(g(s,a,function(j,U){j.relurl&&(O=j.cc-U.cc),Object(X.isFiniteNumber)(j.startPTS)&&Object(X.isFiniteNumber)(j.endPTS)&&(U.start=U.startPTS=j.startPTS,U.startDTS=j.startDTS,U.appendedPTS=j.appendedPTS,U.maxStartPTS=j.maxStartPTS,U.endPTS=j.endPTS,U.endDTS=j.endDTS,U.minEndPTS=j.minEndPTS,U.duration=j.endPTS-j.startPTS,U.duration&&(A=U),a.PTSKnown=a.alignedSliding=!0),U.elementaryStreams=j.elementaryStreams,U.loader=j.loader,U.stats=j.stats,U.urlId=j.urlId,j.initSegment&&(U.initSegment=j.initSegment,R=j.initSegment)}),R){var C=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;C.forEach(function(j){var U;(!j.initSegment||j.initSegment.relurl===((U=R)===null||U===void 0?void 0:U.relurl))&&(j.initSegment=R)})}if(a.skippedSegments&&(a.deltaUpdateFailed=a.fragments.some(function(j){return!j}),a.deltaUpdateFailed)){H.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var T=a.skippedSegments;T--;)a.fragments.shift();a.startSN=a.fragments[0].sn,a.startCC=a.fragments[0].cc}var d=a.fragments;if(O){H.logger.warn("discontinuity sliding from playlist, take drift into account");for(var f=0;f<d.length;f++)d[f].cc+=O}a.skippedSegments&&(a.startCC=a.fragments[0].cc),m(s.partList,a.partList,function(j,U){U.elementaryStreams=j.elementaryStreams,U.stats=j.stats}),A?L(a,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS):l(s,a),d.length&&(a.totalduration=a.edge-d[0].start),a.driftStartTime=s.driftStartTime,a.driftStart=s.driftStart;var b=a.advancedDateTime;if(a.advanced&&b){var _=a.edge;a.driftStart||(a.driftStartTime=b,a.driftStart=_),a.driftEndTime=b,a.driftEnd=_}else a.driftEndTime=s.driftEndTime,a.driftEnd=s.driftEnd,a.advancedDateTime=s.advancedDateTime}function m(s,a,R){if(s&&a)for(var x=0,S=0,D=s.length;S<=D;S++){var O=s[S],A=a[S+x];O&&A&&O.index===A.index&&O.fragment.sn===A.fragment.sn?R(O,A):x--}}function g(s,a,R){for(var x=a.skippedSegments,S=Math.max(s.startSN,a.startSN)-a.startSN,D=(s.fragmentHint?1:0)+(x?a.endSN:Math.min(s.endSN,a.endSN))-a.startSN,O=a.startSN-s.startSN,A=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,C=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,T=S;T<=D;T++){var d=C[O+T],f=A[T];x&&!f&&T<x&&(f=a.fragments[T]=d),d&&f&&R(d,f)}}function l(s,a){var R=a.startSN+a.skippedSegments-s.startSN,x=s.fragments;if(R<0||R>=x.length)return;h(a,x[R].start)}function h(s,a){if(a){for(var R=s.fragments,x=s.skippedSegments;x<R.length;x++)R[x].start+=a;s.fragmentHint&&(s.fragmentHint.start+=a)}}function p(s,a){var R=1e3*s.levelTargetDuration,x=R/2,S=s.age,D=S>0&&S<R*3,O=a.loading.end-a.loading.start,A,C=s.availabilityDelay;if(s.updated===!1)if(D){var T=333*s.misses;A=Math.max(Math.min(x,O*2),T),s.availabilityDelay=(s.availabilityDelay||0)+A}else A=x;else D?(C=Math.min(C||R/2,S),s.availabilityDelay=C,A=C+R-S):A=R-O;return Math.round(A)}function o(s,a,R){if(!s||!s.details)return null;var x=s.details,S=x.fragments[a-x.startSN];return S||(S=x.fragmentHint,S&&S.sn===a?S:a<x.startSN&&R&&R.sn===a?R:null)}function u(s,a,R){if(!s||!s.details)return null;var x=s.details.partList;if(x)for(var S=x.length;S--;){var D=x[S];if(D.index===R&&D.fragment.sn===a)return D}return null}},"./src/controller/stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return x});var X=N("./src/polyfills/number.ts"),H=N("./src/controller/base-stream-controller.ts"),P=N("./src/is-supported.ts"),K=N("./src/events.ts"),z=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),L=N("./src/types/loader.ts"),y=N("./src/loader/fragment.ts"),m=N("./src/demux/transmuxer-interface.ts"),g=N("./src/types/transmuxer.ts"),l=N("./src/controller/gap-controller.ts"),h=N("./src/errors.ts"),p=N("./src/utils/logger.ts");function o(S,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}function u(S,D,O){return D&&o(S.prototype,D),O&&o(S,O),S}function s(S,D){S.prototype=Object.create(D.prototype),S.prototype.constructor=S,a(S,D)}function a(S,D){return a=Object.setPrototypeOf||function(A,C){return A.__proto__=C,A},a(S,D)}var R=100,x=function(S){s(D,S);function D(A,C){var T;return T=S.call(this,A,C,"[stream-controller]")||this,T.audioCodecSwap=!1,T.gapController=null,T.level=-1,T._forceStartLoad=!1,T.altAudio=!1,T.audioOnly=!1,T.fragPlaying=null,T.onvplaying=null,T.onvseeked=null,T.fragLastKbps=0,T.stalled=!1,T.couldBacktrack=!1,T.audioCodecSwitch=!1,T.videoBuffer=null,T._registerListeners(),T}var O=D.prototype;return O._registerListeners=function(){var C=this.hls;C.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),C.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.on(K.Events.ERROR,this.onError,this),C.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var C=this.hls;C.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),C.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),C.off(K.Events.ERROR,this.onError,this),C.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),C.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(C){if(this.levels){var T=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var f=d.startLevel;f===-1&&(d.config.testBandwidth?(f=0,this.bitrateTest=!0):f=d.nextAutoLevel),this.level=d.nextLoadLevel=f,this.loadedmetadata=!1}T>0&&C===-1&&(this.log("Override startPosition with lastCurrentTime @"+T.toFixed(3)),C=T),this.state=H.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()}else this._forceStartLoad=!0,this.state=H.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case H.State.IDLE:this.doTickIdle();break;case H.State.WAITING_LEVEL:{var C,T=this.levels,d=this.level,f=T==null||((C=T[d])===null||C===void 0)?void 0:C.details;if(f&&(!f.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(f))break;this.state=H.State.IDLE;break}break}case H.State.FRAG_LOADING_WAITING_RETRY:{var b,_=self.performance.now(),j=this.retryDate;(!j||_>=j||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=H.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var C,T,d=this.hls,f=this.levelLastLoaded,b=this.levels,_=this.media,j=d.config,U=d.nextLoadLevel;if(f===null||!_&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[U])return;var w=b[U];this.level=d.nextLoadLevel=U;var M=w.details;if(!M||this.state===H.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==U){this.state=H.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,L.PlaylistLevelType.MAIN);if(I===null)return;var v=I.len,W=this.getMaxBufferLength(w.maxBitrate);if(v>=W)return;if(this._streamEnded(I,M)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Z),this.state=H.State.ENDED;return}var oe=I.end,fe=this.getNextFragment(oe,M);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Ae=fe.sn-M.startSN;Ae>1&&(fe=M.fragments[Ae-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>oe){var be=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,be,L.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,M)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((C=fe.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((T=fe.decryptdata)!==null&&T!==void 0&&T.key)?this.loadKey(fe,M):this.loadFragment(fe,M,oe)},O.loadFragment=function(C,T,d){var f,b=this.fragmentTracker.getState(C);if(this.fragCurrent=C,b===n.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(C);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else b=n.FragmentState.NOT_LOADED}b===n.FragmentState.NOT_LOADED||b===n.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,S.prototype.loadFragment.call(this,C,T,d)):b===n.FragmentState.APPENDING?this.reduceMaxBufferLength(C.duration)&&this.fragmentTracker.removeFragment(C):((f=this.media)===null||f===void 0?void 0:f.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(C){var T=this.fragmentTracker.getAppendedFrag(C,L.PlaylistLevelType.MAIN);return T&&"fragment"in T?T.fragment:T},O.getBufferedFrag=function(C){return this.fragmentTracker.getBufferedFrag(C,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(C){return C?this.getBufferedFrag(C.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var C=this.levels,T=this.media;if(T!=null&&T.readyState){var d,f=this.getAppendedFrag(T.currentTime);if(f&&f.start>1&&this.flushMainBuffer(0,f.start-1),!T.paused&&C){var b=this.hls.nextLoadLevel,_=C[b],j=this.fragLastKbps;j&&this.fragCurrent?d=this.fragCurrent.duration*_.maxBitrate/(1e3*j)+1:d=0}else d=0;var U=this.getBufferedFrag(T.currentTime+d);if(U){var w=this.followingBufferedFrag(U);if(w){this.abortCurrentFrag();var M=w.maxStartPTS?w.maxStartPTS:w.start,I=w.duration,v=Math.max(U.end,M+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(v,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var C=this.fragCurrent;this.fragCurrent=null,C!=null&&C.loader&&C.loader.abort(),this.state===H.State.KEY_LOADING&&(this.state=H.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(C,T){S.prototype.flushMainBuffer.call(this,C,T,this.altAudio?"video":null)},O.onMediaAttached=function(C,T){S.prototype.onMediaAttached.call(this,C,T);var d=T.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 l.default(this.config,d,this.fragmentTracker,this.hls)},O.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),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var C=this.media,T=C?C.currentTime:null;Object(X.isFiniteNumber)(T)&&this.log("Media seeked to "+T.toFixed(3)),this.tick()},O.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},O.onManifestParsed=function(C,T){var d=!1,f=!1,b;T.levels.forEach(function(_){b=_.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(d=!0),b.indexOf("mp4a.40.5")!==-1&&(f=!0))}),this.audioCodecSwitch=d&&f&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=T.levels,this.startFragRequested=!1},O.onLevelLoading=function(C,T){var d=this.levels;if(!d||this.state!==H.State.IDLE)return;var f=d[T.level];(!f.details||f.details.live&&this.levelLastLoaded!==T.level||this.waitForCdnTuneIn(f.details))&&(this.state=H.State.WAITING_LEVEL)},O.onLevelLoaded=function(C,T){var d,f=this.levels,b=T.level,_=T.details,j=_.totalduration;if(!f){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+j);var U=this.fragCurrent;U&&(this.state===H.State.FRAG_LOADING||this.state===H.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==T.level&&U.loader&&(this.state=H.State.IDLE,U.loader.abort()));var w=f[b],M=0;if(_.live||(d=w.details)!==null&&d!==void 0&&d.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;M=this.alignPlaylists(_,w.details)}if(w.details=_,this.levelLastLoaded=b,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:_,level:b}),this.state===H.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=H.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,M),this.tick()},O._handleFragmentLoadProgress=function(C){var T,d=C.frag,f=C.part,b=C.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var j=_[d.level],U=j.details;if(!U){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var w=j.videoCodec,M=U.PTSKnown||!U.live,I=(T=d.initSegment)===null||T===void 0?void 0:T.data,v=this._getAudioCodec(j),W=this.transmuxer=this.transmuxer||new m.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=f?f.index:-1,oe=Z!==-1,fe=new g.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,b.byteLength,Z,oe),Ae=this.initPTS[d.cc];W.push(b,I,v,w,d,f,U.totalduration,M,fe,Ae)},O.onAudioTrackSwitching=function(C,T){var d=this.altAudio,f=!!T.url,b=T.id;if(!f){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;d&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:b})}},O.onAudioTrackSwitched=function(C,T){var d=T.id,f=!!this.hls.audioTracks[d].url;if(f){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=f,this.tick()},O.onBufferCreated=function(C,T){var d=T.tracks,f,b,_=!1;for(var j in d){var U=d[j];if(U.id==="main"){if(b=j,f=U,j==="video"){var w=d[j];w&&(this.videoBuffer=w.buffer)}}else _=!0}_&&f?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=f.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(C,T){var d=T.frag,f=T.part;if(d&&d.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(f?" p: "+f.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===H.State.PARSED&&(this.state=H.State.IDLE);return}var b=f?f.stats:d.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,f)},O.onError=function(C,T){switch(T.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,T);break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==H.State.ERROR&&(T.fatal?(this.warn(""+T.details),this.state=H.State.ERROR):!T.levelRetry&&this.state===H.State.WAITING_LEVEL&&(this.state=H.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(T.parent==="main"&&(this.state===H.State.PARSING||this.state===H.State.PARSED)){var d=!0,f=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);f&&f.len>.5&&(d=!this.reduceMaxBufferLength(f.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var C=this.media,T=this.gapController;if(!C||!T||!C.readyState)return;var d=z.BufferHelper.getBuffered(C);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):T.poll(this.lastCurrentTime),this.lastCurrentTime=C.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=H.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(C,T){var d=T.type;if(d!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var f=(d===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(f,d,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(C,T){this.levels=T.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var C=this.media,T=C.currentTime,d=this.startPosition;if(d>=0&&T<d){if(C.seeking){p.logger.log("could not seek to "+d+", already seeking at "+T);return}var f=z.BufferHelper.getBuffered(C),b=f.length?f.start(0):0,_=b-d;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+_+" to match buffer start"),d+=_,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+T),C.currentTime=d}},O._getAudioCodec=function(C){var T=this.config.defaultAudioCodec||C.audioCodec;return this.audioCodecSwap&&T&&(this.log("Swapping audio codec"),T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),T},O._loadBitrateTestFrag=function(C){var T=this;this._doFragLoad(C).then(function(d){var f=T.hls;if(!d||f.nextLoadLevel||T.fragContextChanged(C))return;T.fragLoadError=0,T.state=H.State.IDLE,T.startFragRequested=!1,T.bitrateTest=!1;var b=C.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),f.trigger(K.Events.FRAG_LOADED,d)})},O._handleTransmuxComplete=function(C){var T,d="main",f=this.hls,b=C.remuxResult,_=C.chunkMeta,j=this.getCurrentContext(_);if(!j){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var U=j.frag,w=j.part,M=j.level,I=b.video,v=b.text,W=b.id3,Z=b.initSegment,oe=this.altAudio?void 0:b.audio;if(this.fragContextChanged(U))return;if(this.state=H.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(M,Z.tracks,U,_),f.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:d,tracks:Z.tracks}));var fe=Z.initPTS,Ae=Z.timescale;Object(X.isFiniteNumber)(fe)&&(this.initPTS[U.cc]=fe,f.trigger(K.Events.INIT_PTS_FOUND,{frag:U,id:d,initPTS:fe,timescale:Ae}))}if(I&&b.independent!==!1){if(M.details){var be=I.startPTS,Re=I.endPTS,Ce=I.startDTS,Le=I.endDTS;if(w)w.elementaryStreams[I.type]={startPTS:be,endPTS:Re,startDTS:Ce,endDTS:Le};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<be){this.backtrack(U);return}U.setElementaryStreamInfo(I.type,U.start,Re,U.start,Le,!0)}U.setElementaryStreamInfo(I.type,be,Re,Ce,Le),this.bufferFragmentData(I,U,w,_)}}else if(b.independent===!1){this.backtrack(U);return}if(oe){var $=oe.startPTS,E=oe.endPTS,k=oe.startDTS,B=oe.endDTS;w&&(w.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:E,startDTS:k,endDTS:B}),U.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,$,E,k,B),this.bufferFragmentData(oe,U,w,_)}if(W!=null&&(T=W.samples)!==null&&T!==void 0&&T.length){var Q={frag:U,id:d,samples:W.samples};f.trigger(K.Events.FRAG_PARSING_METADATA,Q)}if(v){var G={frag:U,id:d,samples:v.samples};f.trigger(K.Events.FRAG_PARSING_USERDATA,G)}},O._bufferInitSegment=function(C,T,d,f){var b=this;if(this.state!==H.State.PARSING)return;this.audioOnly=!!T.audio&&!T.video,this.altAudio&&!this.audioOnly&&delete T.audio;var _=T.audio,j=T.video,U=T.audiovideo;if(_){var w=C.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(w&&(w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),_.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(w="mp4a.40.5")),M.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(w="mp4a.40.2",this.log("Android: force audio codec to "+w)),C.audioCodec&&C.audioCodec!==w&&this.log('Swapping manifest audio codec "'+C.audioCodec+'" for "'+w+'"'),_.levelCodec=w,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(w||"")+"/"+(C.audioCodec||"")+"/"+_.codec+"]")}j&&(j.levelCodec=C.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(C.videoCodec||"")+"/"+j.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(C.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,T),Object.keys(T).forEach(function(I){var v=T[I],W=v.initSegment;W!=null&&W.byteLength&&b.hls.trigger(K.Events.BUFFER_APPENDING,{type:I,data:W,frag:d,part:null,chunkMeta:f,parent:d.type})}),this.tick()},O.backtrack=function(C){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(C);var T=this.fragmentTracker.backtrack(C);this.fragPrevious=null,this.nextLoadPosition=C.start,T?this.resetFragmentLoading(C):this.state=H.State.BACKTRACKING},O.checkFragmentChanged=function(){var C=this.media,T=null;if(C&&C.readyState>1&&C.seeking===!1){var d=C.currentTime;if(z.BufferHelper.isBuffered(C,d)?T=this.getAppendedFrag(d):z.BufferHelper.isBuffered(C,d+.1)&&(T=this.getAppendedFrag(d+.1)),T){var f=this.fragPlaying,b=T.level;(!f||T.sn!==f.sn||f.level!==b||T.urlId!==f.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:T}),(!f||f.level!==b)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=T)}}},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 T=this.getAppendedFrag(C.currentTime);if(T)return T.level}return-1}},{key:"nextBufferedFrag",get:function(){var C=this.media;if(C){var T=this.getAppendedFrag(C.currentTime);return this.followingBufferedFrag(T)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(H.default)},"./src/controller/subtitle-stream-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return s});var X=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-finders.ts"),z=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),L=N("./src/controller/fragment-tracker.ts"),y=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),g=N("./src/types/level.ts");function l(a,R){for(var x=0;x<R.length;x++){var S=R[x];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(a,S.key,S)}}function h(a,R,x){return R&&l(a.prototype,R),x&&l(a,x),a}function p(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,o(a,R)}function o(a,R){return o=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},o(a,R)}var u=500,s=function(a){p(R,a);function R(S,D){var O;return O=a.call(this,S,D,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var x=R.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var D=this.hls;D.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(X.Events.ERROR,this.onError,this),D.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var D=this.hls;D.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(X.Events.ERROR,this.onError,this),D.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(u),this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},x.onLevelLoaded=function(D,O){this.mainDetails=O.details},x.onSubtitleFragProcessed=function(D,O){var A=O.frag,C=O.success;if(this.fragPrevious=A,this.state=y.State.IDLE,!C)return;var T=this.tracksBuffered[this.currentTrackId];if(!T)return;for(var d,f=A.start,b=0;b<T.length;b++)if(f>=T[b].start&&f<=T[b].end){d=T[b];break}var _=A.start+A.duration;d?d.end=_:(d={start:f,end:_},T.push(d)),this.fragmentTracker.fragBuffered(A)},x.onBufferFlushing=function(D,O){var A=O.startOffset,C=O.endOffset;if(A===0&&C!==Number.POSITIVE_INFINITY){var T=this.currentTrackId,d=this.levels;if(!d.length||!d[T]||!d[T].details)return;var f=d[T].details,b=f.targetduration,_=C-b;if(_<=0)return;O.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(j){for(var U=0;U<j.length;){if(j[U].end<=_){j.shift();continue}else if(j[U].start<_)j[U].start=_;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(A,_,m.PlaylistLevelType.SUBTITLE)}},x.onError=function(D,O){var A,C=O.frag;if(!C||C.type!==m.PlaylistLevelType.SUBTITLE)return;(A=this.fragCurrent)!==null&&A!==void 0&&A.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},x.onSubtitleTracksUpdated=function(D,O){var A=this,C=O.subtitleTracks;this.tracksBuffered=[],this.levels=C.map(function(T){return new g.Level(T)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(T){A.tracksBuffered[T.id]=[]}),this.mediaBuffer=null},x.onSubtitleTrackSwitch=function(D,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var A=this.levels[this.currentTrackId];A!=null&&A.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,A&&this.setInterval(u)},x.onSubtitleTrackLoaded=function(D,O){var A,C=O.details,T=O.id,d=this.currentTrackId,f=this.levels;if(!f.length)return;var b=f[d];if(T>=f.length||T!==d||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,C.live||(A=b.details)!==null&&A!==void 0&&A.live){var _=this.mainDetails;if(C.deltaUpdateFailed||!_)return;var j=_.fragments[0];if(!b.details)C.hasProgramDateTime&&_.hasProgramDateTime?Object(z.alignMediaPlaylistByPDT)(C,_):j&&Object(n.addSliding)(C,j.start);else{var U=this.alignPlaylists(C,b.details);U===0&&j&&Object(n.addSliding)(C,j.start)}}if(b.details=C,this.levelLastLoaded=T,this.tick(),C.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var w=Object(K.findFragmentByPTS)(null,C.fragments,this.media.currentTime,0);w||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},x._handleFragmentLoadComplete=function(D){var O=D.frag,A=D.payload,C=O.decryptdata,T=this.hls;if(this.fragContextChanged(O))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(f){var b=performance.now();T.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:f,stats:{tstart:d,tdecrypt:b}})})}},x.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var D,O=this.currentTrackId,A=this.levels;if(!A.length||!A[O]||!A[O].details)return;var C=A[O].details,T=C.targetduration,d=this.config,f=this.media,b=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,f.currentTime-T,d.maxBufferHole),_=b.end,j=b.len,U=this.getMaxBufferLength()+T;if(j>U)return;console.assert(C,"Subtitle track details are defined on idle subtitle stream controller tick");var w=C.fragments,M=w.length,I=C.edge,v,W=this.fragPrevious;if(_<I){var Z=d.maxFragLookUpTolerance;W&&C.hasProgramDateTime&&(v=Object(K.findFragmentByPDT)(w,W.endProgramDateTime,Z)),v||(v=Object(K.findFragmentByPTS)(W,w,_,Z),!v&&W&&W.start<w[0].start&&(v=w[0]))}else v=w[M-1];(D=v)!==null&&D!==void 0&&D.encrypted?(H.logger.log("Loading key for "+v.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===L.FragmentState.NOT_LOADED&&this.loadFragment(v,C,_)}},x.loadFragment=function(D,O,A){this.fragCurrent=D,a.prototype.loadFragment.call(this,D,O,A)},h(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(y.default)},"./src/controller/subtitle-track-controller.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/events.ts"),H=N("./src/utils/texttrack-utils.ts"),P=N("./src/controller/base-playlist-controller.ts"),K=N("./src/types/loader.ts");function z(l,h){for(var p=0;p<h.length;p++){var o=h[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(l,o.key,o)}}function n(l,h,p){return h&&z(l.prototype,h),p&&z(l,p),l}function L(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,y(l,h)}function y(l,h){return y=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},y(l,h)}var m=function(l){L(h,l);function h(o){var u;return u=l.call(this,o,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var p=h.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},p.registerListeners=function(){var u=this.hls;u.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(X.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var u=this.hls;u.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(X.Events.ERROR,this.onError,this)},p.onMediaAttached=function(u,s){if(this.media=s.media,!this.media)return;this.queuedDefaultTrack>-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)},p.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},p.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=g(this.media.textTracks);u.forEach(function(s){Object(H.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},p.onSubtitleTrackLoaded=function(u,s){var a=s.id,R=s.details,x=this.trackId,S=this.tracksInGroup[x];if(!S){this.warn("Invalid subtitle track id "+a);return}var D=S.details;S.details=s.details,this.log("subtitle track "+a+" loaded ["+R.startSN+"-"+R.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,s,D))},p.onLevelLoading=function(u,s){this.switchLevel(s.level)},p.onLevelSwitching=function(u,s){this.switchLevel(s.level)},p.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 R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(O){return!a||O.groupId===a});this.tracksInGroup=x;var S=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=a;var D={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,D),S!==-1&&this.setSubtitleTrack(S,R)}},p.findTrackId=function(u){for(var s=this.tracksInGroup,a=0;a<s.length;a++){var R=s[a];if((!this.selectDefaultTrack||R.default)&&(!u||u===R.name))return R.id}return-1},p.onError=function(u,s){if(l.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},p.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var a=s.id,R=s.groupId,x=s.url;if(u)try{x=u.addDirectives(x)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+a),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:x,id:a,groupId:R,deliveryDirectives:u||null})}},p.toggleTrackModes=function(u){var s=this,a=this.media,R=this.subtitleDisplay,x=this.trackId;if(!a)return;var S=g(a.textTracks),D=S.filter(function(C){return C.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(C){C.mode="disabled"});else{var O=D[x];O&&(O.mode="disabled")}var A=D[u];A&&(A.mode=R?"showing":"hidden")},p.setSubtitleTrack=function(u,s){var a,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(a=R[u])!==null&&a!==void 0&&a.details)||u<-1||u>=R.length)return;this.clearTimer();var x=R[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,x){var S=x.id,D=x.groupId,O=D===void 0?"":D,A=x.name,C=x.type,T=x.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:A,type:C,url:T});var d=this.switchParams(x.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:u})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=g(this.media.textTracks),a=0;a<s.length;a++)if(s[a].mode==="hidden")u=a;else if(s[a].mode==="showing"){u=a;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(h,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),h}(P.default);function g(l){for(var h=[],p=0;p<l.length;p++){var o=l[p];o.kind==="subtitles"&&o.label&&h.push(l[p])}return h}Y.default=m},"./src/controller/timeline-controller.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return g});var X=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/utils/cea-608-parser.ts"),K=N("./src/utils/output-filter.ts"),z=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),L=N("./src/utils/imsc1-ttml-parser.ts"),y=N("./src/types/loader.ts"),m=N("./src/utils/logger.ts"),g=function(){function o(s){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var a=new K.default(this,"textTrack1"),R=new K.default(this,"textTrack2"),x=new K.default(this,"textTrack3"),S=new K.default(this,"textTrack4");this.cea608Parser1=new P.default(1,a,R),this.cea608Parser2=new P.default(3,x,S)}s.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(H.Events.FRAG_LOADING,this.onFragLoading,this),s.on(H.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=o.prototype;return u.destroy=function(){var a=this.hls;a.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(H.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.off(H.Events.FRAG_LOADING,this.onFragLoading,this),a.off(H.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(H.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.off(H.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.off(H.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.off(H.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(a,R,x,S,D){for(var O=!1,A=D.length;A--;){var C=D[A],T=h(C[0],C[1],R,x);if(T>=0&&(C[0]=Math.min(C[0],R),C[1]=Math.max(C[1],x),O=!0,T/(x-R)>.5))return}if(O||D.push([R,x]),this.config.renderTextTracksNatively){var d=this.captionsTracks[a];this.Cues.newCue(d,R,x,S)}else{var f=this.Cues.newCue(null,R,x,S);this.hls.trigger(H.Events.CUES_PARSED,{type:"captions",cues:f,track:a})}},u.onInitPtsFound=function(a,R){var x=this,S=R.frag,D=R.id,O=R.initPTS,A=R.timescale,C=this.unparsedVttFrags;D==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=A),C.length&&(this.unparsedVttFrags=[],C.forEach(function(T){x.onFragLoaded(H.Events.FRAG_LOADED,T)}))},u.getExistingTrack=function(a){var R=this.media;if(R)for(var x=0;x<R.textTracks.length;x++){var S=R.textTracks[x];if(S[a])return S}return null},u.createCaptionsTrack=function(a){this.config.renderTextTracksNatively?this.createNativeTrack(a):this.createNonNativeTrack(a)},u.createNativeTrack=function(a){if(this.captionsTracks[a])return;var R=this.captionsProperties,x=this.captionsTracks,S=this.media,D=R[a],O=D.label,A=D.languageCode,C=this.getExistingTrack(a);if(C)x[a]=C,Object(n.clearCurrentCues)(x[a]),Object(n.sendAddTrackEvent)(x[a],S);else{var T=this.createTextTrack("captions",O,A);T&&(T[a]=!0,x[a]=T)}},u.createNonNativeTrack=function(a){if(this.nonNativeCaptionsTracks[a])return;var R=this.captionsProperties[a];if(!R)return;var x=R.label,S={_id:a,label:x,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[a]=S,this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(a,R,x){var S=this.media;return S?S.addTextTrack(a,R,x):void 0},u.onMediaAttaching=function(a,R){this.media=R.media,this._cleanTracks()},u.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(R){Object(n.clearCurrentCues)(a[R]),delete a[R]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},u._cleanTracks=function(){var a=this.media;if(!a)return;var R=a.textTracks;if(R)for(var x=0;x<R.length;x++)Object(n.clearCurrentCues)(R[x])},u.onSubtitleTracksUpdated=function(a,R){var x=this;this.textTracks=[];var S=R.subtitleTracks||[],D=S.some(function(T){return T.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var A=this.media?this.media.textTracks:[];this.tracks.forEach(function(T,d){var f;if(d<A.length){for(var b=null,_=0;_<A.length;_++)if(l(A[_],T)){b=A[_];break}b&&(f=b)}f?Object(n.clearCurrentCues)(f):(f=x.createTextTrack("subtitles",T.name,T.lang),f&&(f.mode="disabled")),f&&(f.groupId=T.groupId,x.textTracks.push(f))})}else if(!O&&this.tracks&&this.tracks.length){var C=this.tracks.map(function(T){return{label:T.name,kind:T.type.toLowerCase(),default:T.default,subtitleTrack:T}});this.hls.trigger(H.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:C})}}},u.onManifestLoaded=function(a,R){var x=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(S){var D=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!D)return;var O="textTrack"+D[1],A=x.captionsProperties[O];if(!A)return;A.label=S.name,S.lang&&(A.languageCode=S.lang),A.media=S})},u.onFragLoading=function(a,R){var x=this.cea608Parser1,S=this.cea608Parser2,D=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(x&&S))return;if(R.frag.type===y.PlaylistLevelType.MAIN){var A,C,T=R.frag.sn,d=(A=R==null||((C=R.part)===null||C===void 0)?void 0:C.index)!=null?A:-1;T===D+1||T===D&&d===O+1||(x.reset(),S.reset()),this.lastSn=T,this.lastPartIndex=d}},u.onFragLoaded=function(a,R){var x=R.frag,S=R.payload,D=this.initPTS,O=this.unparsedVttFrags;if(x.type===y.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(X.isFiniteNumber)(D[x.cc])){O.push(R),D.length&&this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Missing initial subtitle PTS")});return}var A=x.decryptdata;if(A==null||A.key==null||A.method!=="AES-128"){var C=this.tracks[x.level],T=this.vttCCs;T[x.cc]||(T[x.cc]={start:x.start,prevCC:this.prevCC,new:!0},this.prevCC=x.cc),C&&C.textCodec===L.IMSC1_CODEC?this._parseIMSC1(x,S):this._parseVTTs(x,S,T)}}else this.hls.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:x,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(a,R){var x=this,S=this.hls;Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(D){x._appendCues(D,a.level),S.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(D){m.logger.log("Failed to parse IMSC1: "+D),S.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:D})})},u._parseVTTs=function(a,R,x){var S=this,D=this.hls;Object(z.parseWebVTT)(R,this.initPTS[a.cc],this.timescale[a.cc],x,a.cc,a.start,function(O){S._appendCues(O,a.level),D.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(O){S._fallbackToIMSC1(a,R),m.logger.log("Failed to parse VTT cue: "+O),D.trigger(H.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a,error:O})})},u._fallbackToIMSC1=function(a,R){var x=this,S=this.tracks[a.level];S.textCodec||Object(L.parseIMSC1)(R,this.initPTS[a.cc],this.timescale[a.cc],function(){S.textCodec=L.IMSC1_CODEC,x._parseIMSC1(a,R)},function(){S.textCodec="wvtt"})},u._appendCues=function(a,R){var x=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[R];if(S.mode==="disabled")return;a.forEach(function(A){return Object(n.addCueToTrack)(S,A)})}else{var D=this.tracks[R],O=D.default?"default":"subtitles"+R;x.trigger(H.Events.CUES_PARSED,{type:"subtitles",cues:a,track:O})}},u.onFragDecrypted=function(a,R){var x=R.frag;if(x.type===y.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[x.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(H.Events.FRAG_LOADED,R)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(a,R){var x=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(x&&S))return;for(var D=0;D<R.samples.length;D++){var O=R.samples[D].bytes;if(O){var A=this.extractCea608Data(O);x.addData(R.samples[D].pts,A[0]),S.addData(R.samples[D].pts,A[1])}}},u.onBufferFlushing=function(a,R){var x=R.startOffset,S=R.endOffset,D=R.endOffsetSubtitles,O=R.type,A=this.media;if(!A||A.currentTime<S)return;if(!O||O==="video"){var C=this.captionsTracks;Object.keys(C).forEach(function(d){return Object(n.removeCuesInRange)(C[d],x,S)})}if(this.config.renderTextTracksNatively&&(x===0&&D!==void 0)){var T=this.textTracks;Object.keys(T).forEach(function(d){return Object(n.removeCuesInRange)(T[d],x,D)})}},u.extractCea608Data=function(a){for(var R=a[0]&31,x=2,S=[[],[]],D=0;D<R;D++){var O=a[x++],A=127&a[x++],C=127&a[x++],T=(4&O)!==0,d=3&O;if(A===0&&C===0)continue;T&&((d===0||d===1)&&(S[d].push(A),S[d].push(C)))}return S},o}();function l(o,u){return o&&o.label===u.name&&!(o.textTrack1||o.textTrack2)}function h(o,u,s,a){return Math.min(u,a)-Math.max(o,s)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return X});var X=function(){function H(K,z){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=z}var P=H.prototype;return P.decrypt=function(z,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,z)},H}()},"./src/crypt/aes-decryptor.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"removePadding",function(){return H}),N.d(Y,"default",function(){return P});var X=N("./src/utils/typed-array.ts");function H(K){var z=K.byteLength,n=z&&new DataView(K.buffer).getUint8(z-1);return n?Object(X.sliceUint8)(K,0,z-n):K}var P=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var z=K.prototype;return z.uint8ArrayToUint32Array_=function(L){for(var y=new DataView(L),m=new Uint32Array(4),g=0;g<4;g++)m[g]=y.getUint32(g*4);return m},z.initTable=function(){var L=this.sBox,y=this.invSBox,m=this.subMix,g=m[0],l=m[1],h=m[2],p=m[3],o=this.invSubMix,u=o[0],s=o[1],a=o[2],R=o[3],x=new Uint32Array(256),S=0,D=0,O=0;for(O=0;O<256;O++)O<128?x[O]=O<<1:x[O]=O<<1^283;for(O=0;O<256;O++){var A=D^D<<1^D<<2^D<<3^D<<4;A=A>>>8^A&255^99,L[S]=A,y[A]=S;var C=x[S],T=x[C],d=x[T],f=x[A]*257^A*16843008;g[S]=f<<24|f>>>8,l[S]=f<<16|f>>>16,h[S]=f<<8|f>>>24,p[S]=f,f=d*16843009^T*65537^C*257^S*16843008,u[A]=f<<24|f>>>8,s[A]=f<<16|f>>>16,a[A]=f<<8|f>>>24,R[A]=f,S?(S=C^x[x[x[d^C]]],D^=x[x[D]]):S=D=1}},z.expandKey=function(L){for(var y=this.uint8ArrayToUint32Array_(L),m=!0,g=0;g<y.length&&m;)m=y[g]===this.key[g],g++;if(m)return;this.key=y;var l=this.keySize=y.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var h=this.ksRows=(l+6+1)*4,p,o,u=this.keySchedule=new Uint32Array(h),s=this.invKeySchedule=new Uint32Array(h),a=this.sBox,R=this.rcon,x=this.invSubMix,S=x[0],D=x[1],O=x[2],A=x[3],C,T;for(p=0;p<h;p++){if(p<l){C=u[p]=y[p];continue}T=C,p%l===0?(T=T<<8|T>>>24,T=a[T>>>24]<<24|a[T>>>16&255]<<16|a[T>>>8&255]<<8|a[T&255],T^=R[p/l|0]<<24):l>6&&p%l===4&&(T=a[T>>>24]<<24|a[T>>>16&255]<<16|a[T>>>8&255]<<8|a[T&255]),u[p]=C=(u[p-l]^T)>>>0}for(o=0;o<h;o++)p=h-o,o&3?T=u[p]:T=u[p-4],o<4||p<=4?s[o]=T:s[o]=S[a[T>>>24]]^D[a[T>>>16&255]]^O[a[T>>>8&255]]^A[a[T&255]],s[o]=s[o]>>>0},z.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},z.decrypt=function(L,y,m){for(var g=this.keySize+6,l=this.invKeySchedule,h=this.invSBox,p=this.invSubMix,o=p[0],u=p[1],s=p[2],a=p[3],R=this.uint8ArrayToUint32Array_(m),x=R[0],S=R[1],D=R[2],O=R[3],A=new Int32Array(L),C=new Int32Array(A.length),T,d,f,b,_,j,U,w,M,I,v,W,Z,oe,fe=this.networkToHostOrderSwap;y<A.length;){for(M=fe(A[y]),I=fe(A[y+1]),v=fe(A[y+2]),W=fe(A[y+3]),_=M^l[0],j=W^l[1],U=v^l[2],w=I^l[3],Z=4,oe=1;oe<g;oe++)T=o[_>>>24]^u[j>>16&255]^s[U>>8&255]^a[w&255]^l[Z],d=o[j>>>24]^u[U>>16&255]^s[w>>8&255]^a[_&255]^l[Z+1],f=o[U>>>24]^u[w>>16&255]^s[_>>8&255]^a[j&255]^l[Z+2],b=o[w>>>24]^u[_>>16&255]^s[j>>8&255]^a[U&255]^l[Z+3],_=T,j=d,U=f,w=b,Z=Z+4;T=h[_>>>24]<<24^h[j>>16&255]<<16^h[U>>8&255]<<8^h[w&255]^l[Z],d=h[j>>>24]<<24^h[U>>16&255]<<16^h[w>>8&255]<<8^h[_&255]^l[Z+1],f=h[U>>>24]<<24^h[w>>16&255]<<16^h[_>>8&255]<<8^h[j&255]^l[Z+2],b=h[w>>>24]<<24^h[_>>16&255]<<16^h[j>>8&255]<<8^h[U&255]^l[Z+3],C[y]=fe(T^x),C[y+1]=fe(b^S),C[y+2]=fe(f^D),C[y+3]=fe(d^O),x=M,S=I,D=v,O=W,y=y+4}return C.buffer},K}()},"./src/crypt/decrypter.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return y});var X=N("./src/crypt/aes-crypto.ts"),H=N("./src/crypt/fast-aes-key.ts"),P=N("./src/crypt/aes-decryptor.ts"),K=N("./src/utils/logger.ts"),z=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),L=16,y=function(){function m(l,h,p){var o=p===void 0?{}:p,u=o.removePKCS7Padding,s=u===void 0?!0:u;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=l,this.config=h,this.removePKCS7Padding=s,s)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var g=m.prototype;return g.destroy=function(){this.observer=null},g.isSync=function(){return this.config.enableSoftwareAES},g.flush=function(){var h=this.currentResult;if(!h){this.reset();return}var p=new Uint8Array(h);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(p):p},g.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},g.decrypt=function(h,p,o,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(h),p,o);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(h),p,o).then(u)},g.softwareDecrypt=function(h,p,o){var u=this.currentIV,s=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(h=Object(z.appendUint8Array)(a,h),this.remainderData=null);var R=this.getValidChunk(h);if(!R.length)return null;u&&(o=u);var x=this.softwareDecrypter;x||(x=this.softwareDecrypter=new P.default),x.expandKey(p);var S=s;return this.currentResult=x.decrypt(R.buffer,0,o),this.currentIV=Object(n.sliceUint8)(R,-16).buffer,S||null},g.webCryptoDecrypt=function(h,p,o){var u=this,s=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new H.default(s,p)),this.fastAesKey.expandKey().then(function(a){if(!s)return Promise.reject(new Error("web crypto not initialized"));var R=new X.default(s,o);return R.decrypt(h.buffer,a)}).catch(function(a){return u.onWebCryptoError(a,h,p,o)})},g.onWebCryptoError=function(h,p,o,u){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",h),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,o,u)},g.getValidChunk=function(h){var p=h,o=h.length-h.length%L;return o!==h.length&&(p=Object(n.sliceUint8)(h,0,o),this.remainderData=Object(n.sliceUint8)(h,o)),p},g.logOnce=function(h){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+h),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return X});var X=function(){function H(K,z){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=z}var P=H.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},H}()},"./src/demux/aacdemuxer.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/adts.ts"),P=N("./src/utils/logger.ts"),K=N("./src/demux/id3.ts");function z(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,n(y,m)}function n(y,m){return n=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},n(y,m)}var L=function(y){z(m,y);function m(l,h){var p;return p=y.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=l,p.config=h,p}var g=m.prototype;return g.resetInitSegment=function(h,p,o){y.prototype.resetInitSegment.call(this,h,p,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var p=K.getID3Data(h,0)||[],o=p.length,u=h.length;o<u;o++)if(H.probe(h,o))return P.logger.log("ADTS sync word found !"),!0;return!1},g.canParse=function(h,p){return H.canParse(h,p)},g.appendFrame=function(h,p,o){H.initTrackConfig(h,this.observer,p,o,h.manifestCodec);var u=H.appendFrame(h,p,o,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},m}(X.default);L.minProbeByteLength=9,Y.default=L},"./src/demux/adts.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"getAudioConfig",function(){return K}),N.d(Y,"isHeaderPattern",function(){return z}),N.d(Y,"getHeaderLength",function(){return n}),N.d(Y,"getFullFrameLength",function(){return L}),N.d(Y,"canGetFrameLength",function(){return y}),N.d(Y,"isHeader",function(){return m}),N.d(Y,"canParse",function(){return g}),N.d(Y,"probe",function(){return l}),N.d(Y,"initTrackConfig",function(){return h}),N.d(Y,"getFrameDuration",function(){return p}),N.d(Y,"parseFrameHeader",function(){return o}),N.d(Y,"appendFrame",function(){return u});var X=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),P=N("./src/events.ts");function K(s,a,R,x){var S,D,O,A,C=navigator.userAgent.toLowerCase(),T=x,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((a[R+2]&192)>>>6)+1;var f=(a[R+2]&60)>>>2;if(f>d.length-1){s.trigger(P.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f});return}return O=(a[R+2]&1)<<2,O|=(a[R+3]&192)>>>6,X.logger.log("manifest codec:"+x+", ADTS type:"+S+", samplingIndex:"+f),/firefox/i.test(C)?f>=6?(S=5,A=new Array(4),D=f-3):(S=2,A=new Array(2),D=f):C.indexOf("android")!==-1?(S=2,A=new Array(2),D=f):(S=5,A=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&f>=6?D=f-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(f>=6&&O===1||/vivaldi/i.test(C))||!x&&O===1)&&(S=2,A=new Array(2)),D=f)),A[0]=S<<3,A[0]|=(f&14)>>1,A[1]|=(f&1)<<7,A[1]|=O<<3,S===5&&(A[1]|=(D&14)>>1,A[2]=(D&1)<<7,A[2]|=2<<2,A[3]=0),{config:A,samplerate:d[f],channelCount:O,codec:"mp4a.40."+S,manifestCodec:T}}function z(s,a){return s[a]===255&&(s[a+1]&246)===240}function n(s,a){return s[a+1]&1?7:9}function L(s,a){return(s[a+3]&3)<<11|s[a+4]<<3|(s[a+5]&224)>>>5}function y(s,a){return a+5<s.length}function m(s,a){return a+1<s.length&&z(s,a)}function g(s,a){return y(s,a)&&z(s,a)&&L(s,a)<=s.length-a}function l(s,a){if(m(s,a)){var R=n(s,a);if(a+R>=s.length)return!1;var x=L(s,a);if(x<=R)return!1;var S=a+x;return S===s.length||m(s,S)}return!1}function h(s,a,R,x,S){if(!s.samplerate){var D=K(a,R,x,S);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 p(s){return 1024*9e4/s}function o(s,a,R,x,S){var D=n(s,a),O=L(s,a);if(O-=D,O>0){var A=R+x*S;return{headerLength:D,frameLength:O,stamp:A}}}function u(s,a,R,x,S){var D=p(s.samplerate),O=o(a,R,x,S,D);if(O){var A=O.frameLength,C=O.headerLength,T=O.stamp,d=C+A,f=Math.max(0,R+d-a.length),b;f?(b=new Uint8Array(d-C),b.set(a.subarray(R+C,a.length),0)):b=a.subarray(R+C,R+d);var _={unit:b,pts:T};return f||s.samples.push(_),{sample:_,length:d,missing:f}}}},"./src/demux/base-audio-demuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return L});var X=N("./src/polyfills/number.ts"),H=N("./src/demux/id3.ts"),P=N("./src/demux/dummy-demuxed-track.ts"),K=N("./src/utils/mp4-tools.ts"),z=N("./src/utils/typed-array.ts"),n=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=y.prototype;return m.resetInitSegment=function(l,h,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(l,h){return!1},m.appendFrame=function(l,h,p){},m.demux=function(l,h){this.cachedData&&(l=Object(K.appendUint8Array)(this.cachedData,l),this.cachedData=null);var p=H.getID3Data(l,0),o=p?p.length:0,u,s,a=this._audioTrack,R=this._id3Track,x=p?H.getTimeStamp(p):void 0,S=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(x,h)),p&&p.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),s=this.initPTS;o<S;){if(this.canParse(l,o)){var D=this.appendFrame(a,l,o);D?(this.frameIndex++,s=D.sample.pts,o+=D.length,u=o):o=S}else H.canParse(l,o)?(p=H.getID3Data(l,o),R.samples.push({pts:s,dts:s,data:p}),o+=p.length,u=o):o++;if(o===S&&u!==S){var O=Object(z.sliceUint8)(l,u);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:a,avcTrack:Object(P.dummyTrack)(),id3Track:R,textTrack:Object(P.dummyTrack)()}},m.demuxSampleAes=function(l,h,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(l){var h=this.cachedData;return h&&(this.cachedData=null,this.demux(h,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},m.destroy=function(){},y}(),L=function(m,g){return Object(X.isFiniteNumber)(m)?m*90:g*9e4};Y.default=n},"./src/demux/chunk-cache.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return X});var X=function(){function P(){this.chunks=[],this.dataLength=0}var K=P.prototype;return K.push=function(n){this.chunks.push(n),this.dataLength+=n.length},K.flush=function(){var n=this.chunks,L=this.dataLength,y;if(n.length)n.length===1?y=n[0]:y=H(n,L);else return new Uint8Array(0);return this.reset(),y},K.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function H(P,K){for(var z=new Uint8Array(K),n=0,L=0;L<P.length;L++){var y=P[L];z.set(y,n),n+=y.length}return z}},"./src/demux/dummy-demuxed-track.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/utils/logger.ts"),H=function(){function P(z){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=z,this.bytesAvailable=z.byteLength,this.word=0,this.bitsAvailable=0}var K=P.prototype;return K.loadWord=function(){var n=this.data,L=this.bytesAvailable,y=n.byteLength-L,m=new Uint8Array(4),g=Math.min(4,L);if(g===0)throw new Error("no bytes available");m.set(n.subarray(y,y+g)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=g*8,this.bytesAvailable-=g},K.skipBits=function(n){var L;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,L=n>>3,n-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},K.readBits=function(n){var L=Math.min(this.bitsAvailable,n),y=this.word>>>32-L;return n>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=n-L,L>0&&this.bitsAvailable?y<<L|this.readBits(L):y},K.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},K.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>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(n){for(var L=8,y=8,m,g=0;g<n;g++)y!==0&&(m=this.readEG(),y=(L+m+256)%256),L=y===0?L:y},K.readSPS=function(){var n=0,L=0,y=0,m=0,g,l,h,p=this.readUByte.bind(this),o=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),a=this.skipBits.bind(this),R=this.skipEG.bind(this),x=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);p();var D=p();if(o(5),a(3),p(),x(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var O=u();if(O===3&&a(1),x(),x(),a(1),s())for(l=O!==3?8:12,h=0;h<l;h++)s()&&(h<6?S(16):S(64))}x();var A=u();if(A===0)u();else if(A===1)for(a(1),R(),R(),g=u(),h=0;h<g;h++)R();x(),a(1);var C=u(),T=u(),d=o(1);d===0&&a(1),a(1),s()&&(n=u(),L=u(),y=u(),m=u());var f=[1,1];if(s()&&s()){var b=p();switch(b){case 1:f=[1,1];break;case 2:f=[12,11];break;case 3:f=[10,11];break;case 4:f=[16,11];break;case 5:f=[40,33];break;case 6:f=[24,11];break;case 7:f=[20,11];break;case 8:f=[32,11];break;case 9:f=[80,33];break;case 10:f=[18,11];break;case 11:f=[15,11];break;case 12:f=[64,33];break;case 13:f=[160,99];break;case 14:f=[4,3];break;case 15:f=[3,2];break;case 16:f=[2,1];break;case 255:{f=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((C+1)*16-n*2-L*2),height:(2-d)*(T+1)*16-(d?2:4)*(y+m),pixelRatio:f}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();Y.default=H},"./src/demux/id3.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isHeader",function(){return X}),N.d(Y,"isFooter",function(){return H}),N.d(Y,"getID3Data",function(){return P}),N.d(Y,"canParse",function(){return z}),N.d(Y,"getTimeStamp",function(){return n}),N.d(Y,"isTimeStampFrame",function(){return L}),N.d(Y,"getID3Frames",function(){return m}),N.d(Y,"decodeFrame",function(){return g}),N.d(Y,"utf8ArrayToStr",function(){return u}),N.d(Y,"testables",function(){return s});var X=function(S,D){return D+10<=S.length&&(S[D]===73&&S[D+1]===68&&S[D+2]===51&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},H=function(S,D){return D+10<=S.length&&(S[D]===51&&S[D+1]===68&&S[D+2]===73&&(S[D+3]<255&&S[D+4]<255&&(S[D+6]<128&&S[D+7]<128&&S[D+8]<128&&S[D+9]<128)))},P=function(S,D){for(var O=D,A=0;X(S,D);){A+=10;var C=K(S,D+6);A+=C,H(S,D+10)&&(A+=10),D+=A}return A>0?S.subarray(O,O+A):void 0},K=function(S,D){var O=0;return O=(S[D]&127)<<21,O|=(S[D+1]&127)<<14,O|=(S[D+2]&127)<<7,O|=S[D+3]&127,O},z=function(S,D){return X(S,D)&&K(S,D+6)+10<=S.length-D},n=function(S){for(var D=m(S),O=0;O<D.length;O++){var A=D[O];if(L(A))return o(A)}return},L=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},y=function(S){var D=String.fromCharCode(S[0],S[1],S[2],S[3]),O=K(S,4),A=10;return{type:D,size:O,data:S.subarray(A,A+O)}},m=function(S){for(var D=0,O=[];X(S,D);){var A=K(S,D+6);D+=10;for(var C=D+A;D+8<C;){var T=y(S.subarray(D)),d=g(T);d&&O.push(d),D+=T.size+10}H(S,D)&&(D+=10)}return O},g=function(S){return S.type==="PRIV"?l(S):S.type[0]==="W"?p(S):h(S)},l=function(S){if(S.size<2)return;var D=u(S.data,!0),O=new Uint8Array(S.data.subarray(D.length+1));return{key:S.type,info:D,data:O.buffer}},h=function(S){if(S.size<2)return;if(S.type==="TXXX"){var D=1,O=u(S.data.subarray(D),!0);D+=O.length+1;var A=u(S.data.subarray(D));return{key:S.type,info:O,data:A}}var C=u(S.data.subarray(1));return{key:S.type,data:C}},p=function(S){if(S.type==="WXXX"){if(S.size<2)return;var D=1,O=u(S.data.subarray(D),!0);D+=O.length+1;var A=u(S.data.subarray(D));return{key:S.type,info:O,data:A}}var C=u(S.data);return{key:S.type,data:C}},o=function(S){if(S.data.byteLength===8){var D=new Uint8Array(S.data),O=D[3]&1,A=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return A/=45,O&&(A+=4772185884e-2),Math.round(A)}return},u=function(S,D){D===void 0&&(D=!1);var O=R();if(O){var A=O.decode(S);if(D){var C=A.indexOf("\0");return C!==-1?A.substring(0,C):A}return A.replace(/\0/g,"")}for(var T=S.length,d,f,b,_="",j=0;j<T;){if(d=S[j++],d===0&&D)return _;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(d);break;case 12:case 13:f=S[j++],_+=String.fromCharCode((d&31)<<6|f&63);break;case 14:f=S[j++],b=S[j++],_+=String.fromCharCode((d&15)<<12|(f&63)<<6|(b&63)<<0);break;default:}}return _},s={decodeTextFrame:h},a;function R(){return!a&&typeof self.TextDecoder!="undefined"&&(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/demux/base-audio-demuxer.ts"),H=N("./src/demux/id3.ts"),P=N("./src/utils/logger.ts"),K=N("./src/demux/mpegaudio.ts");function z(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,n(y,m)}function n(y,m){return n=Object.setPrototypeOf||function(l,h){return l.__proto__=h,l},n(y,m)}var L=function(y){z(m,y);function m(){return y.apply(this,arguments)||this}var g=m.prototype;return g.resetInitSegment=function(h,p,o){y.prototype.resetInitSegment.call(this,h,p,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:h,duration:o,inputTimeScale:9e4,dropped:0}},m.probe=function(h){if(!h)return!1;for(var p=H.getID3Data(h,0)||[],o=p.length,u=h.length;o<u;o++)if(K.probe(h,o))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},g.canParse=function(h,p){return K.canParse(h,p)},g.appendFrame=function(h,p,o){return this.initPTS===null?void 0:K.appendFrame(h,p,o,this.initPTS,this.frameIndex)},m}(X.default);L.minProbeByteLength=4,Y.default=L},"./src/demux/mp4demuxer.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/utils/mp4-tools.ts"),H=N("./src/demux/dummy-demuxed-track.ts"),P=function(){function K(n,L){this.remainderData=null,this.config=void 0,this.config=L}var z=K.prototype;return z.resetTimeStamp=function(){},z.resetInitSegment=function(){},z.resetContiguity=function(){},K.probe=function(L){return Object(X.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},z.demux=function(L){var y=L,m=Object(H.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(X.appendUint8Array)(this.remainderData,L));var g=Object(X.segmentValidRange)(y);this.remainderData=g.remainder,m.samples=g.valid||new Uint8Array}else m.samples=y;return{audioTrack:Object(H.dummyTrack)(),avcTrack:m,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},z.flush=function(){var L=Object(H.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(H.dummyTrack)(),avcTrack:L,id3Track:Object(H.dummyTrack)(),textTrack:Object(H.dummyTrack)()}},z.demuxSampleAes=function(L,y,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},z.destroy=function(){},K}();P.minProbeByteLength=1024,Y.default=P},"./src/demux/mpegaudio.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return n}),N.d(Y,"parseHeader",function(){return L}),N.d(Y,"isHeaderPattern",function(){return y}),N.d(Y,"isHeader",function(){return m}),N.d(Y,"canParse",function(){return g}),N.d(Y,"probe",function(){return l});var X=null,H=[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],P=[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]],z=[0,1,1,4];function n(h,p,o,u,s){if(o+24>p.length)return;var a=L(p,o);if(a&&o+a.frameLength<=p.length){var R=a.samplesPerFrame*9e4/a.sampleRate,x=u+s*R,S={unit:p.subarray(o,o+a.frameLength),pts:x,dts:x};return h.config=[],h.channelCount=a.channelCount,h.samplerate=a.sampleRate,h.samples.push(S),{sample:S,length:a.frameLength,missing:0}}}function L(h,p){var o=h[p+1]>>3&3,u=h[p+1]>>1&3,s=h[p+2]>>4&15,a=h[p+2]>>2&3;if(o!==1&&s!==0&&s!==15&&a!==3){var R=h[p+2]>>1&1,x=h[p+3]>>6,S=o===3?3-u:u===3?3:4,D=H[S*14+s-1]*1e3,O=o===3?0:o===2?1:2,A=P[O*3+a],C=x===3?1:2,T=K[o][u],d=z[u],f=T*8*d,b=Math.floor(T*D/A+R)*d;if(X===null){var _=navigator.userAgent||"",j=_.match(/Chrome\/(\d+)/i);X=j?parseInt(j[1]):0}var U=!!X&&X<=87;return U&&u===2&&D>=224e3&&x===0&&(h[p+3]=h[p+3]|128),{sampleRate:A,channelCount:C,frameLength:b,samplesPerFrame:f}}}function y(h,p){return h[p]===255&&(h[p+1]&224)===224&&(h[p+1]&6)!==0}function m(h,p){return p+1<h.length&&y(h,p)}function g(h,p){var o=4;return y(h,p)&&o<=h.length-p}function l(h,p){if(p+1<h.length&&y(h,p)){var o=4,u=L(h,p),s=o;u!=null&&u.frameLength&&(s=u.frameLength);var a=p+s;return a===h.length||m(h,a)}return!1}},"./src/demux/sample-aes.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/crypt/decrypter.ts"),H=N("./src/demux/tsdemuxer.ts"),P=function(){function K(n,L,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new X.default(n,L,{removePKCS7Padding:!1})}var z=K.prototype;return z.decryptBuffer=function(L,y){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,y)},z.decryptAacSample=function(L,y,m,g){var l=L[y].unit,h=l.subarray(16,l.length-l.length%16),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.length),o=this;this.decryptBuffer(p,function(u){var s=new Uint8Array(u);l.set(s,16),g||o.decryptAacSamples(L,y+1,m)})},z.decryptAacSamples=function(L,y,m){for(;;y++){if(y>=L.length){m();return}if(L[y].unit.length<32)continue;var g=this.decrypter.isSync();if(this.decryptAacSample(L,y,m,g),!g)return}},z.getAvcEncryptedData=function(L){for(var y=Math.floor((L.length-48)/160)*16+16,m=new Int8Array(y),g=0,l=32;l<=L.length-16;l+=160,g+=16)m.set(L.subarray(l,l+16),g);return m},z.getAvcDecryptedUnit=function(L,y){for(var m=new Uint8Array(y),g=0,l=32;l<=L.length-16;l+=160,g+=16)L.set(m.subarray(g,g+16),l);return L},z.decryptAvcSample=function(L,y,m,g,l,h){var p=Object(H.discardEPB)(l.data),o=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(o.buffer,function(s){l.data=u.getAvcDecryptedUnit(p,s),h||u.decryptAvcSamples(L,y,m+1,g)})},z.decryptAvcSamples=function(L,y,m,g){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,m=0){if(y>=L.length){g();return}for(var l=L[y].units;!(m>=l.length);m++){var h=l[m];if(h.data.length<=48||h.type!==1&&h.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(L,y,m,g,h,p),!p)return}}},K}();Y.default=P},"./src/demux/transmuxer-interface.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var X=N("./node_modules/webworkify-webpack/index.js"),H=N.n(X),P=N("./src/events.ts"),K=N("./src/demux/transmuxer.ts"),z=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),L=N("./src/utils/mediasource-helper.ts"),y=N("./node_modules/eventemitter3/index.js"),m=N.n(y),g=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function h(o,u,s,a){var R=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 x=o.config,S=function(T,d){d=d||{},d.frag=R.frag,d.id=R.id,o.trigger(T,d)};this.observer=new y.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,S),this.observer.on(P.Events.ERROR,S);var D={mp4:g.isTypeSupported("video/mp4"),mpeg:g.isTypeSupported("audio/mpeg"),mp3:g.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){z.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(P.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(C.message+" ("+C.filename+":"+C.lineno+")")})},A.postMessage({cmd:"init",typeSupported:D,vendor:O,id:u,config:JSON.stringify(x)})}catch(C){z.logger.warn("Error in worker:",C),z.logger.error("Error while initializing DemuxerWorker, fallback to inline"),A&&self.URL.revokeObjectURL(A.objectURL),this.transmuxer=new K.default(this.observer,D,x,O,u),this.worker=null}}else this.transmuxer=new K.default(this.observer,D,x,O,u)}var p=h.prototype;return p.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},p.push=function(u,s,a,R,x,S,D,O,A,C){var T=this;A.transmuxing.start=self.performance.now();var d=this.transmuxer,f=this.worker,b=S?S.start:x.start,_=x.decryptdata,j=this.frag,U=!(j&&x.cc===j.cc),w=!(j&&A.level===j.level),M=j?A.sn-j.sn:-1,I=this.part?A.part-this.part.index:1,v=!w&&(M===1||M===0&&I===1),W=self.performance.now();(w||M||x.stats.parsing.start===0)&&(x.stats.parsing.start=W),S&&(I||!v)&&(S.stats.parsing.start=W);var Z=new K.TransmuxState(U,v,O,w,b);if(!v||U){z.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+A.sn+" p: "+A.part+" level: "+A.level+" id: "+A.id+`
discontinuity: `+U+`
trackSwitch: `+w+`
contiguous: `+v+`
accurateTimeOffset: `+O+`
timeOffset: `+b);var oe=new K.TransmuxConfig(a,R,s,D,C);this.configureTransmuxer(oe)}if(this.frag=x,this.part=S,f)f.postMessage({cmd:"demux",data:u,decryptdata:_,chunkMeta:A,state:Z},u instanceof ArrayBuffer?[u]:[]);else if(d){var fe=d.push(u,_,A,Z);Object(K.isPromise)(fe)?fe.then(function(Ae){T.handleTransmuxComplete(Ae)}):this.handleTransmuxComplete(fe)}},p.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:u});else if(a){var x=a.flush(u);Object(K.isPromise)(x)?x.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(x,u)}},p.handleFlushResult=function(u,s){var a=this;u.forEach(function(R){a.handleTransmuxComplete(R)}),this.onFlush(s)},p.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}}},p.configureTransmuxer=function(u){var s=this.worker,a=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):a&&a.configure(u)},p.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},h}()},"./src/demux/transmuxer-worker.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var X=N("./src/demux/transmuxer.ts"),H=N("./src/events.ts"),P=N("./src/utils/logger.ts"),K=N("./node_modules/eventemitter3/index.js"),z=N.n(K);function n(l){var h=new K.EventEmitter,p=function(u,s){l.postMessage({event:u,data:s})};h.on(H.Events.FRAG_DECRYPTED,p),h.on(H.Events.ERROR,p),l.addEventListener("message",function(o){var u=o.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);l.transmuxer=new X.default(h,u.typeSupported,s,u.vendor,u.id),Object(P.enableLogs)(s.debug),p("init",null);break}case"configure":{l.transmuxer.configure(u.config);break}case"demux":{var a=l.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(X.isPromise)(a)?a.then(function(S){L(l,S)}):L(l,a);break}case"flush":{var R=u.chunkMeta,x=l.transmuxer.flush(R);Object(X.isPromise)(x)?x.then(function(S){m(l,S,R)}):m(l,x,R);break}default:break}})}function L(l,h){if(g(h.remuxResult))return;var p=[],o=h.remuxResult,u=o.audio,s=o.video;u&&y(p,u),s&&y(p,s),l.postMessage({event:"transmuxComplete",data:h},p)}function y(l,h){h.data1&&l.push(h.data1.buffer),h.data2&&l.push(h.data2.buffer)}function m(l,h,p){h.forEach(function(o){L(l,o)}),l.postMessage({event:"flush",data:p})}function g(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"isPromise",function(){return x}),N.d(Y,"TransmuxConfig",function(){return S}),N.d(Y,"TransmuxState",function(){return D});var X=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/crypt/decrypter.ts"),K=N("./src/demux/aacdemuxer.ts"),z=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),L=N("./src/demux/mp3demuxer.ts"),y=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),g=N("./src/demux/chunk-cache.ts"),l=N("./src/utils/mp4-tools.ts"),h=N("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){h.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var o=[{demux:n.default,remux:y.default},{demux:z.default,remux:m.default},{demux:K.default,remux:y.default},{demux:L.default,remux:y.default}],u=1024;o.forEach(function(O){var A=O.demux;u=Math.max(u,A.minProbeByteLength)});var s=function(){function O(C,T,d,f,b){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 g.default,this.observer=C,this.typeSupported=T,this.config=d,this.vendor=f,this.id=b}var A=O.prototype;return A.configure=function(T){this.transmuxConfig=T,this.decrypter&&this.decrypter.reset()},A.push=function(T,d,f,b){var _=this,j=f.transmuxing;j.executeStart=p();var U=new Uint8Array(T),w=this.cache,M=this.config,I=this.currentTransmuxState,v=this.transmuxConfig;b&&(this.currentTransmuxState=b);var W=a(U,d);if(W&&W.method==="AES-128"){var Z=this.getDecrypter();if(M.enableSoftwareAES){var oe=Z.softwareDecrypt(U,W.key.buffer,W.iv.buffer);if(!oe)return j.executeEnd=p(),R(f);U=new Uint8Array(oe)}else return this.decryptionPromise=Z.webCryptoDecrypt(U,W.key.buffer,W.iv.buffer).then(function(xe){var Ie=_.push(xe,null,f);return _.decryptionPromise=null,Ie}),this.decryptionPromise}var fe=b||I,Ae=fe.contiguous,be=fe.discontinuity,Re=fe.trackSwitch,Ce=fe.accurateTimeOffset,Le=fe.timeOffset,ve=v.audioCodec,$=v.videoCodec,E=v.defaultInitPts,k=v.duration,B=v.initSegmentData;if((be||Re)&&this.resetInitSegment(B,ve,$,k),be&&this.resetInitialTimestamp(E),Ae||this.resetContiguity(),this.needsProbing(U,be,Re)){if(w.dataLength){var Q=w.flush();U=Object(l.appendUint8Array)(Q,U)}this.configureTransmuxer(U,v)}var G=this.transmux(U,W,Le,Ce,f),he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,j.executeEnd=p(),G},A.flush=function(T){var d=this,f=T.transmuxing;f.executeStart=p();var b=this.decrypter,_=this.cache,j=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return d.flush(T)});var w=[],M=j.timeOffset;if(b){var I=b.flush();I&&w.push(this.push(I,null,T))}var v=_.dataLength;_.reset();var W=this.demuxer,Z=this.remuxer;if(!W||!Z)return v>=u&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),f.executeEnd=p(),[R(T)];var oe=W.flush(M);return x(oe)?oe.then(function(fe){return d.flushRemux(w,fe,T),w}):(this.flushRemux(w,oe,T),w)},A.flushRemux=function(T,d,f){var b=d.audioTrack,_=d.avcTrack,j=d.id3Track,U=d.textTrack,w=this.currentTransmuxState,M=w.accurateTimeOffset,I=w.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+f.sn+(f.part>-1?" p: "+f.part:"")+" of level "+f.level);var v=this.remuxer.remux(b,_,j,U,I,M,!0,this.id);T.push({remuxResult:v,chunkMeta:f}),f.transmuxing.executeEnd=p()},A.resetInitialTimestamp=function(T){var d=this.demuxer,f=this.remuxer;if(!d||!f)return;d.resetTimeStamp(T),f.resetTimeStamp(T)},A.resetContiguity=function(){var T=this.demuxer,d=this.remuxer;if(!T||!d)return;T.resetContiguity(),d.resetNextTimestamp()},A.resetInitSegment=function(T,d,f,b){var _=this.demuxer,j=this.remuxer;if(!_||!j)return;_.resetInitSegment(d,f,b),j.resetInitSegment(T,d,f)},A.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},A.transmux=function(T,d,f,b,_){var j;return d&&d.method==="SAMPLE-AES"?j=this.transmuxSampleAes(T,d,f,b,_):j=this.transmuxUnencrypted(T,f,b,_),j},A.transmuxUnencrypted=function(T,d,f,b){var _=this.demuxer.demux(T,d,!1,!this.config.progressive),j=_.audioTrack,U=_.avcTrack,w=_.id3Track,M=_.textTrack,I=this.remuxer.remux(j,U,w,M,d,f,!1,this.id);return{remuxResult:I,chunkMeta:b}},A.transmuxSampleAes=function(T,d,f,b,_){var j=this;return this.demuxer.demuxSampleAes(T,d,f).then(function(U){var w=j.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,f,b,!1,j.id);return{remuxResult:w,chunkMeta:_}})},A.configureTransmuxer=function(T,d){for(var f=this.config,b=this.observer,_=this.typeSupported,j=this.vendor,U=d.audioCodec,w=d.defaultInitPts,M=d.duration,I=d.initSegmentData,v=d.videoCodec,W,Z=0,oe=o.length;Z<oe;Z++)if(o[Z].demux.probe(T)){W=o[Z];break}W||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:z.default,remux:m.default});var fe=this.demuxer,Ae=this.remuxer,be=W.remux,Re=W.demux;(!Ae||!(Ae instanceof be))&&(this.remuxer=new be(b,f,_,j)),(!fe||!(fe instanceof Re))&&(this.demuxer=new Re(b,f,_),this.probe=Re.probe),this.resetInitSegment(I,U,v,M),this.resetInitialTimestamp(w)},A.needsProbing=function(T,d,f){return!this.demuxer||!this.remuxer||d||f},A.getDecrypter=function(){var T=this.decrypter;return T||(T=this.decrypter=new P.default(this.observer,this.config)),T},O}();function a(O,A){var C=null;return O.byteLength>0&&A!=null&&A.key!=null&&A.iv!==null&&A.method!=null&&(C=A),C}var R=function(A){return{remuxResult:{},chunkMeta:A}};function x(O){return"then"in O&&O.then instanceof Function}var S=function(A,C,T,d,f){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=T,this.duration=d,this.defaultInitPts=f},D=function(A,C,T,d,f){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=T,this.trackSwitch=d,this.timeOffset=f}},"./src/demux/tsdemuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return R});var X=N("./src/demux/adts.ts"),H=N("./src/demux/mpegaudio.ts"),P=N("./src/demux/exp-golomb.ts"),K=N("./src/demux/id3.ts"),z=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),L=N("./src/utils/mp4-tools.ts"),y=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),g={video:1,audio:2,id3:3,text:4},l=function(){function x(D,O,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=O,this.typeSupported=A}x.probe=function(O){var A=x.syncOffset(O);return A<0?!1:(A&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+A+", junk ahead ?"),!0)},x.syncOffset=function(O){for(var A=Math.min(1e3,O.length-3*188),C=0;C<A;){if(O[C]===71&&O[C+188]===71&&O[C+2*188]===71)return C;C++}return-1},x.createTrack=function(O,A){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:g[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?A:void 0}};var S=x.prototype;return S.resetInitSegment=function(O,A,C){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=x.createTrack("video",C),this._audioTrack=x.createTrack("audio",C),this._id3Track=x.createTrack("id3",C),this._txtTrack=x.createTrack("text",C),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=A,this._duration=C},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,A=this._avcTrack,C=this._id3Track;O&&(O.pesData=null),A&&(A.pesData=null),C&&(C.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,A,C,T){C===void 0&&(C=!1),T===void 0&&(T=!1),C||(this.sampleAes=null);var d,f=this._avcTrack,b=this._audioTrack,_=this._id3Track,j=f.pid,U=f.pesData,w=b.pid,M=_.pid,I=b.pesData,v=_.pesData,W=!1,Z=this.pmtParsed,oe=this._pmtId,fe=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),fe=O.length,this.remainderData=null),fe<188&&!T)return this.remainderData=O,{audioTrack:b,avcTrack:f,id3Track:_,textTrack:this._txtTrack};var Ae=Math.max(0,x.syncOffset(O));fe-=(fe+Ae)%188,fe<O.byteLength&&!T&&(this.remainderData=new Uint8Array(O.buffer,fe,O.buffer.byteLength-fe));for(var be=Ae;be<fe;be+=188)if(O[be]===71){var Re=!!(O[be+1]&64),Ce=((O[be+1]&31)<<8)+O[be+2],Le=(O[be+3]&48)>>4,ve=void 0;if(Le>1){if(ve=be+5+O[be+4],ve===be+188)continue}else ve=be+4;switch(Ce){case j:Re&&(U&&(d=u(U))&&this.parseAVCPES(d,!1),U={data:[],size:0}),U&&(U.data.push(O.subarray(ve,be+188)),U.size+=be+188-ve);break;case w:Re&&(I&&(d=u(I))&&(b.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),I={data:[],size:0}),I&&(I.data.push(O.subarray(ve,be+188)),I.size+=be+188-ve);break;case M:Re&&(v&&(d=u(v))&&this.parseID3PES(d),v={data:[],size:0}),v&&(v.data.push(O.subarray(ve,be+188)),v.size+=be+188-ve);break;case 0:Re&&(ve+=O[ve]+1),oe=this._pmtId=p(O,ve);break;case oe:{Re&&(ve+=O[ve]+1);var $=o(O,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,C);j=$.avc,j>0&&(f.pid=j),w=$.audio,w>0&&(b.pid=w,b.isAAC=$.isAAC),M=$.id3,M>0&&(_.pid=M),W&&!Z&&(y.logger.log("reparse from beginning"),W=!1,be=Ae-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});f.pesData=U,b.pesData=I,_.pesData=v;var E={audioTrack:b,avcTrack:f,id3Track:_,textTrack:this._txtTrack};return T&&this.extractRemainingSamples(E),E},S.flush=function(){var O=this.remainderData;this.remainderData=null;var A;return O?A=this.demux(O,-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},S.extractRemainingSamples=function(O){var A=O.audioTrack,C=O.avcTrack,T=O.id3Track,d=C.pesData,f=A.pesData,b=T.pesData,_;d&&(_=u(d))?(this.parseAVCPES(_,!0),C.pesData=null):C.pesData=d,f&&(_=u(f))?(A.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),A.pesData=null):(f!=null&&f.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),A.pesData=f),b&&(_=u(b))?(this.parseID3PES(_),T.pesData=null):T.pesData=b},S.demuxSampleAes=function(O,A,C){var T=this.demux(O,C,!0,!this.config.progressive),d=this.sampleAes=new z.default(this.observer,this.config,A);return this.decrypt(T,d)},S.decrypt=function(O,A){return new Promise(function(C){var T=O.audioTrack,d=O.avcTrack;T.samples&&T.isAAC?A.decryptAacSamples(T.samples,0,function(){d.samples?A.decryptAvcSamples(d.samples,0,0,function(){C(O)}):C(O)}):d.samples&&A.decryptAvcSamples(d.samples,0,0,function(){C(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,A){var C=this,T=this._avcTrack,d=this.parseAVCNALu(O.data),f=!1,b=this.avcSample,_,j=!1;O.data=null,b&&d.length&&!T.audFound&&(s(b,T),b=this.avcSample=h(!1,O.pts,O.dts,"")),d.forEach(function(U){switch(U.type){case 1:{_=!0,b||(b=C.avcSample=h(!0,O.pts,O.dts,"")),f&&(b.debug+="NDR "),b.frame=!0;var w=U.data;if(j&&w.length>4){var M=new P.default(w).readSliceType();(M===2||M===4||M===7||M===9)&&(b.key=!0)}break}case 5:_=!0,b||(b=C.avcSample=h(!0,O.pts,O.dts,"")),f&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{_=!0,f&&b&&(b.debug+="SEI ");var I=new P.default(R(U.data));I.readUByte();for(var v=0,W=0,Z=!1,oe=0;!Z&&I.bytesAvailable>1;){v=0;do oe=I.readUByte(),v+=oe;while(oe===255);W=0;do oe=I.readUByte(),W+=oe;while(oe===255);if(v===4&&I.bytesAvailable!==0){Z=!0;var fe=I.readUByte();if(fe===181){var Ae=I.readUShort();if(Ae===49){var be=I.readUInt();if(be===1195456820){var Re=I.readUByte();if(Re===3){for(var Ce=I.readUByte(),Le=I.readUByte(),ve=31&Ce,$=[Ce,Le],E=0;E<ve;E++)$.push(I.readUByte()),$.push(I.readUByte()),$.push(I.readUByte());a(C._txtTrack.samples,{type:3,pts:O.pts,bytes:$})}}}}}else if(v===5&&I.bytesAvailable!==0){if(Z=!0,W>16){for(var k=[],B=0;B<16;B++)k.push(I.readUByte().toString(16)),(B===3||B===5||B===7||B===9)&&k.push("-");for(var Q=W-16,G=new Uint8Array(Q),he=0;he<Q;he++)G[he]=I.readUByte();a(C._txtTrack.samples,{pts:O.pts,payloadType:v,uuid:k.join(""),userData:Object(K.utf8ArrayToStr)(G),userDataBytes:G})}}else if(W<I.bytesAvailable)for(var xe=0;xe<W;xe++)I.readUByte()}break}case 7:if(_=!0,j=!0,f&&b&&(b.debug+="SPS "),!T.sps){var Ie=new P.default(U.data),ue=Ie.readSPS();T.width=ue.width,T.height=ue.height,T.pixelRatio=ue.pixelRatio,T.sps=[U.data],T.duration=C._duration;for(var ge=U.data.subarray(1,4),_e="avc1.",Se=0;Se<3;Se++){var Pe=ge[Se].toString(16);Pe.length<2&&(Pe="0"+Pe),_e+=Pe}T.codec=_e}break;case 8:_=!0,f&&b&&(b.debug+="PPS "),T.pps||(T.pps=[U.data]);break;case 9:_=!1,T.audFound=!0,b&&s(b,T),b=C.avcSample=h(!1,O.pts,O.dts,f?"AUD ":"");break;case 12:_=!1;break;default:_=!1,b&&(b.debug+="unknown NAL "+U.type+" ");break}if(b&&_){var Ue=b.units;Ue.push(U)}}),A&&b&&(s(b,T),this.avcSample=null)},S.getLastNalUnit=function(){var O,A=this.avcSample,C;if(!A||A.units.length===0){var T=this._avcTrack.samples;A=T[T.length-1]}if((O=A)!==null&&O!==void 0&&O.units){var d=A.units;C=d[d.length-1]}return C},S.parseAVCNALu=function(O){var A=O.byteLength,C=this._avcTrack,T=C.naluState||0,d=T,f=[],b=0,_,j,U,w=-1,M=0;for(T===-1&&(w=0,M=O[0]&31,T=0,b=1);b<A;){if(_=O[b++],!T){T=_?0:1;continue}if(T===1){T=_?0:2;continue}if(!_)T=3;else if(_===1){if(w>=0){var I={data:O.subarray(w,b-T-1),type:M};f.push(I)}else{var v=this.getLastNalUnit();if(v&&(d&&b<=4-d&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-d))),j=b-T-1,j>0)){var W=new Uint8Array(v.data.byteLength+j);W.set(v.data,0),W.set(O.subarray(0,j),v.data.byteLength),v.data=W,v.state=0}}b<A?(U=O[b]&31,w=b,M=U,T=0):T=-1}else T=0}if(w>=0&&T>=0){var Z={data:O.subarray(w,A),type:M,state:T};f.push(Z)}if(f.length===0){var oe=this.getLastNalUnit();if(oe){var fe=new Uint8Array(oe.data.byteLength+O.byteLength);fe.set(oe.data,0),fe.set(O,oe.data.byteLength),oe.data=fe}}return C.naluState=T,f},S.parseAACPES=function(O){var A=0,C=this._audioTrack,T=this.aacOverFlow,d=O.data;if(T){this.aacOverFlow=null;var f=T.sample.unit.byteLength,b=Math.min(T.missing,f),_=f-b;T.sample.unit.set(d.subarray(0,b),_),C.samples.push(T.sample),A=T.missing}var j,U;for(j=A,U=d.length;j<U-1&&!X.isHeader(d,j);j++);if(j!==A){var w,M;if(j<U-1?(w="AAC PES did not start with ADTS header,offset:"+j,M=!1):(w="no ADTS header found in AAC PES",M=!0),y.logger.warn("parsing error:"+w),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:w}),M)return}X.initTrackConfig(C,this.observer,d,j,this.audioCodec);var I;if(O.pts!==void 0)I=O.pts;else if(T){var v=X.getFrameDuration(C.samplerate);I=T.sample.pts+v}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;j<U;)if(X.isHeader(d,j)){if(j+5<U){var Z=X.appendFrame(C,d,j,I,W);if(Z)if(Z.missing)this.aacOverFlow=Z;else{j+=Z.length,W++;continue}}break}else j++},S.parseMPEGPES=function(O){var A=O.data,C=A.length,T=0,d=0,f=O.pts;if(f===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<C;)if(H.isHeader(A,d)){var b=H.appendFrame(this._audioTrack,A,d,f,T);if(b)d+=b.length,T++;else break}else d++},S.parseID3PES=function(O){if(O.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},x}();l.minProbeByteLength=188;function h(x,S,D,O){return{key:x,frame:!1,pts:S,dts:D,units:[],debug:O,length:0}}function p(x,S){return(x[S+10]&31)<<8|x[S+11]}function o(x,S,D,O){var A={audio:-1,avc:-1,id3:-1,isAAC:!0},C=(x[S+1]&15)<<8|x[S+2],T=S+3+C-4,d=(x[S+10]&15)<<8|x[S+11];for(S+=12+d;S<T;){var f=(x[S+1]&31)<<8|x[S+2];switch(x[S]){case 207:if(!O){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:A.audio===-1&&(A.audio=f);break;case 21:A.id3===-1&&(A.id3=f);break;case 219:if(!O){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:A.avc===-1&&(A.avc=f);break;case 3:case 4:D?A.audio===-1&&(A.audio=f,A.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((x[S+3]&15)<<8|x[S+4])+5}return A}function u(x){var S=0,D,O,A,C,T,d=x.data;if(!x||x.size===0)return null;for(;d[0].length<19&&d.length>1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}D=d[0];var b=(D[0]<<16)+(D[1]<<8)+D[2];if(b===1){if(O=(D[4]<<8)+D[5],O&&O>x.size-6)return null;var _=D[7];_&192&&(C=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,_&64?(T=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,C-T>60*9e4&&(y.logger.warn(Math.round((C-T)/9e4)+"s delta between PTS and DTS, align them"),C=T)):T=C),A=D[8];var j=A+9;if(x.size<=j)return null;x.size-=j;for(var U=new Uint8Array(x.size),w=0,M=d.length;w<M;w++){D=d[w];var I=D.byteLength;if(j)if(j>I){j-=I;continue}else D=D.subarray(j),I-=j,j=0;U.set(D,S),S+=I}return O&&(O-=A+3),{data:U,pts:C,dts:T,len:O}}return null}function s(x,S){if(x.units.length&&x.frame){if(x.pts===void 0){var D=S.samples,O=D.length;if(O){var A=D[O-1];x.pts=A.pts,x.dts=A.dts}else{S.dropped++;return}}S.samples.push(x)}x.debug.length&&y.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function a(x,S){var D=x.length;if(D>0){if(S.pts>=x[D-1].pts)x.push(S);else for(var O=D-1;O>=0;O--)if(S.pts<x[O].pts){x.splice(O,0,S);break}}else x.push(S)}function R(x){for(var S=x.byteLength,D=[],O=1;O<S-2;)x[O]===0&&x[O+1]===0&&x[O+2]===3?(D.push(O+2),O+=2):O++;if(D.length===0)return x;var A=S-D.length,C=new Uint8Array(A),T=0;for(O=0;O<A;T++,O++)T===D[0]&&(T++,D.shift()),C[O]=x[T];return C}Y.default=l},"./src/errors.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ErrorTypes",function(){return X}),N.d(Y,"ErrorDetails",function(){return H});var X;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(X||(X={}));var H;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(H||(H={}))},"./src/events.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"Events",function(){return X});var X;(function(H){H.MEDIA_ATTACHING="hlsMediaAttaching",H.MEDIA_ATTACHED="hlsMediaAttached",H.MEDIA_DETACHING="hlsMediaDetaching",H.MEDIA_DETACHED="hlsMediaDetached",H.BUFFER_RESET="hlsBufferReset",H.BUFFER_CODECS="hlsBufferCodecs",H.BUFFER_CREATED="hlsBufferCreated",H.BUFFER_APPENDING="hlsBufferAppending",H.BUFFER_APPENDED="hlsBufferAppended",H.BUFFER_EOS="hlsBufferEos",H.BUFFER_FLUSHING="hlsBufferFlushing",H.BUFFER_FLUSHED="hlsBufferFlushed",H.MANIFEST_LOADING="hlsManifestLoading",H.MANIFEST_LOADED="hlsManifestLoaded",H.MANIFEST_PARSED="hlsManifestParsed",H.LEVEL_SWITCHING="hlsLevelSwitching",H.LEVEL_SWITCHED="hlsLevelSwitched",H.LEVEL_LOADING="hlsLevelLoading",H.LEVEL_LOADED="hlsLevelLoaded",H.LEVEL_UPDATED="hlsLevelUpdated",H.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",H.LEVELS_UPDATED="hlsLevelsUpdated",H.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",H.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",H.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",H.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",H.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",H.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",H.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",H.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",H.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",H.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",H.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",H.CUES_PARSED="hlsCuesParsed",H.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",H.INIT_PTS_FOUND="hlsInitPtsFound",H.FRAG_LOADING="hlsFragLoading",H.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",H.FRAG_LOADED="hlsFragLoaded",H.FRAG_DECRYPTED="hlsFragDecrypted",H.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",H.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",H.FRAG_PARSING_METADATA="hlsFragParsingMetadata",H.FRAG_PARSED="hlsFragParsed",H.FRAG_BUFFERED="hlsFragBuffered",H.FRAG_CHANGED="hlsFragChanged",H.FPS_DROP="hlsFpsDrop",H.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",H.ERROR="hlsError",H.DESTROYING="hlsDestroying",H.KEY_LOADING="hlsKeyLoading",H.KEY_LOADED="hlsKeyLoaded",H.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",H.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return x});var X=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n(X),P=N("./src/loader/playlist-loader.ts"),K=N("./src/loader/key-loader.ts"),z=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),L=N("./src/controller/level-controller.ts"),y=N("./src/controller/fragment-tracker.ts"),m=N("./src/controller/stream-controller.ts"),g=N("./src/is-supported.ts"),l=N("./src/utils/logger.ts"),h=N("./src/config.ts"),p=N("./node_modules/eventemitter3/index.js"),o=N.n(p),u=N("./src/events.ts"),s=N("./src/errors.ts");function a(S,D){for(var O=0;O<D.length;O++){var A=D[O];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}function R(S,D,O){return D&&a(S.prototype,D),O&&a(S,O),S}var x=function(){S.isSupported=function(){return Object(g.isSupported)()};function S(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var A=this.config=Object(h.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(l.enableLogs)(A.debug),this._autoLevelCapping=-1,A.progressive&&Object(h.enableStreamingMode)(A);var C=A.abrController,T=A.bufferController,d=A.capLevelController,f=A.fpsController,b=this.abrController=new C(this),_=this.bufferController=new T(this),j=this.capLevelController=new d(this),U=new f(this),w=new P.default(this),M=new K.default(this),I=new z.default(this),v=this.levelController=new L.default(this),W=new y.FragmentTracker(this),Z=this.streamController=new m.default(this,W);j.setStreamController(Z),U.setStreamController(Z);var oe=[v,Z];this.networkControllers=oe;var fe=[w,M,b,_,j,U,I,W];this.audioTrackController=this.createController(A.audioTrackController,null,oe),this.createController(A.audioStreamController,W,oe),this.subtitleTrackController=this.createController(A.subtitleTrackController,null,oe),this.createController(A.subtitleStreamController,W,oe),this.createController(A.timelineController,null,fe),this.emeController=this.createController(A.emeController,null,fe),this.cmcdController=this.createController(A.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var D=S.prototype;return D.createController=function(A,C,T){if(A){var d=C?new A(this,C):new A(this);return T&&T.push(d),d}return null},D.on=function(A,C,T){T===void 0&&(T=this),this._emitter.on(A,C,T)},D.once=function(A,C,T){T===void 0&&(T=this),this._emitter.once(A,C,T)},D.removeAllListeners=function(A){this._emitter.removeAllListeners(A)},D.off=function(A,C,T,d){T===void 0&&(T=this),this._emitter.off(A,C,T,d)},D.listeners=function(A){return this._emitter.listeners(A)},D.emit=function(A,C,T){return this._emitter.emit(A,C,T)},D.trigger=function(A,C){if(this.config.debug)return this.emit(A,A,C);try{return this.emit(A,A,C)}catch(T){l.logger.error("An internal error happened while handling event "+A+'. Error message: "'+T.message+'". Here is a stacktrace:',T),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:A,error:T})}return!1},D.listenerCount=function(A){return this._emitter.listenerCount(A)},D.destroy=function(){l.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(A){return A.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(A){return A.destroy()}),this.coreComponents.length=0},D.attachMedia=function(A){l.logger.log("attachMedia"),this._media=A,this.trigger(u.Events.MEDIA_ATTACHING,{media:A})},D.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(A){this.stopLoad();var C=this.media,T=this.url,d=this.url=X.buildAbsoluteURL(self.location.href,A,{alwaysNormalize:!0});l.logger.log("loadSource:"+d),C&&T&&T!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(C)),this.trigger(u.Events.MANIFEST_LOADING,{url:A})},D.startLoad=function(A){A===void 0&&(A=-1),l.logger.log("startLoad("+A+")"),this.networkControllers.forEach(function(C){C.startLoad(A)})},D.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(A){A.stopLoad()})},D.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){l.logger.log("recoverMediaError");var A=this._media;this.detachMedia(),A&&this.attachMedia(A)},D.removeLevel=function(A,C){C===void 0&&(C=0),this.levelController.removeLevel(A,C)},R(S,[{key:"levels",get:function(){var A=this.levelController.levels;return A||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(A){l.logger.log("set currentLevel:"+A),this.loadLevel=A,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(A){l.logger.log("set nextLevel:"+A),this.levelController.manualLevel=A,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(A){l.logger.log("set loadLevel:"+A),this.levelController.manualLevel=A}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(A){this.levelController.nextLoadLevel=A}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(A){l.logger.log("set firstLevel:"+A),this.levelController.firstLevel=A}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(A){l.logger.log("set startLevel:"+A),A!==-1&&(A=Math.max(A,this.minAutoLevel)),this.levelController.startLevel=A}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(A){var C=!!A;C!==this.config.capLevelToPlayerSize&&(C?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=C)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(A){this._autoLevelCapping!==A&&(l.logger.log("set autoLevelCapping:"+A),this._autoLevelCapping=A)}},{key:"bandwidthEstimate",get:function(){var A=this.abrController.bwEstimator;return A?A.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var A=this.levels,C=this.config.minAutoBitrate;if(!A)return 0;for(var T=A.length,d=0;d<T;d++)if(A[d].maxBitrate>C)return d;return 0}},{key:"maxAutoLevel",get:function(){var A=this.levels,C=this.autoLevelCapping,T;return C===-1&&A&&A.length?T=A.length-1:T=C,T}},{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 S.defaultConfig?S.defaultConfig:h.hlsDefaultConfig},set:function(A){S.defaultConfig=A}}]),S}();x.defaultConfig=void 0},"./src/is-supported.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return P}),N.d(Y,"changeTypeSupported",function(){return K});var X=N("./src/utils/mediasource-helper.ts");function H(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var z=Object(X.getMediaSource)();if(!z)return!1;var n=H(),L=z&&typeof z.isTypeSupported=="function"&&z.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!L&&!!y}function K(){var z,n=H();return typeof(n==null||((z=n.prototype)===null||z===void 0)?void 0:z.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l}),N.d(Y,"LoadError",function(){return p});var X=N("./src/polyfills/number.ts"),H=N("./src/errors.ts");function P(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,y(o,u)}function K(o){var u=typeof Map=="function"?new Map:void 0;return K=function(a){if(a===null||!L(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,R)}function R(){return z(a,arguments,m(this).constructor)}return R.prototype=Object.create(a.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),y(R,a)},K(o)}function z(o,u,s){return n()?z=Reflect.construct:z=function(R,x,S){var D=[null];D.push.apply(D,x);var O=Function.bind.apply(R,D),A=new O;return S&&y(A,S.prototype),A},z.apply(null,arguments)}function n(){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 L(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function y(o,u){return y=Object.setPrototypeOf||function(a,R){return a.__proto__=R,a},y(o,u)}function m(o){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},m(o)}var g=Math.pow(2,17),l=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,R){var x=this,S=a.url;if(!S)return Promise.reject(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(C,T){x.loader&&x.loader.destroy();var d=x.loader=a.loader=O?new O(D):new A(D),f=h(a),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:g};a.stats=d.stats,d.load(f,b,{onSuccess:function(j,U,w,M){x.resetLoader(a,d),C({frag:a,part:null,payload:j.data,networkDetails:M})},onError:function(j,U,w){x.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,response:j,networkDetails:w}))},onAbort:function(j,U,w){x.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,networkDetails:w}))},onTimeout:function(j,U,w){x.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,networkDetails:w}))},onProgress:function(j,U,w,M){R&&R({frag:a,part:null,payload:w,networkDetails:M})}})})},u.loadPart=function(a,R,x){var S=this;this.abort();var D=this.config,O=D.fLoader,A=D.loader;return new Promise(function(C,T){S.loader&&S.loader.destroy();var d=S.loader=a.loader=O?new O(D):new A(D),f=h(a,R),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:g};R.stats=d.stats,d.load(f,b,{onSuccess:function(j,U,w,M){S.resetLoader(a,d),S.updateStatsFromPart(a,R);var I={frag:a,part:R,payload:j.data,networkDetails:M};x(I),C(I)},onError:function(j,U,w){S.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:a,part:R,response:j,networkDetails:w}))},onAbort:function(j,U,w){a.stats.aborted=R.stats.aborted,S.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:a,part:R,networkDetails:w}))},onTimeout:function(j,U,w){S.resetLoader(a,d),T(new p({type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:a,part:R,networkDetails:w}))}})})},u.updateStatsFromPart=function(a,R){var x=a.stats,S=R.stats,D=S.total;if(x.loaded+=S.loaded,D){var O=Math.round(a.duration/R.duration),A=Math.min(Math.round(x.loaded/D),O),C=O-A,T=C*Math.round(x.loaded/A);x.total=x.loaded+T}else x.total=Math.max(x.loaded,x.total);var d=x.loading,f=S.loading;d.start?d.first+=f.first-f.start:(d.start=f.start,d.first=f.first),d.end=f.end},u.resetLoader=function(a,R){a.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function h(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},R=s.byteRangeStartOffset,x=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(R)&&Object(X.isFiniteNumber)(x)&&(a.rangeStart=R,a.rangeEnd=x),a}var p=function(o){P(u,o);function u(s){for(var a,R=arguments.length,x=new Array(R>1?R-1:0),S=1;S<R;S++)x[S-1]=arguments[S];return a=o.call.apply(o,[this].concat(x))||this,a.data=void 0,a.data=s,a}return u}(K(Error))},"./src/loader/fragment.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ElementaryStreamTypes",function(){return l}),N.d(Y,"BaseSegment",function(){return h}),N.d(Y,"Fragment",function(){return p}),N.d(Y,"Part",function(){return o});var X=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(H),K=N("./src/utils/logger.ts"),z=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function L(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,y(u,s)}function y(u,s){return y=Object.setPrototypeOf||function(R,x){return R.__proto__=x,R},y(u,s)}function m(u,s){for(var a=0;a<s.length;a++){var R=s[a];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(u,R.key,R)}}function g(u,s,a){return s&&m(u.prototype,s),a&&m(u,a),u}var l;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(l||(l={}));var h=function(){function u(a){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[l.AUDIO]=null,R[l.VIDEO]=null,R[l.AUDIOVIDEO]=null,R),this.baseurl=a}var s=u.prototype;return s.setByteRange=function(R,x){var S=R.split("@",2),D=[];S.length===1?D[0]=x?x.byteRangeEndOffset:0:D[0]=parseInt(S[1]),D[1]=parseInt(S[0])+D[0],this._byteRange=D},g(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(H.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),u}(),p=function(u){L(s,u);function s(R,x){var S;return S=u.call(this,x)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new n.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=R,S}var a=s.prototype;return a.createInitializationVector=function(x){for(var S=new Uint8Array(16),D=12;D<16;D++)S[D]=x>>8*(15-D)&255;return S},a.setDecryptDataFromLevelKey=function(x,S){var D=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(D=z.LevelKey.fromURI(x.uri),D.method=x.method,D.iv=this.createInitializationVector(S),D.keyFormat="identity"),D},a.setElementaryStreamInfo=function(x,S,D,O,A,C){C===void 0&&(C=!1);var T=this.elementaryStreams,d=T[x];if(!d){T[x]={startPTS:S,endPTS:D,startDTS:O,endDTS:A,partial:C};return}d.startPTS=Math.min(d.startPTS,S),d.endPTS=Math.max(d.endPTS,D),d.startDTS=Math.min(d.startDTS,O),d.endDTS=Math.max(d.endDTS,A)},a.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[l.AUDIO]=null,x[l.VIDEO]=null,x[l.AUDIOVIDEO]=null},g(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="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'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}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 x=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),s}(h),o=function(u){L(s,u);function s(a,R,x,S,D){var O;O=u.call(this,x)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=a.decimalFloatingPoint("DURATION"),O.gap=a.bool("GAP"),O.independent=a.bool("INDEPENDENT"),O.relurl=a.enumeratedString("URI"),O.fragment=R,O.index=S;var A=a.enumeratedString("BYTERANGE");return A&&O.setByteRange(A,D),D&&(O.fragOffset=D.fragOffset+D.duration),O}return g(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 R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),s}(h)},"./src/loader/key-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var X=N("./src/events.ts"),H=N("./src/errors.ts"),P=N("./src/utils/logger.ts"),K=function(){function z(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var n=z.prototype;return n._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var m=this.loaders[y];m&&m.destroy()}this.loaders={}},n.onKeyLoading=function(y,m){var g=m.frag,l=g.type,h=this.loaders[l];if(!g.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=g.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(h&&(P.logger.warn("abort previous key loader for type:"+l),h.abort()),!p){P.logger.warn("key uri is falsy");return}var u=o.loader,s=g.loader=this.loaders[l]=new u(o);this.decrypturl=p,this.decryptkey=null;var a={url:p,frag:g,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(a,R,x)}else this.decryptkey&&(g.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:g}))},n.loadsuccess=function(y,m,g){var l=g.frag;if(!l.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(y.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:l})},n.loaderror=function(y,m){var g=m.frag,l=g.loader;l&&l.abort(),delete this.loaders[g.type],this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:g,response:y})},n.loadtimeout=function(y,m){var g=m.frag,l=g.loader;l&&l.abort(),delete this.loaders[g.type],this.hls.trigger(X.Events.ERROR,{type:H.ErrorTypes.NETWORK_ERROR,details:H.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:g})},z}()},"./src/loader/level-details.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return z});var X=N("./src/polyfills/number.ts");function H(n,L){for(var y=0;y<L.length;y++){var m=L[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function P(n,L,y){return L&&H(n.prototype,L),y&&H(n,y),n}var K=10,z=function(){function n(y){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=y}var L=n.prototype;return L.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var g=this.lastPartSn-m.lastPartSn,l=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!l||!!g,this.advanced=this.endSN>m.endSN||g>0||g===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},P(n,[{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 g=this.driftEnd-this.driftStart;return g*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}}]),n}()},"./src/loader/level-key.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return z});var X=N("./node_modules/url-toolkit/src/url-toolkit.js"),H=N.n(X);function P(n,L){for(var y=0;y<L.length;y++){var m=L[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(n,m.key,m)}}function K(n,L,y){return L&&P(n.prototype,L),y&&P(n,y),n}var z=function(){n.fromURL=function(y,m){return new n(y,m)},n.fromURI=function(y){return new n(y)};function n(L,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(X.buildAbsoluteURL)(L,y,{alwaysNormalize:!0}):this._uri=L}return K(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s});var X=N("./src/polyfills/number.ts"),H=N("./node_modules/url-toolkit/src/url-toolkit.js"),P=N.n(H),K=N("./src/loader/fragment.ts"),z=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),L=N("./src/utils/attr-list.ts"),y=N("./src/utils/logger.ts"),m=N("./src/utils/codecs.ts"),g=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,h=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function u(D){var O,A;return o.test((O=(A=H.parseURL(D))===null||A===void 0?void 0:A.path)!=null?O:"")}var s=function(){function D(){}return D.findGroup=function(A,C){for(var T=0;T<A.length;T++){var d=A[T];if(d.id===C)return d}},D.convertAVC1ToAVCOTI=function(A){var C=A.split(".");if(C.length>2){var T=C.shift()+".";return T+=parseInt(C.shift()).toString(16),T+=("000"+parseInt(C.shift()).toString(16)).substr(-4),T}return A},D.resolve=function(A,C){return H.buildAbsoluteURL(C,A,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(A,C){var T=[],d={},f=!1;g.lastIndex=0;for(var b;(b=g.exec(A))!=null;)if(b[1]){var _=new L.AttrList(b[1]),j={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:D.resolve(b[2],C)},U=_.decimalResolution("RESOLUTION");U&&(j.width=U.width,j.height=U.height),a((_.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=D.convertAVC1ToAVCOTI(j.videoCodec)),T.push(j)}else if(b[3]){var w=new L.AttrList(b[3]);w["DATA-ID"]&&(f=!0,d[w["DATA-ID"]]=w)}return{levels:T,sessionData:f?d:null}},D.parseMasterPlaylistMedia=function(A,C,T,d){d===void 0&&(d=[]);var f,b=[],_=0;for(l.lastIndex=0;(f=l.exec(A))!==null;){var j=new L.AttrList(f[1]);if(j.TYPE===T){var U={attrs:j,bitrate:0,id:_++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:T,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?D.resolve(j.URI,C):""};if(d.length){var w=D.findGroup(d,U.groupId)||d[0];R(U,w,"audioCodec"),R(U,w,"textCodec")}b.push(U)}}return b},D.parseLevelPlaylist=function(A,C,T,d,f){var b=new z.LevelDetails(C),_=b.fragments,j=null,U=0,w=0,M=0,I=0,v=null,W=new K.Fragment(d,C),Z,oe,fe,Ae=-1,be=!1;for(h.lastIndex=0,b.m3u8=A;(Z=h.exec(A))!==null;){be&&(be=!1,W=new K.Fragment(d,C),W.start=M,W.sn=U,W.cc=I,W.level=T,j&&(W.initSegment=j,W.rawProgramDateTime=j.rawProgramDateTime));var Re=Z[1];if(Re){W.duration=parseFloat(Re);var Ce=(" "+Z[2]).slice(1);W.title=Ce||null,W.tagList.push(Ce?["INF",Re,Ce]:["INF",Re])}else if(Z[3])Object(X.isFiniteNumber)(W.duration)&&(W.start=M,fe&&(W.levelkey=fe),W.sn=U,W.level=T,W.cc=I,W.urlId=f,_.push(W),W.relurl=(" "+Z[3]).slice(1),S(W,v),v=W,M+=W.duration,U++,w=0,be=!0);else if(Z[4]){var Le=(" "+Z[4]).slice(1);v?W.setByteRange(Le,v):W.setByteRange(Le)}else if(Z[5])W.rawProgramDateTime=(" "+Z[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Ae===-1&&(Ae=_.length);else{if(Z=Z[0].match(p),!Z){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<Z.length&&!(typeof Z[oe]!="undefined");oe++);var ve=(" "+Z[oe]).slice(1),$=(" "+Z[oe+1]).slice(1),E=Z[oe+2]?(" "+Z[oe+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":b.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":U=b.startSN=parseInt($);break;case"SKIP":{var k=new L.AttrList($),B=k.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(B)){b.skippedSegments=B;for(var Q=B;Q--;)_.unshift(null);U+=B}var G=k.enumeratedString("RECENTLY-REMOVED-DATERANGES");G&&(b.recentlyRemovedDateranges=G.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat($);break;case"VERSION":b.version=parseInt($);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":($||E)&&W.tagList.push(E?[$,E]:[$]);break;case"DIS":I++;case"GAP":W.tagList.push([ve]);break;case"BITRATE":W.tagList.push([ve,$]);break;case"DISCONTINUITY-SEQ":I=parseInt($);break;case"KEY":{var he,xe=new L.AttrList($),Ie=xe.enumeratedString("METHOD"),ue=xe.URI,ge=xe.hexadecimalInteger("IV"),_e=xe.enumeratedString("KEYFORMATVERSIONS"),Se=xe.enumeratedString("KEYID"),Pe=(he=xe.enumeratedString("KEYFORMAT"))!=null?he:"identity",Ue=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ue.indexOf(Pe)>-1){y.logger.warn("Keyformat "+Pe+" is not supported from the manifest");continue}else if(Pe!=="identity")continue;Ie&&(fe=n.LevelKey.fromURL(C,ue),ue&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(fe.method=Ie,fe.keyFormat=Pe,Se&&(fe.keyID=Se),_e&&(fe.keyFormatVersions=_e),fe.iv=ge));break}case"START":{var He=new L.AttrList($),Be=He.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Be)&&(b.startTimeOffset=Be);break}case"MAP":{var Qe=new L.AttrList($);W.relurl=Qe.URI,Qe.BYTERANGE&&W.setByteRange(Qe.BYTERANGE),W.level=T,W.sn="initSegment",fe&&(W.levelkey=fe),W.initSegment=null,j=W,be=!0;break}case"SERVER-CONTROL":{var ze=new L.AttrList($);b.canBlockReload=ze.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=ze.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&ze.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=ze.optionalFloat("PART-HOLD-BACK",0),b.holdBack=ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new L.AttrList($);b.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Me=b.partList;Me||(Me=b.partList=[]);var it=w>0?Me[Me.length-1]:void 0,Ze=w++,ce=new K.Part(new L.AttrList($),W,C,Ze,it);Me.push(ce),W.duration+=ce.duration;break}case"PRELOAD-HINT":{var ee=new L.AttrList($);b.preloadHint=ee;break}case"RENDITION-REPORT":{var ne=new L.AttrList($);b.renditionReports=b.renditionReports||[],b.renditionReports.push(ne);break}default:y.logger.warn("line parsed but not handled: "+Z);break}}}v&&!v.relurl?(_.pop(),M-=v.duration,b.partList&&(b.fragmentHint=v)):b.partList&&(S(W,v),W.cc=I,b.fragmentHint=W);var ae=_.length,de=_[0],re=_[ae-1];if(M+=b.skippedSegments*b.targetduration,M>0&&ae&&re){b.averagetargetduration=M/ae;var se=re.sn;b.endSN=se!=="initSegment"?se:0,de&&(b.startCC=de.cc,de.initSegment||b.fragments.every(function(pe){return pe.relurl&&u(pe.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new K.Fragment(d,C),W.relurl=re.relurl,W.level=T,W.sn="initSegment",de.initSegment=W,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(M+=b.fragmentHint.duration),b.totalduration=M,b.endCC=I,Ae>0&&x(_,Ae),b},D}();function a(D,O){["video","audio","text"].forEach(function(A){var C=D.filter(function(d){return Object(m.isCodecType)(d,A)});if(C.length){var T=C.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});O[A+"Codec"]=T.length>0?T[0]:C[0],D=D.filter(function(d){return C.indexOf(d)===-1})}}),O.unknownCodecs=D}function R(D,O,A){var C=O[A];C&&(D[A]=C)}function x(D,O){for(var A=D[O],C=O;C--;){var T=D[C];if(!T)return;T.programDateTime=A.programDateTime-T.duration*1e3,A=T}}function S(D,O){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):O!=null&&O.programDateTime&&(D.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/polyfills/number.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),K=N("./src/utils/logger.ts"),z=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),L=N("./src/types/loader.ts"),y=N("./src/utils/attr-list.ts");function m(h){var p=h.type;switch(p){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function g(h,p){var o=h.url;return(o===void 0||o.indexOf("data:")===0)&&(o=p.url),o}var l=function(){function h(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var p=h.prototype;return p.registerListeners=function(){var u=this.hls;u.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(H.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(H.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(u){var s=this.hls.config,a=s.pLoader,R=s.loader,x=a||R,S=new x(s);return u.loader=S,this.loaders[u.type]=S,S},p.getInternalLoader=function(u){return this.loaders[u.type]},p.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},p.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(u,s){var a=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:a,deliveryDirectives:null})},p.onLevelLoading=function(u,s){var a=s.id,R=s.level,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:null,level:R,responseType:"text",type:L.PlaylistContextType.LEVEL,url:x,deliveryDirectives:S})},p.onAudioTrackLoading=function(u,s){var a=s.id,R=s.groupId,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:S})},p.onSubtitleTrackLoading=function(u,s){var a=s.id,R=s.groupId,x=s.url,S=s.deliveryDirectives;this.load({id:a,groupId:R,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:S})},p.load=function(u){var s,a=this.hls.config,R=this.getInternalLoader(u);if(R){var x=R.context;if(x&&x.url===u.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),R.abort()}var S,D,O,A;switch(u.type){case L.PlaylistContextType.MANIFEST:S=a.manifestLoadingMaxRetry,D=a.manifestLoadingTimeOut,O=a.manifestLoadingRetryDelay,A=a.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:S=0,D=a.levelLoadingTimeOut;break;default:S=a.levelLoadingMaxRetry,D=a.levelLoadingTimeOut,O=a.levelLoadingRetryDelay,A=a.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var C;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?C=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?C=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(C=this.hls.subtitleTracks[u.id].details),C){var T=C.partTarget,d=C.targetduration;T&&d&&(D=Math.min(Math.max(T*3,d*.8)*1e3,D))}}var f={timeout:D,maxRetry:S,retryDelay:O,maxRetryDelay:A,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(u,f,b)},p.loadsuccess=function(u,s,a,R){if(R===void 0&&(R=null),a.isSidxRequest){this.handleSidxRequest(u,a),this.handlePlaylistLoaded(u,s,a,R);return}this.resetInternalLoader(a.type);var x=u.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,a,"no EXTM3U delimiter",R);return}s.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,a,R):this.handleMasterPlaylist(u,s,a,R)},p.loaderror=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!1,u)},p.loadtimeout=function(u,s,a){a===void 0&&(a=null),this.handleNetworkError(s,a,!0)},p.handleMasterPlaylist=function(u,s,a,R){var x=this.hls,S=u.data,D=g(u,a),O=n.default.parseMasterPlaylist(S,D),A=O.levels,C=O.sessionData;if(!A.length){this.handleManifestParsingError(u,a,"no level found in manifest",R);return}var T=A.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),d=A.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),f=n.default.parseMasterPlaylistMedia(S,D,"AUDIO",T),b=n.default.parseMasterPlaylistMedia(S,D,"SUBTITLES",d),_=n.default.parseMasterPlaylistMedia(S,D,"CLOSED-CAPTIONS");if(f.length){var j=f.some(function(U){return!U.url});!j&&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"),f.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}x.trigger(H.Events.MANIFEST_LOADED,{levels:A,audioTracks:f,subtitles:b,captions:_,url:D,stats:s,networkDetails:R,sessionData:C})},p.handleTrackOrLevelPlaylist=function(u,s,a,R){var x=this.hls,S=a.id,D=a.level,O=a.type,A=g(u,a),C=Object(X.isFiniteNumber)(S)?S:0,T=Object(X.isFiniteNumber)(D)?D:C,d=m(a),f=n.default.parseLevelPlaylist(u.data,A,T,d,C);if(!f.fragments.length){x.trigger(H.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.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(O===L.PlaylistContextType.MANIFEST){var b={attrs:new y.AttrList({}),bitrate:0,details:f,name:"",url:A};x.trigger(H.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:A,stats:s,networkDetails:R,sessionData:null})}if(s.parsing.end=performance.now(),f.needSidxRanges){var _,j=(_=f.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:j,isSidxRequest:!0,type:O,level:D,levelDetails:f,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}a.levelDetails=f,this.handlePlaylistLoaded(u,s,a,R)},p.handleSidxRequest=function(u,s){var a=Object(z.parseSegmentIndex)(new Uint8Array(u.data));if(!a)return;var R=a.references,x=s.levelDetails;R.forEach(function(S,D){var O=S.info,A=x.fragments[D];A.byteRange.length===0&&A.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),A.initSegment&&A.initSegment.setByteRange(String(a.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,s,a,R){this.hls.trigger(H.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:u.url,reason:a,response:u,context:s,networkDetails:R})},p.handleNetworkError=function(u,s,a,R){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 x=P.ErrorDetails.UNKNOWN,S=!1,D=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:x=a?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case L.PlaylistContextType.LEVEL:x=a?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.AUDIO_TRACK:x=a?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:x=a?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}D&&this.resetInternalLoader(u.type);var O={type:P.ErrorTypes.NETWORK_ERROR,details:x,fatal:S,url:u.url,loader:D,context:u,networkDetails:s};R&&(O.response=R),this.hls.trigger(H.Events.ERROR,O)},p.handlePlaylistLoaded=function(u,s,a,R){var x=a.type,S=a.level,D=a.id,O=a.groupId,A=a.loader,C=a.levelDetails,T=a.deliveryDirectives;if(!(C!=null&&C.targetduration)){this.handleManifestParsingError(u,a,"invalid target duration",R);return}if(!A)return;C.live&&(A.getCacheAge&&(C.ageHeader=A.getCacheAge()||0),(!A.getCacheAge||isNaN(C.ageHeader))&&(C.ageHeader=0));switch(x){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(H.Events.LEVEL_LOADED,{details:C,level:S||0,id:D||0,stats:s,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(H.Events.AUDIO_TRACK_LOADED,{details:C,id:D||0,groupId:O||"",stats:s,networkDetails:R,deliveryDirectives:T});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADED,{details:C,id:D||0,groupId:O||"",stats:s,networkDetails:R,deliveryDirectives:T});break}},h}();Y.default=l},"./src/polyfills/number.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return X}),N.d(Y,"MAX_SAFE_INTEGER",function(){return H});var X=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},H=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(le,Y,N){"use strict";N.r(Y);var X=function(){function H(){}return H.getSilentFrame=function(K,z){switch(K){case"mp4a.40.2":if(z===1)return new Uint8Array([0,200,0,128,35,128]);if(z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(z===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(z===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(z===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(z===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(z===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},H}();Y.default=X},"./src/remux/mp4-generator.ts":function(le,Y,N){"use strict";N.r(Y);var X=Math.pow(2,32)-1,H=function(){function P(){}return P.init=function(){P.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 z;for(z in P.types)P.types.hasOwnProperty(z)&&(P.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var n=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]),L=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]);P.HDLR_TYPES={video:n,audio:L};var y=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]);P.STTS=P.STSC=P.STCO=m,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var g=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),h=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,g,h,g,l),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,y))},P.box=function(z){for(var n=8,L=arguments.length,y=new Array(L>1?L-1:0),m=1;m<L;m++)y[m-1]=arguments[m];for(var g=y.length,l=g;g--;)n+=y[g].byteLength;var h=new Uint8Array(n);for(h[0]=n>>24&255,h[1]=n>>16&255,h[2]=n>>8&255,h[3]=n&255,h.set(z,4),g=0,n=8;g<l;g++)h.set(y[g],n),n+=y[g].byteLength;return h},P.hdlr=function(z){return P.box(P.types.hdlr,P.HDLR_TYPES[z])},P.mdat=function(z){return P.box(P.types.mdat,z)},P.mdhd=function(z,n){n*=z;var L=Math.floor(n/(X+1)),y=Math.floor(n%(X+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,z>>24&255,z>>16&255,z>>8&255,z&255,L>>24,L>>16&255,L>>8&255,L&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},P.mdia=function(z){return P.box(P.types.mdia,P.mdhd(z.timescale,z.duration),P.hdlr(z.type),P.minf(z))},P.mfhd=function(z){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,z>>24,z>>16&255,z>>8&255,z&255]))},P.minf=function(z){return z.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(z)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(z))},P.moof=function(z,n,L){return P.box(P.types.moof,P.mfhd(z),P.traf(L,n))},P.moov=function(z){for(var n=z.length,L=[];n--;)L[n]=P.trak(z[n]);return P.box.apply(null,[P.types.moov,P.mvhd(z[0].timescale,z[0].duration)].concat(L).concat(P.mvex(z)))},P.mvex=function(z){for(var n=z.length,L=[];n--;)L[n]=P.trex(z[n]);return P.box.apply(null,[P.types.mvex].concat(L))},P.mvhd=function(z,n){n*=z;var L=Math.floor(n/(X+1)),y=Math.floor(n%(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,z>>24&255,z>>16&255,z>>8&255,z&255,L>>24,L>>16&255,L>>8&255,L&255,y>>24,y>>16&255,y>>8&255,y&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 P.box(P.types.mvhd,m)},P.sdtp=function(z){var n=z.samples||[],L=new Uint8Array(4+n.length),y,m;for(y=0;y<n.length;y++)m=n[y].flags,L[y+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return P.box(P.types.sdtp,L)},P.stbl=function(z){return P.box(P.types.stbl,P.stsd(z),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(z){var n=[],L=[],y,m,g;for(y=0;y<z.sps.length;y++)m=z.sps[y],g=m.byteLength,n.push(g>>>8&255),n.push(g&255),n=n.concat(Array.prototype.slice.call(m));for(y=0;y<z.pps.length;y++)m=z.pps[y],g=m.byteLength,L.push(g>>>8&255),L.push(g&255),L=L.concat(Array.prototype.slice.call(m));var l=P.box(P.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|z.sps.length].concat(n).concat([z.pps.length]).concat(L))),h=z.width,p=z.height,o=z.pixelRatio[0],u=z.pixelRatio[1];return P.box(P.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,h>>8&255,h&255,p>>8&255,p&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]),l,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},P.esds=function(z){var n=z.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(z.config).concat([6,1,2]))},P.mp4a=function(z){var n=z.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),P.box(P.types.esds,P.esds(z)))},P.mp3=function(z){var n=z.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},P.stsd=function(z){return z.type==="audio"?!z.isAAC&&z.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(z)):P.box(P.types.stsd,P.STSD,P.mp4a(z)):P.box(P.types.stsd,P.STSD,P.avc1(z))},P.tkhd=function(z){var n=z.id,L=z.duration*z.timescale,y=z.width,m=z.height,g=Math.floor(L/(X+1)),l=Math.floor(L%(X+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,l>>24,l>>16&255,l>>8&255,l&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,y>>8&255,y&255,0,0,m>>8&255,m&255,0,0]))},P.traf=function(z,n){var L=P.sdtp(z),y=z.id,m=Math.floor(n/(X+1)),g=Math.floor(n%(X+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,g>>24,g>>16&255,g>>8&255,g&255])),P.trun(z,L.length+16+20+8+16+8+8),L)},P.trak=function(z){return z.duration=z.duration||4294967295,P.box(P.types.trak,P.tkhd(z),P.mdia(z))},P.trex=function(z){var n=z.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(z,n){var L=z.samples||[],y=L.length,m=12+16*y,g=new Uint8Array(m),l,h,p,o,u,s;for(n+=8+m,g.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),l=0;l<y;l++)h=L[l],p=h.duration,o=h.size,u=h.flags,s=h.cts,g.set([p>>>24&255,p>>>16&255,p>>>8&255,p&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*l);return P.box(P.types.trun,g)},P.initSegment=function(z){P.types||P.init();var n=P.moov(z),L=new Uint8Array(P.FTYP.byteLength+n.byteLength);return L.set(P.FTYP),L.set(n,P.FTYP.byteLength),L},P}();H.types=void 0,H.HDLR_TYPES=void 0,H.STTS=void 0,H.STSC=void 0,H.STCO=void 0,H.STSZ=void 0,H.VMHD=void 0,H.SMHD=void 0,H.STSD=void 0,H.FTYP=void 0,H.DINF=void 0,Y.default=H},"./src/remux/mp4-remuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"normalizePts",function(){return a});var X=N("./src/polyfills/number.ts"),H=N("./src/remux/aac-helper.ts"),P=N("./src/remux/mp4-generator.ts"),K=N("./src/events.ts"),z=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),L=N("./src/types/loader.ts"),y=N("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var O=1;O<arguments.length;O++){var A=arguments[O];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(D[C]=A[C])}return D},m.apply(this,arguments)}var g=10*1e3,l=1024,h=1152,p=null,o=null,u=!1,s=function(){function D(A,C,T,d){if(d===void 0&&(d=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=A,this.config=C,this.typeSupported=T,this.ISGenerated=!1,p===null){var f=navigator.userAgent||"",b=f.match(/Chrome\/(\d+)/i);p=b?parseInt(b[1]):0}if(o===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);o=_?parseInt(_[1]):0}u=!!p&&p<75||!!o&&o<600}var O=D.prototype;return O.destroy=function(){},O.resetTimeStamp=function(C){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=C},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(C){var T=!1,d=C.reduce(function(f,b){var _=b.pts-f;return _<-4294967296?(T=!0,a(f,b.pts)):_>0?f:b.pts},C[0].pts);return T&&n.logger.debug("PTS rollover detected"),d},O.remux=function(C,T,d,f,b,_,j,U){var w,M,I,v,W,Z,oe=b,fe=b,Ae=C.pid>-1,be=T.pid>-1,Re=T.samples.length,Ce=C.samples.length>0,Le=Re>1,ve=(!Ae||Ce)&&(!be||Le)||this.ISGenerated||j;if(ve){this.ISGenerated||(I=this.generateIS(C,T,b));var $=this.isVideoContiguous,E=-1;if(Le&&(E=R(T.samples),!$&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,E>0){n.logger.warn("[mp4-remuxer]: Dropped "+E+" out of "+Re+" video samples due to a missing keyframe");var k=this.getVideoStartPts(T.samples);T.samples=T.samples.slice(E),T.dropped+=E,fe+=(T.samples[0].pts-k)/(T.timescale||9e4)}else E===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),Z=!1);if(this.ISGenerated){if(Ce&&Le){var B=this.getVideoStartPts(T.samples),Q=a(C.samples[0].pts,B)-B,G=Q/T.inputTimeScale;oe+=Math.max(0,G),fe+=Math.max(0,-G)}if(Ce){if(C.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(C,T,b)),M=this.remuxAudio(C,oe,this.isAudioContiguous,_,be||Le||U===L.PlaylistLevelType.AUDIO?fe:void 0),Le){var he=M?M.endPTS-M.startPTS:0;T.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(C,T,b)),w=this.remuxVideo(T,fe,$,he)}}else Le&&(w=this.remuxVideo(T,fe,$,0));w&&(w.firstKeyFrame=E,w.independent=E!==-1)}}return this.ISGenerated&&(d.samples.length&&(W=this.remuxID3(d,b)),f.samples.length&&(v=this.remuxText(f,b))),{audio:M,video:w,initSegment:I,independent:Z,text:v,id3:W}},O.generateIS=function(C,T,d){var f=C.samples,b=T.samples,_=this.typeSupported,j={},U=!Object(X.isFiniteNumber)(this._initPTS),w="audio/mp4",M,I,v;if(U&&(M=I=Infinity),C.config&&f.length&&(C.timescale=C.samplerate,C.isAAC||(_.mpeg?(w="audio/mpeg",C.codec=""):_.mp3&&(C.codec="mp3")),j.audio={id:"audio",container:w,codec:C.codec,initSegment:!C.isAAC&&_.mpeg?new Uint8Array(0):P.default.initSegment([C]),metadata:{channelCount:C.channelCount}},U&&(v=C.inputTimeScale,M=I=f[0].pts-Math.round(v*d))),T.sps&&T.pps&&b.length&&(T.timescale=T.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:T.codec,initSegment:P.default.initSegment([T]),metadata:{width:T.width,height:T.height}},U)){v=T.inputTimeScale;var W=this.getVideoStartPts(b),Z=Math.round(v*d);I=Math.min(I,a(b[0].dts,W)-Z),M=Math.min(M,W-Z)}if(Object.keys(j).length)return this.ISGenerated=!0,U&&(this._initPTS=M,this._initDTS=I),{tracks:j,initPTS:M,timescale:v}},O.remuxVideo=function(C,T,d,f){var b=C.inputTimeScale,_=C.samples,j=[],U=_.length,w=this._initPTS,M=this.nextAvcDts,I=8,v,W,Z,oe=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Ae=0,be=!1;if(!d||M===null){var Re=T*b,Ce=_[0].pts-a(_[0].dts,_[0].pts);M=Re-Ce}for(var Le=0;Le<U;Le++){var ve=_[Le];if(ve.pts=a(ve.pts-w,M),ve.dts=a(ve.dts-w,M),ve.dts>ve.pts){var $=9e4*.2;Ae=Math.max(Math.min(Ae,ve.pts-ve.dts),-1*$)}ve.dts<_[Le>0?Le-1:Le].dts&&(be=!0)}be&&_.sort(function(xt,ut){var ot=xt.dts-ut.dts,Tt=xt.pts-ut.pts;return ot||Tt}),W=_[0].dts,Z=_[_.length-1].dts;var E=Math.round((Z-W)/(U-1));if(Ae<0){if(Ae<E*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-E,!0)+" ms");for(var k=Ae,B=0;B<U;B++)_[B].dts=k=Math.max(k,_[B].pts-E),_[B].pts=Math.max(k,_[B].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Ae,!0)+" ms to overcome this issue");for(var Q=0;Q<U;Q++)_[Q].dts=_[Q].dts+Ae}W=_[0].dts}if(d){var G=W-M,he=G>E,xe=G<-1;if(he||xe){he?n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(G,!0)+" ms ("+G+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-G,!0)+" ms ("+G+"dts) overlapping between fragments detected"),W=M;var Ie=_[0].pts-G;_[0].dts=W,_[0].pts=Ie,n.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(y.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(G,!0)+" ms")}}u&&(W=Math.max(0,W));for(var ue=0,ge=0,_e=0;_e<U;_e++){for(var Se=_[_e],Pe=Se.units,Ue=Pe.length,He=0,Be=0;Be<Ue;Be++)He+=Pe[Be].data.length;ge+=He,ue+=Ue,Se.length=He,Se.dts=Math.max(Se.dts,W),Se.pts=Math.max(Se.pts,Se.dts,0),oe=Math.min(Se.pts,oe),fe=Math.max(Se.pts,fe)}Z=_[U-1].dts;var Qe=ge+4*ue+8,ze;try{ze=new Uint8Array(Qe)}catch(xt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating video mdat "+Qe});return}var Ye=new DataView(ze.buffer);Ye.setUint32(0,Qe),ze.set(P.default.types.mdat,4);for(var Me=0;Me<U;Me++){for(var it=_[Me],Ze=it.units,ce=0,ee=0,ne=Ze.length;ee<ne;ee++){var ae=Ze[ee],de=ae.data,re=ae.data.byteLength;Ye.setUint32(I,re),I+=4,ze.set(de,I),I+=re,ce+=4+re}if(Me<U-1)v=_[Me+1].dts-it.dts;else{var se=this.config,pe=it.dts-_[Me>0?Me-1:Me].dts;if(se.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(se.maxBufferHole*b),Te=(f?oe+f*b:this.nextAudioPts)-it.pts;Te>me?(v=Te-pe,v<0&&(v=pe),n.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+v/90+" ms for the last video frame.")):v=pe}else v=pe}var Oe=Math.round(it.pts-it.dts);j.push(new x(it.key,v,ce,Oe))}if(j.length&&p&&p<70){var Ne=j[0].flags;Ne.dependsOn=2,Ne.isNonSync=0}console.assert(v!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=Z+v,this.isVideoContiguous=!0;var Ke=P.default.moof(C.sequenceNumber++,W,m({},C,{samples:j})),nt="video",at={data1:Ke,data2:ze,startPTS:oe/b,endPTS:(fe+v)/b,startDTS:W/b,endDTS:M/b,type:nt,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:C.dropped};return C.samples=[],C.dropped=0,console.assert(ze.length,"MDAT length must not be zero"),at},O.remuxAudio=function(C,T,d,f,b){var _=C.inputTimeScale,j=C.samplerate?C.samplerate:_,U=_/j,w=C.isAAC?l:h,M=w*U,I=this._initPTS,v=!C.isAAC&&this.typeSupported.mpeg,W=[],Z=C.samples,oe=v?0:8,fe=this.nextAudioPts||-1,Ae=T*_;if(this.isAudioContiguous=d=d||Z.length&&fe>0&&(f&&Math.abs(Ae-fe)<9e3||Math.abs(a(Z[0].pts-I,Ae)-fe)<20*M),Z.forEach(function(de){de.pts=a(de.pts-I,Ae)}),!d||fe<0){if(Z=Z.filter(function(de){return de.pts>=0}),!Z.length)return;b===0?fe=0:f?fe=Math.max(0,Ae):fe=Z[0].pts}if(C.isAAC)for(var be=b!==void 0,Re=this.config.maxAudioFramesDrift,Ce=0,Le=fe;Ce<Z.length;Ce++){var ve=Z[Ce],$=ve.pts,E=$-Le,k=Math.abs(1e3*E/_);if(E<=-Re*M&&be)Ce===0&&(n.logger.warn("Audio frame @ "+($/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*E/_)+" ms."),this.nextAudioPts=fe=Le=$);else if(E>=Re*M&&k<g&&be){var B=Math.round(E/M);Le=$-B*M,Le<0&&(B--,Le+=M),Ce===0&&(this.nextAudioPts=fe=Le),n.logger.warn("[mp4-remuxer]: Injecting "+B+" audio frame @ "+(Le/_).toFixed(3)+"s due to "+Math.round(1e3*E/_)+" ms gap.");for(var Q=0;Q<B;Q++){var G=Math.max(Le,0),he=H.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);he||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),he=ve.unit.subarray()),Z.splice(Ce,0,{unit:he,pts:G}),Le+=M,Ce++}}ve.pts=Le,Le+=M}for(var xe=null,Ie=null,ue,ge=0,_e=Z.length;_e--;)ge+=Z[_e].unit.byteLength;for(var Se=0,Pe=Z.length;Se<Pe;Se++){var Ue=Z[Se],He=Ue.unit,Be=Ue.pts;if(Ie!==null){var Qe=W[Se-1];Qe.duration=Math.round((Be-Ie)/U)}else if(d&&C.isAAC&&(Be=fe),xe=Be,ge>0){ge+=oe;try{ue=new Uint8Array(ge)}catch(de){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ge,reason:"fail allocating audio mdat "+ge});return}if(!v){var ze=new DataView(ue.buffer);ze.setUint32(0,ge),ue.set(P.default.types.mdat,4)}}else return;ue.set(He,oe);var Ye=He.byteLength;oe+=Ye,W.push(new x(!0,w,Ye,0)),Ie=Be}var Me=W.length;if(!Me)return;var it=W[W.length-1];this.nextAudioPts=fe=Ie+U*it.duration;var Ze=v?new Uint8Array(0):P.default.moof(C.sequenceNumber++,xe/U,m({},C,{samples:W}));C.samples=[];var ce=xe/_,ee=fe/_,ne="audio",ae={data1:Ze,data2:ue,startPTS:ce,endPTS:ee,startDTS:ce,endDTS:ee,type:ne,hasAudio:!0,hasVideo:!1,nb:Me};return this.isAudioContiguous=!0,console.assert(ue.length,"MDAT length must not be zero"),ae},O.remuxEmptyAudio=function(C,T,d,f){var b=C.inputTimeScale,_=C.samplerate?C.samplerate:b,j=b/_,U=this.nextAudioPts,w=(U!==null?U:f.startDTS*b)+this._initDTS,M=f.endDTS*b+this._initDTS,I=j*l,v=Math.ceil((M-w)/I),W=H.default.getSilentFrame(C.manifestCodec||C.codec,C.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],oe=0;oe<v;oe++){var fe=w+oe*I;Z.push({unit:W,pts:fe,dts:fe})}return C.samples=Z,this.remuxAudio(C,T,d,!1)},O.remuxID3=function(C,T){var d=C.samples.length;if(!d)return;for(var f=C.inputTimeScale,b=this._initPTS,_=this._initDTS,j=0;j<d;j++){var U=C.samples[j];U.pts=a(U.pts-b,T*f)/f,U.dts=a(U.dts-_,T*f)/f}var w=C.samples;return C.samples=[],{samples:w}},O.remuxText=function(C,T){var d=C.samples.length;if(!d)return;for(var f=C.inputTimeScale,b=this._initPTS,_=0;_<d;_++){var j=C.samples[_];j.pts=a(j.pts-b,T*f)/f}C.samples.sort(function(w,M){return w.pts-M.pts});var U=C.samples;return C.samples=[],{samples:U}},D}();function a(D,O){var A;if(O===null)return D;for(O<D?A=-8589934592:A=8589934592;Math.abs(D-O)>4294967296;)D+=A;return D}function R(D){for(var O=0;O<D.length;O++)if(D[O].key)return O;return-1}var x=function(O,A,C,T){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=A,this.size=C,this.cts=T,this.flags=new S(O)},S=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/polyfills/number.ts"),H=N("./src/utils/mp4-tools.ts"),P=N("./src/loader/fragment.ts"),K=N("./src/utils/logger.ts"),z=function(){function y(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=y.prototype;return m.destroy=function(){},m.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(l,h,p){this.audioCodec=h,this.videoCodec=p,this.generateInitSegment(l),this.emitInitSegment=!0},m.generateInitSegment=function(l){var h=this.audioCodec,p=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(H.parseInitSegment)(l);h||(h=L(o.audio,P.ElementaryStreamTypes.AUDIO)),p||(p=L(o.video,P.ElementaryStreamTypes.VIDEO));var u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:h+","+p,initSegment:l,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:h,initSegment:l,id:"audio"}:o.video?u.video={container:"video/mp4",codec:p,initSegment:l,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},m.remux=function(l,h,p,o,u){var s=this.initPTS,a=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:p,initSegment:void 0};Object(X.isFiniteNumber)(a)||(a=this.lastEndDTS=u||0);var x=h.samples;if(!x||!x.length)return R;var S={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(x),D=this.initData),!D||!D.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=n(D,x,a));var O=Object(H.getDuration)(x,D),A=a,C=O+A;Object(H.offsetStartDTS)(D,x,s),O>0?this.lastEndDTS=C:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var T=!!D.audio,d=!!D.video,f="";T&&(f+="audio"),d&&(f+="video");var b={data1:x,startPTS:A,startDTS:A,endPTS:C,endDTS:C,type:f,hasAudio:T,hasVideo:d,nb:1,dropped:0};return R.audio=b.type==="audio"?b:void 0,R.video=b.type!=="audio"?b:void 0,R.text=o,R.id3=p,R.initSegment=S,R},y}(),n=function(m,g,l){return Object(H.getStartDTS)(m,g)-l};function L(y,m){var g=y==null?void 0:y.codec;return g&&g.length>4?g:g==="hvc1"?"hvc1.1.c.L120.90":g==="av01"?"av01.0.04M.08":g==="avc1"||m===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=z},"./src/task-loop.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return X});var X=function(){function H(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=H.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(z){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,z),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},H}()},"./src/types/cmcd.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return X}),N.d(Y,"CMCDObjectType",function(){return H}),N.d(Y,"CMCDStreamingFormat",function(){return P}),N.d(Y,"CMCDStreamType",function(){return K});var X=1,H;(function(z){z.MANIFEST="m",z.AUDIO="a",z.VIDEO="v",z.MUXED="av",z.INIT="i",z.CAPTION="c",z.TIMED_TEXT="tt",z.KEY="k",z.OTHER="o"})(H||(H={}));var P;(function(z){z.DASH="d",z.HLS="h",z.SMOOTH="s",z.OTHER="o"})(P||(P={}));var K;(function(z){z.VOD="v",z.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return P}),N.d(Y,"getSkipValue",function(){return K}),N.d(Y,"HlsUrlParameters",function(){return z}),N.d(Y,"Level",function(){return n});function X(L,y){for(var m=0;m<y.length;m++){var g=y[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(L,g.key,g)}}function H(L,y,m){return y&&X(L.prototype,y),m&&X(L,m),L}var P;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(P||(P={}));function K(L,y){var m=L.canSkipUntil,g=L.canSkipDateRanges,l=L.endSN,h=y!==void 0?y-l:0;return m&&h<m?g?P.v2:P.Yes:P.No}var z=function(){function L(m,g,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=g,this.skip=l}var y=L.prototype;return y.addDirectives=function(g){var l=new self.URL(g);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},L}(),n=function(){function L(y){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return H(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var g=m%this.url.length;this._urlId!==g&&(this.details=void 0,this._urlId=g)}}]),L}()},"./src/types/loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"PlaylistContextType",function(){return X}),N.d(Y,"PlaylistLevelType",function(){return H});var X;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var H;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(H||(H={}))},"./src/types/transmuxer.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"ChunkMetadata",function(){return X});var X=function(K,z,n,L,y,m){L===void 0&&(L=0),y===void 0&&(y=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=H(),this.buffering={audio:H(),video:H(),audiovideo:H()},this.level=K,this.sn=z,this.id=n,this.size=L,this.part=y,this.partial=m};function H(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"AttrList",function(){return P});var X=/^(\d+)x(\d+)$/,H=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function K(n){typeof n=="string"&&(n=K.parseAttrList(n));for(var L in n)n.hasOwnProperty(L)&&(this[L]=n[L])}var z=K.prototype;return z.decimalInteger=function(L){var y=parseInt(this[L],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},z.hexadecimalInteger=function(L){if(this[L]){var y=(this[L]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var m=new Uint8Array(y.length/2),g=0;g<y.length/2;g++)m[g]=parseInt(y.slice(g*2,g*2+2),16);return m}else return null},z.hexadecimalIntegerAsNumber=function(L){var y=parseInt(this[L],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},z.decimalFloatingPoint=function(L){return parseFloat(this[L])},z.optionalFloat=function(L,y){var m=this[L];return m?parseFloat(m):y},z.enumeratedString=function(L){return this[L]},z.bool=function(L){return this[L]==="YES"},z.decimalResolution=function(L){var y=X.exec(this[L]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},K.parseAttrList=function(L){var y,m={},g='"';for(H.lastIndex=0;(y=H.exec(L))!==null;){var l=y[2];l.indexOf(g)===0&&l.lastIndexOf(g)===l.length-1&&(l=l.slice(1,-1)),m[y[1]]=l}return m},K}()},"./src/utils/binary-search.ts":function(le,Y,N){"use strict";N.r(Y);var X={search:function(P,K){for(var z=0,n=P.length-1,L=null,y=null;z<=n;){L=(z+n)/2|0,y=P[L];var m=K(y);if(m>0)z=L+1;else if(m<0)n=L-1;else return y}return null}};Y.default=X},"./src/utils/buffer-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return P});var X=N("./src/utils/logger.ts"),H={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function K(){}return K.isBuffered=function(n,L){try{if(n){for(var y=K.getBuffered(n),m=0;m<y.length;m++)if(L>=y.start(m)&&L<=y.end(m))return!0}}catch(g){}return!1},K.bufferInfo=function(n,L,y){try{if(n){var m=K.getBuffered(n),g=[],l;for(l=0;l<m.length;l++)g.push({start:m.start(l),end:m.end(l)});return this.bufferedInfo(g,L,y)}}catch(h){}return{len:0,start:L,end:L,nextStart:void 0}},K.bufferedInfo=function(n,L,y){L=Math.max(0,L),n.sort(function(S,D){var O=S.start-D.start;return O||D.end-S.end});var m=[];if(y)for(var g=0;g<n.length;g++){var l=m.length;if(l){var h=m[l-1].end;n[g].start-h<y?n[g].end>h&&(m[l-1].end=n[g].end):m.push(n[g])}else m.push(n[g])}else m=n;for(var p=0,o,u=L,s=L,a=0;a<m.length;a++){var R=m[a].start,x=m[a].end;if(L+y>=R&&L<x)u=R,s=x,p=s-L;else if(L+y<R){o=R;break}}return{len:p,start:u||0,end:s||0,nextStart:o}},K.getBuffered=function(n){try{return n.buffered}catch(L){return X.logger.log("failed to get media.buffered",L),H}},K}()},"./src/utils/cea-608-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"Row",function(){return s}),N.d(Y,"CaptionScreen",function(){return a});var X=N("./src/utils/logger.ts"),H={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},P=function(C){var T=C;return H.hasOwnProperty(C)&&(T=H[C]),String.fromCharCode(T)},K=15,z=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},g=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(A){A[A.ERROR=0]="ERROR",A[A.TEXT=1]="TEXT",A[A.WARNING=2]="WARNING",A[A.INFO=2]="INFO",A[A.DEBUG=3]="DEBUG",A[A.DATA=3]="DATA"})(l||(l={}));var h=function(){function A(){this.time=null,this.verboseLevel=l.ERROR}var C=A.prototype;return C.log=function(d,f){this.verboseLevel>=d&&X.logger.log(this.time+" ["+d+"] "+f)},A}(),p=function(C){for(var T=[],d=0;d<C.length;d++)T.push(C[d].toString(16));return T},o=function(){function A(T,d,f,b,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=T||"white",this.underline=d||!1,this.italics=f||!1,this.background=b||"black",this.flash=_||!1}var C=A.prototype;return C.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},C.setStyles=function(d){for(var f=["foreground","underline","italics","background","flash"],b=0;b<f.length;b++){var _=f[b];d.hasOwnProperty(_)&&(this[_]=d[_])}},C.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},C.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},C.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},C.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},A}(),u=function(){function A(T,d,f,b,_,j){this.uchar=void 0,this.penState=void 0,this.uchar=T||" ",this.penState=new o(d,f,b,_,j)}var C=A.prototype;return C.reset=function(){this.uchar=" ",this.penState.reset()},C.setChar=function(d,f){this.uchar=d,this.penState.copy(f)},C.setPenState=function(d){this.penState.copy(d)},C.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},C.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},C.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},A}(),s=function(){function A(T){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<z;d++)this.chars.push(new u);this.logger=T,this.pos=0,this.currPenState=new o}var C=A.prototype;return C.equals=function(d){for(var f=!0,b=0;b<z;b++)if(!this.chars[b].equals(d.chars[b])){f=!1;break}return f},C.copy=function(d){for(var f=0;f<z;f++)this.chars[f].copy(d.chars[f])},C.isEmpty=function(){for(var d=!0,f=0;f<z;f++)if(!this.chars[f].isEmpty()){d=!1;break}return d},C.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>z&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=z)},C.moveCursor=function(d){var f=this.pos+d;if(d>1)for(var b=this.pos+1;b<f+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(f)},C.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},C.insertChar=function(d){d>=144&&this.backSpace();var f=P(d);if(this.pos>=z){this.logger.log(l.ERROR,"Cannot insert "+d.toString(16)+" ("+f+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(f,this.currPenState),this.moveCursor(1)},C.clearFromPos=function(d){var f;for(f=d;f<z;f++)this.chars[f].reset()},C.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},C.clearToEndOfRow=function(){this.clearFromPos(this.pos)},C.getTextString=function(){for(var d=[],f=!0,b=0;b<z;b++){var _=this.chars[b].uchar;_!==" "&&(f=!1),d.push(_)}return f?"":d.join("")},C.setPenStyles=function(d){this.currPenState.setStyles(d);var f=this.chars[this.pos];f.setPenState(this.currPenState)},A}(),a=function(){function A(T){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<K;d++)this.rows.push(new s(T));this.logger=T,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var C=A.prototype;return C.reset=function(){for(var d=0;d<K;d++)this.rows[d].clear();this.currRow=K-1},C.equals=function(d){for(var f=!0,b=0;b<K;b++)if(!this.rows[b].equals(d.rows[b])){f=!1;break}return f},C.copy=function(d){for(var f=0;f<K;f++)this.rows[f].copy(d.rows[f])},C.isEmpty=function(){for(var d=!0,f=0;f<K;f++)if(!this.rows[f].isEmpty()){d=!1;break}return d},C.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},C.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},C.insertChar=function(d){var f=this.rows[this.currRow];f.insertChar(d)},C.setPen=function(d){var f=this.rows[this.currRow];f.setPenStyles(d)},C.moveCursor=function(d){var f=this.rows[this.currRow];f.moveCursor(d)},C.setCursor=function(d){this.logger.log(l.INFO,"setCursor: "+d);var f=this.rows[this.currRow];f.setCursor(d)},C.setPAC=function(d){this.logger.log(l.INFO,"pacData = "+JSON.stringify(d));var f=d.row-1;if(this.nrRollUpRows&&f<this.nrRollUpRows-1&&(f=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==f){for(var b=0;b<K;b++)this.rows[b].clear();var _=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var U=j.rows[_].cueStartTime,w=this.logger.time;if(U&&w!==null&&U<w)for(var M=0;M<this.nrRollUpRows;M++)this.rows[f-this.nrRollUpRows+M+1].copy(j.rows[_+M])}}this.currRow=f;var I=this.rows[this.currRow];if(d.indent!==null){var v=d.indent,W=Math.max(v-1,0);I.setCursor(d.indent),d.color=I.chars[W].penState.foreground}var Z={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(Z)},C.setBkgData=function(d){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},C.setRollUpRows=function(d){this.nrRollUpRows=d},C.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,f=this.rows.splice(d,1)[0];f.clear(),this.rows.splice(this.currRow,0,f),this.logger.log(l.INFO,"Rolling up")},C.getDisplayText=function(d){d=d||!1;for(var f=[],b="",_=-1,j=0;j<K;j++){var U=this.rows[j].getTextString();U&&(_=j+1,d?f.push("Row "+_+": '"+U+"'"):f.push(U.trim()))}return f.length>0&&(d?b="["+f.join(" | ")+"]":b=f.join(`
`)),b},C.getTextAndFormat=function(){return this.rows},A}(),R=function(){function A(T,d,f){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=T,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new a(f),this.nonDisplayedMemory=new a(f),this.lastOutputScreen=new a(f),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=f}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(l.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 f=0;f<d.length;f++)this.writeScreen.insertChar(d[f]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},C.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},C.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},C.ccAOF=function(){},C.ccAON=function(){},C.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},C.ccRU=function(d){this.logger.log(l.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},C.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},C.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},C.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},C.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},C.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},C.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},C.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},C.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},C.ccTO=function(d){this.logger.log(l.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},C.ccMIDROW=function(d){var f={flash:!1};if(f.underline=d%2===1,f.italics=d>=46,f.italics)f.foreground="white";else{var b=Math.floor(d/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];f.foreground=_[b]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(f)),this.writeScreen.setPen(f)},C.outputDataUpdate=function(d){d===void 0&&(d=!1);var f=this.logger.time;if(f===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=f:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,f,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:f),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}(),x=function(){function A(T,d,f){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new h;this.channels=[null,new R(T,d,b),new R(T+1,f,b)],this.cmdHistory=O(),this.logger=b}var C=A.prototype;return C.getHandler=function(d){return this.channels[d].getHandler()},C.setHandler=function(d,f){this.channels[d].setHandler(f)},C.addData=function(d,f){var b,_,j,U=!1;this.logger.time=d;for(var w=0;w<f.length;w+=2){if(_=f[w]&127,j=f[w+1]&127,_===0&&j===0)continue;if(this.logger.log(l.DATA,"["+p([f[w],f[w+1]])+"] -> ("+p([_,j])+")"),b=this.parseCmd(_,j),b||(b=this.parseMidrow(_,j)),b||(b=this.parsePAC(_,j)),b||(b=this.parseBackgroundAttributes(_,j)),!b&&(U=this.parseChars(_,j),U)){var M=this.currentChannel;if(M&&M>0){var I=this.channels[M];I.insertChars(U)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!U&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+p([_,j])+" orig: "+p([f[w],f[w+1]]))}},C.parseCmd=function(d,f){var b=this.cmdHistory,_=(d===20||d===28||d===21||d===29)&&f>=32&&f<=47,j=(d===23||d===31)&&f>=33&&f<=35;if(!(_||j))return!1;if(D(d,f,b))return S(null,null,b),this.logger.log(l.DEBUG,"Repeated command ("+p([d,f])+") is dropped"),!0;var U=d===20||d===21||d===23?1:2,w=this.channels[U];return d===20||d===21||d===28||d===29?f===32?w.ccRCL():f===33?w.ccBS():f===34?w.ccAOF():f===35?w.ccAON():f===36?w.ccDER():f===37?w.ccRU(2):f===38?w.ccRU(3):f===39?w.ccRU(4):f===40?w.ccFON():f===41?w.ccRDC():f===42?w.ccTR():f===43?w.ccRTD():f===44?w.ccEDM():f===45?w.ccCR():f===46?w.ccENM():f===47&&w.ccEOC():w.ccTO(f-32),S(d,f,b),this.currentChannel=U,!0},C.parseMidrow=function(d,f){var b=0;if((d===17||d===25)&&f>=32&&f<=47){if(d===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[b];return _?(_.ccMIDROW(f),this.logger.log(l.DEBUG,"MIDROW ("+p([d,f])+")"),!0):!1}return!1},C.parsePAC=function(d,f){var b,_=this.cmdHistory,j=(d>=17&&d<=23||d>=25&&d<=31)&&f>=64&&f<=127,U=(d===16||d===24)&&f>=64&&f<=95;if(!(j||U))return!1;if(D(d,f,_))return S(null,null,_),!0;var w=d<=23?1:2;f>=64&&f<=95?b=w===1?n[d]:y[d]:b=w===1?L[d]:m[d];var M=this.channels[w];return M?(M.setPAC(this.interpretPAC(b,f)),S(d,f,_),this.currentChannel=w,!0):!1},C.interpretPAC=function(d,f){var b,_={color:null,italics:!1,indent:null,underline:!1,row:d};return f>95?b=f-96:b=f-64,_.underline=(b&1)===1,b<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((b-16)/2)*4,_},C.parseChars=function(d,f){var b,_=null,j=null;if(d>=25?(b=2,j=d-8):(b=1,j=d),j>=17&&j<=19){var U;j===17?U=f+80:j===18?U=f+112:U=f+144,this.logger.log(l.INFO,"Special char '"+P(U)+"' in channel "+b),_=[U]}else d>=32&&d<=127&&(_=f===0?[d]:[d,f]);if(_){var w=p(_);this.logger.log(l.DEBUG,"Char codes = "+w.join(",")),S(d,f,this.cmdHistory)}return _},C.parseBackgroundAttributes=function(d,f){var b=(d===16||d===24)&&f>=32&&f<=47,_=(d===23||d===31)&&f>=45&&f<=47;if(!(b||_))return!1;var j,U={};d===16||d===24?(j=Math.floor((f-32)/2),U.background=g[j],f%2===1&&(U.background=U.background+"_semi")):f===45?U.background="transparent":(U.foreground="black",f===47&&(U.underline=!0));var w=d<=23?1:2,M=this.channels[w];return M.setBkgData(U),S(d,f,this.cmdHistory),!0},C.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var f=this.channels[d];f&&f.reset()}this.cmdHistory=O()},C.cueSplitAtTime=function(d){for(var f=0;f<this.channels.length;f++){var b=this.channels[f];b&&b.cueSplitAtTime(d)}},A}();function S(A,C,T){T.a=A,T.b=C}function D(A,C,T){return T.a===A&&T.b===C}function O(){return{a:null,b:null}}Y.default=x},"./src/utils/codecs.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"isCodecType",function(){return H}),N.d(Y,"isCodecSupportedInMp4",function(){return P});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function H(K,z){var n=X[z];return!!n&&n[K.slice(0,4)]===!0}function P(K,z){return MediaSource.isTypeSupported((z||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/utils/vttparser.ts"),H=N("./src/utils/webvtt-parser.ts"),P=N("./src/utils/texttrack-utils.ts"),K=/\s/,z={newCue:function(L,y,m,g){for(var l=[],h,p,o,u,s,a=self.VTTCue||self.TextTrackCue,R=0;R<g.rows.length;R++)if(h=g.rows[R],o=!0,u=0,s="",!h.isEmpty()){for(var x=0;x<h.chars.length;x++)K.test(h.chars[x].uchar)&&o?u++:(s+=h.chars[x].uchar,o=!1);h.cueStartTime=y,y===m&&(m+=1e-4),u>=16?u--:u++;var S=Object(X.fixLineBreaks)(s.trim()),D=Object(H.generateCueId)(y,m,S);(!L||!L.cues||!L.cues.getCueById(D))&&(p=new a(y,m,S),p.id=D,p.line=R+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),l.push(p))}return L&&l.length&&(l.sort(function(O,A){return O.line==="auto"||A.line==="auto"?0:O.line>8&&A.line>8?A.line-O.line:O.line-A.line}),l.forEach(function(O){return Object(P.addCueToTrack)(L,O)})),l}};Y.default=z},"./src/utils/discontinuities.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return K}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return z}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return y}),N.d(Y,"alignStream",function(){return m}),N.d(Y,"alignPDT",function(){return l}),N.d(Y,"alignFragmentByPDTDelta",function(){return h}),N.d(Y,"alignMediaPlaylistByPDT",function(){return p});var X=N("./src/polyfills/number.ts"),H=N("./src/utils/logger.ts"),P=N("./src/controller/level-helper.ts");function K(o,u){for(var s=null,a=0,R=o.length;a<R;a++){var x=o[a];if(x&&x.cc===u){s=x;break}}return s}function z(o,u,s){return!!(u.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function n(o,u){var s=o.fragments,a=u.fragments;if(!a.length||!s.length){H.logger.log("No fragments to align");return}var R=K(s,a[0].cc);if(!R||R&&!R.startPTS){H.logger.log("No frag in previous level to align on");return}return R}function L(o,u){if(o){var s=o.start+u;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function y(o,u){for(var s=u.fragments,a=0,R=s.length;a<R;a++)L(s[a],o);u.fragmentHint&&L(u.fragmentHint,o),u.alignedSliding=!0}function m(o,u,s){if(!u)return;g(o,s,u),!s.alignedSliding&&u.details&&l(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(P.adjustSliding)(u.details,s)}function g(o,u,s){if(z(o,s,u)){var a=n(s.details,u);a&&Object(X.isFiniteNumber)(a.start)&&(H.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),y(a.start,u))}}function l(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=o.fragments[0].programDateTime,R=(a-s)/1e3+u.fragments[0].start;R&&Object(X.isFiniteNumber)(R)&&(H.logger.log("Adjusting PTS using programDateTime delta "+(a-s)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),y(R,o))}function h(o,u){var s=o.programDateTime;if(!s)return;var a=(s-u)/1e3;o.start=o.startPTS=a,o.endPTS=a+o.duration}function p(o,u){if(!u.fragments.length||!o.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,a=u.fragments[0].start,R=s-a*1e3;o.fragments.forEach(function(x){h(x,R)}),o.fragmentHint&&h(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/utils/ewma.ts"),H=function(){function P(z,n,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(z),this.fast_=new X.default(n)}var K=P.prototype;return K.update=function(n,L){var y=this.slow_,m=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new X.default(n,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new X.default(L,m.getEstimate(),m.getTotalWeight()))},K.sample=function(n,L){n=Math.max(n,this.minDelayMs_);var y=8*L,m=n/1e3,g=y/m;this.fast_.sample(m,g),this.slow_.sample(m,g)},K.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},P}();Y.default=H},"./src/utils/ewma.ts":function(le,Y,N){"use strict";N.r(Y);var X=function(){function H(K,z,n){z===void 0&&(z=0),n===void 0&&(n=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_=z,this.totalWeight_=n}var P=H.prototype;return P.sample=function(z,n){var L=Math.pow(this.alpha_,z);this.estimate_=n*(1-L)+L*this.estimate_,this.totalWeight_+=z},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var z=1-Math.pow(this.alpha_,this.totalWeight_);if(z)return this.estimate_/z}return this.estimate_},H}();Y.default=X},"./src/utils/fetch-loader.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return h});var X=N("./src/polyfills/number.ts"),H=N("./src/loader/load-stats.ts"),P=N("./src/demux/chunk-cache.ts");function K(a,R){a.prototype=Object.create(R.prototype),a.prototype.constructor=a,m(a,R)}function z(a){var R=typeof Map=="function"?new Map:void 0;return z=function(S){if(S===null||!y(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(S))return R.get(S);R.set(S,D)}function D(){return n(S,arguments,g(this).constructor)}return D.prototype=Object.create(S.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,S)},z(a)}function n(a,R,x){return L()?n=Reflect.construct:n=function(D,O,A){var C=[null];C.push.apply(C,O);var T=Function.bind.apply(D,C),d=new T;return A&&m(d,A.prototype),d},n.apply(null,arguments)}function L(){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 y(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function m(a,R){return m=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},m(a,R)}function g(a){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},g(a)}function l(){return l=Object.assign||function(a){for(var R=1;R<arguments.length;R++){var x=arguments[R];for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(a[S]=x[S])}return a},l.apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(a){}return!1}var p=function(){function a(x){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=x.fetchSetup||u,this.controller=new self.AbortController,this.stats=new H.LoadStats}var R=a.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(S,D,O){var A=this,C=this.stats;if(C.loading.start)throw new Error("Loader can only be used once.");C.loading.start=self.performance.now();var T=o(S,this.controller.signal),d=O.onProgress,f=S.responseType==="arraybuffer",b=f?"byteLength":"length";this.context=S,this.config=D,this.callbacks=O,this.request=this.fetchSetup(S,T),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){A.abortInternal(),O.onTimeout(C,S,A.response)},D.timeout),self.fetch(this.request).then(function(_){if(A.response=A.loader=_,!_.ok){var j=_.status,U=_.statusText;throw new s(U||"fetch, bad network response",j,_)}return C.loading.first=Math.max(self.performance.now(),C.loading.start),C.total=parseInt(_.headers.get("Content-Length")||"0"),d&&Object(X.isFiniteNumber)(D.highWaterMark)?A.loadProgressively(_,C,S,D.highWaterMark,d):f?_.arrayBuffer():_.text()}).then(function(_){var j=A.response;self.clearTimeout(A.requestTimeout),C.loading.end=Math.max(self.performance.now(),C.loading.first),C.loaded=C.total=_[b];var U={url:j.url,data:_};d&&!Object(X.isFiniteNumber)(D.highWaterMark)&&d(C,S,_,j),O.onSuccess(U,C,S,j)}).catch(function(_){if(self.clearTimeout(A.requestTimeout),C.aborted)return;var j=_.code||0;O.onError({code:j,text:_.message},S,_.details)})},R.getCacheAge=function(){var S=null;if(this.response){var D=this.response.headers.get("age");S=D?parseFloat(D):null}return S},R.loadProgressively=function(S,D,O,A,C){A===void 0&&(A=0);var T=new P.default,d=S.body.getReader(),f=function b(){return d.read().then(function(_){if(_.done)return T.dataLength&&C(D,O,T.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=_.value,U=j.length;return D.loaded+=U,U<A||T.dataLength?(T.push(j),T.dataLength>=A&&C(D,O,T.flush(),S)):C(D,O,j,S),b()}).catch(function(){return Promise.reject()})};return f()},a}();function o(a,R){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(l({},a.headers))};return a.rangeEnd&&x.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),x}function u(a,R){return new self.Request(a.url,R)}var s=function(a){K(R,a);function R(x,S,D){var O;return O=a.call(this,x)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=D,O}return R}(z(Error));Y.default=p},"./src/utils/imsc1-ttml-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return y}),N.d(Y,"parseIMSC1",function(){return h});var X=N("./src/utils/mp4-tools.ts"),H=N("./src/utils/vttparser.ts"),P=N("./src/utils/vttcue.ts"),K=N("./src/demux/id3.ts"),z=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(A){for(var C=1;C<arguments.length;C++){var T=arguments[C];for(var d in T)Object.prototype.hasOwnProperty.call(T,d)&&(A[d]=T[d])}return A},L.apply(this,arguments)}var y="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,g=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function h(A,C,T,d,f){var b=Object(X.findBox)(new Uint8Array(A),["mdat"]);if(b.length===0){f(new Error("Could not parse IMSC1 mdat"));return}var _=b[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(A,_.start,_.end-_.start)),U=Object(z.toTimescaleFromScale)(C,1,T);try{d(p(j,U))}catch(w){f(w)}}function p(A,C){var T=new DOMParser,d=T.parseFromString(A,"text/xml"),f=d.getElementsByTagName("tt")[0];if(!f)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(b).reduce(function(I,v){return I[v]=f.getAttribute("ttp:"+v)||b[v],I},{}),j=f.getAttribute("xml:space")!=="preserve",U=u(o(f,"styling","style")),w=u(o(f,"layout","region")),M=o(f,"body","[begin]");return[].map.call(M,function(I){var v=s(I,j);if(!v||!I.hasAttribute("begin"))return null;var W=S(I.getAttribute("begin"),_),Z=S(I.getAttribute("dur"),_),oe=S(I.getAttribute("end"),_);if(W===null)throw x(I);if(oe===null){if(Z===null)throw x(I);oe=W+Z}var fe=new P.default(W-C,oe-C,v);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var Ae=w[I.getAttribute("region")],be=U[I.getAttribute("style")];fe.position=10,fe.size=80;var Re=a(Ae,be),Ce=Re.textAlign;if(Ce){var Le=l[Ce];Le&&(fe.lineAlign=Le),fe.align=Ce}return L(fe,Re),fe}).filter(function(I){return I!==null})}function o(A,C,T){var d=A.getElementsByTagName(C)[0];return d?[].slice.call(d.querySelectorAll(T)):[]}function u(A){return A.reduce(function(C,T){var d=T.getAttribute("xml:id");return d&&(C[d]=T),C},{})}function s(A,C){return[].slice.call(A.childNodes).reduce(function(T,d,f){var b;return d.nodeName==="br"&&f?T+`
`:(b=d.childNodes)!==null&&b!==void 0&&b.length?s(d,C):C?T+d.textContent.trim().replace(/\s+/g," "):T+d.textContent},"")}function a(A,C){var T="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(f,b){var _=R(C,T,b)||R(A,T,b);return _&&(f[b]=_),f},{})}function R(A,C,T){return A.hasAttributeNS(C,T)?A.getAttributeNS(C,T):null}function x(A){return new Error("Could not parse ttml timestamp "+A)}function S(A,C){if(!A)return null;var T=Object(H.parseTimeStamp)(A);return T===null&&(m.test(A)?T=D(A,C):g.test(A)&&(T=O(A,C))),T}function D(A,C){var T=m.exec(A),d=(T[4]|0)+(T[5]|0)/C.subFrameRate;return(T[1]|0)*3600+(T[2]|0)*60+(T[3]|0)+d/C.frameRate}function O(A,C){var T=g.exec(A),d=Number(T[1]),f=T[2];switch(f){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/C.frameRate;case"t":return d/C.tickRate}return d}},"./src/utils/logger.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"enableLogs",function(){return n}),N.d(Y,"logger",function(){return L});var X=function(){},H={trace:X,debug:X,log:X,warn:X,info:X,error:X},P=H;function K(y){var m=self.console[y];return m?m.bind(self.console,"["+y+"] >"):X}function z(y){for(var m=arguments.length,g=new Array(m>1?m-1:0),l=1;l<m;l++)g[l-1]=arguments[l];g.forEach(function(h){P[h]=y[h]?y[h].bind(y):K(h)})}function n(y){if(self.console&&y===!0||typeof y=="object"){z(y,"debug","log","info","warn","error");try{P.log()}catch(m){P=H}}else P=H}var L=P},"./src/utils/mediakeys-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"KeySystems",function(){return X}),N.d(Y,"requestMediaKeySystemAccess",function(){return H});var X;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(X||(X={}));var H=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"bin2str",function(){return z}),N.d(Y,"readUint16",function(){return n}),N.d(Y,"readUint32",function(){return L}),N.d(Y,"writeUint32",function(){return y}),N.d(Y,"findBox",function(){return m}),N.d(Y,"parseSegmentIndex",function(){return g}),N.d(Y,"parseInitSegment",function(){return l}),N.d(Y,"getStartDTS",function(){return h}),N.d(Y,"getDuration",function(){return p}),N.d(Y,"computeRawDurationFromSamples",function(){return o}),N.d(Y,"offsetStartDTS",function(){return u}),N.d(Y,"segmentValidRange",function(){return s}),N.d(Y,"appendUint8Array",function(){return a});var X=N("./src/utils/typed-array.ts"),H=N("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,K=[].push;function z(R){return String.fromCharCode.apply(null,R)}function n(R,x){"data"in R&&(x+=R.start,R=R.data);var S=R[x]<<8|R[x+1];return S<0?65536+S:S}function L(R,x){"data"in R&&(x+=R.start,R=R.data);var S=R[x]<<24|R[x+1]<<16|R[x+2]<<8|R[x+3];return S<0?4294967296+S:S}function y(R,x,S){"data"in R&&(x+=R.start,R=R.data),R[x]=S>>24,R[x+1]=S>>16&255,R[x+2]=S>>8&255,R[x+3]=S&255}function m(R,x){var S=[];if(!x.length)return S;var D,O,A;"data"in R?(D=R.data,O=R.start,A=R.end):(D=R,O=0,A=D.byteLength);for(var C=O;C<A;){var T=L(D,C),d=z(D.subarray(C+4,C+8)),f=T>1?C+T:A;if(d===x[0])if(x.length===1)S.push({data:D,start:C+8,end:f});else{var b=m({data:D,start:C+8,end:f},x.slice(1));b.length&&K.apply(S,b)}C=f}return S}function g(R){var x=m(R,["moov"]),S=x[0],D=S?S.end:null,O=m(R,["sidx"]);if(!O||!O[0])return null;var A=[],C=O[0],T=C.data[0],d=T===0?8:16,f=L(C,d);d+=4;var b=0,_=0;T===0?d+=8:d+=16,d+=2;var j=C.end+_,U=n(C,d);d+=2;for(var w=0;w<U;w++){var M=d,I=L(C,M);M+=4;var v=I&2147483647,W=(I&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=L(C,M);M+=4,A.push({referenceSize:v,subsegmentDuration:Z,info:{duration:Z/f,start:j,end:j+v-1}}),j+=v,M+=4,d=M}return{earliestPresentationTime:b,timescale:f,version:T,referencesCount:U,references:A,moovEndOffset:D}}function l(R){for(var x=[],S=m(R,["moov","trak"]),D=0;D<S.length;D++){var O=S[D],A=m(O,["tkhd"])[0];if(A){var C=A.data[A.start],T=C===0?12:20,d=L(A,T),f=m(O,["mdia","mdhd"])[0];if(f){C=f.data[f.start],T=C===0?12:20;var b=L(f,T),_=m(O,["mdia","hdlr"])[0];if(_){var j=z(_.data.subarray(_.start+8,_.start+12)),U={soun:H.ElementaryStreamTypes.AUDIO,vide:H.ElementaryStreamTypes.VIDEO}[j];if(U){var w=m(O,["mdia","minf","stbl","stsd"])[0],M=void 0;w&&(M=z(w.data.subarray(w.start+12,w.start+16))),x[d]={timescale:b,type:U},x[U]={timescale:b,id:d,codec:M}}}}}}var I=m(R,["moov","mvex","trex"]);return I.forEach(function(v){var W=L(v,4),Z=x[W];Z&&(Z.default={duration:L(v,12),flags:L(v,20)})}),x}function h(R,x){return m(x,["moof","traf"]).reduce(function(S,D){var O=m(D,["tfdt"])[0],A=O.data[O.start],C=m(D,["tfhd"]).reduce(function(T,d){var f=L(d,4),b=R[f];if(b){var _=L(O,4);A===1&&(_*=Math.pow(2,32),_+=L(O,8));var j=b.timescale||9e4,U=_/j;if(isFinite(U)&&(T===null||U<T))return U}return T},null);return C!==null&&isFinite(C)&&(S===null||C<S)?C:S},null)||0}function p(R,x){for(var S=0,D=0,O=0,A=m(R,["moof","traf"]),C=0;C<A.length;C++){var T=A[C],d=m(T,["tfhd"])[0],f=L(d,4),b=x[f];if(!b)continue;var _=b.default,j=L(d,0)|(_==null?void 0:_.flags),U=_==null?void 0:_.duration;j&8&&(j&2?U=L(d,12):U=L(d,8));for(var w=b.timescale||9e4,M=m(T,["trun"]),I=0;I<M.length;I++){if(U){var v=L(M[I],4);S=U*v}else S=o(M[I]);b.type===H.ElementaryStreamTypes.VIDEO?D+=S/w:b.type===H.ElementaryStreamTypes.AUDIO&&(O+=S/w)}}if(D===0&&O===0){var W=g(R);if(W!=null&&W.references)return W.references.reduce(function(Z,oe){return Z+oe.info.duration||0},0)}return D||O}function o(R){var x=L(R,0),S=8;x&1&&(S+=4),x&4&&(S+=4);for(var D=0,O=L(R,4),A=0;A<O;A++){if(x&256){var C=L(R,S);D+=C,S+=4}x&512&&(S+=4),x&1024&&(S+=4),x&2048&&(S+=4)}return D}function u(R,x,S){m(x,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(O){var A=L(O,4),C=R[A];if(!C)return;var T=C.timescale||9e4;m(D,["tfdt"]).forEach(function(d){var f=d.data[d.start],b=L(d,4);if(f===0)y(d,4,b-S*T);else{b*=Math.pow(2,32),b+=L(d,8),b-=S*T,b=Math.max(b,0);var _=Math.floor(b/(P+1)),j=Math.floor(b%(P+1));y(d,4,_),y(d,8,j)}})})})}function s(R){var x={valid:null,remainder:null},S=m(R,["moof"]);if(S){if(S.length<2)return x.remainder=R,x}else return x;var D=S[S.length-1];return x.valid=Object(X.sliceUint8)(R,0,D.start-8),x.remainder=Object(X.sliceUint8)(R,D.start-8),x}function a(R,x){var S=new Uint8Array(R.length+x.length);return S.set(R),S.set(x,R.length),S}},"./src/utils/output-filter.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return X});var X=function(){function H(K,z){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=z}var P=H.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(z,n,L){(this.startTime===null||this.startTime>z)&&(this.startTime=z),this.endTime=n,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},H}()},"./src/utils/texttrack-utils.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return H}),N.d(Y,"addCueToTrack",function(){return P}),N.d(Y,"clearCurrentCues",function(){return K}),N.d(Y,"removeCuesInRange",function(){return z}),N.d(Y,"getCuesInRange",function(){return L});var X=N("./src/utils/logger.ts");function H(y,m){var g;try{g=new Event("addtrack")}catch(l){g=document.createEvent("Event"),g.initEvent("addtrack",!1,!1)}g.track=y,m.dispatchEvent(g)}function P(y,m){var g=y.mode;if(g==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(m.id))try{if(y.addCue(m),!y.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(h){X.logger.debug("[texttrack-utils]: "+h);var l=new self.TextTrackCue(m.startTime,m.endTime,m.text);l.id=m.id,y.addCue(l)}g==="disabled"&&(y.mode=g)}function K(y){var m=y.mode;if(m==="disabled"&&(y.mode="hidden"),y.cues)for(var g=y.cues.length;g--;)y.removeCue(y.cues[g]);m==="disabled"&&(y.mode=m)}function z(y,m,g){var l=y.mode;if(l==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var h=L(y.cues,m,g),p=0;p<h.length;p++)y.removeCue(h[p]);l==="disabled"&&(y.mode=l)}function n(y,m){if(m<y[0].startTime)return 0;var g=y.length-1;if(m>y[g].endTime)return-1;for(var l=0,h=g;l<=h;){var p=Math.floor((h+l)/2);if(m<y[p].startTime)h=p-1;else if(m>y[p].startTime&&l<g)l=p+1;else return p}return y[l].startTime-m<m-y[h].startTime?l:h}function L(y,m,g){var l=[],h=n(y,m);if(h>-1)for(var p=h,o=y.length;p<o;p++){var u=y[p];if(u.startTime>=m&&u.endTime<=g)l.push(u);else if(u.startTime>g)return l}return l}},"./src/utils/time-ranges.ts":function(le,Y,N){"use strict";N.r(Y);var X={toString:function(P){for(var K="",z=P.length,n=0;n<z;n++)K+="["+P.start(n).toFixed(3)+","+P.end(n).toFixed(3)+"]";return K}};Y.default=X},"./src/utils/timescale-conversion.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"toTimescaleFromBase",function(){return H}),N.d(Y,"toTimescaleFromScale",function(){return P}),N.d(Y,"toMsFromMpegTsClock",function(){return K}),N.d(Y,"toMpegTsClockFromTimescale",function(){return z});var X=9e4;function H(n,L,y,m){y===void 0&&(y=1),m===void 0&&(m=!1);var g=n*L*y;return m?Math.round(g):g}function P(n,L,y,m){return y===void 0&&(y=1),m===void 0&&(m=!1),H(n,L,1/y,m)}function K(n,L){return L===void 0&&(L=!1),H(n,1e3,1/X,L)}function z(n,L){return L===void 0&&(L=1),H(n,X,1/L)}},"./src/utils/typed-array.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"sliceUint8",function(){return X});function X(H,P,K){return Uint8Array.prototype.slice?H.slice(P,K):new Uint8Array(Array.prototype.slice.call(H,P,K))}},"./src/utils/vttcue.ts":function(le,Y,N){"use strict";N.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],H=["start","middle","end","left","right"];function P(y,m){if(typeof m!="string")return!1;if(!Array.isArray(y))return!1;var g=m.toLowerCase();return~y.indexOf(g)?g:!1}function K(y){return P(X,y)}function z(y){return P(H,y)}function n(y){for(var m=arguments.length,g=new Array(m>1?m-1:0),l=1;l<m;l++)g[l-1]=arguments[l];for(var h=1;h<arguments.length;h++){var p=arguments[h];for(var o in p)y[o]=p[o]}return y}function L(y,m,g){var l=this,h={enumerable:!0};l.hasBeenReset=!1;var p="",o=!1,u=y,s=m,a=g,R=null,x="",S=!0,D="auto",O="start",A=50,C="middle",T=50,d="middle";Object.defineProperty(l,"id",n({},h,{get:function(){return p},set:function(b){p=""+b}})),Object.defineProperty(l,"pauseOnExit",n({},h,{get:function(){return o},set:function(b){o=!!b}})),Object.defineProperty(l,"startTime",n({},h,{get:function(){return u},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",n({},h,{get:function(){return s},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",n({},h,{get:function(){return a},set:function(b){a=""+b,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",n({},h,{get:function(){return R},set:function(b){R=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",n({},h,{get:function(){return x},set:function(b){var _=K(b);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");x=_,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",n({},h,{get:function(){return S},set:function(b){S=!!b,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",n({},h,{get:function(){return D},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",n({},h,{get:function(){return O},set:function(b){var _=z(b);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");O=_,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",n({},h,{get:function(){return A},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");A=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",n({},h,{get:function(){return C},set:function(b){var _=z(b);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");C=_,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",n({},h,{get:function(){return T},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",n({},h,{get:function(){return d},set:function(b){var _=z(b);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");d=_,this.hasBeenReset=!0}})),l.displayState=void 0}return L.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return P}),N.d(Y,"fixLineBreaks",function(){return m}),N.d(Y,"VTTParser",function(){return g});var X=N("./src/utils/vttcue.ts"),H=function(){function l(){}var h=l.prototype;return h.decode=function(o,u){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},l}();function P(l){function h(o,u,s,a){return(o|0)*3600+(u|0)*60+(s|0)+parseFloat(a||0)}var p=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?h(p[2],p[3],0,p[4]):h(p[1],p[2],p[3],p[4]):null}var K=function(){function l(){this.values=Object.create(null)}var h=l.prototype;return h.set=function(o,u){!this.get(o)&&u!==""&&(this.values[o]=u)},h.get=function(o,u,s){return s?this.has(o)?this.values[o]:u[s]:this.has(o)?this.values[o]:u},h.has=function(o){return o in this.values},h.alt=function(o,u,s){for(var a=0;a<s.length;++a)if(u===s[a]){this.set(o,u);break}},h.integer=function(o,u){/^-?\d+$/.test(u)&&this.set(o,parseInt(u,10))},h.percent=function(o,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},l}();function z(l,h,p,o){var u=o?l.split(o):[l];for(var s in u){if(typeof u[s]!="string")continue;var a=u[s].split(p);if(a.length!==2)continue;var R=a[0],x=a[1];h(R,x)}}var n=new X.default(0,0,""),L=n.align==="middle"?"middle":"center";function y(l,h,p){var o=l;function u(){var R=P(l);if(R===null)throw new Error("Malformed timestamp: "+o);return l=l.replace(/^[^\sa-zA-Z-]+/,""),R}function s(R,x){var S=new K;z(R,function(A,C){var T;switch(A){case"region":for(var d=p.length-1;d>=0;d--)if(p[d].id===C){S.set(A,p[d].region);break}break;case"vertical":S.alt(A,C,["rl","lr"]);break;case"line":T=C.split(","),S.integer(A,T[0]),S.percent(A,T[0])&&S.set("snapToLines",!1),S.alt(A,T[0],["auto"]),T.length===2&&S.alt("lineAlign",T[1],["start",L,"end"]);break;case"position":T=C.split(","),S.percent(A,T[0]),T.length===2&&S.alt("positionAlign",T[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":S.percent(A,C);break;case"align":S.alt(A,C,["start",L,"end","left","right"]);break}},/:/,/\s/),x.region=S.get("region",null),x.vertical=S.get("vertical","");var D=S.get("line","auto");D==="auto"&&n.line===-1&&(D=-1),x.line=D,x.lineAlign=S.get("lineAlign","start"),x.snapToLines=S.get("snapToLines",!0),x.size=S.get("size",100),x.align=S.get("align",L);var O=S.get("position","auto");O==="auto"&&n.position===50&&(O=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=O}function a(){l=l.replace(/^\s+/,"")}if(a(),h.startTime=u(),a(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);l=l.substr(3),a(),h.endTime=u(),a(),s(l,h)}function m(l){return l.replace(/<br(?: \/)?>/gi,`
`)}var g=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new H,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var h=l.prototype;return h.parse=function(o){var u=this;o&&(u.buffer+=u.decoder.decode(o,{stream:!0}));function s(){var O=u.buffer,A=0;for(O=m(O);A<O.length&&O[A]!=="\r"&&O[A]!==`
`;)++A;var C=O.substr(0,A);return O[A]==="\r"&&++A,O[A]===`
`&&++A,u.buffer=O.substr(A),C}function a(O){z(O,function(A,C){},/:/)}try{var R="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;R=s();var x=R.match(/^()?WEBVTT([ \t].*)?$/);if(!x||!x[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:R=s();switch(u.state){case"HEADER":/:/.test(R)?a(R):R||(u.state="ID");continue;case"NOTE":R||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){u.state="NOTE";break}if(!R)continue;if(u.cue=new X.default(0,0,""),u.state="CUE",R.indexOf("-->")===-1){u.cue.id=R;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{y(R,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(S=!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+=R}continue;case"BADCUE":R||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},h.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},l}()},"./src/utils/webvtt-parser.ts":function(le,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return g}),N.d(Y,"parseWebVTT",function(){return h});var X=N("./src/polyfills/number.ts"),H=N("./src/utils/vttparser.ts"),P=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),z=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,L=function(o,u,s){return s===void 0&&(s=0),o.substr(s,u.length)===u},y=function(o){var u=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),a=parseInt(o.substr(-9,2)),R=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)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return u+=1e3*s,u+=60*1e3*a,u+=60*60*1e3*R,u},m=function(o){for(var u=5381,s=o.length;s;)u=u*33^o.charCodeAt(--s);return(u>>>0).toString()};function g(p,o,u){return m(p.toString())+m(o.toString())+m(u)}var l=function(o,u,s){var a=o[u],R=o[a.prevCC];if(!R||!R.new&&a.new){o.ccOffset=o.presentationOffset=a.start,a.new=!1;return}for(;(x=R)!==null&&x!==void 0&&x.new;){var x;o.ccOffset+=a.start-R.start,a.new=!1,a=R,R=o[a.prevCC]}o.presentationOffset=s};function h(p,o,u,s,a,R,x,S){var D=new H.VTTParser,O=Object(P.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
`).split(`
`),A=[],C=Object(K.toMpegTsClockFromTimescale)(o,u),T="00:00.000",d=0,f=0,b,_=!0,j=!1;D.oncue=function(U){var w=s[a],M=s.ccOffset,I=(d-C)/9e4;if(w!=null&&w.new&&(f!==void 0?M=s.ccOffset=w.start:l(s,a,I)),I&&(M=I-s.presentationOffset),j){var v=U.endTime-U.startTime,W=Object(z.normalizePts)((U.startTime+M-f)*9e4,R*9e4)/9e4;U.startTime=W,U.endTime=W+v}var Z=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Z)),U.id||(U.id=g(U.startTime,U.endTime,Z)),U.endTime>0&&A.push(U)},D.onparsingerror=function(U){b=U},D.onflush=function(){if(b){S(b);return}x(A)},O.forEach(function(U){if(_)if(L(U,"X-TIMESTAMP-MAP=")){_=!1,j=!0,U.substr(16).split(",").forEach(function(w){L(w,"LOCAL:")?T=w.substr(6):L(w,"MPEGTS:")&&(d=parseInt(w.substr(7)))});try{f=y(T)/1e3}catch(w){j=!1,b=w}return}else U===""&&(_=!1);D.parse(U+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(le,Y,N){"use strict";N.r(Y);var X=N("./src/utils/logger.ts"),H=N("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,K=function(){function z(L){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=L?L.xhrSetup:null,this.stats=new H.LoadStats,this.retryDelay=0}var n=z.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},n.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(y,m,g){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=m,this.callbacks=g,this.retryDelay=m.retryDelay,this.loadInternal()},n.loadInternal=function(){var y=this.config,m=this.context;if(!y)return;var g=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var h=this.xhrSetup;try{if(h)try{h(g,m.url)}catch(u){g.open("GET",m.url,!0),h(g,m.url)}g.readyState||g.open("GET",m.url,!0);var p=this.context.headers;if(p)for(var o in p)g.setRequestHeader(o,p[o])}catch(u){this.callbacks.onError({code:g.status,text:u.message},m,g);return}m.rangeEnd&&g.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),g.onreadystatechange=this.readystatechange.bind(this),g.onprogress=this.loadprogress.bind(this),g.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),g.send()},n.readystatechange=function(){var y=this.context,m=this.loader,g=this.stats;if(!y||!m)return;var l=m.readyState,h=this.config;if(g.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),g.loading.first===0&&(g.loading.first=Math.max(self.performance.now(),g.loading.start)),l===4){m.onreadystatechange=null,m.onprogress=null;var p=m.status;if(p>=200&&p<300){g.loading.end=Math.max(self.performance.now(),g.loading.first);var o,u;if(y.responseType==="arraybuffer"?(o=m.response,u=o.byteLength):(o=m.responseText,u=o.length),g.loaded=g.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(g,y,o,m),!this.callbacks)return;var a={url:m.responseURL,data:o};this.callbacks.onSuccess(a,g,y,m)}else g.retry>=h.maxRetry||p>=400&&p<499?(X.logger.error(p+" while loading "+y.url),this.callbacks.onError({code:p,text:m.statusText},y,m)):(X.logger.warn(p+" while loading "+y.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,h.maxRetryDelay),g.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout)},n.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(y){var m=this.stats;m.loaded=y.loaded,y.lengthComputable&&(m.total=y.total)},n.getCacheAge=function(){var y=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");y=m?parseFloat(m):null}return y},z}();Y.default=K}}).default})},vHTk:function(Je,Ee,J){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(Je,Ee,J){"use strict";J.d(Ee,"c",function(){return H}),J.d(Ee,"b",function(){return P}),J.d(Ee,"d",function(){return K}),J.d(Ee,"a",function(){return n}),J.d(Ee,"e",function(){return L});var le=J("9og8"),Y=J("WmNS"),N=J.n(Y),X=J("ErOA");function H(y){return Object(X.c)("libraries/".concat(y,".json"))}function P(){return Object(X.c)("library_tags.json")}function K(y){return z.apply(this,arguments)}function z(){return z=Object(le.a)(N.a.mark(function y(m){var g;return N.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Object(X.b)("attachments/".concat(m,".json"));case 2:return g=h.sent,h.abrupt("return",g.status===0);case 4:case"end":return h.stop()}},y)})),z.apply(this,arguments)}function n(y){return Object(X.f)("libraries.json",y)}function L(y,m){return Object(X.g)("libraries/".concat(y,".json"),m)}},y5JW:function(Je,Ee,J){"use strict";J.d(Ee,"c",function(){return p}),J.d(Ee,"a",function(){return o});var le=J("DZo9"),Y=J("8z0m"),N=J("+L6B"),X=J("2/Rp"),H=J("9og8"),P=J("miYZ"),K=J("tsqr"),z=J("k1fw"),n=J("oBTY"),L=J("WmNS"),y=J.n(L),m=J("q1tI"),g=J.n(m),l=J("m3rI"),h=J("wzkS"),p="\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]}Ee.b=function(u){var s=u.value,a=s===void 0?[]:s,R=u.action,x=u.onChange,S=u.className,D=u.maxSize,O=D===void 0?150:D,A=u.title,C=A===void 0?"\u6587\u4EF6\u4E0A\u4F20":A,T=u.accept,d=T===void 0?null:T,f={multiple:!1,fileList:a,accept:d,withCredentials:!0,beforeUpload:function(j){var U=j.size/1024/1024;return!0},action:"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(j){var U,w,M=Object(n.a)(j.fileList);if(M=M.map(function(W){return W.name.indexOf(p)===-1&&(W.name="".concat(W.name).concat(p).concat(o(W.size))),Object(z.a)({},W)}),j.file.status==="done"&&((U=j.file)===null||U===void 0||((w=U.response)===null||w===void 0)?void 0:w.status)===-1){var I,v;K.b.error((I=j.file)===null||I===void 0||((v=I.response)===null||v===void 0)?void 0:v.message),x([]);return}x(M)},onRemove:function(){var _=Object(H.a)(y.a.mark(function U(w){var M,I,v;return y.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(M=w.size/1024/1024,!(w.status==="uploading")){Z.next=3;break}return Z.abrupt("return",!0);case 3:if(M<O){Z.next=7;break}return Z.abrupt("return",!0);case 7:if(I=w.response?w.response.id:w.uid,!I){Z.next=15;break}return Z.next=11,Object(h.d)(w.response?w.response.id:w.id);case 11:return v=Z.sent,Z.abrupt("return",v);case 15:return Z.abrupt("return",!0);case 16:case"end":return Z.stop()}},U)}));function j(U){return _.apply(this,arguments)}return j}()};function b(_){_.preventDefault(),_.stopPropagation()}return g.a.createElement("div",{className:"single-upload ".concat(S||"")},g.a.createElement(Y.a,f,g.a.createElement(X.a,{type:"primary",title:a.length>0?"\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),g.a.createElement("span",{onClick:b,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",O,"M)"," ")))}}}]);