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.
446 lines
1.3 MiB
446 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[211,3,4,7,8],{"+NIl":function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(z,D){"use strict";function V(c,s){c.cmdState.push(s)}function U(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function O(c){var s=c.cmdState.pop();s&&s.closeBracket()}function G(c){for(var s=c.cmdState,d=s.length-1;d>=0;d--){var i=s[d];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function W(c,s,d){return function(){this.name=c,this.bracketNo=0,this.style=s,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=W("importmodule","tag",["string","builtin"]),n.documentclass=W("documentclass","tag",["","atom"]),n.usepackage=W("usepackage","tag",["atom"]),n.begin=W("begin","tag",["atom"]),n.end=W("end","tag",["atom"]),n.label=W("label","tag",["atom"]),n.ref=W("ref","tag",["atom"]),n.eqref=W("eqref","tag",["atom"]),n.cite=W("cite","tag",["atom"]),n.bibitem=W("bibitem","tag",["atom"]),n.Bibitem=W("Bibitem","tag",["atom"]),n.RBibitem=W("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,s){c.f=s}function g(c,s){var d;if(c.match(/^\\[a-zA-Z@]+/)){var i=c.current().slice(1);return d=n.hasOwnProperty(i)?n[i]:n.DEFAULT,d=new d,V(s,d),I(s,h),d.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(s,function(r,o){return p(r,o,"\\]")}),"keyword";if(c.match("\\("))return I(s,function(r,o){return p(r,o,"\\)")}),"keyword";if(c.match("$$"))return I(s,function(r,o){return p(r,o,"$$")}),"keyword";if(c.match("$"))return I(s,function(r,o){return p(r,o,"$")}),"keyword";var l=c.next();if(l=="%")return c.skipToEnd(),"comment";if(l=="}"||l=="]"){if(d=U(s),d)d.closeBracket(l),I(s,h);else return"error";return"bracket"}else return l=="{"||l=="["?(d=n.DEFAULT,d=new d,V(s,d),"bracket"):/\d/.test(l)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),d=G(s),d.name=="begin"&&(d.argument=c.current()),d.styleIdentifier())}function p(c,s,d){if(c.eatSpace())return null;if(d&&c.match(d))return I(s,g),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=c.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(c.skipToEnd(),"comment"):"error"}function h(c,s){var d=c.peek(),i;return d=="{"||d=="["?(i=U(s),i.openBracket(d),c.eat(d),I(s,g),"bracket"):/[ \t\r]/.test(d)?(c.eat(d),null):(I(s,g),O(s),g(c,s))}return{startState:function(){var c=D.inMathMode?function(s,d){return p(s,d)}:g;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,s){return s.f(c,s)},blankLine:function(c){c.f=g,c.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+aKw":function(ke,de,P){"use strict";var q=P("tJVT"),z=P("q1tI"),D=P.n(z),V=function(G){return String(G).length===1?"0".concat(G):G},U=function(G){var W=G.className,n=W===void 0?"":W,I=G.onChange,g=G.defaultValue,p=g===void 0?0:g,h=Object(z.useState)(p),c=Object(q.a)(h,2),s=c[0],d=c[1];Object(z.useEffect)(function(){var o=setTimeout(function(){d(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(o)}},[s]);var i=parseInt(s/(60*6e4))||"00",l=parseInt(s%(60*6e4)/6e4)||"00",r=parseInt(s%6e4/1e3)||"00";return D.a.createElement("div",{className:n},V(i),":",V(l),":",V(r))};de.a=U},"+k/U":function(ke,de,P){ke.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(ke,de,P){},"/cxE":function(ke,de,P){"use strict";P.d(de,"f",function(){return D}),P.d(de,"g",function(){return V}),P.d(de,"h",function(){return U}),P.d(de,"e",function(){return G}),P.d(de,"b",function(){return W}),P.d(de,"c",function(){return n}),P.d(de,"d",function(){return I}),P.d(de,"a",function(){return g});class q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(h=>{h(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const z=new q;function D(p){G(p)||z.onUnexpectedError(p);return}function V(p){G(p)||z.onUnexpectedExternalError(p);return}function U(p){if(p instanceof Error){let{name:h,message:c}=p;const s=p.stacktrace||p.stack;return{$isError:!0,name:h,message:c,stack:s}}return p}const O="Canceled";function G(p){return p instanceof Error&&p.name===O&&p.message===O}function W(){const p=new Error(O);return p.name=p.message,p}function n(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function I(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class g extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"07cG":function(ke,de,P){ke.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){q.defineOption("placeholder","",function(W,n,I){var g=I&&I!=q.Init;if(n&&!g)W.on("blur",U),W.on("change",O),W.on("swapDoc",O),q.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),O(W);else if(!n&&g){W.off("blur",U),W.off("change",O),W.off("swapDoc",O),q.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),z(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}n&&!W.hasFocus()&&U(W)});function z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function D(W){z(W);var n=W.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=W.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=W.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),W.display.lineSpace.insertBefore(n,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var n=!1,I=W.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:W.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?D(W):z(W)},20)}function U(W){G(W)&&D(W)}function O(W){var n=W.getWrapperElement(),I=G(W);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?D(W):z(W)}function G(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){"use strict";var z={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(V,U){var O=V.indentUnit,G={},W=U.htmlMode?z:D;for(var n in W)G[n]=W[n];for(var n in U)G[n]=U[n];var I,g;function p(f,S){function b(B){return S.tokenize=B,B(f,S)}var y=f.next();if(y=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?b(s("atom","]]>")):null:f.match("--")?b(s("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),b(d(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),S.tokenize=s("meta","?>"),"meta"):(I=f.eat("/")?"closeTag":"openTag",S.tokenize=h,"tag bracket");if(y=="&"){var M;return f.eat("#")?f.eat("x")?M=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):M=f.eatWhile(/[\d]/)&&f.eat(";"):M=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),M?"atom":"error"}else return f.eatWhile(/[^&<]/),null}p.isInText=!0;function h(f,S){var b=f.next();if(b==">"||b=="/"&&f.eat(">"))return S.tokenize=p,I=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return I="equals",null;if(b=="<"){S.tokenize=p,S.state=o,S.tagName=S.tagStart=null;var y=S.tokenize(f,S);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(b)?(S.tokenize=c(b),S.stringStartCol=f.column(),S.tokenize(f,S)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(f){var S=function(b,y){for(;!b.eol();)if(b.next()==f){y.tokenize=h;break}return"string"};return S.isInAttribute=!0,S}function s(f,S){return function(b,y){for(;!b.eol();){if(b.match(S)){y.tokenize=p;break}b.next()}return f}}function d(f){return function(S,b){for(var y;(y=S.next())!=null;){if(y=="<")return b.tokenize=d(f+1),b.tokenize(S,b);if(y==">")if(f==1){b.tokenize=p;break}else return b.tokenize=d(f-1),b.tokenize(S,b)}return"meta"}}function i(f,S,b){this.prev=f.context,this.tagName=S,this.indent=f.indented,this.startOfLine=b,(G.doNotIndent.hasOwnProperty(S)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function l(f){f.context&&(f.context=f.context.prev)}function r(f,S){for(var b;;){if(!f.context)return;if(b=f.context.tagName,!G.contextGrabbers.hasOwnProperty(b)||!G.contextGrabbers[b].hasOwnProperty(S))return;l(f)}}function o(f,S,b){return f=="openTag"?(b.tagStart=S.column(),w):f=="closeTag"?T:o}function w(f,S,b){return f=="word"?(b.tagName=S.current(),g="tag",A):G.allowMissingTagName&&f=="endTag"?(g="tag bracket",A(f,S,b)):(g="error",w)}function T(f,S,b){if(f=="word"){var y=S.current();return b.context&&b.context.tagName!=y&&G.implicitlyClosed.hasOwnProperty(b.context.tagName)&&l(b),b.context&&b.context.tagName==y||G.matchClosing===!1?(g="tag",x):(g="tag error",L)}else return G.allowMissingTagName&&f=="endTag"?(g="tag bracket",x(f,S,b)):(g="error",L)}function x(f,S,b){return f!="endTag"?(g="error",x):(l(b),o)}function L(f,S,b){return g="error",x(f,S,b)}function A(f,S,b){if(f=="word")return g="attribute",E;if(f=="endTag"||f=="selfcloseTag"){var y=b.tagName,M=b.tagStart;return b.tagName=b.tagStart=null,f=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(y)?r(b,y):(r(b,y),b.context=new i(b,y,M==b.indented)),o}return g="error",A}function E(f,S,b){return f=="equals"?_:(G.allowMissing||(g="error"),A(f,S,b))}function _(f,S,b){return f=="string"?m:f=="word"&&G.allowUnquoted?(g="string",A):(g="error",A(f,S,b))}function m(f,S,b){return f=="string"?m:A(f,S,b)}return{startState:function(f){var S={tokenize:p,state:o,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(S.baseIndent=f),S},token:function(f,S){if(!S.tagName&&f.sol()&&(S.indented=f.indentation()),f.eatSpace())return null;I=null;var b=S.tokenize(f,S);return(b||I)&&b!="comment"&&(g=null,S.state=S.state(I||b,f,S),g&&(b=g=="error"?b+" error":g)),b},indent:function(f,S,b){var y=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+O;if(y&&y.noIndent)return q.Pass;if(f.tokenize!=h&&f.tokenize!=p)return b?b.match(/^(\s*)/)[0].length:0;if(f.tagName)return G.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+O*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var M=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(M&&M[1])for(;y;)if(y.tagName==M[2]){y=y.prev;break}else if(G.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(M)for(;y;){var B=G.contextGrabbers[y.tagName];if(B&&B.hasOwnProperty(M[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+O:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(f){f.state==_&&(f.state=A)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var S=[],b=f.context;b;b=b.prev)b.tagName&&S.push(b.tagName);return S.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(ke,de,P){"use strict";P.d(de,"a",function(){return z});class q{constructor(D){this.element=D,this.next=q.Undefined,this.prev=q.Undefined}}q.Undefined=new q(void 0);class z{constructor(){this._first=q.Undefined,this._last=q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===q.Undefined}clear(){let D=this._first;for(;D!==q.Undefined;){const V=D.next;D.prev=q.Undefined,D.next=q.Undefined,D=V}this._first=q.Undefined,this._last=q.Undefined,this._size=0}unshift(D){return this._insert(D,!1)}push(D){return this._insert(D,!0)}_insert(D,V){const U=new q(D);if(this._first===q.Undefined)this._first=U,this._last=U;else if(V){const G=this._last;this._last=U,U.prev=G,G.next=U}else{const G=this._first;this._first=U,U.next=G,G.prev=U}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(U))}}shift(){if(this._first===q.Undefined)return;{const D=this._first.element;return this._remove(this._first),D}}pop(){if(this._last===q.Undefined)return;{const D=this._last.element;return this._remove(this._last),D}}_remove(D){if(D.prev!==q.Undefined&&D.next!==q.Undefined){const V=D.prev;V.next=D.next,D.next.prev=V}else D.prev===q.Undefined&&D.next===q.Undefined?(this._first=q.Undefined,this._last=q.Undefined):D.next===q.Undefined?(this._last=this._last.prev,this._last.next=q.Undefined):D.prev===q.Undefined&&(this._first=this._first.next,this._first.prev=q.Undefined);this._size-=1}*[Symbol.iterator](){let D=this._first;for(;D!==q.Undefined;)yield D.element,D=D.next}}},"3/fG":function(ke,de,P){"use strict";P.d(de,"a",function(){return z});function q(D,V){let U;return V.length===0?U=D:U=D.replace(/\{(\d+)\}/g,function(O,G){const W=G[0];return typeof V[W]!="undefined"?V[W]:O}),U}function z(D,V,...U){return q(V,U)}},"55Ip":function(ke,de,P){"use strict";P.d(de,"a",function(){return r});var q=P("Ty5D"),z=P("dI71"),D=P("q1tI"),V=P.n(D),U=P("YS25"),O=P("17x9"),G=P.n(O),W=P("wx14"),n=P("zLVn"),I=P("9R94"),g=function(_){Object(z.a)(m,_);function m(){for(var S,b=arguments.length,y=new Array(b),M=0;M<b;M++)y[M]=arguments[M];return S=_.call.apply(_,[this].concat(y))||this,S.history=Object(U.a)(S.props),S}var f=m.prototype;return f.render=function(){return V.a.createElement(q.c,{history:this.history,children:this.props.children})},m}(V.a.Component),p=function(_){Object(z.a)(m,_);function m(){for(var S,b=arguments.length,y=new Array(b),M=0;M<b;M++)y[M]=arguments[M];return S=_.call.apply(_,[this].concat(y))||this,S.history=Object(U.b)(S.props),S}var f=m.prototype;return f.render=function(){return V.a.createElement(q.c,{history:this.history,children:this.props.children})},m}(V.a.Component),h=function(m,f){return typeof m=="function"?m(f):m},c=function(m,f){return typeof m=="string"?Object(U.c)(m,null,null,f):m},s=function(m){return m},d=V.a.forwardRef;typeof d=="undefined"&&(d=s);function i(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var l=d(function(_,m){var f=_.innerRef,S=_.navigate,b=_.onClick,y=Object(n.a)(_,["innerRef","navigate","onClick"]),M=y.target,B=Object(W.a)({},y,{onClick:function(H){try{b&&b(H)}catch(N){throw H.preventDefault(),N}!H.defaultPrevented&&H.button===0&&(!M||M==="_self")&&!i(H)&&(H.preventDefault(),S())}});return s!==d?B.ref=m||f:B.ref=f,V.a.createElement("a",B)}),r=d(function(_,m){var f=_.component,S=f===void 0?l:f,b=_.replace,y=_.to,M=_.innerRef,B=Object(n.a)(_,["component","replace","to","innerRef"]);return V.a.createElement(q.e.Consumer,null,function(R){R||Object(I.a)(!1);var H=R.history,N=c(h(y,R.location),R.location),C=N?H.createHref(N):"",K=Object(W.a)({},B,{href:C,navigate:function(){var oe=h(y,R.location),fe=b?H.replace:H.push;fe(oe)}});return s!==d?K.ref=m||M:K.innerRef=M,V.a.createElement(S,K)})});if(!1)var o,w;var T=function(m){return m},x=V.a.forwardRef;typeof x=="undefined"&&(x=T);function L(){for(var _=arguments.length,m=new Array(_),f=0;f<_;f++)m[f]=arguments[f];return m.filter(function(S){return S}).join(" ")}var A=x(function(_,m){var f=_["aria-current"],S=f===void 0?"page":f,b=_.activeClassName,y=b===void 0?"active":b,M=_.activeStyle,B=_.className,R=_.exact,H=_.isActive,N=_.location,C=_.sensitive,K=_.strict,Z=_.style,oe=_.to,fe=_.innerRef,xe=Object(n.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return V.a.createElement(q.e.Consumer,null,function(be){be||Object(I.a)(!1);var Te=N||be.location,Ce=c(h(oe,Te),Te),Le=Ce.pathname,ge=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),Y=ge?Object(q.f)(Te.pathname,{path:ge,exact:R,sensitive:C,strict:K}):null,k=!!(H?H(Y,Te):Y),j=k?L(B,y):B,J=k?Object(W.a)({},Z,{},M):Z,ie=Object(W.a)({"aria-current":k&&S||null,className:j,style:J,to:Ce},xe);return T!==x?ie.ref=m||fe:ie.innerRef=fe,V.a.createElement(r,ie)})});if(!1)var E},"5VLF":function(ke,de,P){"use strict";var q,z;function D(V,U,O){var G=function(W,n){return V.js_beautify(W,n)};return G.js=V.js_beautify,G.css=U.css_beautify,G.html=O.html_beautify,G.js_beautify=V.js_beautify,G.css_beautify=U.css_beautify,G.html_beautify=O.html_beautify,G}!(q=[P("6UM0"),P("TXwP"),P("psGv")],z=function(V,U,O){return D(V,U,O)}.apply(de,q),z!==void 0&&(ke.exports=z))},"5Y4S":function(ke,de,P){"use strict";P.d(de,"a",function(){return D});var q=P("MNsG");const z=q.b.performance&&typeof q.b.performance.now=="function";class D{constructor(V){this._highResolution=z&&V,this._startTime=this._now(),this._stopTime=-1}static create(V=!0){return new D(V)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?q.b.performance.now():Date.now()}}},"5nXd":function(ke,de,P){var q=P("MFOe"),z=q.slice,D=q.pluck,V=q.each,U=q.bind,O=q.create,G=q.isList,W=q.isFunction,n=q.isObject;ke.exports={createStore:p};var I={version:"2.0.12",enabled:!1,get:function(h,c){var s=this.storage.read(this._namespacePrefix+h);return this._deserialize(s,c)},set:function(h,c){return c===void 0?this.remove(h):(this.storage.write(this._namespacePrefix+h,this._serialize(c)),c)},remove:function(h){this.storage.remove(this._namespacePrefix+h)},each:function(h){var c=this;this.storage.each(function(s,d){h.call(c,c._deserialize(s),(d||"").replace(c._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(h){return this._namespacePrefix=="__storejs_"+h+"_"},createStore:function(){return p.apply(this,arguments)},addPlugin:function(h){this._addPlugin(h)},namespace:function(h){return p(this.storage,this.plugins,h)}};function g(){var h=typeof console=="undefined"?null:console;if(!h)return;var c=h.warn?h.warn:h.log;c.apply(h,arguments)}function p(h,c,s){s||(s=""),h&&!G(h)&&(h=[h]),c&&!G(c)&&(c=[c]);var d=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+d):null,l=/^[a-zA-Z0-9_\-]*$/;if(!l.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:d,_namespaceRegexp:i,_testStorage:function(w){try{var T="__storejs__test__";w.write(T,T);var x=w.read(T)===T;return w.remove(T),x}catch(L){return!1}},_assignPluginFnProp:function(w,T){var x=this[T];this[T]=function(){var A=z(arguments,0),E=this;function _(){return x?(V(arguments,function(f,S){A[S]=f}),x.apply(E,A)):void 0}var m=[_].concat(A);return w.apply(E,m)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,T){if(!w)return T;var x="";try{x=JSON.parse(w)}catch(L){x=w}return x!==void 0?x:T},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var T=this;if(G(w)){V(w,function(A){T._addPlugin(A)});return}var x=D(this.plugins,function(A){return w===A});if(x)return;if(this.plugins.push(w),!W(w))throw new Error("Plugins must be function values that return objects");var L=w.call(this);if(!n(L))throw new Error("Plugins must return an object of function properties");V(L,function(A,E){if(!W(A))throw new Error("Bad plugin property: "+E+" from plugin "+w.name+". Plugins should only return functions.");T._assignPluginFnProp(A,E)})},addStorage:function(w){g("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},o=O(r,I,{plugins:[]});return o.raw={},V(o,function(w,T){W(w)&&(o.raw[T]=U(o,w))}),V(h,function(w){o._addStorage(w)}),V(c,function(w){o._addPlugin(w)}),o}},"6+eU":function(ke,de,P){"use strict";P.d(de,"a",function(){return x});var q=P("wx14"),z=P("rePB"),D=P("VTBJ"),V=P("1OyB"),U=P("vuIU"),O=P("Ji7U"),G=P("LK+K"),W=P("q1tI"),n=P.n(W),I=P("TSYQ"),g=P.n(I),p=function(A){var E,_="".concat(A.rootPrefixCls,"-item"),m=g()(_,"".concat(_,"-").concat(A.page),(E={},Object(z.a)(E,"".concat(_,"-active"),A.active),Object(z.a)(E,A.className,!!A.className),Object(z.a)(E,"".concat(_,"-disabled"),!A.page),E)),f=function(){A.onClick(A.page)},S=function(y){A.onKeyPress(y,A.onClick,A.page)};return n.a.createElement("li",{title:A.showTitle?A.page:null,className:m,onClick:f,onKeyPress:S,tabIndex:"0"},A.itemRender(A.page,"page",n.a.createElement("a",{rel:"nofollow"},A.page)))},h=p,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(L){Object(O.a)(E,L);var A=Object(G.a)(E);function E(){var _;Object(V.a)(this,E);for(var m=arguments.length,f=new Array(m),S=0;S<m;S++)f[S]=arguments[S];return _=A.call.apply(A,[this].concat(f)),_.state={goInputText:""},_.buildOptionText=function(b){return"".concat(b," ").concat(_.props.locale.items_per_page)},_.changeSize=function(b){_.props.changeSize(Number(b))},_.handleChange=function(b){_.setState({goInputText:b.target.value})},_.handleBlur=function(b){var y=_.props,M=y.goButton,B=y.quickGo,R=y.rootPrefixCls,H=_.state.goInputText;if(M||H==="")return;if(b.relatedTarget&&(b.relatedTarget.className.indexOf("".concat(R,"-prev"))>=0||b.relatedTarget.className.indexOf("".concat(R,"-next"))>=0))return;_.setState({goInputText:""}),B(_.getValidValue())},_.go=function(b){var y=_.state.goInputText;if(y==="")return;(b.keyCode===c.ENTER||b.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(U.a)(E,[{key:"getValidValue",value:function(){var m=this.state,f=m.goInputText,S=m.current;return!f||isNaN(f)?S:Number(f)}},{key:"getPageSizeOptions",value:function(){var m=this.props,f=m.pageSize,S=m.pageSizeOptions;return S.some(function(b){return b.toString()===f.toString()})?S:S.concat([f.toString()]).sort(function(b,y){var M=isNaN(Number(b))?0:Number(b),B=isNaN(Number(y))?0:Number(y);return M-B})}},{key:"render",value:function(){var m=this,f=this.props,S=f.pageSize,b=f.locale,y=f.rootPrefixCls,M=f.changeSize,B=f.quickGo,R=f.goButton,H=f.selectComponentClass,N=f.buildOptionText,C=f.selectPrefixCls,K=f.disabled,Z=this.state.goInputText,oe="".concat(y,"-options"),fe=H,xe=null,be=null,Te=null;if(!M&&!B)return null;var Ce=this.getPageSizeOptions();if(M&&fe){var Le=Ce.map(function(ge,Y){return n.a.createElement(fe.Option,{key:Y,value:ge.toString()},(N||m.buildOptionText)(ge))});xe=n.a.createElement(fe,{disabled:K,prefixCls:C,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||Ce[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Y){return Y.parentNode}},Le)}return B&&(R&&(Te=typeof R=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(oe,"-quick-jumper-button")},b.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},R)),be=n.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},b.jump_to,n.a.createElement("input",{disabled:K,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),b.page,Te)),n.a.createElement("li",{className:"".concat(oe)},xe,be)}}]),E}(n.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=s,i=P("N2Kk");function l(){}function r(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function o(L,A,E){return E}function w(L,A,E){var _=typeof L=="undefined"?A.pageSize:L;return Math.floor((E.total-1)/_)+1}var T=function(L){Object(O.a)(E,L);var A=Object(G.a)(E);function E(_){var m;Object(V.a)(this,E),m=A.call(this,_),m.getJumpPrevPage=function(){return Math.max(1,m.state.current-(m.props.showLessItems?3:5))},m.getJumpNextPage=function(){return Math.min(w(void 0,m.state,m.props),m.state.current+(m.props.showLessItems?3:5))},m.getItemIcon=function(M,B){var R=m.props.prefixCls,H=M||n.a.createElement("button",{type:"button","aria-label":B,className:"".concat(R,"-item-link")});return typeof M=="function"&&(H=n.a.createElement(M,Object(D.a)({},m.props))),H},m.savePaginationNode=function(M){m.paginationNode=M},m.isValid=function(M){return r(M)&&M!==m.state.current},m.shouldDisplayQuickJumper=function(){var M=m.props,B=M.showQuickJumper,R=M.pageSize,H=M.total;return H<=R?!1:B},m.handleKeyDown=function(M){(M.keyCode===c.ARROW_UP||M.keyCode===c.ARROW_DOWN)&&M.preventDefault()},m.handleKeyUp=function(M){var B=m.getValidValue(M),R=m.state.currentInputValue;B!==R&&m.setState({currentInputValue:B}),M.keyCode===c.ENTER?m.handleChange(B):M.keyCode===c.ARROW_UP?m.handleChange(B-1):M.keyCode===c.ARROW_DOWN&&m.handleChange(B+1)},m.changePageSize=function(M){var B=m.state.current,R=w(M,m.state,m.props);B=B>R?R:B,R===0&&(B=m.state.current),typeof M=="number"&&("pageSize"in m.props||m.setState({pageSize:M}),"current"in m.props||m.setState({current:B,currentInputValue:B})),m.props.onShowSizeChange(B,M),"onChange"in m.props&&m.props.onChange&&m.props.onChange(B,M)},m.handleChange=function(M){var B=m.props.disabled,R=M;if(m.isValid(R)&&!B){var H=w(void 0,m.state,m.props);R>H?R=H:R<1&&(R=1),"current"in m.props||m.setState({current:R,currentInputValue:R});var N=m.state.pageSize;return m.props.onChange(R,N),R}return m.state.current},m.prev=function(){m.hasPrev()&&m.handleChange(m.state.current-1)},m.next=function(){m.hasNext()&&m.handleChange(m.state.current+1)},m.jumpPrev=function(){m.handleChange(m.getJumpPrevPage())},m.jumpNext=function(){m.handleChange(m.getJumpNextPage())},m.hasPrev=function(){return m.state.current>1},m.hasNext=function(){return m.state.current<w(void 0,m.state,m.props)},m.runIfEnter=function(M,B){if(M.key==="Enter"||M.charCode===13){for(var R=arguments.length,H=new Array(R>2?R-2:0),N=2;N<R;N++)H[N-2]=arguments[N];B.apply(void 0,H)}},m.runIfEnterPrev=function(M){m.runIfEnter(M,m.prev)},m.runIfEnterNext=function(M){m.runIfEnter(M,m.next)},m.runIfEnterJumpPrev=function(M){m.runIfEnter(M,m.jumpPrev)},m.runIfEnterJumpNext=function(M){m.runIfEnter(M,m.jumpNext)},m.handleGoTO=function(M){(M.keyCode===c.ENTER||M.type==="click")&&m.handleChange(m.state.currentInputValue)};var f=_.onChange!==l,S="current"in _;S&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var b=_.defaultCurrent;"current"in _&&(b=_.current);var y=_.defaultPageSize;return"pageSize"in _&&(y=_.pageSize),b=Math.min(b,w(y,void 0,_)),m.state={current:b,currentInputValue:b,pageSize:y},m}return Object(U.a)(E,[{key:"componentDidUpdate",value:function(m,f){var S=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var b=this.paginationNode.querySelector(".".concat(S,"-item-").concat(f.current));b&&document.activeElement===b&&b.blur()}}},{key:"getValidValue",value:function(m){var f=m.target.value,S=w(void 0,this.state,this.props),b=this.state.currentInputValue,y;return f===""?y=f:isNaN(Number(f))?y=b:f>=S?y=S:y=Number(f),y}},{key:"getShowSizeChanger",value:function(){var m=this.props,f=m.showSizeChanger,S=m.total,b=m.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:S>b}},{key:"renderPrev",value:function(m){var f=this.props,S=f.prevIcon,b=f.itemRender,y=b(m,"prev",this.getItemIcon(S,"prev page")),M=!this.hasPrev();return Object(W.isValidElement)(y)?Object(W.cloneElement)(y,{disabled:M}):y}},{key:"renderNext",value:function(m){var f=this.props,S=f.nextIcon,b=f.itemRender,y=b(m,"next",this.getItemIcon(S,"next page")),M=!this.hasNext();return Object(W.isValidElement)(y)?Object(W.cloneElement)(y,{disabled:M}):y}},{key:"render",value:function(){var m=this,f=this.props,S=f.prefixCls,b=f.className,y=f.style,M=f.disabled,B=f.hideOnSinglePage,R=f.total,H=f.locale,N=f.showQuickJumper,C=f.showLessItems,K=f.showTitle,Z=f.showTotal,oe=f.simple,fe=f.itemRender,xe=f.showPrevNextJumpers,be=f.jumpPrevIcon,Te=f.jumpNextIcon,Ce=f.selectComponentClass,Le=f.selectPrefixCls,ge=f.pageSizeOptions,Y=this.state,k=Y.current,j=Y.pageSize,J=Y.currentInputValue;if(B===!0&&R<=j)return null;var ie=w(void 0,this.state,this.props),X=[],ve=null,Ie=null,Ue=null,pe=null,_e=null,Ae=N&&N.goButton,De=C?1:2,je=k-1>0?k-1:0,ze=k+1<ie?k+1:ie,Je=Object.keys(this.props).reduce(function(re,se){return(se.substr(0,5)==="data-"||se.substr(0,5)==="aria-"||se==="role")&&(re[se]=m.props[se]),re},{});if(oe)return Ae&&(typeof Ae=="boolean"?_e=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):_e=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ae),_e=n.a.createElement("li",{title:K?"".concat(H.jump_to).concat(k,"/").concat(ie):null,className:"".concat(S,"-simple-pager")},_e)),n.a.createElement("ul",Object(q.a)({className:g()(S,"".concat(S,"-simple"),Object(z.a)({},"".concat(S,"-disabled"),M),b),style:y,ref:this.savePaginationNode},Je),n.a.createElement("li",{title:K?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(S,"-prev"),Object(z.a)({},"".concat(S,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(je)),n.a.createElement("li",{title:K?"".concat(k,"/").concat(ie):null,className:"".concat(S,"-simple-pager")},n.a.createElement("input",{type:"text",value:J,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(S,"-slash")},"/"),ie),n.a.createElement("li",{title:K?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(S,"-next"),Object(z.a)({},"".concat(S,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ze)),_e);if(ie<=3+De*2){var $e={locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:fe};ie||X.push(n.a.createElement(h,Object(q.a)({},$e,{key:"noPager",page:ie,className:"".concat(S,"-disabled")})));for(var tt=1;tt<=ie;tt+=1){var Qe=k===tt;X.push(n.a.createElement(h,Object(q.a)({},$e,{key:tt,page:tt,active:Qe})))}}else{var Re=C?H.prev_3:H.prev_5,Oe=C?H.next_3:H.next_5;xe&&(ve=n.a.createElement("li",{title:K?Re:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(S,"-jump-prev"),Object(z.a)({},"".concat(S,"-jump-prev-custom-icon"),!!be))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(be,"prev page"))),Ie=n.a.createElement("li",{title:K?Oe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(S,"-jump-next"),Object(z.a)({},"".concat(S,"-jump-next-custom-icon"),!!Te))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),pe=n.a.createElement(h,{locale:H,last:!0,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ie,page:ie,active:!1,showTitle:K,itemRender:fe}),Ue=n.a.createElement(h,{locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:fe});var We=Math.max(1,k-De),He=Math.min(k+De,ie);k-1<=De&&(He=1+De*2),ie-k<=De&&(We=ie-De*2);for(var ue=We;ue<=He;ue+=1){var Q=k===ue;X.push(n.a.createElement(h,{locale:H,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ue,page:ue,active:Q,showTitle:K,itemRender:fe}))}k-1>=De*2&&k!==1+2&&(X[0]=Object(W.cloneElement)(X[0],{className:"".concat(S,"-item-after-jump-prev")}),X.unshift(ve)),ie-k>=De*2&&k!==ie-2&&(X[X.length-1]=Object(W.cloneElement)(X[X.length-1],{className:"".concat(S,"-item-before-jump-next")}),X.push(Ie)),We!==1&&X.unshift(Ue),He!==ie&&X.push(pe)}var te=null;Z&&(te=n.a.createElement("li",{className:"".concat(S,"-total-text")},Z(R,[R===0?0:(k-1)*j+1,k*j>R?R:k*j])));var ae=!this.hasPrev()||!ie,ce=!this.hasNext()||!ie;return n.a.createElement("ul",Object(q.a)({className:g()(S,b,Object(z.a)({},"".concat(S,"-disabled"),M)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},Je),te,n.a.createElement("li",{title:K?H.prev_page:null,onClick:this.prev,tabIndex:ae?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(S,"-prev"),Object(z.a)({},"".concat(S,"-disabled"),ae)),"aria-disabled":ae},this.renderPrev(je)),X,n.a.createElement("li",{title:K?H.next_page:null,onClick:this.next,tabIndex:ce?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(S,"-next"),Object(z.a)({},"".concat(S,"-disabled"),ce)),"aria-disabled":ce},this.renderNext(ze)),n.a.createElement(d,{disabled:M,locale:H,rootPrefixCls:S,selectComponentClass:Ce,selectPrefixCls:Le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:k,pageSize:j,pageSizeOptions:ge,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ae}))}}],[{key:"getDerivedStateFromProps",value:function(m,f){var S={};if("current"in m&&(S.current=m.current,m.current!==f.current&&(S.currentInputValue=S.current)),"pageSize"in m&&m.pageSize!==f.pageSize){var b=f.current,y=w(m.pageSize,f,m);b=b>y?y:b,"current"in m||(S.current=b,S.currentInputValue=b),S.pageSize=m.pageSize}return S}}]),E}(n.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:l,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:l,locale:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var x=T},"6RRn":function(ke,de,P){"use strict";var q=P("wCXF"),z=P("n6Qo");P.d(de,"b",function(){return z.a});var D=P("IBYe"),V=P("6eGT"),U=P("hW8S");P.d(de,"a",function(){return U.a}),de.c=q.b},"6UM0":function(ke,de,P){var q,z;(function(){var D;(function(){"use strict";var U=[function(n,I,g){var p=g(1).Beautifier,h=g(5).Options;function c(s,d){var i=new p(s,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var p=g(2).Output,h=g(3).Token,c=g(4),s=g(5).Options,d=g(7).Tokenizer,i=g(7).line_starters,l=g(7).positionable_operators,r=g(7).TOKEN;function o(C,K){return K.indexOf(C)!==-1}function w(C){return C.replace(/^\s+/g,"")}function T(C){for(var K={},Z=0;Z<C.length;Z++)K[C[Z].replace(/-/g,"_")]=C[Z];return K}function x(C,K){return C&&C.type===r.RESERVED&&C.text===K}function L(C,K){return C&&C.type===r.RESERVED&&o(C.text,K)}var A=["case","return","do","if","throw","else","await","break","continue","async"],E=["before-newline","after-newline","preserve-newline"],_=T(E),m=[_.before_newline,_.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function S(C,K){if(K.multiline_frame||K.mode===f.ForInitializer||K.mode===f.Conditional)return;C.remove_indent(K.start_line_index)}function b(C){C=C.replace(c.allLineBreaks,`
|
|
`);for(var K=[],Z=C.indexOf(`
|
|
`);Z!==-1;)K.push(C.substring(0,Z)),C=C.substring(Z+1),Z=C.indexOf(`
|
|
`);return C.length&&K.push(C),K}function y(C){return C===f.ArrayLiteral}function M(C){return o(C,[f.Expression,f.ForInitializer,f.Conditional])}function B(C,K){for(var Z=0;Z<C.length;Z++){var oe=C[Z].trim();if(oe.charAt(0)!==K)return!1}return!0}function R(C,K){for(var Z=0,oe=C.length,fe;Z<oe;Z++)if(fe=C[Z],fe&&fe.indexOf(K)!==0)return!1;return!0}function H(C,K){K=K||{},this._source_text=C||"",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 s(K)}H.prototype.create_flags=function(C,K){var Z=0;C&&(Z=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>Z&&(Z=C.line_indent_level));var oe={mode:K,parent:C,last_token:C?C.last_token:new h(r.START_BLOCK,""),last_word:C?C.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:C?C.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},H.prototype._reset=function(C){var K=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var Z=new d(C,this._options);return this._tokens=Z.tokenize(),C},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,K=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
|
|
`,K&&c.lineBreak.test(K||"")&&(Z=K.match(c.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 C=this._output.get_code(Z),C},H.prototype.handle_token=function(C,K){C.type===r.START_EXPR?this.handle_start_expr(C):C.type===r.END_EXPR?this.handle_end_expr(C):C.type===r.START_BLOCK?this.handle_start_block(C):C.type===r.END_BLOCK?this.handle_end_block(C):C.type===r.WORD?this.handle_word(C):C.type===r.RESERVED?this.handle_word(C):C.type===r.SEMICOLON?this.handle_semicolon(C):C.type===r.STRING?this.handle_string(C):C.type===r.EQUALS?this.handle_equals(C):C.type===r.OPERATOR?this.handle_operator(C):C.type===r.COMMA?this.handle_comma(C):C.type===r.BLOCK_COMMENT?this.handle_block_comment(C,K):C.type===r.COMMENT?this.handle_comment(C,K):C.type===r.DOT?this.handle_dot(C):C.type===r.EOF?this.handle_eof(C):C.type===r.UNKNOWN?this.handle_unknown(C,K):this.handle_unknown(C,K)},H.prototype.handle_whitespace_and_comments=function(C,K){var Z=C.newlines,oe=this._options.keep_array_indentation&&y(this._flags.mode);if(C.comments_before)for(var fe=C.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,K),this.handle_token(fe,K),fe=C.comments_before.next();if(oe)for(var xe=0;xe<Z;xe+=1)this.print_newline(xe>0,K);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,K);for(var be=1;be<Z;be+=1)this.print_newline(!0,K)}};var N=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(C,K){if(K=K===void 0?!1:K,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&C.newlines||K,oe=o(this._flags.last_token.text,l)||o(C.text,l);if(oe){var fe=o(this._flags.last_token.text,l)&&o(this._options.operator_position,m)||o(C.text,l);Z=Z&&fe}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,N))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(C,K){if(!K&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Z=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&x(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.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))},H.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.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))},H.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(C){var K=!1;return K=K||L(this._flags.last_token,["var","let","const"])&&C.type===r.WORD,K=K||x(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&L(this._flags.last_token,N)&&!C.newlines,K=K||x(this._flags.last_token,"else")&&!(x(C,"if")&&!C.comments_before),K=K||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),K=K||this._flags.last_token.type===r.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==r.WORD&&C.type!==r.RESERVED,K=K||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),K?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,L(C,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var K=f.Expression;if(C.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=f.ArrayLiteral,y(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())),o(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=f.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=f.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===r.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);L(Z,["async","function"])||Z.text==="*"&&L(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.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(C);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(C){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(C),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var K=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):Z&&(o(Z.text,[":",","])&&o(K.type,[r.STRING,r.WORD,r.RESERVED])||o(K.text,["get","set","..."])&&o(Z.type,[r.WORD,r.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Z.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):o(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!K.comments_before&&K.text==="}",fe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var xe=0,be=null;this._flags.inline_frame=!0;do if(xe+=1,be=this._tokens.peek(xe-1),be.newlines){this._flags.inline_frame=!1;break}while(be.type!==r.EOF&&!(be.type===r.END_BLOCK&&be.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(fe||this._flags.last_token.type===r.EQUALS||L(this._flags.last_token,A)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===f.Statement;)this.restore_mode();var K=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(y(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(C)},H.prototype.handle_word=function(C){if(C.type===r.RESERVED){if(o(C.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)C.type=r.WORD;else if(C.text==="import"&&o(this._tokens.peek().text,["(","."]))C.type=r.WORD;else if(o(C.text,["as","from"])&&!this._flags.import_block)C.type=r.WORD;else if(this._flags.mode===f.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(C.type=r.WORD)}}if(this.start_of_statement(C)?L(this._flags.last_token,["var","let","const"])&&C.type===r.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!M(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(x(C,"while")){this._output.space_before_token=!0,this.print_token(C),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&&x(C,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(C,["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(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),x(C,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?L(this._flags.last_token,["get","set","new","export"])||L(this._flags.last_token,N)?this._output.space_before_token=!0:x(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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(M(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var Z="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":L(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===f.BlockStatement?Z="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&M(this._flags.mode)?Z="SPACE":this._flags.last_token.type===r.STRING?Z="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),L(C,i)&&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"),L(C,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.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"?L(this._flags.last_token,A)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!L(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(C,"if")&&x(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(C,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===r.WORD||C.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===r.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(C,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var K=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&x(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},H.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},H.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},H.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(M(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(C)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)},H.prototype.handle_operator=function(C){var K=C.text==="*"&&(L(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),Z=o(C.text,["-","+"])&&(o(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var oe=!K;this.handle_whitespace_and_comments(C,oe)}if(C.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===r.OPERATOR&&o(this._options.operator_position,m)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.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,xe=!0,be=!1;if(C.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,be=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!K&&this._options.preserve_newlines&&o(C.text,l)){var Te=C.text===":",Ce=Te&&be,Le=Te&&!be;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!Le,this.print_token(C),(!Te||Ce)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Te||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case _.preserve_newline:Le||this.allow_wrap_or_preserved_newline(C),fe=!(this._output.just_added_newline()||Le),this._output.space_before_token=fe,this.print_token(C),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(C),fe=!1;var ge=this._tokens.peek();xe=ge&&o(ge.type,[r.WORD,r.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),fe=this._flags.last_token.type===r.START_BLOCK,xe=!1;else if(o(C.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),fe=!1,xe=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var Y=L(this._flags.last_token,A)&&C.newlines;Y&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Y,!0)}this._flags.last_token.text===";"&&M(this._flags.mode)&&(fe=!0),this._flags.last_token.type===r.RESERVED?fe=!0:this._flags.last_token.type===r.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===r.OPERATOR&&(fe=o(C.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(C.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(xe=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(C),this._output.space_before_token=xe},H.prototype.handle_block_comment=function(C,K){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,K),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,K)},H.prototype.print_block_commment=function(C,K){var Z=b(C.text),oe,fe=!1,xe=!1,be=C.whitespace_before,Te=be.length;if(this.print_newline(!1,K),this.print_token_line_indentation(C),this._output.add_token(Z[0]),this.print_newline(!1,K),Z.length>1){for(Z=Z.slice(1),fe=B(Z,"*"),xe=R(Z,be),fe&&(this._flags.alignment=1),oe=0;oe<Z.length;oe++)fe?(this.print_token_line_indentation(C),this._output.add_token(w(Z[oe]))):xe&&Z[oe]?(this.print_token_line_indentation(C),this._output.add_token(Z[oe].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[oe])),this.print_newline(!1,K);this._flags.alignment=0}},H.prototype.handle_comment=function(C,K){C.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,K)},H.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,A)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,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(C)},H.prototype.handle_unknown=function(C,K){this.print_token(C),C.text[C.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},H.prototype.handle_eof=function(C){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},n.exports.Beautifier=H},function(n){function I(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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},I.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.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},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.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,c){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)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var s=this.__base_string_length;return c=c||0,h<0&&(s=0),s+=h*this.__indent_size,s+=c,s},g.prototype.get_indent_string=function(h,c){var s=this.__base_string;return c=c||0,h<0&&(h=0,s=""),c+=h*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,s="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),h&&(s+=new Array(h+1).join(" ")),this.__cache.push(s)};function p(h,c){this.__indent_cache=new g(h,c),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 I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(s=s.replace(/[\n]/g,h)),s},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=p},function(n){function I(g,p,h,c){this.type=g,this.text=p,this.comments_before=null,this.newlines=h||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=I},function(n,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",c="\\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",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+h+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])*";I.identifier=new RegExp(s+d,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+h+c+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|
|
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(n,I,g){var p=g(6).Options,h=["before-newline","after-newline","preserve-newline"];function c(s){p.call(this,s,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var l=0;l<i.length;l++)i[l]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[l];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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new p,n.exports.Options=c},function(n){function I(h,c){this.raw_options=g(h,c),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"])}I.prototype._get_array=function(h,c){var s=this.raw_options[h],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},I.prototype._get_boolean=function(h,c){var s=this.raw_options[h],d=s===void 0?!!c:!!s;return d},I.prototype._get_characters=function(h,c){var s=this.raw_options[h],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},I.prototype._get_number=function(h,c){var s=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},I.prototype._get_selection=function(h,c,s){var d=this._get_selection_list(h,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d[0]},I.prototype._get_selection_list=function(h,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d},I.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(s){return c.indexOf(s)===-1})};function g(h,c){var s={};h=p(h);var d;for(d in h)d!==c&&(s[d]=h[d]);if(c&&h[c])for(d in h[c])s[d]=h[c][d];return s}function p(h){var c={},s;for(s in h){var d=s.replace(/-/g,"_");c[d]=h[s]}return c}n.exports.Options=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},function(n,I,g){var p=g(8).InputScanner,h=g(9).Tokenizer,c=g(9).TOKEN,s=g(13).Directives,d=g(4),i=g(12).Pattern,l=g(14).TemplatablePattern;function r(B,R){return R.indexOf(B)!==-1}var o={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:c.START,RAW:c.RAW,EOF:c.EOF},w=new s(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,L=/[^\d\.]/,A=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),E=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";E=E.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),E="\\?\\.(?!\\d) "+E,E=E.replace(/ /g,"|");var _=new RegExp(E),m="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=m.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+f.join("|")+")$"),b,y=function(B,R){h.call(this,B,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new i(this._input),N=new l(this._input).read_options(this._options);this.__patterns={template:N,identifier:N.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(T),punct:H.matching(_),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.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:N.until(/['\\\n\r\u2028\u2029]/),double_quote:N.until(/["\\\n\r\u2028\u2029]/),template_text:N.until(/[`\\$]/),template_expression:N.until(/[`}\\]/)}};y.prototype=new h,y.prototype._is_comment=function(B){return B.type===o.COMMENT||B.type===o.BLOCK_COMMENT||B.type===o.UNKNOWN},y.prototype._is_opening=function(B){return B.type===o.START_BLOCK||B.type===o.START_EXPR},y.prototype._is_closing=function(B,R){return(B.type===o.END_BLOCK||B.type===o.END_EXPR)&&R&&(B.text==="]"&&R.text==="["||B.text===")"&&R.text==="("||B.text==="}"&&R.text==="{")},y.prototype._reset=function(){b=!1},y.prototype._get_next_token=function(B,R){var H=null;this._readWhitespace();var N=this._input.peek();return N===null?this._create_token(o.EOF,""):(H=H||this._read_non_javascript(N),H=H||this._read_string(N),H=H||this._read_word(B),H=H||this._read_singles(N),H=H||this._read_comment(N),H=H||this._read_regexp(N,B),H=H||this._read_xml(N,B),H=H||this._read_punctuation(),H=H||this._create_token(o.UNKNOWN,this._input.next()),H)},y.prototype._read_word=function(B){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(d.allLineBreaks,`
|
|
`),!(B.type===o.DOT||B.type===o.RESERVED&&(B.text==="set"||B.text==="get"))&&S.test(R)?(R==="in"||R==="of")&&(B.type===o.WORD||B.type===o.STRING)?this._create_token(o.OPERATOR,R):this._create_token(o.RESERVED,R):this._create_token(o.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(o.WORD,R)},y.prototype._read_singles=function(B){var R=null;return B==="("||B==="["?R=this._create_token(o.START_EXPR,B):B===")"||B==="]"?R=this._create_token(o.END_EXPR,B):B==="{"?R=this._create_token(o.START_BLOCK,B):B==="}"?R=this._create_token(o.END_BLOCK,B):B===";"?R=this._create_token(o.SEMICOLON,B):B==="."&&L.test(this._input.peek(1))?R=this._create_token(o.DOT,B):B===","&&(R=this._create_token(o.COMMA,B)),R&&this._input.next(),R},y.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(o.EQUALS,B):B==="?."?this._create_token(o.DOT,B):this._create_token(o.OPERATOR,B)},y.prototype._read_non_javascript=function(B){var R="";if(B==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(o.UNKNOWN,R.trim()+`
|
|
`);if(R=this.__patterns.include.read(),R)return this._create_token(o.UNKNOWN,R.trim()+`
|
|
`);B=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(x)){do B=this._input.next(),H+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,H)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)R+=this._input.next();return b=!0,this._create_token(o.COMMENT,R)}}else if(b&&B==="-"&&(R=this.__patterns.html_comment_end.read(),R))return b=!1,this._create_token(o.COMMENT,R);return null},y.prototype._read_comment=function(B){var R=null;if(B==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var N=w.get_directives(H);N&&N.ignore==="start"&&(H+=w.readIgnored(this._input)),H=H.replace(d.allLineBreaks,`
|
|
`),R=this._create_token(o.BLOCK_COMMENT,H),R.directives=N}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),R=this._create_token(o.COMMENT,H))}return R},y.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var R=this._input.next();return this.has_char_escapes=!1,B==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(R=M(R)),this._input.peek()===B&&(R+=this._input.next()),R=R.replace(d.allLineBreaks,`
|
|
`),this._create_token(o.STRING,R)}return null},y.prototype._allow_regexp_or_xml=function(B){return B.type===o.RESERVED&&r(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===o.END_EXPR&&B.text===")"&&B.opened.previous.type===o.RESERVED&&r(B.opened.previous.text,["if","while","for"])||r(B.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},y.prototype._read_regexp=function(B,R){if(B==="/"&&this._allow_regexp_or_xml(R)){for(var H=this._input.next(),N=!1,C=!1;this._input.hasNext()&&(N||C||this._input.peek()!==B)&&!this._input.testChar(d.newline);)H+=this._input.peek(),N?N=!1:(N=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===B&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(o.STRING,H)}return null},y.prototype._read_xml=function(B,R){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(R)){var H="",N=this.__patterns.xml.read_match();if(N){for(var C=N[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=C.indexOf("{")===0,Z=0;N;){var oe=!!N[1],fe=N[2],xe=!!N[N.length-1]||fe.slice(0,8)==="![CDATA[";if(!xe&&(fe===C||K&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--Z:++Z),H+=N[0],Z<=0)break;N=this.__patterns.xml.read_match()}return N||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,`
|
|
`),this._create_token(o.STRING,H)}}return null};function M(B){for(var R="",H=0,N=new p(B),C=null;N.hasNext();)if(C=N.match(/([\s]|[^\\]|\\\\)+/g),C&&(R+=C[0]),N.peek()==="\\"){if(N.next(),N.peek()==="x")C=N.match(/x([0-9A-Fa-f]{2})/g);else if(N.peek()==="u")C=N.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",N.hasNext()&&(R+=N.next());continue}if(!C)return B;if(H=parseInt(C[1],16),H>126&&H<=255&&C[0].indexOf("x")===0)return B;if(H>=0&&H<32){R+="\\"+C[0];continue}else H===34||H===39||H===92?R+="\\"+String.fromCharCode(H):R+=String.fromCharCode(H)}return R}y.prototype._read_string_recursive=function(B,R,H){var N,C;B==="'"?C=this.__patterns.single_quote:B==='"'?C=this.__patterns.double_quote:B==="`"?C=this.__patterns.template_text:B==="}"&&(C=this.__patterns.template_expression);for(var K=C.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===B||!R&&d.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(N=this._input.peek(),N==="x"||N==="u"?this.has_char_escapes=!0:N==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Z+=this._input.next()):H&&(H==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),H===Z&&(B==="`"?Z+=this._read_string_recursive("}",R,"`"):Z+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=C.read(),K+=Z}return K},n.exports.Tokenizer=y,n.exports.TOKEN=o,n.exports.positionable_operators=A.slice(),n.exports.line_starters=m.slice()},function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},g.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(I&&p.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},g.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},g.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(p,h,c){var s="",d;return p&&(d=this.match(p),d&&(s+=d[0])),h&&(d||!p)&&(s+=this.readUntil(h,c)),s},g.prototype.readUntil=function(p,h){var c="",s=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(s=d.index,h&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,h){var c=null,s="g";return h&&I&&(s="y"),typeof p=="string"&&p!==""?c=new RegExp(p,s):p&&(c=new RegExp(p.source,s)),c},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},g.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=g},function(n,I,g){var p=g(8).InputScanner,h=g(3).Token,c=g(10).TokenStream,s=g(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(l,r){this._input=new p(l),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var l,r=new h(d.START,""),o=null,w=[],T=new c;r.type!==d.EOF;){for(l=this._get_next_token(r,o);this._is_comment(l);)T.add(l),l=this._get_next_token(r,o);T.isEmpty()||(l.comments_before=T,T=new c),l.parent=o,this._is_opening(l)?(w.push(o),o=l):o&&this._is_closing(l,o)&&(l.opened=o,o.closed=l,o=w.pop(),l.parent=o),l.previous=r,r.next=l,this.__tokens.add(l),r=l}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(l,r){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(d.RAW,o):this._create_token(d.EOF,"")},i.prototype._is_comment=function(l){return!1},i.prototype._is_opening=function(l){return!1},i.prototype._is_closing=function(l,r){return!1},i.prototype._create_token=function(l,r){var o=new h(l,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=i,n.exports.TOKEN=d},function(n){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},I.prototype.peek=function(g){var p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(p=this.__tokens[g]),p},I.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,g){var p=g(12).Pattern;function h(c,s){p.call(this,c,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new p,h.prototype.__set_whitespace_patterns=function(c,s){c+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var s=this.__split(this._newline_regexp,c);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return c},h.prototype.matching=function(c,s){var d=this._create();return d.__set_whitespace_patterns(c,s),d._update(),d},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(c,s){c.lastIndex=0;for(var d=0,i=[],l=c.exec(s);l;)i.push(s.substring(d,l.index)),d=l.index+l[0].length,l=c.exec(s);return d<s.length?i.push(s.substring(d,s.length)):i.push(""),i},n.exports.WhitespacePattern=h},function(n){function I(g,p){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}I.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},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(g){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(g),p._update(),p},I.prototype.until=function(g){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(g),p._update(),p},I.prototype.starting_with=function(g){var p=this._create();return p._starting_pattern=this._input.get_regexp(g,!0),p._update(),p},I.prototype.matching=function(g){var p=this._create();return p._match_pattern=this._input.get_regexp(g,!0),p._update(),p},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}I.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(g);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(g);return p},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,g){var p=g(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(s,d){p.call(this,s,d),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var i=new p(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new p,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(s){var d=this._create();return d._disabled[s]=!0,d._update(),d},c.prototype.read_options=function(s){var d=this._create();for(var i in h)d._disabled[i]=s.templating.indexOf(i)===-1;return d._update(),d},c.prototype.exclude=function(s){var d=this._create();return d._excluded[s]=!0,d._update(),d},c.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),s+=d,d=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},c.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},c.prototype._read_template=function(){var s="",d=this._input.peek();if(d==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},n.exports.TemplatablePattern=c}],O={};function G(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return U[n](g,g.exports,G),g.exports}var W=G(0);D=W})();var V=D;!(q=[],z=function(){return{js_beautify:V}}.apply(de,q),z!==void 0&&(ke.exports=z))})()},"6eGT":function(ke,de,P){"use strict";function q(z){return null}de.a=q},"746U":function(ke,de,P){"use strict";P.d(de,"f",function(){return q}),P.d(de,"l",function(){return z}),P.d(de,"k",function(){return D}),P.d(de,"j",function(){return V}),P.d(de,"g",function(){return U}),P.d(de,"m",function(){return O}),P.d(de,"h",function(){return G}),P.d(de,"n",function(){return W}),P.d(de,"c",function(){return n}),P.d(de,"a",function(){return I}),P.d(de,"i",function(){return g}),P.d(de,"o",function(){return p}),P.d(de,"e",function(){return s}),P.d(de,"d",function(){return d}),P.d(de,"p",function(){return i}),P.d(de,"b",function(){return l});function q(r){return Array.isArray(r)}function z(r){return typeof r=="string"}function D(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function V(r){return typeof r=="number"&&!isNaN(r)}function U(r){return r===!0||r===!1}function O(r){return typeof r=="undefined"}function G(r){return!W(r)}function W(r){return O(r)||r===null}function n(r,o){if(!r)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function I(r){if(W(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function g(r){return typeof r=="function"}function p(r,o){const w=Math.min(r.length,o.length);for(let T=0;T<w;T++)h(r[T],o[T])}function h(r,o){if(z(o)){if(typeof r!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(g(o)){try{if(r instanceof o)return}catch(w){}if(!W(r)&&r.constructor===o)return;if(o.length===1&&o.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(r){let o=[],w=Object.getPrototypeOf(r);for(;Object.prototype!==w;)o=o.concat(Object.getOwnPropertyNames(w)),w=Object.getPrototypeOf(w);return o}function s(r){const o=[];for(const w of c(r))typeof r[w]=="function"&&o.push(w);return o}function d(r,o){const w=x=>function(){const L=Array.prototype.slice.call(arguments,0);return o(x,L)};let T={};for(const x of r)T[x]=w(x);return T}function i(r){return r===null?void 0:r}function l(r,o="Unreachable"){throw new Error(o)}},"7Cbv":function(ke,de,P){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function D(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(z)}var V=/^(?:[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 U(h){return typeof h=="string"&&V.test(h)}for(var O=U,G=[],W=0;W<256;++W)G.push((W+256).toString(16).substr(1));function n(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(G[h[c+0]]+G[h[c+1]]+G[h[c+2]]+G[h[c+3]]+"-"+G[h[c+4]]+G[h[c+5]]+"-"+G[h[c+6]]+G[h[c+7]]+"-"+G[h[c+8]]+G[h[c+9]]+"-"+G[h[c+10]]+G[h[c+11]]+G[h[c+12]]+G[h[c+13]]+G[h[c+14]]+G[h[c+15]]).toLowerCase();if(!O(s))throw TypeError("Stringified UUID is invalid");return s}var I=n;function g(h,c,s){h=h||{};var d=h.random||(h.rng||D)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,c){s=s||0;for(var i=0;i<16;++i)c[s+i]=d[i];return c}return I(d)}var p=de.a=g},"7ahc":function(ke,de,P){"use strict";P.d(de,"a",function(){return w});var q=P("k1fw"),z=P("0Owb"),D=P("+L6B"),V=P("2/Rp"),U=P("y8nQ"),O=P("Vl3Y"),G=P("tJVT"),W=P("OaEy"),n=P("2fM7"),I=P("q1tI"),g=P.n(I),p=P("VrN/"),h=P.n(p),c=P("p77/"),s=P.n(c),d=P("c5Ni"),i=P.n(d),l=n.a.Option,r={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};de.b=function(T){var x=T.callback,L=T.onCancel,A=Object(I.useState)("python"),E=Object(G.a)(A,2),_=E[0],m=E[1];function f(b){m(o[b][1])}function S(b){x(b)}return g.a.createElement(O.a,Object(z.a)({},r,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),g.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(n.a,{onChange:f},Object.keys(o).map(function(b){return g.a.createElement(l,{key:b,value:b},o[b][0])}))),g.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(w,{mode:_})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(V.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function w(T){var x=T.value,L=T.onChange,A=T.mode,E=T.options,_=E===void 0?{}:E,m=Object(I.useRef)(),f=Object(I.useState)(),S=Object(G.a)(f,2),b=S[0],y=S[1];return Object(I.useEffect)(function(){if(b){function M(B){var R=B.getValue();L&&L(R)}return b.on("change",M),function(){b.off("change",M)}}},[b,L]),Object(I.useEffect)(function(){b&&b.setOption("mode",A)},[b,A]),Object(I.useEffect)(function(){b&&((x!==b.getValue()||x==="")&&setTimeout(function(){b.setValue(x||" ")},300))},[b,x]),Object(I.useEffect)(function(){if(m.current&&!b){var M=h.a.fromTextArea(m.current,Object(q.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));y(M)}},[m.current,b]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:m}))}},"815F":function(ke,de,P){"use strict";P.d(de,"e",function(){return G}),P.d(de,"c",function(){return n}),P.d(de,"d",function(){return I}),P.d(de,"a",function(){return p}),P.d(de,"f",function(){return h}),P.d(de,"b",function(){return c});var q=P("KQm4"),z=P("VTBJ"),D=P("Ff2n"),V=P("Zm9Q"),U=P("Kwbf"),O=P("OZM5");function G(s,d){return s!=null?s:d}function W(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function i(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(l||[]).forEach(function(o){var w=o.key,T=o.children;Object(U.a)(w!=null,"Tree node must have a certain key: [".concat(r).concat(w,"]"));var x=String(w);Object(U.a)(!d.has(x)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(x)),d.set(x,!0),i(T,"".concat(r).concat(x," > "))})}i(s)}function n(s){function d(i){var l=Object(V.a)(i);return l.map(function(r){if(!Object(O.i)(r))return Object(U.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var o=r.key,w=r.props,T=w.children,x=Object(D.a)(w,["children"]),L=Object(z.a)({key:o},x),A=d(T);return A.length&&(L.children=A),L}).filter(function(r){return r})}return d(s)}function I(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(d===!0?[]:d),l=[];function r(o){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(T,x){var L=Object(O.h)(w?w.pos:"0",x),A=G(T.key,L),E=Object(z.a)(Object(z.a)({},T),{},{parent:w,pos:L,children:null,data:T,isStart:[].concat(Object(q.a)(w?w.isStart:[]),[x===0]),isEnd:[].concat(Object(q.a)(w?w.isEnd:[]),[x===o.length-1])});return l.push(E),d===!0||i.has(A)?E.children=r(T.children||[],E):E.children=[],E})}return r(s),l}function g(s,d,i){var l;i?typeof i=="string"?l=function(w){return w[i]}:typeof i=="function"&&(l=function(w){return i(w)}):l=function(w,T){return G(w.key,T)};function r(o,w,T){var x=o?o.children:s,L=o?Object(O.h)(T.pos,w):"0";if(o){var A=l(o,L),E={node:o,index:w,pos:L,key:A,parentPos:T.node?T.pos:null,level:T.level+1};d(E)}x&&x.forEach(function(_,m){r(_,m,{node:o,pos:L,level:T?T.level+1:-1})})}r(null)}function p(s){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=d.initWrapper,l=d.processEntity,r=d.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,w={},T={},x={posEntities:w,keyEntities:T};return i&&(x=i(x)||x),g(s,function(L){var A=L.node,E=L.index,_=L.pos,m=L.key,f=L.parentPos,S=L.level,b={node:A,index:E,key:m,pos:_,level:S},y=G(m,_);w[_]=b,T[y]=b,b.parent=w[f],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),l&&l(b,x)},o),r&&r(x),x}function h(s,d){var i=d.expandedKeys,l=d.selectedKeys,r=d.loadedKeys,o=d.loadingKeys,w=d.checkedKeys,T=d.halfCheckedKeys,x=d.dragOverNodeKey,L=d.dropPosition,A=d.keyEntities,E=A[s],_={eventKey:s,expanded:i.indexOf(s)!==-1,selected:l.indexOf(s)!==-1,loaded:r.indexOf(s)!==-1,loading:o.indexOf(s)!==-1,checked:w.indexOf(s)!==-1,halfChecked:T.indexOf(s)!==-1,pos:String(E?E.pos:""),dragOver:x===s&&L===0,dragOverGapTop:x===s&&L===-1,dragOverGapBottom:x===s&&L===1};return _}function c(s){var d=s.data,i=s.expanded,l=s.selected,r=s.checked,o=s.loaded,w=s.loading,T=s.halfChecked,x=s.dragOver,L=s.dragOverGapTop,A=s.dragOverGapBottom,E=s.pos,_=s.active,m=Object(z.a)(Object(z.a)({},d),{},{expanded:i,selected:l,checked:r,loaded:o,loading:w,halfChecked:T,dragOver:x,dragOverGapTop:L,dragOverGapBottom:A,pos:E,active:_});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),m}},"8EBN":function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){"use strict";q.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 z=0;z<q.modeInfo.length;z++){var D=q.modeInfo[z];D.mimes&&(D.mime=D.mimes[0])}q.findModeByMIME=function(V){V=V.toLowerCase();for(var U=0;U<q.modeInfo.length;U++){var O=q.modeInfo[U];if(O.mime==V)return O;if(O.mimes){for(var G=0;G<O.mimes.length;G++)if(O.mimes[G]==V)return O}}if(/\+xml$/.test(V))return q.findModeByMIME("application/xml");if(/\+json$/.test(V))return q.findModeByMIME("application/json")},q.findModeByExtension=function(V){V=V.toLowerCase();for(var U=0;U<q.modeInfo.length;U++){var O=q.modeInfo[U];if(O.ext){for(var G=0;G<O.ext.length;G++)if(O.ext[G]==V)return O}}},q.findModeByFileName=function(V){for(var U=0;U<q.modeInfo.length;U++){var O=q.modeInfo[U];if(O.file&&O.file.test(V))return O}var G=V.lastIndexOf("."),W=G>-1&&V.substring(G+1,V.length);if(W)return q.findModeByExtension(W)},q.findModeByName=function(V){V=V.toLowerCase();for(var U=0;U<q.modeInfo.length;U++){var O=q.modeInfo[U];if(O.name.toLowerCase()==V)return O;if(O.alias){for(var G=0;G<O.alias.length;G++)if(O.alias[G].toLowerCase()==V)return O}}}})},"8HAY":function(ke,de,P){"use strict";P.d(de,"a",function(){return U}),P.d(de,"b",function(){return O}),P.d(de,"d",function(){return G}),P.d(de,"e",function(){return W}),P.d(de,"c",function(){return n});var q=P("MI8n"),z=P("pmY6"),D=P("3/fG"),V=function(I,g,p,h){function c(s){return s instanceof p?s:new p(function(d){d(s)})}return new(p||(p=Promise))(function(s,d){function i(o){try{r(h.next(o))}catch(w){d(w)}}function l(o){try{r(h.throw(o))}catch(w){d(w)}}function r(o){o.done?s(o.value):c(o.value).then(i,l)}r((h=h.apply(I,g||[])).next())})};class U extends z.a{constructor(I,g="",p="",h=!0,c){super();this._onDidChange=this._register(new q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=g,this._cssClass=p,this._enabled=h,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,g){return V(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class O extends z.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new q.b),this.onDidRun=this._onDidRun.event}run(I,g){return V(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let p;try{yield this.runAction(I,g)}catch(h){p=h}this._onDidRun.fire({action:I,error:p})})}runAction(I,g){return V(this,void 0,void 0,function*(){yield I.run(g)})}}class G extends U{constructor(I){super(G.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class W{constructor(I,g,p,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=g,this.class=h,this._actions=p}get actions(){return this._actions}dispose(){}run(){return V(this,void 0,void 0,function*(){})}}class n extends U{constructor(){super(n.ID,D.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(ke,de,P){ke.exports={button:"button___1wy9m"}},"9Bee":function(ke,de,P){"use strict";var q=P("DYRE"),z=P("zeV3"),D=P("+L6B"),V=P("2/Rp"),U=P("k1fw"),O=P("9og8"),G=P("tJVT"),W=P("WmNS"),n=P.n(W),I=P("q1tI"),g=P.n(I),p=P("vg9a"),h=P("DlQD"),c=P.n(h),s=P("rUJ1");function d(ue,Q){var te=ue.match(/^(\s+)(?:```)/);if(te===null)return Q;var ae=te[1];return Q.split(`
|
|
`).map(function(ce){var re=ce.match(/^\s+/);if(re===null)return ce;var se=Object(G.a)(re,1),he=se[0];return he.length>=ae.length?ce.slice(ae.length):ce}).join(`
|
|
`)}var i=[],l=["<ul>"],r=new c.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){i.length=0,l=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(ue,Q,te,ae){if(Q>=ue.length||ue[Q].level<=te)return Q;var ce=ue[Q];ae.push("<li><a href='#"+ce.anchor+"'>"+ce.text+"</a>"),Q++;var re=[];return Q=x(ue,Q,ce.level,re),re.length>0&&(ae.push("<ul>"),re.forEach(function(se){ae.push(se)}),ae.push("</ul>")),ae.push("</li>"),Q=x(ue,Q,te,ae),Q}function L(){return x(i,0,0,l),l.push("</ul>"),l.join("")}var A={heading:function(Q){var te=o.exec(Q);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},fences:function(Q){var te=this.rules.block.fences.exec(Q);if(te){var ae=te[0],ce=d(ae,te[3]||""),re=te[2]?te[2].trim():te[2];if(["latex","katex","math"].indexOf(re)>=0){var se=m(),he=ce;ce=se,f[se]={type:"block",expression:he}}return{type:"code",raw:ae,lang:re,text:ce}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,m=function(){return"__special_katext_id_".concat(_++,"__")},f={};function S(){return f}function b(){_=0,f={}}function y(ue){return ue=ue.replace(E,function(Q,te){var ae=m();return f[ae]={type:"inline",expression:te},ae}),ue}var M=r.listitem;r.listitem=function(ue){return M(y(ue))};var B=r.paragraph;r.paragraph=function(ue){return B(y(ue))};var R=r.tablecell;r.tablecell=function(ue,Q){return R(y(ue),Q)},r.code=function(ue,Q,te){var ae=(Q||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?"<p class='editormd-tex'>".concat(ue,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Q,'">').concat(te?ue:Object(s.escape)(ue,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(te?ue:Object(s.escape)(ue,!0))+"</code></pre>"},r.heading=function(ue,Q,te){var ae=this.options.headerPrefix+te.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:ae,level:Q,text:ue}),"<h"+Q+' id="'+ae+'">'+ue+"</h"+Q+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:A,renderer:r});var H=c.a,N=P("SJMd"),C=P("ulZh"),K=P.n(C),Z=P("m3rI"),oe=P("Oy/b"),fe=P("p5ED"),xe=P("ErOA"),be=P("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 Te=function(ue,Q){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(te,ae){te.__proto__=ae}||function(te,ae){for(var ce in ae)Object.prototype.hasOwnProperty.call(ae,ce)&&(te[ce]=ae[ce])})(ue,Q)};function Ce(ue,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Class extends value "+String(Q)+" is not a constructor or null");function te(){this.constructor=ue}Te(ue,Q),ue.prototype=Q===null?Object.create(Q):(te.prototype=Q.prototype,new te)}function Le(ue,Q,te,ae){return new(te||(te=Promise))(function(ce,re){function se(ye){try{me(ae.next(ye))}catch(Se){re(Se)}}function he(ye){try{me(ae.throw(ye))}catch(Se){re(Se)}}function me(ye){var Se;ye.done?ce(ye.value):(Se=ye.value,Se instanceof te?Se:new te(function(Fe){Fe(Se)})).then(se,he)}me((ae=ae.apply(ue,Q||[])).next())})}function ge(ue,Q){var te,ae,ce,re,se={label:0,sent:function(){if(1&ce[0])throw ce[1];return ce[1]},trys:[],ops:[]};return re={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(re[Symbol.iterator]=function(){return this}),re;function he(me){return function(ye){return function(Se){if(te)throw new TypeError("Generator is already executing.");for(;se;)try{if(te=1,ae&&(ce=2&Se[0]?ae.return:Se[0]?ae.throw||((ce=ae.return)&&ce.call(ae),0):ae.next)&&!(ce=ce.call(ae,Se[1])).done)return ce;switch(ae=0,ce&&(Se=[2&Se[0],ce.value]),Se[0]){case 0:case 1:ce=Se;break;case 4:return se.label++,{value:Se[1],done:!1};case 5:se.label++,ae=Se[1],Se=[0];continue;case 7:Se=se.ops.pop(),se.trys.pop();continue;default:if(!(ce=se.trys,(ce=ce.length>0&&ce[ce.length-1])||Se[0]!==6&&Se[0]!==2)){se=0;continue}if(Se[0]===3&&(!ce||Se[1]>ce[0]&&Se[1]<ce[3])){se.label=Se[1];break}if(Se[0]===6&&se.label<ce[1]){se.label=ce[1],ce=Se;break}if(ce&&se.label<ce[2]){se.label=ce[2],se.ops.push(Se);break}ce[2]&&se.ops.pop(),se.trys.pop();continue}Se=Q.call(ue,se)}catch(Fe){Se=[6,Fe],ae=0}finally{te=ce=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([me,ye])}}}var Y=function(){function ue(){}return ue.addKey=function(Q){ue.key=Q},Object.defineProperty(ue,"isLicensed",{get:function(){return!!ue.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ue.key)},enumerable:!1,configurable:!0}),ue}(),k=function(){function ue(){}return ue.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ue.setAttributes=function(Q,te){for(var ae=0,ce=te;ae<ce.length;ae++){var re=ce[ae],se=re[0],he=re[1];Q.setAttribute(se,he)}},ue.createRect=function(Q,te,ae){var ce=document.createElementNS("http://www.w3.org/2000/svg","rect");return ce.setAttribute("width",Q.toString()),ce.setAttribute("height",te.toString()),ae&&ue.setAttributes(ce,ae),ce},ue.createLine=function(Q,te,ae,ce,re){var se=document.createElementNS("http://www.w3.org/2000/svg","line");return se.setAttribute("x1",Q.toString()),se.setAttribute("y1",te.toString()),se.setAttribute("x2",ae.toString()),se.setAttribute("y2",ce.toString()),re&&ue.setAttributes(se,re),se},ue.createPolygon=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ae.setAttribute("points",Q),te&&ue.setAttributes(ae,te),ae},ue.createCircle=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","circle");return ae.setAttribute("cx",(Q/2).toString()),ae.setAttribute("cy",(Q/2).toString()),ae.setAttribute("r",Q.toString()),te&&ue.setAttributes(ae,te),ae},ue.createEllipse=function(Q,te,ae){var ce=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ce.setAttribute("cx",(Q/2).toString()),ce.setAttribute("cy",(te/2).toString()),ce.setAttribute("rx",(Q/2).toString()),ce.setAttribute("ry",(te/2).toString()),ae&&ue.setAttributes(ce,ae),ce},ue.createGroup=function(Q){var te=document.createElementNS("http://www.w3.org/2000/svg","g");return Q&&ue.setAttributes(te,Q),te},ue.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ue.createMarker=function(Q,te,ae,ce,re,se,he){var me=document.createElementNS("http://www.w3.org/2000/svg","marker");return ue.setAttributes(me,[["id",Q],["orient",te],["markerWidth",ae.toString()],["markerHeight",ce.toString()],["refX",re.toString()],["refY",se.toString()]]),me.appendChild(he),me},ue.createText=function(Q){var te=document.createElementNS("http://www.w3.org/2000/svg","text");return te.setAttribute("x","0"),te.setAttribute("y","0"),Q&&ue.setAttributes(te,Q),te},ue.createTSpan=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ae.textContent=Q,te&&ue.setAttributes(ae,te),ae},ue.createImage=function(Q){var te=document.createElementNS("http://www.w3.org/2000/svg","image");return Q&&ue.setAttributes(te,Q),te},ue.createPoint=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ae.x=Q,ae.y=te,ae},ue.createPath=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg","path");return ae.setAttribute("d",Q),te&&ue.setAttributes(ae,te),ae},ue.createElement=function(Q,te){var ae=document.createElementNS("http://www.w3.org/2000/svg",Q);return te&&ue.setAttributes(ae,te),ae},ue.getHollowRectanglePath=function(Q,te,ae,ce,re,se,he,me){return"M"+Q+","+te+"V"+(te+ce)+"H"+(Q+ae)+"V"+te+"H"+re+"V"+se+"H"+(re+he)+"V"+(se+me)+"H"+re+"V"+te+"Z"},ue}(),j=function(){function ue(Q){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Q+"_"}return Object.defineProperty(ue.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ue.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(ue.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ue.prototype.addClass=function(Q){return this.styleSheet===void 0&&this.addStyleSheet(),Q.name=""+this.classNamePrefix+Q.localName,this.classes.push(Q),this.styleSheet.sheet.insertRule("."+Q.name+" {"+Q.style+"}",this.styleSheet.sheet.cssRules.length),Q},ue.prototype.addRule=function(Q){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Q),this.styleSheet.sheet.insertRule(Q.selector+" {"+Q.style+"}",this.styleSheet.sheet.cssRules.length)},ue.prototype.addStyleSheet=function(){var Q;this.styleSheet=document.createElement("style"),((Q=this.styleSheetRoot)!==null&&Q!==void 0?Q:document.head).appendChild(this.styleSheet),this.addRule(new J("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new J("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new J("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ie("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ie("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ue.prototype.removeStyleSheet=function(){var Q;this.styleSheet&&(((Q=this.styleSheetRoot)!==null&&Q!==void 0?Q:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ue}(),J=function(ue,Q){this.selector=ue,this.style=Q},ie=function(ue,Q){this.localName=ue,this.style=Q},X=function(){function ue(){this.blocks=[],this.display=""}return ue.prototype.addButtonBlock=function(Q){Q.className=this.blockClassName,Q.buttonClassName=this.buttonClassName,Q.buttonColorsClassName=this.buttonColorsClassName,Q.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(Q)},ue.prototype.addElementBlock=function(Q){Q.className===void 0&&(Q.className=this.blockClassName),this.blocks.push(Q)},ue.prototype.getUI=function(){var Q=document.createElement("div");return Q.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,Q.style.display=this.display,this.blocks.forEach(function(te){return Q.appendChild(te.getUI())}),Q},ue}(),ve=function(){function ue(){}return ue.prototype.getUI=function(){var Q=document.createElement("div");if(Q.className=this.className,this.minWidth!==void 0&&(Q.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":Q.style.justifyContent="flex-start";break;case"center":Q.style.justifyContent="center";break;case"end":Q.style.justifyContent="flex-end"}return Q.style.whiteSpace="nowrap",Q},ue}(),Ie=function(ue){function Q(){var te=ue!==null&&ue.apply(this,arguments)||this;return te.buttons=[],te}return Ce(Q,ue),Q.prototype.addButton=function(te){te.className=this.buttonClassName,te.colorsClassName=this.buttonColorsClassName,te.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(te)},Q.prototype.getUI=function(){var te=ue.prototype.getUI.call(this);return this.buttons.forEach(function(ae){return te.appendChild(ae.getUI())}),te},Q}(ve),Ue=function(){function ue(Q,te){this._isActive=!1,this._isHidden=!1,this._icon=Q,this.title=te,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ue.prototype,"icon",{get:function(){return this._icon},set:function(Q){this._icon=Q,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isActive",{get:function(){return this._isActive},set:function(Q){this._isActive=Q,this.adjustClassName()},enumerable:!1,configurable:!0}),ue.prototype.getUI=function(){var Q=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 Q.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ue.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,"")))},ue.prototype.hide=function(){this._isHidden=!0},ue}(),pe=function(ue){function Q(){var te=ue!==null&&ue.apply(this,arguments)||this;return te.elements=[],te}return Ce(Q,ue),Q.prototype.addElement=function(te){this.elements.push(te)},Q.prototype.getUI=function(){var te=ue.prototype.getUI.call(this);return this.elements.forEach(function(ae){return te.appendChild(ae)}),te},Q}(ve),_e=function(){function ue(Q,te){this.horizontal=Q,this.vertical=te}return Object.defineProperty(ue.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ue.prototype.getVerticalLength=function(Q){return Q/this.ratio},ue.prototype.getHorizontalLength=function(Q){return Q*this.ratio},ue}(),Ae=function(){function ue(){}return ue.getIcon=function(Q,te){if(Q>0&&te>0){var ae=new _e(Q,te),ce=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 he=k.createDefs();se.appendChild(he);var me=k.createElement("clipPath",[["id","text-bg-clip"]]);he.appendChild(me);var ye=k.createPath(k.getHollowRectanglePath((24-ce)/2,(24-re)/2,ce,re,(24-ce)/2+2,(24-re)/2+2,ce-4,re-4));se.appendChild(ye);var Se=k.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Se.appendChild(k.createTSpan(Q+":"+te)),se.appendChild(Se);var Fe=Se.getBBox();k.setAttributes(Se,[["x",((24-Fe.width)/2).toString()],["y",((24-Fe.height)/2-Fe.y).toString()]]);var Ge=k.createPath(k.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Fe.width))/2,(24-Math.ceil(Fe.height))/2,Math.ceil(Fe.width),Math.ceil(Fe.height)));return me.appendChild(Ge),k.setAttributes(ye,[["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>'},ue}(),De=function(ue){function Q(te,ae,ce){var re=ue.call(this,te,ae)||this;return re.isDropdownOpen=!1,re.onClick=re.dropdownButtonClicked,re.dropdownButtons=ce,re}return Ce(Q,ue),Q.prototype.setupDropdown=function(){var te=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=te.className,ae.colorsClassName=te.colorsClassName,te.dropdownBlock.appendChild(ae.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},Q.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},Q.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},Q.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},Q.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},Q.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},Q}(Ue),je=function(){function ue(Q,te){this.GRIP_SIZE=10,this.color=Q,this.fillColor=te,this.visual=k.createGroup(),this.visual.appendChild(k.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(k.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ue.prototype.ownsTarget=function(Q){return Q===this.visual||Q===this.visual.childNodes[0]||Q===this.visual.childNodes[1]},ue.prototype.setCenter=function(Q,te){this.visual.childNodes.forEach(function(ae){return k.setAttributes(ae,[["cx",Q.toString()],["cy",te.toString()]])})},ue}(),ze=function(){function ue(Q,te,ae,ce){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=Q,this.canvasHeight=te,this.margin=ae,this.container=ce,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(ue.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(Q){this._aspectRatio=Q,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Q){this._isGridVisible=Q,this.gridContainer&&k.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(Q){this._zoomFactor=Q,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ue.prototype.open=function(){var Q=this;this.cropShadeElement=k.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=k.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var te=0;te<this.numberOfGridLines;te++)this.horizontalGridLines.push(k.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(k.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(ae){return Q.gridContainer.appendChild(ae)}),this.verticalGridLines.forEach(function(ae){return Q.gridContainer.appendChild(ae)}),this.cropRectElement=k.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new je(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new je(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ue.prototype.setCropRectangle=function(Q){this.cropRect=Q;var te=Object.assign({},this.cropRect);this.zoomFactor!==1&&(te.width=this.cropRect.width*this.zoomFactor,te.height=this.cropRect.height*this.zoomFactor,te.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-te.width/2,te.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-te.height/2),k.setAttributes(this.cropRectElement,[["x",te.x.toString()],["y",te.y.toString()],["width",te.width.toString()],["height",te.height.toString()]]);var ae=te.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(re,se){var he=te.y+ae*(se+1);k.setAttributes(re,[["x1",""+te.x],["y1",""+he],["x2",""+(te.x+te.width)],["y2",""+he]])});var ce=te.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(re,se){var he=te.x+ce*(se+1);k.setAttributes(re,[["x1",""+he],["y1",""+te.y],["x2",""+he],["y2",""+(te.y+te.height)]])}),k.setAttributes(this.cropShadeElement,[["d",k.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,te.x,te.y,te.width,te.height)]]),this.topLeftGrip.setCenter(te.x,te.y),this.topRightGrip.setCenter(te.x+te.width,te.y),this.bottomLeftGrip.setCenter(te.x,te.y+te.height),this.bottomRightGrip.setCenter(te.x+te.width,te.y+te.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ue.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)},ue.prototype.clientToLocalCoordinates=function(Q,te){var ae=this.container.getBoundingClientRect();return{x:Q-ae.left+this.margin,y:te-ae.top+this.margin}},ue.prototype.onPointerDown=function(Q){this.container.setPointerCapture(Q.pointerId),this.previousPoint=this.clientToLocalCoordinates(Q.clientX,Q.clientY),this.cropRectElement===Q.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(Q.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(Q.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(Q.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(Q.target)&&(this.activeGrip=this.bottomRightGrip)},ue.prototype.onPointerMove=function(Q){if(this.isMoving)this.move(this.clientToLocalCoordinates(Q.clientX,Q.clientY));else if(this.activeGrip){var te=this.clientToLocalCoordinates(Q.clientX,Q.clientY);this.resize(te)}Q.preventDefault()},ue.prototype.onPointerUp=function(Q){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(Q.pointerId)},ue.prototype.move=function(Q){var te=Q.x-this.previousPoint.x,ae=Q.y-this.previousPoint.y;this.zoomFactor!==1&&(te=-te/this.zoomFactor,ae=-ae/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+te),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=Q},ue.prototype.resize=function(Q){var te=Object.assign({},this.cropRect),ae=Q.x-this.previousPoint.x,ce=Q.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:te.x+ae<this.margin&&(ae=this.margin-te.x),te.x+=ae,te.width=this.cropRect.x+this.cropRect.width-te.x;break;case this.bottomRightGrip:case this.topRightGrip:te.width+ae>this.canvasWidth*this.zoomFactor&&(ae=this.canvasWidth*this.zoomFactor-te.width),te.width+=ae}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(te.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ae),te.height=this.aspectRatio.getVerticalLength(te.width)):(te.y+=ce,te.height=this.cropRect.y+this.cropRect.height-te.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?te.height=this.aspectRatio.getVerticalLength(te.width):te.height+=ce}te.width<10&&(te.x=this.cropRect.x,te.width=10),te.height<10&&(te.y=this.cropRect.y,te.height=10),this.previousPoint=Q,te.x>=this.margin&&te.y>=this.margin&&te.x-this.margin+te.width<=this.canvasWidth&&te.y-this.margin+te.height<=this.canvasHeight&&(this.cropRect=te,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ue.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var Q=this.cropRect.x+this.cropRect.width/2,te=this.cropRect.y+this.cropRect.height/2,ae=this.aspectRatio.getHorizontalLength(this.cropRect.height),ce=this.aspectRatio.getVerticalLength(this.cropRect.width);ae/this.canvasWidth<ce/this.canvasHeight?this.cropRect.width=ae:this.cropRect.height=ce,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=Q-this.cropRect.width/2,this.cropRect.y=te-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)}},ue.prototype.getRescaledRect=function(Q,te,ae,ce,re,se){var he=ae/Q,me=ce/te;return{x:(re.x-se)*he+se,y:(re.y-se)*me+se,width:re.width*he,height:re.height*me}},ue.prototype.scaleCanvas=function(Q,te){var ae=this.getRescaledRect(this.canvasWidth,this.canvasHeight,Q,te,this.cropRect,this.margin);this.canvasWidth=Q,this.canvasHeight=te,this.onCropChange&&this.onCropChange(ae),this.setCropRectangle(ae)},ue}(),Je=function(){function ue(Q){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=Q,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(ue.prototype,"angle",{get:function(){return this._angle},set:function(Q){this._angle=Q,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ue.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},ue.prototype.onPointerDown=function(Q){this.controlContainer.setPointerCapture(Q.pointerId),this.isDragging=!0,this.previousPoint={x:Q.clientX,y:Q.clientY}},ue.prototype.onPointerMove=function(Q){this.isDragging&&(this.onAngleChange&&this.onAngleChange((Q.clientX-this.previousPoint.x)/5),this.previousPoint.x=Q.clientX)},ue.prototype.onPointerUp=function(Q){this.isDragging&&this.onAngleChange&&this.onAngleChange((Q.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(Q.pointerId)},ue.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var Q=this.angleLabelText.getBBox();k.setAttributes(this.angleLabelElement,[["x",((this.width-Q.width)/2).toString()],["y",(this.height/2).toString()]])}},ue.prototype.positionScaleShape=function(){if(this.scaleShape){var Q=this.scaleShape.transform.baseVal.getItem(0);Q.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(Q,0)}},ue.prototype.getVisual=function(){var Q=document.createElementNS("http://www.w3.org/2000/svg","svg");Q.setAttribute("xmlns","http://www.w3.org/2000/svg"),Q.setAttribute("width",this.width+"px"),Q.setAttribute("height",this.height+"px"),Q.setAttribute("viewBox","0 0 "+this.width+" "+this.height),Q.style.flexShrink="0",document.body.appendChild(Q);for(var te="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ae=1;ae<=this.width/5+10;ae++){var ce=ae%5==0?this.height/3:this.height/6;te+="h4v"+-ce+"h1v"+ce}te+="v1H0Z",this.scaleShape=k.createPath(te);var re=k.createTransform();this.scaleShape.transform.baseVal.appendItem(re),Q.appendChild(this.scaleShape),this.angleLabelElement=k.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=k.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var se=k.createTSpan("");return se.innerHTML="°",this.angleLabelElement.appendChild(se),Q.appendChild(this.angleLabelElement),document.body.removeChild(Q),Q},ue}(),$e=function(){function ue(){this.naturalSize=!1,this.imageType="image/png"}return ue.prototype.rasterize=function(Q,te,ae,ce,re,se,he){var me=this;return new Promise(function(ye){var Se=document.createElement("canvas");Se.width=Q.width.baseVal.value-2*ce,Se.height=Q.height.baseVal.value-2*ce;var Fe=1,Ge=1;me.naturalSize===!0?(Fe=te.naturalWidth/(Q.width.baseVal.value-2*ce)/se,Ge=te.naturalHeight/(Q.height.baseVal.value-2*ce)/he,Se.width=te.naturalWidth/se,Se.height=te.naturalHeight/he):me.width!==void 0&&me.height!==void 0&&(Fe=me.width/ae.width,Ge=me.height/ae.height,Se.width*=Fe,Se.height*=Ge);var Ze=Se.getContext("2d");Ze.translate(Se.width/2,Se.height/2),Ze.rotate(re*Math.PI/180),Ze.scale(se,he),Ze.translate(-Se.width/2,-Se.height/2),Ze.drawImage(te,0,0,Se.width,Se.height);var Ye=document.createElement("canvas");Ye.width=ae.width*Fe,Ye.height=ae.height*Ge,Ye.getContext("2d").putImageData(Ze.getImageData((ae.x-ce)*Fe,(ae.y-ce)*Ge,ae.width*Fe,ae.height*Ge),0,0),ye(Ye.toDataURL(me.imageType,me.imageQuality))})},ue}(),tt=function(){function ue(Q){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=ue.instanceCounter++,this.styles=new j(this.instanceNo),this.target=Q,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(ue.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(Q){this._zoomToCropEnabled=Q,Q?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(Q){this._isGridVisible=Q,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"gridLines",{get:function(){return this._gridLines},set:function(Q){this._gridLines=Q,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(Q){this._rotationAngle=Q,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"aspectRatio",{get:function(){var Q;return(Q=this._aspectRatio)!==null&&Q!==void 0?Q:this.aspectRatios[0]},set:function(Q){this._aspectRatio=Q},enumerable:!1,configurable:!0}),ue.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},ue.prototype.show=function(){this.showUI(),this.open()},ue.prototype.close=function(Q){Q===void 0&&(Q=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),Q||this.closeEventListeners.forEach(function(te){return te()}),this._isOpen=!1)},ue.prototype.addRenderEventListener=function(Q){this.renderEventListeners.push(Q)},ue.prototype.removeRenderEventListener=function(Q){this.renderEventListeners.indexOf(Q)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(Q),1)},ue.prototype.addCloseEventListener=function(Q){this.closeEventListeners.push(Q)},ue.prototype.removeCloseEventListener=function(Q){this.closeEventListeners.indexOf(Q)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(Q),1)},ue.prototype.setupResizeObserver=function(){var Q=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Q.resize(Q.target.clientWidth,Q.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))},ue.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var Q=1*this.target.clientWidth/this.target.clientHeight,te=this.contentDiv.clientWidth/Q>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*Q:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ae=te+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/Q;this.resize(te,ae)}},ue.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ue.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",k.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ue.prototype.resize=function(Q,te){this.imageWidth=Math.round(Q),this.imageHeight=Math.round(te),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()},ue.prototype.setEditingTarget=function(){var Q=document.createElement("canvas");Q.width=this.target.naturalWidth,Q.height=this.target.naturalHeight,Q.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var te=Q.toDataURL();k.setAttributes(this.editingTarget,[["href",te]]),this.setEditingTargetSize()},ue.prototype.setTopLeft=function(){var Q=this.target.getBoundingClientRect(),te=this.editorCanvas.getBoundingClientRect();this.left=Q.left-te.left-this.CANVAS_MARGIN,this.top=Q.top-te.top-this.CANVAS_MARGIN},ue.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=k.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=k.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=k.createGroup(),this.editingTargetRotationScaleContainer=k.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var Q=k.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(Q);var te=k.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(te),this.editingTargetContainer=k.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)},ue.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ue.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=k.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ze(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()},ue.prototype.zoomToCrop=function(){if(this.cropRect){var Q=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,te=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=Q+"px "+te+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-Q+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-te+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ue.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)},ue.prototype.cropRectChanged=function(Q){this.cropRect=Q,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ue.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ue.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"},ue.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ue.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 Q=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,te=this.target.offsetTop>Q+this.CANVAS_MARGIN?this.target.offsetTop-(Q+this.CANVAS_MARGIN):0;this.coverDiv.style.top=te+"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},ue.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ue.prototype.addTopToolbar=function(){var Q=this;this.topToolbar=new X,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 te=new Ie;te.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(te);var ae=[];this.aspectRatios.forEach(function(Ge){var Ze=new Ue(Ae.getIcon(Ge.horizontal,Ge.vertical),Ge.horizontal===0&&Ge.vertical===0?"FREE":Ge.horizontal+":"+Ge.vertical);Ze.onClick=function(){return Q.ratioButtonClicked(Ge)},ae.push(Ze)}),this.aspectRatioButton=new De(Ae.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,te.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ce=new Ue('<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");ce.isActive=this.isGridVisible,ce.onClick=function(){Q.isGridVisible=!Q.isGridVisible,ce.isActive=Q.isGridVisible},te.addButton(ce);var re=new Ue('<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(){Q.zoomToCropEnabled=!Q.zoomToCropEnabled,re.isActive=Q.zoomToCropEnabled},te.addButton(re),!Y.isLicensed){var se=new pe;this.topToolbar.addElementBlock(se);var he=document.createElement("div");he.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>',he.appendChild(me),se.addElement(he)}var ye=new Ie;ye.minWidth=3*this.toolbarHeight+"px",ye.contentAlign="end",this.topToolbar.addButtonBlock(ye);var Se=new Ue('<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");Se.onClick=this.startRenderAndClose,ye.addButton(Se),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Se.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Fe=new Ue('<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");Fe.onClick=this.close,ye.addButton(Fe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Fe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ue.prototype.addBottomToolbar=function(){var Q=this;this.bottomToolbar=new X,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 te=new Ie;te.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(te);var ae=new Ue('<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,te.addButton(ae);var ce=new Ue('<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");ce.onClick=this.rotateRightButtonClicked,te.addButton(ce);var re=new pe;re.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(re),this.straightener=new Je("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(ye){Q.rotateBy(ye),Q.straightener.angle=Q.rotationAngle},re.addElement(this.straightener.getUI());var se=new Ie;se.minWidth=2*this.toolbarHeight+"px",se.contentAlign="end",this.bottomToolbar.addButtonBlock(se);var he=new Ue('<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");he.onClick=this.flipHorizontallyButtonClicked,se.addButton(he);var me=new Ue('<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)},ue.prototype.ratioButtonClicked=function(Q){this.aspectRatio=Q,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ue.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ae.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ue.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new _e(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ue.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ue.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ue.prototype.restoreState=function(Q){if(Q){var te=this.cropLayer.getRescaledRect(Q.width,Q.height,this.imageWidth,this.imageHeight,Q.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(te),this.cropRectChanged(te),this.flippedHorizontally=Q.flippedHorizontally,this.flippedVertically=Q.flippedVertically,this.applyFlip(),this.rotationAngle=Q.rotationAngle,this.applyRotation()}},ue.prototype.clientToLocalCoordinates=function(Q,te){var ae=this.cropImage.getBoundingClientRect();return{x:Q-ae.left,y:te-ae.top}},ue.prototype.onWindowResize=function(){this.positionUI()},ue.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var Q=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=Q+"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()},ue.prototype.rotateLeftButtonClicked=function(){var Q=this.rotationAngle-90;this.rotationAngle%90!=0&&(Q+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(Q)},ue.prototype.rotateRightButtonClicked=function(){var Q=this.rotationAngle+90;this.rotationAngle%90!=0&&(Q-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(Q)},ue.prototype.rotateTo=function(Q){Q=(Q=Q>180?Q-360:Q)<=-180?Q+360:Q,this.rotationAngle=Q,this.applyRotation()},ue.prototype.rotateBy=function(Q){this.rotateTo((this.rotationAngle+Q)%360)},ue.prototype.applyRotation=function(){var Q=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var te=this.editingTargetRotationContainer.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(te,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=Q},ue.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ue.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ue.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ue.prototype.startRenderAndClose=function(){return Le(this,void 0,void 0,function(){var Q,te;return ge(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return Q=ae.sent(),te=this.getState(),this.renderEventListeners.forEach(function(ce){return ce(Q,te)}),this.close(!0),[2]}})})},ue.prototype.render=function(){return Le(this,void 0,void 0,function(){var Q;return ge(this,function(te){switch(te.label){case 0:return(Q=new $e).naturalSize=this.renderAtNaturalSize,Q.imageType=this.renderImageType,Q.imageQuality=this.renderImageQuality,Q.width=this.renderWidth,Q.height=this.renderHeight,this.unzoomFromCrop(),k.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,Q.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 te.sent(),[4,Q.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,te.sent()]}})})},ue.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ie("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 ie("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ie("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var Q=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ie("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*Q)+`px;
|
|
height: `+(this.toolbarHeight-2*Q)+`px;
|
|
padding: `+Q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new J("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new J("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ie("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 ie("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ie("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 ie("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*Q)+`px;
|
|
padding: `+Q+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ie("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},ue.instanceCounter=0,ue}(),Qe=P("8hTe"),Re=P.n(Qe),Oe=/<pre[^>]*>/g;function We(ue){var Q=document.createElement("div");return Q.innerHTML=ue,Q.childNodes.length===0?"":Q.childNodes[0].nodeValue}var He=de.a=function(ue){var Q=ue.value,te=Q===void 0?"":Q,ae=ue.edit,ce=ae===void 0?!1:ae,re=ue.className,se=ue.showTextOnly,he=ue.showLines,me=ue.replaces,ye=ue.zoomImg,Se=ue.hasMask,Fe=ue.style,Ge=Fe===void 0?{}:Fe,Ze=ue.stylesPrev,Ye=Ze===void 0?{}:Ze,Rt=String(te),lt=Object(I.useRef)(),it=Object(I.useRef)(),Wt=Object(I.useState)(""),Nt=Object(G.a)(Wt,2),Ut=Nt[0],rn=Nt[1],vt=Object(I.useState)("office"),on=Object(G.a)(vt,2),an=on[0],Ct=on[1],Mt=function(){var Kt=new tt(it.current);Kt.displayMode="popup",Kt.addRenderEventListener(function(){var Yt=Object(O.a)(n.a.mark(function xt(Dt){var jt;return n.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return lt.current.style.display="none",En.next=3,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt}});case 3:jt=En.sent,jt!=null&&jt.id&&me(it.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 5:case"end":return En.stop()}},xt)}));return function(xt){return Yt.apply(this,arguments)}}()),Kt.show()},ht=function(){var Kt=new be.a(it.current);Kt.settings.displayMode="popup",Kt.addEventListener("render",function(){var Yt=Object(O.a)(n.a.mark(function xt(Dt){var jt;return n.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(lt.current.style.display="none",!it.current){En.next=6;break}return En.next=4,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt.dataUrl}});case 4:jt=En.sent,jt!=null&&jt.id&&me(it.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(jt==null?void 0:jt.id,"?type=").concat(jt.content_type));case 6:case"end":return En.stop()}},xt)}));return function(xt){return Yt.apply(this,arguments)}}()),Kt.show(),window.markerArea=Kt},Tt=Object(I.useMemo)(function(){lt.current&&(lt.current.style.zIndex=-1);try{var et=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Kt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Yt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Rt=Rt.replace(et,"("+Z.a.API_SERVER+"/api/attachments/").replace(Kt,'"'+Z.a.API_SERVER+"/api/attachments/").replace(Yt,'"'+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(Fn){}var xt=H(Rt),Dt=S();if(Rt.match(/\[TOC\]/)&&(xt=xt.replace("<p>[TOC]</p>",L()),w()),xt=xt.replace(/(__special_katext_id_\d+__)/g,function(Fn,En){var Ve=Dt[En],nt=Ve.type,rr=Ve.expression;return Object(oe.renderToString)(We(rr)||"",{displayMode:nt==="block",throwOnError:!1,output:"html"})}),xt=xt.replace(/▁/g,"\u2581\u2581\u2581"),b(),se){var jt=document.createElement("div");return jt.innerHTML=xt,jt.innerText}return setTimeout(function(){return Kn()},500),xt},[Rt]),yt=Object(I.useRef)();T.WebkitLineClamp=he,he&&(Ge=Object(U.a)(Object(U.a)({},Ge),T));function Sn(et){var Kt=et.target;if(Kt.tagName.toUpperCase()==="IMG"){if(ye){var Yt=Kt.getAttribute("src");rn(Yt),Ct("image")}}else if(Kt.tagName.toUpperCase()==="A"){var xt=Kt.getAttribute("href");if(xt.indexOf("office")>-1)et.preventDefault(),rn(xt),Ct("office");else if(xt.indexOf("application/pdf")>-1)et.preventDefault(),rn(xt),Ct("pdf");else if(xt.indexOf("text/html")>-1)et.preventDefault(),rn(xt),Ct("html");else if(xt.startsWith("#")){et.preventDefault();var Dt=document.getElementById(xt.replace("#",""));Dt&&Dt.scrollIntoView(!0)}}}var Kn=function(){var Kt,Yt=(Kt=yt.current)===null||Kt===void 0?void 0:Kt.querySelectorAll("video");Yt==null||Yt.forEach(function(xt){if(xt.oncontextmenu=function(){return!1},xt.src.indexOf(".m3u8")>-1&&!xt.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var Dt=new K.a;Dt.loadSource(xt.src),Dt.attachMedia(xt)}}})};Object(I.useEffect)(function(){if(yt.current&&Tt&&(Tt.match(Oe)&&window.PR.prettyPrint()),yt.current)return yt.current.addEventListener("click",Sn),function(){yt.current.removeEventListener("click",Sn),b(),w()}},[Tt,yt.current,Sn]);var pn=function(Kt){if(!ce)return;Kt.target.nodeName==="IMG"?(lt.current.style.zIndex=1,lt.current.style.display="flex",lt.current.style.width=Kt.target.clientWidth+"px",lt.current.style.height=Kt.target.clientHeight+"px",lt.current.style.top=Kt.target.offsetTop+"px",lt.current.style.left=Kt.target.offsetLeft+"px",it.current.src=Kt.target.getAttribute("src")):lt.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:yt,style:Object(U.a)({},Ge),className:"".concat(re||""," markdown-body ").concat(Re.a.mdBody),onMouseOver:pn,dangerouslySetInnerHTML:{__html:Tt}}),g.a.createElement("div",{ref:lt,className:Re.a.button},g.a.createElement(z.a,null,g.a.createElement(V.a,{onClick:function(){return Mt()}},"\u88C1\u526A"),g.a.createElement(V.a,{onClick:function(){return ht()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:it,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(fe.a,{close:!0,data:Ut,type:Ut!=null&&Ut.length?an:"",style:Object(U.a)({},Ye),onClose:function(){return rn("")}}))}},"9VGf":function(ke,de,P){"use strict";P.d(de,"a",function(){return D});var q=P("q1tI"),z=P.n(q);function D(V,U){var O=Object(q.useRef)();Object(q.useEffect)(function(){O.current=V}),Object(q.useEffect)(function(){function G(){O.current()}if(U!==null){var W=setInterval(G,U);return function(){return clearInterval(W)}}},[U])}},AMnG:function(ke,de,P){"use strict";var q=P("miYZ"),z=P("tsqr"),D=P("tJVT"),V=P("q1tI"),U=P.n(V),O=P("nWbc"),G=P.n(O),W=P("Ot1p");de.a=function(n){var I=n.id,g=n.activeDiscussIndex,p=n.onReplyDiscuss,h=Object(V.useState)(""),c=Object(D.a)(h,2),s=c[0],d=c[1];function i(r){d(r)}function l(){if(!s){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}p(I,s),d("")}return U.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:g===I?"block":"none",width:"100%"}},U.a.createElement(W.a,{miniToolbar:!0,startInit:g===I,defaultValue:s,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),U.a.createElement("a",{onClick:l,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(ke,de,P){"use strict";P.d(de,"a",function(){return O});var q=P("MNnm"),z="rc-util-key";function D(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function V(G){var W,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var I=document.createElement("style");if((W=n.csp)===null||W===void 0?void 0:W.nonce){var g;I.nonce=(g=n.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=G;var p=D(n),h=p.firstChild;return n.prepend&&p.prepend?p.prepend(I):n.prepend&&h?p.insertBefore(I,h):p.appendChild(I),I}var U=new Map;function O(G,W){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=D(n);if(!U.has(I)){var g=V("",n),p=g.parentNode;U.set(I,p),p.removeChild(g)}var h=Array.from(U.get(I).children).find(function(l){return l.tagName==="STYLE"&&l[z]===W});if(h){var c,s;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&h.nonce!==((s=n.csp)===null||s===void 0?void 0:s.nonce)){var d;h.nonce=(d=n.csp)===null||d===void 0?void 0:d.nonce}return h.innerHTML!==G&&(h.innerHTML=G),h}var i=V(G,n);return i[z]=W,i}},Bd2K:function(ke,de,P){(function(q){q(P("VrN/"),P("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(n,I,g){if(g!=q.Init&&g&&n.removeKeyMap("autoCloseTags"),!I)return;var p={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(p["'/'"]=function(h){return O(h)}),(typeof I!="object"||I.whenOpening!==!1)&&(p["'>'"]=function(h){return V(h)}),n.addKeyMap(p)});var z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 V(n){if(n.getOption("disableInput"))return q.Pass;for(var I=n.listSelections(),g=[],p=n.getOption("autoCloseTags"),h=0;h<I.length;h++){if(!I[h].empty())return q.Pass;var c=I[h].head,s=n.getTokenAt(c),d=q.innerMode(n.getMode(),s.state),i=d.state,l=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(i),r=l&&l.name;if(!r)return q.Pass;var o=d.mode.configuration=="html",w=typeof p=="object"&&p.dontCloseTags||o&&z,T=typeof p=="object"&&p.indentTags||o&&D;s.end>c.ch&&(r=r.slice(0,r.length-s.end+c.ch));var x=r.toLowerCase();if(!r||s.type=="string"&&(s.end!=c.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&l.close||s.string.indexOf("/")==c.ch-s.start-1||w&&G(w,x)>-1||W(n,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(i)||[],r,c,!0))return q.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,r)>-1){g[h]={text:"/>",newPos:q.Pos(c.line,c.ch+2)};continue}var A=T&&G(T,x)>-1;g[h]={indent:A,text:">"+(A?`
|
|
|
|
`:"")+"</"+r+">",newPos:A?q.Pos(c.line+1,0):q.Pos(c.line,c.ch+1)}}for(var E=typeof p=="object"&&p.dontIndentOnAutoClose,h=I.length-1;h>=0;h--){var _=g[h];n.replaceRange(_.text,I[h].head,I[h].anchor,"+insert");var m=n.listSelections().slice(0);m[h]={head:_.newPos,anchor:_.newPos},n.setSelections(m),!E&&_.indent&&(n.indentLine(_.newPos.line,null,!0),n.indentLine(_.newPos.line+1,null,!0))}}function U(n,I){for(var g=n.listSelections(),p=[],h=I?"/":"</",c=n.getOption("autoCloseTags"),s=typeof c=="object"&&c.dontIndentOnSlash,d=0;d<g.length;d++){if(!g[d].empty())return q.Pass;var i=g[d].head,l=n.getTokenAt(i),r=q.innerMode(n.getMode(),l.state),o=r.state;if(I&&(l.type=="string"||l.string.charAt(0)!="<"||l.start!=i.ch-1))return q.Pass;var w,T=r.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(T&&r.mode.name=="javascript")w=h+"script";else if(T&&r.mode.name=="css")w=h+"style";else{var x=r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(o);if(!x||x.length&&W(n,x,x[x.length-1],i))return q.Pass;w=h+x[x.length-1]}n.getLine(i.line).charAt(l.end)!=">"&&(w+=">"),p[d]=w}if(n.replaceSelections(p),g=n.listSelections(),!s)for(var d=0;d<g.length;d++)(d==g.length-1||g[d].head.line<g[d+1].head.line)&&n.indentLine(g[d].head.line)}function O(n){return n.getOption("disableInput")?q.Pass:U(n,!0)}q.commands.closeTag=function(n){return U(n)};function G(n,I){if(n.indexOf)return n.indexOf(I);for(var g=0,p=n.length;g<p;++g)if(n[g]==I)return g;return-1}function W(n,I,g,p,h){if(!q.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,p.line+500),s=q.scanForClosingTag(n,p,null,c);if(!s||s.tag!=g)return!1;for(var d=h?1:0,i=I.length-1;i>=0&&I[i]==g;i--)++d;p=s.to;for(var i=1;i<d;i++){var l=q.scanForClosingTag(n,p,null,c);if(!l||l.tag!=g)return!1;p=l.to}return!0}})},BdwD:function(ke,de,P){"use strict";var q=P("+L6B"),z=P("2/Rp"),D=P("0Owb"),V=P("k1fw"),U=P("q1tI"),O=P.n(U),G=P("FOrL"),W=P.n(G),n=function(g){var p=g.buttonProps,h=p===void 0?{}:p,c=g.styles,s=c===void 0?{}:c,d=g.imgStyles,i=d===void 0?{}:d,l=g.customText,r=g.ButtonText,o=g.ButtonClick,w=g.Buttonclass,T=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(V.a)(Object(V.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),s)},O.a.createElement("img",{src:W.a,style:Object(V.a)(Object(V.a)({},{width:"200px",height:"150px"}),i)}),O.a.createElement("p",{className:"mt10 font14"},l||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),r&&O.a.createElement(z.a,Object(D.a)({className:w,onClick:o},h),r),T&&T)};de.a=n},BjJ7:function(ke,de,P){"use strict";P.d(de,"d",function(){return z}),P.d(de,"c",function(){return D}),P.d(de,"e",function(){return V}),P.d(de,"b",function(){return U}),P.d(de,"a",function(){return G});var q=P("m3rI");function z(W){var n=!0;if(W.length>0){for(var I=0;I<W.length;I++)if(W[I].compile_success==0||!W[I].compile_success){n=!1;break}}else n=!1;return n}function D(W){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;g<W.length;g++){var p=W[g],h=n?"".concat(n,"/").concat(p.name):"".concat(p.name);I.push({title:p.name,isLeaf:!(p.type==="tree"),key:h})}return I}function V(W,n,I){for(var g=0;g<W.length;g++){var p=W[g];if(p.key===n){p.children=I;break}p.children&&V(p.children,n,I)}return W}function U(W,n,I){var g;return function(){var p=this,h=arguments,c=function(){g=null,I||W.apply(p,h)},s=I&&!g;clearTimeout(g),g=setTimeout(c,n),s&&W.apply(p,h)}}var O=!0,G=q.a.API_SERVER},"C+DQ":function(ke,de,P){},"C/vA":function(ke,de,P){"use strict";P.d(de,"a",function(){return q});function q(z){const D=this;let V=!1,U;return function(){return V||(V=!0,U=z.apply(D,arguments)),U}}},"Cg/j":function(ke,de,P){"use strict";P.d(de,"b",function(){return q}),P.d(de,"a",function(){return z}),P.d(de,"c",function(){return V}),P.d(de,"d",function(){return U});var q;(function(O){O.serviceIds=new Map,O.DI_TARGET="$di$target",O.DI_DEPENDENCIES="$di$dependencies";function G(W){return W[O.DI_DEPENDENCIES]||[]}O.getServiceDependencies=G})(q||(q={}));const z=V("instantiationService");function D(O,G,W,n){G[q.DI_TARGET]===G?G[q.DI_DEPENDENCIES].push({id:O,index:W,optional:n}):(G[q.DI_DEPENDENCIES]=[{id:O,index:W,optional:n}],G[q.DI_TARGET]=G)}function V(O){if(q.serviceIds.has(O))return q.serviceIds.get(O);const G=function(W,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");D(G,W,I,!1)};return G.toString=()=>O,q.serviceIds.set(O,G),G}function U(O){return function(G,W,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");D(O,G,n,!0)}}},CrYA:function(ke,de,P){var q=P("MFOe"),z=q.Global;ke.exports={name:"sessionStorage",read:V,write:U,each:O,remove:G,clearAll:W};function D(){return z.sessionStorage}function V(n){return D().getItem(n)}function U(n,I){return D().setItem(n,I)}function O(n){for(var I=D().length-1;I>=0;I--){var g=D().key(I);n(V(g),g)}}function G(n){return D().removeItem(n)}function W(){return D().clear()}},DlQD:function(ke,de,P){(function(q,z){ke.exports=z()})(this,function(){"use strict";function q(te,ae){for(var ce=0;ce<ae.length;ce++){var re=ae[ce];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(te,re.key,re)}}function z(te,ae,ce){return ae&&q(te.prototype,ae),ce&&q(te,ce),te}function D(te,ae){if(!te)return;if(typeof te=="string")return V(te,ae);var ce=Object.prototype.toString.call(te).slice(8,-1);if(ce==="Object"&&te.constructor&&(ce=te.constructor.name),ce==="Map"||ce==="Set")return Array.from(te);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return V(te,ae)}function V(te,ae){(ae==null||ae>te.length)&&(ae=te.length);for(var ce=0,re=new Array(ae);ce<ae;ce++)re[ce]=te[ce];return re}function U(te,ae){var ce;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(ce=D(te))||ae&&te&&typeof te.length=="number"){ce&&(te=ce);var re=0;return function(){return re>=te.length?{done:!0}:{done:!1,value:te[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 ce=te[Symbol.iterator](),ce.next.bind(ce)}function O(te,ae){return ae={exports:{}},te(ae,ae.exports),ae.exports}var G=O(function(te){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 ce(re){te.exports.defaults=re}te.exports={defaults:ae(),getDefaults:ae,changeDefaults:ce}}),W=G.defaults,n=G.getDefaults,I=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(ae){return s[ae]};function i(te,ae){if(ae){if(g.test(te))return te.replace(p,d)}else if(h.test(te))return te.replace(c,d);return te}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(te){return te.replace(l,function(ae,ce){return ce=ce.toLowerCase(),ce==="colon"?":":ce.charAt(0)==="#"?ce.charAt(1)==="x"?String.fromCharCode(parseInt(ce.substring(2),16)):String.fromCharCode(+ce.substring(1)):""})}var o=/(^|[^\[])\^/g;function w(te,ae){te=te.source||te,ae=ae||"";var ce={replace:function(se,he){return he=he.source||he,he=he.replace(o,"$1"),te=te.replace(se,he),ce},getRegex:function(){return new RegExp(te,ae)}};return ce}var T=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(te,ae,ce){if(te){var re;try{re=decodeURIComponent(r(ce)).replace(T,"").toLowerCase()}catch(se){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ae&&!x.test(ce)&&(ce=f(ae,ce));try{ce=encodeURI(ce).replace(/%25/g,"%")}catch(se){return null}return ce}var A={},E=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(te,ae){A[" "+te]||(E.test(te)?A[" "+te]=te+"/":A[" "+te]=M(te,"/",!0)),te=A[" "+te];var ce=te.indexOf(":")===-1;return ae.substring(0,2)==="//"?ce?ae:te.replace(_,"$1")+ae:ae.charAt(0)==="/"?ce?ae:te.replace(m,"$1")+ae:te+ae}var S={exec:function(){}};function b(te){for(var ae=1,ce,re;ae<arguments.length;ae++){ce=arguments[ae];for(re in ce)Object.prototype.hasOwnProperty.call(ce,re)&&(te[re]=ce[re])}return te}function y(te,ae){var ce=te.replace(/\|/g,function(he,me,ye){for(var Se=!1,Fe=me;--Fe>=0&&ye[Fe]==="\\";)Se=!Se;return Se?"|":" |"}),re=ce.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 M(te,ae,ce){var re=te.length;if(re===0)return"";for(var se=0;se<re;){var he=te.charAt(re-se-1);if(he===ae&&!ce)se++;else if(he!==ae&&ce)se++;else break}return te.substr(0,re-se)}function B(te,ae){if(te.indexOf(ae[1])===-1)return-1;for(var ce=te.length,re=0,se=0;se<ce;se++)if(te[se]==="\\")se++;else if(te[se]===ae[0])re++;else if(te[se]===ae[1]&&(re--,re<0))return se;return-1}function R(te){te&&te.sanitize&&!te.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 H={escape:i,unescape:r,edit:w,cleanUrl:L,resolveUrl:f,noopTest:S,merge:b,splitCells:y,rtrim:M,findClosingBracket:B,checkSanitizeDeprecation:R},N=G.defaults,C=H.rtrim,K=H.splitCells,Z=H.escape,oe=H.findClosingBracket;function fe(te,ae,ce){var re=ae.href,se=ae.title?Z(ae.title):null,he=te[1].replace(/\\([\[\]])/g,"$1");return te[0].charAt(0)!=="!"?{type:"link",raw:ce,href:re,title:se,text:he}:{type:"image",raw:ce,href:re,title:se,text:Z(he)}}function xe(te,ae){var ce=te.match(/^(\s+)(?:```)/);if(ce===null)return ae;var re=ce[1];return ae.split(`
|
|
`).map(function(se){var he=se.match(/^\s+/);if(he===null)return se;var me=he[0];return me.length>=re.length?se.slice(re.length):se}).join(`
|
|
`)}var be=function(){function te(ce){this.options=ce||N}var ae=te.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 he=this.rules.block.code.exec(re);if(he){var me=se[se.length-1];if(me&&me.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var ye=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:C(ye,`
|
|
`)}}},ae.fences=function(re){var se=this.rules.block.fences.exec(re);if(se){var he=se[0],me=xe(he,se[3]||"");return{type:"code",raw:he,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 he={type:"table",header:K(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[],raw:se[0]};if(he.header.length===he.align.length){var me=he.align.length,ye;for(ye=0;ye<me;ye++)/^ *-+: *$/.test(he.align[ye])?he.align[ye]="right":/^ *:-+: *$/.test(he.align[ye])?he.align[ye]="center":/^ *:-+ *$/.test(he.align[ye])?he.align[ye]="left":he.align[ye]=null;for(me=he.cells.length,ye=0;ye<me;ye++)he.cells[ye]=K(he.cells[ye],he.header.length);return he}}},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 he=se[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:se[0],text:he}}},ae.list=function(re){var se=this.rules.block.list.exec(re);if(se){for(var he=se[0],me=se[2],ye=me.length>1,Se=me[me.length-1]===")",Fe={type:"list",raw:he,ordered:ye,start:ye?+me.slice(0,-1):"",loose:!1,items:[]},Ge=se[0].match(this.rules.block.item),Ze=!1,Ye,Rt,lt,it,Wt,Nt,Ut,rn=Ge.length,vt=0;vt<rn;vt++)Ye=Ge[vt],he=Ye,Rt=Ye.length,Ye=Ye.replace(/^ *([*+-]|\d+[.)]) */,""),~Ye.indexOf(`
|
|
`)&&(Rt-=Ye.length,Ye=this.options.pedantic?Ye.replace(/^ {1,4}/gm,""):Ye.replace(new RegExp("^ {1,"+Rt+"}","gm"),"")),vt!==rn-1&&(lt=this.rules.block.bullet.exec(Ge[vt+1])[0],(ye?lt.length===1||!Se&<[lt.length-1]===")":lt.length>1||this.options.smartLists&<!==me)&&(it=Ge.slice(vt+1).join(`
|
|
`),Fe.raw=Fe.raw.substring(0,Fe.raw.length-it.length),vt=rn-1)),Wt=Ze||/\n\n(?!\s*$)/.test(Ye),vt!==rn-1&&(Ze=Ye.charAt(Ye.length-1)===`
|
|
`,Wt||(Wt=Ze)),Wt&&(Fe.loose=!0),Nt=/^\[[ xX]\] /.test(Ye),Ut=void 0,Nt&&(Ut=Ye[1]!==" ",Ye=Ye.replace(/^\[[ xX]\] +/,"")),Fe.items.push({type:"list_item",raw:he,task:Nt,checked:Ut,loose:Wt,text:Ye});return Fe}},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 he=se[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:se[0],href:se[2],title:se[3]}}},ae.table=function(re){var se=this.rules.block.table.exec(re);if(se){var he={type:"table",header:K(se[1].replace(/^ *| *\| *$/g,"")),align:se[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:se[3]?se[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=se[0];var me=he.align.length,ye;for(ye=0;ye<me;ye++)/^ *-+: *$/.test(he.align[ye])?he.align[ye]="right":/^ *:-+: *$/.test(he.align[ye])?he.align[ye]="center":/^ *:-+ *$/.test(he.align[ye])?he.align[ye]="left":he.align[ye]=null;for(me=he.cells.length,ye=0;ye<me;ye++)he.cells[ye]=K(he.cells[ye].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},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 he=this.rules.block.text.exec(re);if(he){var me=se[se.length-1];return me&&me.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[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,he){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),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:se,inRawBlock:he,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 he=oe(se[2],"()");if(he>-1){var me=se[0].indexOf("!")===0?5:4,ye=me+se[1].length+he;se[2]=se[2].substring(0,he),se[0]=se[0].substring(0,ye).trim(),se[3]=""}var Se=se[2],Fe="";if(this.options.pedantic){var Ge=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);Ge?(Se=Ge[1],Fe=Ge[3]):Fe=""}else Fe=se[3]?se[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var Ze=fe(se,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:Fe&&Fe.replace(this.rules.inline._escapes,"$1")},se[0]);return Ze}},ae.reflink=function(re,se){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var me=(he[2]||he[1]).replace(/\s+/g," ");if(me=se[me.toLowerCase()],!me||!me.href){var ye=he[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Se=fe(he,me,he[0]);return Se}},ae.strong=function(re,se,he){he===void 0&&(he="");var me=this.rules.inline.strong.start.exec(re);if(me&&(!me[1]||me[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){se=se.slice(-1*re.length);var ye=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Se;(me=ye.exec(se))!=null;)if(Se=this.rules.inline.strong.middle.exec(se.slice(0,me.index+3)),Se)return{type:"strong",raw:re.slice(0,Se[0].length),text:re.slice(2,Se[0].length-2)}}},ae.em=function(re,se,he){he===void 0&&(he="");var me=this.rules.inline.em.start.exec(re);if(me&&(!me[1]||me[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){se=se.slice(-1*re.length);var ye=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Se;(me=ye.exec(se))!=null;)if(Se=this.rules.inline.em.middle.exec(se.slice(0,me.index+2)),Se)return{type:"em",raw:re.slice(0,Se[0].length),text:re.slice(1,Se[0].length-1)}}},ae.codespan=function(re){var se=this.rules.inline.code.exec(re);if(se){var he=se[2].replace(/\n/g," "),me=/[^ ]/.test(he),ye=he.startsWith(" ")&&he.endsWith(" ");return me&&ye&&(he=he.substring(1,he.length-1)),he=Z(he,!0),{type:"codespan",raw:se[0],text:he}}},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 he=this.rules.inline.autolink.exec(re);if(he){var me,ye;return he[2]==="@"?(me=Z(this.options.mangle?se(he[1]):he[1]),ye="mailto:"+me):(me=Z(he[1]),ye=me),{type:"link",raw:he[0],text:me,href:ye,tokens:[{type:"text",raw:me,text:me}]}}},ae.url=function(re,se){var he;if(he=this.rules.inline.url.exec(re)){var me,ye;if(he[2]==="@")me=Z(this.options.mangle?se(he[0]):he[0]),ye="mailto:"+me;else{var Se;do Se=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Se!==he[0]);me=Z(he[0]),he[1]==="www."?ye="http://"+me:ye=me}return{type:"link",raw:he[0],text:me,href:ye,tokens:[{type:"text",raw:me,text:me}]}}},ae.inlineText=function(re,se,he){var me=this.rules.inline.text.exec(re);if(me){var ye;return se?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):Z(me[0]):me[0]:ye=Z(this.options.smartypants?he(me[0]):me[0]),{type:"text",raw:me[0],text:ye}}},te}(),Te=H.noopTest,Ce=H.edit,Le=H.merge,ge={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Ce(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Ce(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Ce(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=/<!--(?!-?>)[\s\S]*?-->/,ge.html=Ce(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Ce(ge._paragraph).replace("hr",ge.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",ge._tag).getRegex(),ge.blockquote=Ce(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Le({},ge),ge.gfm=Le({},ge.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*|$)"}),ge.gfm.nptable=Ce(ge.gfm.nptable).replace("hr",ge.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",ge._tag).getRegex(),ge.gfm.table=Ce(ge.gfm.table).replace("hr",ge.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",ge._tag).getRegex(),ge.pedantic=Le({},ge.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._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:Te,paragraph:Ce(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Y._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Y.punctuation=Ce(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=Ce(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=Ce(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=Ce(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=Ce(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=Ce(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=Ce(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=Ce(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=Ce(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=Ce(Y._blockSkip,"g").getRegex(),Y.overlapSkip=Ce(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._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])?)+(?![-_])/,Y.autolink=Ce(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=Ce(Y.tag).replace("comment",ge._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=Ce(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=Ce(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=Ce(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=Le({},Y),Y.pedantic=Le({},Y.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",Y._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=Le({},Y.normal,{escape:Ce(Y.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Y.gfm.url=Ce(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=Le({},Y.gfm,{br:Ce(Y.br).replace("{2,}","*").getRegex(),text:Ce(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var k={block:ge,inline:Y},j=G.defaults,J=k.block,ie=k.inline;function X(te){return te.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 ve(te){var ae="",ce,re,se=te.length;for(ce=0;ce<se;ce++)re=te.charCodeAt(ce),Math.random()>.5&&(re="x"+re.toString(16)),ae+="&#"+re+";";return ae}var Ie=function(){function te(ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=ce||j,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:J.normal,inline:ie.normal};this.options.pedantic?(re.block=J.pedantic,re.inline=ie.pedantic):this.options.gfm&&(re.block=J.gfm,this.options.breaks?re.inline=ie.breaks:re.inline=ie.gfm),this.tokenizer.rules=re}te.lex=function(re,se){var he=new te(se);return he.lex(re)};var ae=te.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,he){se===void 0&&(se=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var me,ye,Se,Fe;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):(Fe=se[se.length-1],Fe.raw+=`
|
|
`+me.raw,Fe.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,[],he),se.push(me);continue}if(me=this.tokenizer.list(re)){for(re=re.substring(me.raw.length),Se=me.items.length,ye=0;ye<Se;ye++)me.items[ye].tokens=this.blockTokens(me.items[ye].text,[],!1);se.push(me);continue}if(me=this.tokenizer.html(re)){re=re.substring(me.raw.length),se.push(me);continue}if(he&&(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(he&&(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):(Fe=se[se.length-1],Fe.raw+=`
|
|
`+me.raw,Fe.text+=`
|
|
`+me.text);continue}if(re){var Ge="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return se},ae.inline=function(re){var se,he,me,ye,Se,Fe,Ge=re.length;for(se=0;se<Ge;se++){Fe=re[se];switch(Fe.type){case"paragraph":case"text":case"heading":{Fe.tokens=[],this.inlineTokens(Fe.text,Fe.tokens);break}case"table":{for(Fe.tokens={header:[],cells:[]},ye=Fe.header.length,he=0;he<ye;he++)Fe.tokens.header[he]=[],this.inlineTokens(Fe.header[he],Fe.tokens.header[he]);for(ye=Fe.cells.length,he=0;he<ye;he++)for(Se=Fe.cells[he],Fe.tokens.cells[he]=[],me=0;me<Se.length;me++)Fe.tokens.cells[he][me]=[],this.inlineTokens(Se[me],Fe.tokens.cells[he][me]);break}case"blockquote":{this.inline(Fe.tokens);break}case"list":{for(ye=Fe.items.length,he=0;he<ye;he++)this.inline(Fe.items[he].tokens);break}}}return re},ae.inlineTokens=function(re,se,he,me,ye){se===void 0&&(se=[]),he===void 0&&(he=!1),me===void 0&&(me=!1),ye===void 0&&(ye="");var Se,Fe=re,Ge;if(this.tokens.links){var Ze=Object.keys(this.tokens.links);if(Ze.length>0)for(;(Ge=this.tokenizer.rules.inline.reflinkSearch.exec(Fe))!=null;)Ze.includes(Ge[0].slice(Ge[0].lastIndexOf("[")+1,-1))&&(Fe=Fe.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Fe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ge=this.tokenizer.rules.inline.blockSkip.exec(Fe))!=null;)Fe=Fe.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Fe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Se=this.tokenizer.escape(re)){re=re.substring(Se.raw.length),se.push(Se);continue}if(Se=this.tokenizer.tag(re,he,me)){re=re.substring(Se.raw.length),he=Se.inLink,me=Se.inRawBlock,se.push(Se);continue}if(Se=this.tokenizer.link(re)){re=re.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,me)),se.push(Se);continue}if(Se=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,me)),se.push(Se);continue}if(Se=this.tokenizer.strong(re,Fe,ye)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],he,me),se.push(Se);continue}if(Se=this.tokenizer.em(re,Fe,ye)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],he,me),se.push(Se);continue}if(Se=this.tokenizer.codespan(re)){re=re.substring(Se.raw.length),se.push(Se);continue}if(Se=this.tokenizer.br(re)){re=re.substring(Se.raw.length),se.push(Se);continue}if(Se=this.tokenizer.del(re)){re=re.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],he,me),se.push(Se);continue}if(Se=this.tokenizer.autolink(re,ve)){re=re.substring(Se.raw.length),se.push(Se);continue}if(!he&&(Se=this.tokenizer.url(re,ve))){re=re.substring(Se.raw.length),se.push(Se);continue}if(Se=this.tokenizer.inlineText(re,me,X)){re=re.substring(Se.raw.length),ye=Se.raw.slice(-1),se.push(Se);continue}if(re){var Ye="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return se},z(te,null,[{key:"rules",get:function(){return{block:J,inline:ie}}}]),te}(),Ue=G.defaults,pe=H.cleanUrl,_e=H.escape,Ae=function(){function te(ce){this.options=ce||Ue}var ae=te.prototype;return ae.code=function(re,se,he){var me=(se||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(re,me);ye!=null&&ye!==re&&(he=!0,re=ye)}return me?'<pre><code class="'+this.options.langPrefix+_e(me,!0)+'">'+(he?re:_e(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?re:_e(re,!0))+`</code></pre>
|
|
`},ae.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},ae.html=function(re){return re},ae.heading=function(re,se,he,me){return this.options.headerIds?"<h"+se+' id="'+this.options.headerPrefix+me.slug(he)+'">'+re+"</h"+se+`>
|
|
`:"<h"+se+">"+re+"</h"+se+`>
|
|
`},ae.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ae.list=function(re,se,he){var me=se?"ol":"ul",ye=se&&he!==1?' start="'+he+'"':"";return"<"+me+ye+`>
|
|
`+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 he=se.header?"th":"td",me=se.align?"<"+he+' align="'+se.align+'">':"<"+he+">";return me+re+"</"+he+`>
|
|
`},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,he){if(re=pe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var me='<a href="'+_e(re)+'"';return se&&(me+=' title="'+se+'"'),me+=">"+he+"</a>",me},ae.image=function(re,se,he){if(re=pe(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var me='<img src="'+re+'" alt="'+he+'"';return se&&(me+=' title="'+se+'"'),me+=this.options.xhtml?"/>":">",me},ae.text=function(re){return re},te}(),De=function(){function te(){}var ae=te.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,he){return""+he},ae.image=function(re,se,he){return""+he},ae.br=function(){return""},te}(),je=function(){function te(){this.seen={}}var ae=te.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 he=se;do this.seen[he]++,se=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(se))}return this.seen[se]=0,se},te}(),ze=G.defaults,Je=H.unescape,$e=function(){function te(ce){this.options=ce||ze,this.options.renderer=this.options.renderer||new Ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new De,this.slugger=new je}te.parse=function(re,se){var he=new te(se);return he.parse(re)};var ae=te.prototype;return ae.parse=function(re,se){se===void 0&&(se=!0);var he="",me,ye,Se,Fe,Ge,Ze,Ye,Rt,lt,it,Wt,Nt,Ut,rn,vt,on,an,Ct,Mt=re.length;for(me=0;me<Mt;me++){it=re[me];switch(it.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(it.tokens),it.depth,Je(this.parseInline(it.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(it.text,it.lang,it.escaped);continue}case"table":{for(Rt="",Ye="",Fe=it.header.length,ye=0;ye<Fe;ye++)Ye+=this.renderer.tablecell(this.parseInline(it.tokens.header[ye]),{header:!0,align:it.align[ye]});for(Rt+=this.renderer.tablerow(Ye),lt="",Fe=it.cells.length,ye=0;ye<Fe;ye++){for(Ze=it.tokens.cells[ye],Ye="",Ge=Ze.length,Se=0;Se<Ge;Se++)Ye+=this.renderer.tablecell(this.parseInline(Ze[Se]),{header:!1,align:it.align[Se]});lt+=this.renderer.tablerow(Ye)}he+=this.renderer.table(Rt,lt);continue}case"blockquote":{lt=this.parse(it.tokens),he+=this.renderer.blockquote(lt);continue}case"list":{for(Wt=it.ordered,Nt=it.start,Ut=it.loose,Fe=it.items.length,lt="",ye=0;ye<Fe;ye++)vt=it.items[ye],on=vt.checked,an=vt.task,rn="",vt.task&&(Ct=this.renderer.checkbox(on),Ut?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=Ct+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=Ct+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:Ct}):rn+=Ct),rn+=this.parse(vt.tokens,Ut),lt+=this.renderer.listitem(rn,an,on);he+=this.renderer.list(lt,Wt,Nt);continue}case"html":{he+=this.renderer.html(it.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(it.tokens));continue}case"text":{for(lt=it.tokens?this.parseInline(it.tokens):it.text;me+1<Mt&&re[me+1].type==="text";)it=re[++me],lt+=`
|
|
`+(it.tokens?this.parseInline(it.tokens):it.text);he+=se?this.renderer.paragraph(lt):lt;continue}default:{var ht='Token with "'+it.type+'" type was not found.';if(this.options.silent){console.error(ht);return}else throw new Error(ht)}}}return he},ae.parseInline=function(re,se){se=se||this.renderer;var he="",me,ye,Se=re.length;for(me=0;me<Se;me++){ye=re[me];switch(ye.type){case"escape":{he+=se.text(ye.text);break}case"html":{he+=se.html(ye.text);break}case"link":{he+=se.link(ye.href,ye.title,this.parseInline(ye.tokens,se));break}case"image":{he+=se.image(ye.href,ye.title,ye.text);break}case"strong":{he+=se.strong(this.parseInline(ye.tokens,se));break}case"em":{he+=se.em(this.parseInline(ye.tokens,se));break}case"codespan":{he+=se.codespan(ye.text);break}case"br":{he+=se.br();break}case"del":{he+=se.del(this.parseInline(ye.tokens,se));break}case"text":{he+=se.text(ye.text);break}default:{var Fe='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Fe);return}else throw new Error(Fe)}}}return he},te}(),tt=H.merge,Qe=H.checkSanitizeDeprecation,Re=H.escape,Oe=G.getDefaults,We=G.changeDefaults,He=G.defaults;function ue(te,ae,ce){if(typeof te=="undefined"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof ae=="function"&&(ce=ae,ae=null),ae=tt({},ue.defaults,ae||{}),Qe(ae),ce){var re=ae.highlight,se;try{se=Ie.lex(te,ae)}catch(Se){return ce(Se)}var he=function(Fe){var Ge;if(!Fe)try{Ge=$e.parse(se,ae)}catch(Ze){Fe=Ze}return ae.highlight=re,Fe?ce(Fe):ce(null,Ge)};if(!re||re.length<3)return he();if(delete ae.highlight,!se.length)return he();var me=0;ue.walkTokens(se,function(Se){Se.type==="code"&&(me++,setTimeout(function(){re(Se.text,Se.lang,function(Fe,Ge){if(Fe)return he(Fe);Ge!=null&&Ge!==Se.text&&(Se.text=Ge,Se.escaped=!0),me--,me===0&&he()})},0))}),me===0&&he();return}try{var ye=Ie.lex(te,ae);return ae.walkTokens&&ue.walkTokens(ye,ae.walkTokens),$e.parse(ye,ae)}catch(Se){if(Se.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ae.silent)return"<p>An error occurred:</p><pre>"+Re(Se.message+"",!0)+"</pre>";throw Se}}ue.options=ue.setOptions=function(te){return tt(ue.defaults,te),We(ue.defaults),ue},ue.getDefaults=Oe,ue.defaults=He,ue.use=function(te){var ae=tt({},te);if(te.renderer&&function(){var re=ue.defaults.renderer||new Ae,se=function(ye){var Se=re[ye];re[ye]=function(){for(var Fe=arguments.length,Ge=new Array(Fe),Ze=0;Ze<Fe;Ze++)Ge[Ze]=arguments[Ze];var Ye=te.renderer[ye].apply(re,Ge);return Ye===!1&&(Ye=Se.apply(re,Ge)),Ye}};for(var he in te.renderer)se(he);ae.renderer=re}(),te.tokenizer&&function(){var re=ue.defaults.tokenizer||new be,se=function(ye){var Se=re[ye];re[ye]=function(){for(var Fe=arguments.length,Ge=new Array(Fe),Ze=0;Ze<Fe;Ze++)Ge[Ze]=arguments[Ze];var Ye=te.tokenizer[ye].apply(re,Ge);return Ye===!1&&(Ye=Se.apply(re,Ge)),Ye}};for(var he in te.tokenizer)se(he);ae.tokenizer=re}(),te.walkTokens){var ce=ue.defaults.walkTokens;ae.walkTokens=function(re){te.walkTokens(re),ce&&ce(re)}}ue.setOptions(ae)},ue.walkTokens=function(te,ae){for(var ce=U(te),re;!(re=ce()).done;){var se=re.value;ae(se);switch(se.type){case"table":{for(var he=U(se.tokens.header),me;!(me=he()).done;){var ye=me.value;ue.walkTokens(ye,ae)}for(var Se=U(se.tokens.cells),Fe;!(Fe=Se()).done;)for(var Ge=Fe.value,Ze=U(Ge),Ye;!(Ye=Ze()).done;){var Rt=Ye.value;ue.walkTokens(Rt,ae)}break}case"list":{ue.walkTokens(se.items,ae);break}default:se.tokens&&ue.walkTokens(se.tokens,ae)}}},ue.Parser=$e,ue.parser=$e.parse,ue.Renderer=Ae,ue.TextRenderer=De,ue.Lexer=Ie,ue.lexer=Ie.lex,ue.Tokenizer=be,ue.Slugger=je,ue.parse=ue;var Q=ue;return Q})},"DlR+":function(ke,de,P){var q=P("MFOe"),z=q.Global,D=q.trim;ke.exports={name:"cookieStorage",read:U,write:G,each:O,remove:W,clearAll:n};var V=z.document;function U(g){if(!g||!I(g))return null;var p="(?:^|.*;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(V.cookie.replace(new RegExp(p),"$1"))}function O(g){for(var p=V.cookie.split(/; ?/g),h=p.length-1;h>=0;h--){if(!D(p[h]))continue;var c=p[h].split("="),s=unescape(c[0]),d=unescape(c[1]);g(d,s)}}function G(g,p){if(!g)return;V.cookie=escape(g)+"="+escape(p)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function W(g){if(!g||!I(g))return;V.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){O(function(g,p){W(p)})}function I(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(V.cookie)}},EHPI:function(ke,de,P){"use strict";var q=P("bbsP"),z=P("/wGt"),D=P("tJVT"),V=P("k1fw"),U=P("q1tI"),O=P.n(U),G=P("ZW9T"),W=P("ZD9Y"),n=P("M8RZ"),I=P("bCnd"),g=P("fcyK"),p=P.n(g),h={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},c;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(c||(c={}));function s(i,l){switch(l.type){case c.set_show_editor_setting:return Object(V.a)(Object(V.a)({},i),{},{showEditorSetting:l.payload});case c.set_theme:return Object(V.a)(Object(V.a)({},i),{},{theme:l.payload});case c.set_font_size:return Object(V.a)(Object(V.a)({},i),{},{fontSize:l.payload});case c.on_tab_to_space:return Object(V.a)(Object(V.a)({},i),{},{tabToSpace:l.payload});default:throw new Error}}de.a=function(i){var l=i.isLoading,r=i.value,o=i.onChange,w=i.language,T=i.ActionBarRender,x=T===void 0?function(H){return O.a.createElement(d,{onShowCodeSetting:H})}:T,L=Object(U.useReducer)(s,h),A=Object(D.a)(L,2),E=A[0],_=A[1],m=E.theme,f=E.fontSize,S=E.showEditorSetting,b=E.tabToSpace,y={onFontSizeChange:function(N){_({type:c.set_font_size,payload:N}),Object(I.b)("cmFontSize",N)},tabToSpace:b,cmFontSize:f,className:"oj",cmCodeMode:m,onTabToSpace:function(N){_({type:c.on_tab_to_space,payload:N}),Object(I.b)("cmTabToSpace",N)},onCodeModeChange:function(N){_({type:c.set_theme,payload:N}),Object(I.b)("cmCodeMode",N)}};function M(){_({type:c.set_show_editor_setting,payload:!1})}function B(){_({type:c.set_show_editor_setting,payload:!0})}var R={value:r,language:w,onChange:o,theme:m,height:"calc(100% - 56px)",options:{fontSize:f,insertSpaces:b}};return O.a.createElement(U.Fragment,null,O.a.createElement("div",{className:"code-panel-container"},x(B),!l&&O.a.createElement(G.b,R)),O.a.createElement(n.a,null,O.a.createElement(z.a,{className:"oj",title:null,placement:"right",closable:!1,visible:S,onClose:M},O.a.createElement(W.a,y))))};function d(i){var l=i.onShowCodeSetting;return O.a.createElement("div",{className:"action-bar"},O.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),O.a.createElement("a",{onClick:l},O.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){var z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=q.Pos;q.defineOption("autoCloseBrackets",!1,function(s,d,i){i&&i!=q.Init&&(s.removeKeyMap(U),s.state.closeBrackets=null),d&&(O(V(d,"pairs")),s.state.closeBrackets=d,s.addKeyMap(U))});function V(s,d){return d=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[d]!=null?s[d]:z[d]}var U={Backspace:n,Enter:I};function O(s){for(var d=0;d<s.length;d++){var i=s.charAt(d),l="'"+i+"'";U[l]||(U[l]=G(i))}}O(z.pairs+"`");function G(s){return function(d){return p(d,s)}}function W(s){var d=s.state.closeBrackets;if(!d||d.override)return d;var i=s.getModeAt(s.getCursor());return i.closeBrackets||d}function n(s){var d=W(s);if(!d||s.getOption("disableInput"))return q.Pass;for(var i=V(d,"pairs"),l=s.listSelections(),r=0;r<l.length;r++){if(!l[r].empty())return q.Pass;var o=h(s,l[r].head);if(!o||i.indexOf(o)%2!=0)return q.Pass}for(var r=l.length-1;r>=0;r--){var w=l[r].head;s.replaceRange("",D(w.line,w.ch-1),D(w.line,w.ch+1),"+delete")}}function I(s){var d=W(s),i=d&&V(d,"explode");if(!i||s.getOption("disableInput"))return q.Pass;for(var l=s.listSelections(),r=0;r<l.length;r++){if(!l[r].empty())return q.Pass;var o=h(s,l[r].head);if(!o||i.indexOf(o)%2!=0)return q.Pass}s.operation(function(){var w=s.lineSeparator()||`
|
|
`;s.replaceSelection(w+w,null),s.execCommand("goCharLeft"),l=s.listSelections();for(var T=0;T<l.length;T++){var x=l[T].head.line;s.indentLine(x,null,!0),s.indentLine(x+1,null,!0)}})}function g(s){var d=q.cmpPos(s.anchor,s.head)>0;return{anchor:new D(s.anchor.line,s.anchor.ch+(d?-1:1)),head:new D(s.head.line,s.head.ch+(d?1:-1))}}function p(s,d){var i=W(s);if(!i||s.getOption("disableInput"))return q.Pass;var l=V(i,"pairs"),r=l.indexOf(d);if(r==-1)return q.Pass;for(var o=V(i,"closeBefore"),w=V(i,"triples"),T=l.charAt(r+1)==d,x=s.listSelections(),L=r%2==0,A,E=0;E<x.length;E++){var _=x[E],m=_.head,f,S=s.getRange(m,D(m.line,m.ch+1));if(L&&!_.empty())f="surround";else if((T||!L)&&S==d)T&&c(s,m)?f="both":w.indexOf(d)>=0&&s.getRange(m,D(m.line,m.ch+3))==d+d+d?f="skipThree":f="skip";else if(T&&m.ch>1&&w.indexOf(d)>=0&&s.getRange(D(m.line,m.ch-2),m)==d+d){if(m.ch>2&&/\bstring/.test(s.getTokenTypeAt(D(m.line,m.ch-2))))return q.Pass;f="addFour"}else if(T){var b=m.ch==0?" ":s.getRange(D(m.line,m.ch-1),m);if(!q.isWordChar(S)&&b!=d&&!q.isWordChar(b))f="both";else return q.Pass}else if(L&&(S.length===0||/\s/.test(S)||o.indexOf(S)>-1))f="both";else return q.Pass;if(!A)A=f;else if(A!=f)return q.Pass}var y=r%2?l.charAt(r-1):d,M=r%2?d:l.charAt(r+1);s.operation(function(){if(A=="skip")s.execCommand("goCharRight");else if(A=="skipThree")for(var B=0;B<3;B++)s.execCommand("goCharRight");else if(A=="surround"){for(var R=s.getSelections(),B=0;B<R.length;B++)R[B]=y+R[B]+M;s.replaceSelections(R,"around"),R=s.listSelections().slice();for(var B=0;B<R.length;B++)R[B]=g(R[B]);s.setSelections(R)}else A=="both"?(s.replaceSelection(y+M,null),s.triggerElectric(y+M),s.execCommand("goCharLeft")):A=="addFour"&&(s.replaceSelection(y+y+y+y,"before"),s.execCommand("goCharRight"))})}function h(s,d){var i=s.getRange(D(d.line,d.ch-1),D(d.line,d.ch+1));return i.length==2?i:null}function c(s,d){var i=s.getTokenAt(D(d.line,d.ch+1));return/\bstring/.test(i.type)&&i.start==d.ch&&(d.ch==0||!/\bstring/.test(s.getTokenTypeAt(d)))}})},FOrL:function(ke,de,P){ke.exports=P.p+"static/nodata.a6b3f948.png"},FWmy:function(ke,de,P){"use strict";P.d(de,"a",function(){return q});function q(z,D){if(!z)throw new Error(D?`Assertion failed (${D})`:"Assertion Failed")}},H2Ag:function(ke,de,P){ke.exports={flex_box_center:"flex_box_center___2pJkw",flex_space_between:"flex_space_between___2XyGR",flex_box_vertical_center:"flex_box_vertical_center___3RcdW",flex_box_center_end:"flex_box_center_end___ELbjB",flex_box_column:"flex_box_column___1nxOL","left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B",b1:"b1___rOGbM","oj-width-input":"oj-width-input___1L1MS","oj-mr":"oj-mr___2FJRu","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG",list:"list___2RvQV",btns:"btns___FcbS4",drawer:"drawer___2L-f8"}},HmJG:function(ke,de,P){},IBYe:function(ke,de,P){"use strict";function q(z){return null}de.a=q},IxHN:function(ke,de,P){"use strict";var q=P("q1tI"),z=P.n(q),D=P("07cG"),V=P.n(D);de.a=function(U){var O=U.message,G=U.className,W=U.children,n=U.style,I=n===void 0?{}:n;return z.a.createElement("div",{className:"".concat(V.a.idsRingWrapper," ").concat(G)},z.a.createElement("div",{className:V.a.ldsRing},z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null),z.a.createElement("div",null)),O?z.a.createElement("p",{style:I},O):null,W)}},J66h:function(ke,de,P){(function(q){var z,D;(function(V,U){ke.exports=U(V)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof q!="undefined"?q:this,function(V){"use strict";V=V||{};var U=V.Base64,O="2.6.4",G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W=function(y){for(var M={},B=0,R=y.length;B<R;B++)M[y.charAt(B)]=B;return M}(G),n=String.fromCharCode,I=function(y){if(y.length<2){var M=y.charCodeAt(0);return M<128?y:M<2048?n(192|M>>>6)+n(128|M&63):n(224|M>>>12&15)+n(128|M>>>6&63)+n(128|M&63)}else{var M=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return n(240|M>>>18&7)+n(128|M>>>12&63)+n(128|M>>>6&63)+n(128|M&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(y){return y.replace(g,I)},h=function(y){var M=[0,2,1][y.length%3],B=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),R=[G.charAt(B>>>18),G.charAt(B>>>12&63),M>=2?"=":G.charAt(B>>>6&63),M>=1?"=":G.charAt(B&63)];return R.join("")},c=V.btoa&&typeof V.btoa=="function"?function(y){return V.btoa(y)}:function(y){if(y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return y.replace(/[\s\S]{1,3}/g,h)},s=function(y){return c(p(String(y)))},d=function(y){return y.replace(/[+\/]/g,function(M){return M=="+"?"-":"_"}).replace(/=/g,"")},i=function(y,M){return M?d(s(y)):s(y)},l=function(y){return i(y,!0)},r;V.Uint8Array&&(r=function(y,M){for(var B="",R=0,H=y.length;R<H;R+=3){var N=y[R],C=y[R+1],K=y[R+2],Z=N<<16|C<<8|K;B+=G.charAt(Z>>>18)+G.charAt(Z>>>12&63)+(typeof C!="undefined"?G.charAt(Z>>>6&63):"=")+(typeof K!="undefined"?G.charAt(Z&63):"=")}return M?d(B):B});var o=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(y){switch(y.length){case 4:var M=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),B=M-65536;return n((B>>>10)+55296)+n((B&1023)+56320);case 3:return n((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));default:return n((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},T=function(y){return y.replace(o,w)},x=function(y){var M=y.length,B=M%4,R=(M>0?W[y.charAt(0)]<<18:0)|(M>1?W[y.charAt(1)]<<12:0)|(M>2?W[y.charAt(2)]<<6:0)|(M>3?W[y.charAt(3)]:0),H=[n(R>>>16),n(R>>>8&255),n(R&255)];return H.length-=[0,0,2,1][B],H.join("")},L=V.atob&&typeof V.atob=="function"?function(y){return V.atob(y)}:function(y){return y.replace(/\S{1,4}/g,x)},A=function(y){return L(String(y).replace(/[^A-Za-z0-9\+\/]/g,""))},E=function(y){return T(L(y))},_=function(y){return String(y).replace(/[-_]/g,function(M){return M=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},m=function(y){return E(_(y))},f;V.Uint8Array&&(f=function(y){return Uint8Array.from(A(_(y)),function(M){return M.charCodeAt(0)})});var S=function(){var y=V.Base64;return V.Base64=U,y};if(V.Base64={VERSION:O,atob:A,btoa:c,fromBase64:m,toBase64:i,utob:p,encode:i,encodeURI:l,btou:T,decode:m,noConflict:S,fromUint8Array:r,toUint8Array:f},typeof Object.defineProperty=="function"){var b=function(y){return{value:y,enumerable:!1,writable:!0,configurable:!0}};V.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",b(function(){return m(this)})),Object.defineProperty(String.prototype,"toBase64",b(function(y){return i(this,y)})),Object.defineProperty(String.prototype,"toBase64URI",b(function(){return i(this,!0)}))}}return V.Meteor&&(Base64=V.Base64),ke.exports?ke.exports.Base64=V.Base64:!(z=[],D=function(){return V.Base64}.apply(de,z),D!==void 0&&(ke.exports=D)),{Base64:V.Base64}})}).call(this,P("IyRk"))},JB8y:function(ke,de,P){"use strict";P.d(de,"a",function(){return q});var q;(function(z){z[z.NOMATCH=-1]="NOMATCH",z[z.OK=0]="OK",z[z.TIMEOUT=2]="TIMEOUT",z[z.PODFAILURE=3]="PODFAILURE",z[z.COMPILEFAILURE=4]="COMPILEFAILURE",z[z.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(q||(q={}))},JPnl:function(ke,de,P){"use strict";P.d(de,"a",function(){return _}),P.d(de,"c",function(){return S});var q=P("+L6B"),z=P("2/Rp"),D=P("tJVT"),V=P("9og8"),U=P("k1fw"),O=P("jrin"),G=P("5NDa"),W=P("5rEg"),n=P("WmNS"),I=P.n(n),g=P("q1tI"),p=P.n(g),h=P("8Skl"),c=P("y3Kf"),s=P("JB8y"),d=P("J66h"),i=P.n(d),l=P("a4uL"),r=P.n(l),o=P("IxHN"),w=P("9Bee"),T=P("1vsH"),x=P("ErOA"),L,A=W.a.TextArea,E={visible:!1,tabIndex:"0"},_=(L={},Object(O.a)(L,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(O.a)(L,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(O.a)(L,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(O.a)(L,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(O.a)(L,4,"\u7F16\u8BD1\u5931\u8D25"),Object(O.a)(L,5,"\u6267\u884C\u5931\u8D25"),L),m;(function(y){y[y.SET_VISIBLE=0]="SET_VISIBLE",y[y.SET_TABINDEX=1]="SET_TABINDEX"})(m||(m={}));function f(y,M){switch(M.type){case m.SET_VISIBLE:return Object(U.a)(Object(U.a)({},y),{},{visible:M.payload});case m.SET_TABINDEX:return Object(U.a)(Object(U.a)({},y),{},{tabIndex:M.payload});default:throw new Error}}function S(y){var M=y.status,B=y.error_msg,R=y.output,H=y.input,N=y.expected_output,C=y.is_file,K=y.input_file_url,Z=y.output_file_url,oe=y.expected_output_file_url,fe=y.setMonacoValue,xe=y.setData,be=null,Te={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(M){case s.a.NOMATCH:be=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!C&&p.a.createElement(w.a,{value:H,style:Te}),C&&p.a.createElement("div",{style:Te},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ce(){var Le;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,fetch(K,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Le=Y.sent,Y.t0=fe,Y.next=6,Le.text();case 6:Y.t1=Y.sent,(0,Y.t0)(Y.t1),setTimeout(function(){xe(K)},200);case 9:case"end":return Y.stop()}},Ce)}))},H)),p.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!C&&p.a.createElement(w.a,{value:R&&d.Base64.decode(R)||"",style:Te}),C&&p.a.createElement("div",{style:Te},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ce(){var Le;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(x.a)(Z,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:Le=Y.sent,fe(Le),setTimeout(function(){xe(Z)},200);case 5:case"end":return Y.stop()}},Ce)}))},R)),p.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!C&&p.a.createElement(w.a,{value:N&&d.Base64.decode(N)||"",style:Te}),C&&p.a.createElement("div",{style:Te},p.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(V.a)(I.a.mark(function Ce(){var Le;return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,fetch(oe,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return Le=Y.sent,Y.t0=fe,Y.next=6,Le.text();case 6:Y.t1=Y.sent,(0,Y.t0)(Y.t1),setTimeout(function(){xe(oe)},200);case 9:case"end":return Y.stop()}},Ce)}))},N)));break;case s.a.EXECUTEFAILURE:be=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!C&&p.a.createElement(w.a,{value:H,style:Te}),C&&p.a.createElement("div",{style:Te},p.a.createElement("a",{onClick:function(){return Object(T.y)(K,H)}},H)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(B)));break;case s.a.COMPILEFAILURE:be=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!C&&p.a.createElement(w.a,{value:H,style:Te}),C&&p.a.createElement("div",{style:Te},p.a.createElement("a",{onClick:function(){return Object(T.y)(K,H)}},H)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(B)));break;case s.a.PODFAILURE:be=p.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:be=p.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.a.createElement(p.a.Fragment,null," ",be," ")}function b(y){var M=y.status,B=y.error_msg,R=y.execute_time,H=y.output,N=y.input,C=y.expected_output,K=y.is_file,Z=y.input_file_url,oe=y.output_file_url,fe=y.expected_output_file_url,xe=null;switch(M){case s.a.OK:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",R,"ms"),p.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),p.a.createElement("pre",null,d.Base64.decode(H)));break;case s.a.NOMATCH:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u8F93\u5165\uFF1A",p.a.createElement("pre",null,N)),p.a.createElement("p",null,"\u8F93\u51FA\uFF1A",H&&d.Base64.decode(H)),p.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",C&&d.Base64.decode(C)));break;case s.a.EXECUTEFAILURE:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.a.createElement("pre",null,N)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(B)));break;case s.a.COMPILEFAILURE:xe=p.a.createElement(p.a.Fragment,null,p.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",p.a.createElement("pre",null,N)),p.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),p.a.createElement("pre",{className:"error"},d.Base64.decode(B)));break;case s.a.PODFAILURE:xe=p.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:xe=p.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return p.a.createElement(p.a.Fragment,null," ",xe," ")}de.b=function(y){var M=y.input,B=y.debuging,R=y.submitting,H=y.executingMessage,N=y.debugResult,C=y.onChangeInput,K=y.onDebugCode,Z=y.onSubmitCode,oe=y.hack,fe=y.user,xe=Object(g.useReducer)(f,E),be=Object(D.a)(xe,2),Te=be[0],Ce=be[1],Le=Te.visible,ge=Te.tabIndex;function Y(X){var ve=X.target.id;Ce({type:m.SET_TABINDEX,payload:ve})}function k(){Ce({type:m.SET_VISIBLE,payload:!Le})}var j=Object(g.useMemo)(function(){if(N){var X=N.status;return p.a.createElement(p.a.Fragment,null,b(N))}return null},[N]);function J(){Ce({type:m.SET_VISIBLE,payload:!0}),Ce({type:m.SET_TABINDEX,payload:"1"}),K()}var ie=function(){var X=Object(V.a)(I.a.mark(function ve(Ie){var Ue;return I.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return _e.next=2,Object(x.a)("/api/problems/".concat(Ie,"/start.json"),{method:"get",params:{hack_user_id:fe==null?void 0:fe.user_id}});case 2:Ue=_e.sent,Ue&&(window.location.href="/myproblems/".concat(Ue==null?void 0:Ue.identifier,"?type=1"));case 4:case"end":return _e.stop()}},ve)}));return function(Ie){return X.apply(this,arguments)}}();return p.a.createElement("div",{className:"test-case-panel"},p.a.createElement("div",{className:"test-case-panel-body ".concat(Le?"active":"")},p.a.createElement("ul",{className:"s-navs"},p.a.createElement("li",null,p.a.createElement("a",{className:ge==="0"?"active":"",id:"0",onClick:Y},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),p.a.createElement("li",null,p.a.createElement("a",{className:ge==="1"?"active":"",id:"1",onClick:Y},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),p.a.createElement("div",{className:"tab-panel-body ".concat(ge==="0"?"":"hide")},p.a.createElement(A,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:M,onChange:C})),p.a.createElement("div",{className:"tab-panel-body ".concat(ge==="1"?"":"hide")},B?p.a.createElement(o.a,{message:H}):N?p.a.createElement("section",{style:{height:200}}," ",j," "):p.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),p.a.createElement("a",{className:"btn-collapse ".concat(Le?"up":""),onClick:k},Le?p.a.createElement(h.a,null):p.a.createElement(c.a,null)),p.a.createElement("footer",{className:"footer"},p.a.createElement("span",null,"\u63A7\u5236\u53F0"),p.a.createElement("div",{className:"flex-container"},(oe==null?void 0:oe.is_program)&&(oe==null?void 0:oe.above_question)&&p.a.createElement(z.a,{onClick:function(){return ie(oe==null?void 0:oe.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(oe==null?void 0:oe.is_program)&&(oe==null?void 0:oe.under_question)&&p.a.createElement(z.a,{onClick:function(){return ie(oe==null?void 0:oe.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),p.a.createElement(z.a,{className:"btn-green",type:"ghost",loading:B,onClick:J},"\u8C03\u8BD5\u4EE3\u7801"),p.a.createElement(z.a,{type:"primary",loading:R,disabled:R,onClick:function(){Ce({type:m.SET_VISIBLE,payload:!1}),Z()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},JYp7:function(ke,de,P){"use strict";P.d(de,"a",function(){return q});var q;(function(z){function D(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}z.is=D;const V=Object.freeze([]);function U(){return V}z.empty=U;function*O(o){yield o}z.single=O;function G(o){return o||V}z.from=G;function W(o){return!o||o[Symbol.iterator]().next().done===!0}z.isEmpty=W;function n(o){return o[Symbol.iterator]().next().value}z.first=n;function I(o,w){for(const T of o)if(w(T))return!0;return!1}z.some=I;function g(o,w){for(const T of o)if(w(T))return T;return}z.find=g;function*p(o,w){for(const T of o)w(T)&&(yield T)}z.filter=p;function*h(o,w){let T=0;for(const x of o)yield w(x,T++)}z.map=h;function*c(...o){for(const w of o)for(const T of w)yield T}z.concat=c;function*s(o){for(const w of o)for(const T of w)yield T}z.concatNested=s;function d(o,w,T){let x=T;for(const L of o)x=w(x,L);return x}z.reduce=d;function*i(o,w,T=o.length){for(w<0&&(w+=o.length),T<0?T+=o.length:T>o.length&&(T=o.length);w<T;w++)yield o[w]}z.slice=i;function l(o,w=Number.POSITIVE_INFINITY){const T=[];if(w===0)return[T,o];const x=o[Symbol.iterator]();for(let L=0;L<w;L++){const A=x.next();if(A.done)return[T,z.empty()];T.push(A.value)}return[T,{[Symbol.iterator](){return x}}]}z.consume=l;function r(o,w,T=(x,L)=>x===L){const x=o[Symbol.iterator](),L=w[Symbol.iterator]();for(;;){const A=x.next(),E=L.next();if(A.done!==E.done)return!1;if(A.done)return!0;if(!T(A.value,E.value))return!1}}z.equals=r})(q||(q={}))},LdHM:function(ke,de,P){"use strict";P.d(de,"b",function(){return o}),P.d(de,"a",function(){return T});var q=P("1OyB"),z=P("vuIU"),D=P("Ji7U"),V=P("LK+K"),U=P("q1tI"),O=P("rePB"),G=P("Ff2n"),W=P("ODXe"),n=P("4IlW"),I=P("bX4T"),g=P("YrtM"),p=P("TSYQ"),h=P.n(p),c=P("+nKL"),s=P("8OUc"),d=function(K,Z){var oe=K.prefixCls,fe=K.id,xe=K.flattenOptions,be=K.childrenAsData,Te=K.values,Ce=K.searchValue,Le=K.multiple,ge=K.defaultActiveFirstOption,Y=K.height,k=K.itemHeight,j=K.notFoundContent,J=K.open,ie=K.menuItemSelectedIcon,X=K.virtual,ve=K.onSelect,Ie=K.onToggleOpen,Ue=K.onActiveValue,pe=K.onScroll,_e=K.onMouseEnter,Ae="".concat(oe,"-item"),De=Object(g.a)(function(){return xe},[J,xe],function(Q,te){return te[0]&&Q[1]!==te[1]}),je=U.useRef(null),ze=function(te){te.preventDefault()},Je=function(te){je.current&&je.current.scrollTo({index:te})},$e=function(te){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=De.length,re=0;re<ce;re+=1){var se=(te+re*ae+ce)%ce,he=De[se],me=he.group,ye=he.data;if(!me&&!ye.disabled)return se}return-1},tt=U.useState(function(){return $e(0)}),Qe=Object(W.a)(tt,2),Re=Qe[0],Oe=Qe[1],We=function(te){Oe(te);var ae=De[te];if(!ae){Ue(null,-1);return}Ue(ae.data.value,te)};U.useEffect(function(){We(ge!==!1?$e(0):-1)},[De.length,Ce]),U.useEffect(function(){var Q=setTimeout(function(){if(!Le&&J&&Te.size===1){var te=Array.from(Te)[0],ae=De.findIndex(function(ce){var re=ce.data;return re.value===te});We(ae),Je(ae)}});return function(){return clearTimeout(Q)}},[J]);var He=function(te){te!==void 0&&ve(te,{selected:!Te.has(te)}),Le||Ie(!1)};if(U.useImperativeHandle(Z,function(){return{onKeyDown:function(te){var ae=te.which;switch(ae){case n.a.UP:case n.a.DOWN:{var ce=0;if(ae===n.a.UP?ce=-1:ae===n.a.DOWN&&(ce=1),ce!==0){var re=$e(Re+ce,ce);Je(re),We(re)}break}case n.a.ENTER:{var se=De[Re];se&&!se.data.disabled?He(se.data.value):He(void 0),J&&te.preventDefault();break}case n.a.ESC:Ie(!1)}},onKeyUp:function(){},scrollTo:function(te){Je(te)}}}),De.length===0)return U.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(Ae,"-empty"),onMouseDown:ze},j);function ue(Q){var te=De[Q];if(!te)return null;var ae=te.data||{},ce=ae.value,re=ae.label,se=ae.children,he=Object(I.a)(ae,!0),me=be?se:re;return te?U.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},he,{key:Q,role:"option",id:"".concat(fe,"_list_").concat(Q),"aria-selected":Te.has(ce)}),ce):null}return U.createElement(U.Fragment,null,U.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ue(Re-1),ue(Re),ue(Re+1)),U.createElement(c.a,{itemKey:"key",ref:je,data:De,height:Y,itemHeight:k,fullHeight:!1,onMouseDown:ze,onScroll:pe,virtual:X,onMouseEnter:_e},function(Q,te){var ae,ce=Q.group,re=Q.groupOption,se=Q.data,he=se.label,me=se.key;if(ce)return U.createElement("div",{className:h()(Ae,"".concat(Ae,"-group"))},he!==void 0?he:me);var ye=se.disabled,Se=se.value,Fe=se.title,Ge=se.children,Ze=se.style,Ye=se.className,Rt=Object(G.a)(se,["disabled","value","title","children","style","className"]),lt=Te.has(Se),it="".concat(Ae,"-option"),Wt=h()(Ae,it,Ye,(ae={},Object(O.a)(ae,"".concat(it,"-grouped"),re),Object(O.a)(ae,"".concat(it,"-active"),Re===te&&!ye),Object(O.a)(ae,"".concat(it,"-disabled"),ye),Object(O.a)(ae,"".concat(it,"-selected"),lt),ae)),Nt=be?Ge:he,Ut=!ie||typeof ie=="function"||lt;return U.createElement("div",Object.assign({},Rt,{"aria-selected":lt,className:Wt,title:Fe,onMouseMove:function(){if(Re===te||ye)return;We(te)},onClick:function(){ye||He(Se)},style:Ze}),U.createElement("div",{className:"".concat(it,"-content")},Nt||Se),U.isValidElement(ie)||lt,Ut&&U.createElement(s.a,{className:"".concat(Ae,"-option-state"),customizeIcon:ie,customizeIconProps:{isSelected:lt}},lt?"\u2713":null))}))},i=U.forwardRef(d);i.displayName="OptionList";var l=i,r=function(){return null};r.isSelectOption=!0;var o=r,w=function(){return null};w.isSelectOptGroup=!0;var T=w,x=P("VTBJ"),L=P("Zm9Q");function A(C){var K=C.key,Z=C.props,oe=Z.children,fe=Z.value,xe=Object(G.a)(Z,["children","value"]);return Object(x.a)({key:K,value:fe!==void 0?fe:K,children:oe},xe)}function E(C){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(C).map(function(Z,oe){if(!U.isValidElement(Z)||!Z.type)return null;var fe=Z.type.isSelectOptGroup,xe=Z.key,be=Z.props,Te=be.children,Ce=Object(G.a)(be,["children"]);return K||!fe?A(Z):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(xe===null?oe:xe,"__"),label:xe},Ce),{},{options:E(Te)})}).filter(function(Z){return Z})}var _=P("2Qr1"),m=P("qNPg"),f=P("U8pU"),S=P("Kwbf"),b=P("WKfj");function y(C){var K=C.mode,Z=C.options,oe=C.children,fe=C.backfill,xe=C.allowClear,be=C.placeholder,Te=C.getInputElement,Ce=C.showSearch,Le=C.onSearch,ge=C.defaultOpen,Y=C.autoFocus,k=C.labelInValue,j=C.value,J=C.inputValue,ie=C.optionLabelProp,X=K==="multiple"||K==="tags",ve=Ce!==void 0?Ce:X||K==="combobox",Ie=Z||E(oe);if(Object(S.a)(K!=="tags"||Ie.every(function(Ae){return!Ae.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Ue=Ie.some(function(Ae){return Ae.options?Ae.options.some(function(De){return typeof("value"in De?De.value:De.key)=="number"}):typeof("value"in Ae?Ae.value:Ae.key)=="number"});Object(S.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(K!=="combobox"||!ie,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(K==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(S.a)(K==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(S.b)(K!=="combobox"||!Te||!xe||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!ve&&K!=="combobox"&&K!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!ge||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),j!=null){var pe=Object(b.d)(j);Object(S.a)(!k||pe.every(function(Ae){return Object(f.a)(Ae)==="object"&&("key"in Ae||"value"in Ae)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!X||Array.isArray(j),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var _e=null;Object(L.a)(oe).some(function(Ae){if(!U.isValidElement(Ae)||!Ae.type)return!1;var De=Ae.type;if(De.isSelectOption)return!1;if(De.isSelectOptGroup){var je=Object(L.a)(Ae.props.children).every(function(ze){return!U.isValidElement(ze)||!Ae.type||ze.type.isSelectOption?!0:(_e=ze.type,!1)});return!je}return _e=De,!0}),_e&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(S.a)(J===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=y,B=Object(m.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:E,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:M,fillOptionsWithMissingValue:_.a}),R=function(C){Object(D.a)(Z,C);var K=Object(V.a)(Z);function Z(){var oe;return Object(q.a)(this,Z),oe=K.apply(this,arguments),oe.selectRef=U.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(z.a)(Z,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),Z}(U.Component);R.Option=o,R.OptGroup=T;var H=R,N=de.c=H},M8RZ:function(ke,de,P){"use strict";P.d(de,"a",function(){return n});var q=P("fWQN"),z=P("mtLc"),D=P("yKVA"),V=P("879j"),U=P("q1tI"),O=P.n(U),G=P("i8i4"),W=P.n(G),n=function(I){Object(D.a)(p,I);var g=Object(V.a)(p);function p(h){var c;Object(q.a)(this,p),c=g.call(this,h);var s=window.document;return c.node=s.createElement("div"),s.body.appendChild(c.node),c}return Object(z.a)(p,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(O.a.Component)},MFOe:function(ke,de,P){(function(q){var z=O(),D=G(),V=W(),U=typeof window!="undefined"?window:q;ke.exports={assign:z,create:D,trim:V,bind:n,slice:I,each:g,map:p,pluck:h,isList:c,isFunction:s,isObject:d,Global:U};function O(){return Object.assign?Object.assign:function(l,r,o,w){for(var T=1;T<arguments.length;T++)g(Object(arguments[T]),function(x,L){l[L]=x});return l}}function G(){if(Object.create)return function(r,o,w,T){var x=I(arguments,1);return z.apply(this,[Object.create(r)].concat(x))};{function i(){}return function(r,o,w,T){var x=I(arguments,1);return i.prototype=r,z.apply(this,[new i].concat(x))}}}function W(){return String.prototype.trim?function(l){return String.prototype.trim.call(l)}:function(l){return l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function n(i,l){return function(){return l.apply(i,Array.prototype.slice.call(arguments,0))}}function I(i,l){return Array.prototype.slice.call(i,l||0)}function g(i,l){h(i,function(r,o){return l(r,o),!1})}function p(i,l){var r=c(i)?[]:{};return h(i,function(o,w){return r[w]=l(o,w),!1}),r}function h(i,l){if(c(i)){for(var r=0;r<i.length;r++)if(l(i[r],r))return i[r]}else for(var o in i)if(i.hasOwnProperty(o)&&l(i[o],o))return i[o]}function c(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function d(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,P("IyRk"))},MI8n:function(ke,de,P){"use strict";P.d(de,"c",function(){return U}),P.d(de,"b",function(){return n}),P.d(de,"e",function(){return I}),P.d(de,"a",function(){return g}),P.d(de,"d",function(){return p}),P.d(de,"f",function(){return h});var q=P("/cxE"),z=P("pmY6"),D=P("24hK"),V=P("5Y4S"),U;(function(c){c.None=()=>z.a.None;function s(y){return(M,B=null,R)=>{let H=!1,N;return N=y(C=>H?void 0:(N?N.dispose():H=!0,M.call(B,C)),null,R),H&&N.dispose(),N}}c.once=s;function d(y,M){return T((B,R=null,H)=>y(N=>B.call(R,M(N)),null,H))}c.map=d;function i(y,M){return T((B,R=null,H)=>y(N=>{M(N),B.call(R,N)},null,H))}c.forEach=i;function l(y,M){return T((B,R=null,H)=>y(N=>M(N)&&B.call(R,N),null,H))}c.filter=l;function r(y){return y}c.signal=r;function o(...y){return(M,B=null,R)=>Object(z.e)(...y.map(H=>H(N=>M.call(B,N),null,R)))}c.any=o;function w(y,M,B){let R=B;return d(y,H=>(R=M(R,H),R))}c.reduce=w;function T(y){let M;const B=new n({onFirstListenerAdd(){M=y(B.fire,B)},onLastListenerRemove(){M.dispose()}});return B.event}function x(y,M,B=100,R=!1,H){let N,C,K,Z=0;const oe=new n({leakWarningThreshold:H,onFirstListenerAdd(){N=y(fe=>{Z++,C=M(C,fe),R&&!K&&(oe.fire(C),C=void 0),clearTimeout(K),K=setTimeout(()=>{const xe=C;C=void 0,K=void 0,(!R||Z>1)&&oe.fire(xe),Z=0},B)})},onLastListenerRemove(){N.dispose()}});return oe.event}c.debounce=x;function L(y,M=(B,R)=>B===R){let B=!0,R;return l(y,H=>{const N=B||!M(H,R);return B=!1,R=H,N})}c.latch=L;function A(y,M){return[c.filter(y,M),c.filter(y,B=>!M(B))]}c.split=A;function E(y,M=!1,B=[]){let R=B.slice(),H=y(K=>{R?R.push(K):C.fire(K)});const N=()=>{R&&R.forEach(K=>C.fire(K)),R=null},C=new n({onFirstListenerAdd(){H||(H=y(K=>C.fire(K)))},onFirstListenerDidAdd(){R&&(M?setTimeout(N):N())},onLastListenerRemove(){H&&H.dispose(),H=null}});return C.event}c.buffer=E;class _{constructor(y){this.event=y}map(y){return new _(d(this.event,y))}forEach(y){return new _(i(this.event,y))}filter(y){return new _(l(this.event,y))}reduce(y,M){return new _(w(this.event,y,M))}latch(){return new _(L(this.event))}debounce(y,M=100,B=!1,R){return new _(x(this.event,y,M,B,R))}on(y,M,B){return this.event(y,M,B)}once(y,M,B){return s(this.event)(y,M,B)}}function m(y){return new _(y)}c.chain=m;function f(y,M,B=R=>R){const R=(...K)=>C.fire(B(...K)),H=()=>y.on(M,R),N=()=>y.removeListener(M,R),C=new n({onFirstListenerAdd:H,onLastListenerRemove:N});return C.event}c.fromNodeEventEmitter=f;function S(y,M,B=R=>R){const R=(...K)=>C.fire(B(...K)),H=()=>y.addEventListener(M,R),N=()=>y.removeEventListener(M,R),C=new n({onFirstListenerAdd:H,onLastListenerRemove:N});return C.event}c.fromDOMEventEmitter=S;function b(y){return new Promise(M=>s(y)(M))}c.toPromise=b})(U||(U={}));class O{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${O._idPool++}`}start(c){this._stopWatch=new V.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}O._idPool=0;let G=-1;class W{constructor(c,s=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=s,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let s=G;if(typeof this.customThreshold=="number"&&(s=this.customThreshold),s<=0||c<s)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),i=this._stacks.get(d)||0;if(this._stacks.set(d,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let l,r=0;for(const[o,w]of this._stacks)(!l||r<w)&&(l=o,r=w);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${r}):`),console.warn(l)}return()=>{const l=this._stacks.get(d)||0;this._stacks.set(d,l-1)}}}class n{constructor(c){var s;this._disposed=!1,this._options=c,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((s=this._options)===null||s===void 0?void 0:s._profName)?new O(this._options._profName):void 0}get event(){return this._event||(this._event=(c,s,d)=>{var i;this._listeners||(this._listeners=new D.a);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(s?[c,s]:c);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,s);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),w=Object(z.i)(()=>{if(o&&o(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return d instanceof z.b?d.add(w):Array.isArray(d)&&d.push(w),w}),this._event}fire(c){var s,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new D.a);for(let i of this._listeners)this._deliveryQueue.push([i,c]);for((s=this._perfMon)===null||s===void 0||s.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,l]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,l):i[0].call(i[1],l)}catch(r){Object(q.f)(r)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var c,s,d,i,l;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(s=this._deliveryQueue)===null||s===void 0||s.clear(),(i=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||i===void 0||i.call(d),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class I extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new D.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class g extends I{constructor(c){var s;super(c);this._delay=(s=c.delay)!==null&&s!==void 0?s:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class p{constructor(){this.buffers=[]}wrapEvent(c){return(s,d,i)=>c(l=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>s.call(d,l)):s.call(d,l)},void 0,i)}bufferEvents(c){const s=[];this.buffers.push(s);const d=c();return this.buffers.pop(),s.forEach(i=>i()),d}}class h{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=z.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(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ke,de,P){"use strict";(function(q,z){P.d(de,"b",function(){return d}),P.d(de,"i",function(){return o}),P.d(de,"f",function(){return w}),P.d(de,"d",function(){return T}),P.d(de,"g",function(){return x}),P.d(de,"h",function(){return L}),P.d(de,"c",function(){return A}),P.d(de,"k",function(){return E}),P.d(de,"j",function(){return _}),P.d(de,"a",function(){return m}),P.d(de,"e",function(){return b});var D;const V="en";let U=!1,O=!1,G=!1,W=!1,n=!1,I=!1,g=!1,p,h=V,c,s;const d=typeof self=="object"?self:typeof q=="object"?q:{};let i;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?i=d.vscode.process:typeof z!="undefined"&&(i=z);const l=typeof((D=i==null?void 0:i.versions)===null||D===void 0?void 0:D.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!l)s=navigator.userAgent,U=s.indexOf("Windows")>=0,O=s.indexOf("Macintosh")>=0,g=(s.indexOf("Macintosh")>=0||s.indexOf("iPad")>=0||s.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=s.indexOf("Linux")>=0,I=!0,p=navigator.language,h=p;else if(typeof i=="object"){U=i.platform==="win32",O=i.platform==="darwin",G=i.platform==="linux",W=G&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,p=V,h=V;const y=i.env.VSCODE_NLS_CONFIG;if(y)try{const M=JSON.parse(y),B=M.availableLanguages["*"];p=M.locale,h=B||V,c=M._translationsConfigFile}catch(M){}n=!0}else console.error("Unable to resolve platform.");let r=0;O?r=1:U?r=3:G&&(r=2);const o=U,w=O,T=G,x=n,L=I,A=g,E=s,_=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let B=[];d.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let N=0,C=B.length;N<C;N++){const K=B[N];if(K.id===H.data.vscodeSetImmediateId){B.splice(N,1),K.callback();return}}});let R=0;return H=>{const N=++R;B.push({id:N,callback:H}),d.postMessage({vscodeSetImmediateId:N},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const M=Promise.resolve();return B=>M.then(B)}(),m=O||g?2:U?1:3;let f=!0,S=!1;function b(){if(!S){S=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const M=new Uint16Array(y.buffer);f=M[0]===(2<<8)+1}return f}}).call(this,P("IyRk"),P("Q2Ig"))},N0LK:function(ke,de,P){"use strict";P.d(de,"C",function(){return q}),P.d(de,"v",function(){return D}),P.d(de,"s",function(){return V}),P.d(de,"t",function(){return U}),P.d(de,"U",function(){return O}),P.d(de,"J",function(){return G}),P.d(de,"O",function(){return W}),P.d(de,"p",function(){return n}),P.d(de,"T",function(){return I}),P.d(de,"q",function(){return g}),P.d(de,"N",function(){return p}),P.d(de,"M",function(){return h}),P.d(de,"Q",function(){return c}),P.d(de,"u",function(){return s}),P.d(de,"x",function(){return d}),P.d(de,"I",function(){return i}),P.d(de,"f",function(){return l}),P.d(de,"h",function(){return r}),P.d(de,"g",function(){return o}),P.d(de,"i",function(){return w}),P.d(de,"G",function(){return T}),P.d(de,"H",function(){return x}),P.d(de,"r",function(){return L}),P.d(de,"R",function(){return A}),P.d(de,"d",function(){return E}),P.d(de,"e",function(){return _}),P.d(de,"E",function(){return m}),P.d(de,"F",function(){return f}),P.d(de,"j",function(){return S}),P.d(de,"z",function(){return b}),P.d(de,"K",function(){return M}),P.d(de,"L",function(){return B}),P.d(de,"m",function(){return H}),P.d(de,"k",function(){return C}),P.d(de,"A",function(){return Z}),P.d(de,"a",function(){return oe}),P.d(de,"n",function(){return fe}),P.d(de,"l",function(){return xe}),P.d(de,"D",function(){return be}),P.d(de,"B",function(){return Te}),P.d(de,"b",function(){return Ce}),P.d(de,"S",function(){return Le}),P.d(de,"o",function(){return ge}),P.d(de,"P",function(){return Y}),P.d(de,"w",function(){return k}),P.d(de,"c",function(){return j}),P.d(de,"y",function(){return X});function q(pe){return!pe||typeof pe!="string"?!0:pe.trim().length===0}const z=/{(\d+)}/g;function D(pe,..._e){return _e.length===0?pe:pe.replace(z,function(Ae,De){const je=parseInt(De,10);return isNaN(je)||je<0||je>=_e.length?Ae:_e[je]})}function V(pe){return pe.replace(/[<>&]/g,function(_e){switch(_e){case"<":return"<";case">":return">";case"&":return"&";default:return _e}})}function U(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function O(pe,_e=" "){const Ae=G(pe,_e);return W(Ae,_e)}function G(pe,_e){if(!pe||!_e)return pe;const Ae=_e.length;if(Ae===0||pe.length===0)return pe;let De=0;for(;pe.indexOf(_e,De)===De;)De=De+Ae;return pe.substring(De)}function W(pe,_e){if(!pe||!_e)return pe;const Ae=_e.length,De=pe.length;if(Ae===0||De===0)return pe;let je=De,ze=-1;for(;!(ze=pe.lastIndexOf(_e,je-1),ze===-1||ze+Ae!==je);){if(ze===0)return"";je=ze}return pe.substring(0,je)}function n(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(pe){return pe.replace(/\*/g,"")}function g(pe,_e,Ae={}){if(!pe)throw new Error("Cannot create regex from empty string");_e||(pe=U(pe)),Ae.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let De="";return Ae.global&&(De+="g"),Ae.matchCase||(De+="i"),Ae.multiline&&(De+="m"),Ae.unicode&&(De+="u"),new RegExp(pe,De)}function p(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const _e=pe.exec("");return!!(_e&&pe.lastIndex===0)}function h(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function c(pe){return pe.split(/\r\n|\r|\n/)}function s(pe){for(let _e=0,Ae=pe.length;_e<Ae;_e++){const De=pe.charCodeAt(_e);if(De!==32&&De!==9)return _e}return-1}function d(pe,_e=0,Ae=pe.length){for(let De=_e;De<Ae;De++){const je=pe.charCodeAt(De);if(je!==32&&je!==9)return pe.substring(_e,De)}return pe.substring(_e,Ae)}function i(pe,_e=pe.length-1){for(let Ae=_e;Ae>=0;Ae--){const De=pe.charCodeAt(Ae);if(De!==32&&De!==9)return Ae}return-1}function l(pe,_e){return pe<_e?-1:pe>_e?1:0}function r(pe,_e,Ae=0,De=pe.length,je=0,ze=_e.length){for(;Ae<De&&je<ze;Ae++,je++){let tt=pe.charCodeAt(Ae),Qe=_e.charCodeAt(je);if(tt<Qe)return-1;if(tt>Qe)return 1}const Je=De-Ae,$e=ze-je;return Je<$e?-1:Je>$e?1:0}function o(pe,_e){return w(pe,_e,0,pe.length,0,_e.length)}function w(pe,_e,Ae=0,De=pe.length,je=0,ze=_e.length){for(;Ae<De&&je<ze;Ae++,je++){let tt=pe.charCodeAt(Ae),Qe=_e.charCodeAt(je);if(tt===Qe)continue;if(tt>=128||Qe>=128)return r(pe.toLowerCase(),_e.toLowerCase(),Ae,De,je,ze);T(tt)&&(tt-=32),T(Qe)&&(Qe-=32);const Re=tt-Qe;if(Re===0)continue;return Re}const Je=De-Ae,$e=ze-je;return Je<$e?-1:Je>$e?1:0}function T(pe){return pe>=97&&pe<=122}function x(pe){return pe>=65&&pe<=90}function L(pe,_e){return pe.length===_e.length&&w(pe,_e)===0}function A(pe,_e){const Ae=_e.length;return _e.length>pe.length?!1:w(pe,_e,0,Ae)===0}function E(pe,_e){let Ae,De=Math.min(pe.length,_e.length);for(Ae=0;Ae<De;Ae++)if(pe.charCodeAt(Ae)!==_e.charCodeAt(Ae))return Ae;return De}function _(pe,_e){let Ae,De=Math.min(pe.length,_e.length);const je=pe.length-1,ze=_e.length-1;for(Ae=0;Ae<De;Ae++)if(pe.charCodeAt(je-Ae)!==_e.charCodeAt(ze-Ae))return Ae;return De}function m(pe){return 55296<=pe&&pe<=56319}function f(pe){return 56320<=pe&&pe<=57343}function S(pe,_e){return(pe-55296<<10)+(_e-56320)+65536}function b(pe,_e,Ae){const De=pe.charCodeAt(Ae);if(m(De)&&Ae+1<_e){const je=pe.charCodeAt(Ae+1);if(f(je))return S(De,je)}return De}function y(pe,_e){const Ae=pe.charCodeAt(_e-1);if(f(Ae)&&_e>1){const De=pe.charCodeAt(_e-2);if(m(De))return S(De,Ae)}return Ae}function M(pe,_e){const Ae=J.getInstance(),De=_e,je=pe.length,ze=b(pe,je,_e);_e+=ze>=65536?2:1;let Je=Ae.getGraphemeBreakType(ze);for(;_e<je;){const $e=b(pe,je,_e),tt=Ae.getGraphemeBreakType($e);if(j(Je,tt))break;_e+=$e>=65536?2:1,Je=tt}return _e-De}function B(pe,_e){const Ae=J.getInstance(),De=_e,je=y(pe,_e);_e-=je>=65536?2:1;let ze=Ae.getGraphemeBreakType(je);for(;_e>0;){const Je=y(pe,_e),$e=Ae.getGraphemeBreakType(Je);if(j($e,ze))break;_e-=Je>=65536?2:1,ze=$e}return De-_e}const R=/(?:[\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 H(pe){return R.test(pe)}const N=/(?:[\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 C(pe){return N.test(pe)}const K=/^[\t\n\r\x20-\x7E]*$/;function Z(pe){return K.test(pe)}const oe=/[\u2028\u2029]/;function fe(pe){return oe.test(pe)}function xe(pe){for(let _e=0,Ae=pe.length;_e<Ae;_e++)if(be(pe.charCodeAt(_e)))return!0;return!1}function be(pe){return pe=+pe,pe>=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function Te(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const Ce=String.fromCharCode(65279);function Le(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function ge(pe,_e=!1){return pe?(_e&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function Y(pe){const _e=90-65+1;return pe=pe%(2*_e),pe<_e?String.fromCharCode(97+pe):String.fromCharCode(65+pe-_e)}function k(pe){const _e=J.getInstance();return _e.getGraphemeBreakType(pe)}function j(pe,_e){return pe===0?_e!==5&&_e!==7:pe===2&&_e===3?!1:pe===4||pe===2||pe===3||(_e===4||_e===2||_e===3)?!0:pe===8&&(_e===8||_e===9||_e===11||_e===12)||((pe===11||pe===9)&&(_e===9||_e===10)||((pe===12||pe===10)&&_e===10||(_e===5||_e===13||(_e===7||(pe===1||pe===13&&_e===14)))))?!1:!(pe===6&&_e===6)}class J{constructor(){this._data=ie()}static getInstance(){return J._INSTANCE||(J._INSTANCE=new J),J._INSTANCE}getGraphemeBreakType(pe){if(pe<32)return pe===10?3:pe===13?2:4;if(pe<127)return 0;const _e=this._data,Ae=_e.length/3;let De=1;for(;De<=Ae;)if(pe<_e[3*De])De=2*De;else if(pe>_e[3*De+1])De=2*De+1;else return _e[3*De+2];return 0}}J._INSTANCE=null;function ie(){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 X(pe,_e){if(pe===0)return 0;const Ae=ve(pe,_e);if(Ae!==void 0)return Ae;const De=y(_e,pe);return pe-=Ie(De),pe}function ve(pe,_e){let Ae=y(_e,pe);for(pe-=Ie(Ae);Ue(Ae)||Ae===65039||Ae===8419;){if(pe===0)return;Ae=y(_e,pe),pe-=Ie(Ae)}if(!Te(Ae))return;if(pe>=0){const De=y(_e,pe);De===8205&&(pe-=Ie(De))}return pe}function Ie(pe){return pe>=65536?2:1}function Ue(pe){return 127995<=pe&&pe<=127999}},NvD2:function(ke,de,P){"use strict";P.d(de,"a",function(){return O});var q=P("Kwbf");function z(G,W){var n=new Set;return G.forEach(function(I){W.has(I)||n.add(I)}),n}function D(G){var W=G||{},n=W.disabled,I=W.disableCheckbox,g=W.checkable;return!!(n||I)||g===!1}function V(G,W,n,I){for(var g=new Set(G),p=new Set,h=0;h<=n;h+=1){var c=W.get(h)||new Set;c.forEach(function(l){var r=l.key,o=l.node,w=l.children,T=w===void 0?[]:w;g.has(r)&&!I(o)&&T.filter(function(x){return!I(x.node)}).forEach(function(x){g.add(x.key)})})}for(var s=new Set,d=n;d>=0;d-=1){var i=W.get(d)||new Set;i.forEach(function(l){var r=l.parent,o=l.node;if(I(o)||!l.parent||s.has(l.parent.key))return;if(I(l.parent.node)){s.add(r.key);return}var w=!0,T=!1;(r.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var L=x.key,A=g.has(L);w&&!A&&(w=!1),!T&&(A||p.has(L))&&(T=!0)}),w&&g.add(r.key),T&&p.add(r.key),s.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(z(p,g))}}function U(G,W,n,I,g){for(var p=new Set(G),h=new Set(W),c=0;c<=I;c+=1){var s=n.get(c)||new Set;s.forEach(function(r){var o=r.key,w=r.node,T=r.children,x=T===void 0?[]:T;!p.has(o)&&!h.has(o)&&!g(w)&&x.filter(function(L){return!g(L.node)}).forEach(function(L){p.delete(L.key)})})}h=new Set;for(var d=new Set,i=I;i>=0;i-=1){var l=n.get(i)||new Set;l.forEach(function(r){var o=r.parent,w=r.node;if(g(w)||!r.parent||d.has(r.parent.key))return;if(g(r.parent.node)){d.add(o.key);return}var T=!0,x=!1;(o.children||[]).filter(function(L){return!g(L.node)}).forEach(function(L){var A=L.key,E=p.has(A);T&&!E&&(T=!1),!x&&(E||h.has(A))&&(x=!0)}),T||p.delete(o.key),x&&h.add(o.key),d.add(o.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(z(h,p))}}function O(G,W,n,I){var g=[],p;I?p=I:p=D;var h=new Set(G.filter(function(i){var l=!!n[i];return l||g.push(i),l})),c=new Map,s=0;Object.keys(n).forEach(function(i){var l=n[i],r=l.level,o=c.get(r);o||(o=new Set,c.set(r,o)),o.add(l),s=Math.max(s,r)}),Object(q.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var d;return W===!0?d=V(h,c,s,p):d=U(h,W.halfCheckedKeys,c,s,p),d}},OJz4:function(ke,de,P){"use strict";P.d(de,"d",function(){return z}),P.d(de,"h",function(){return D}),P.d(de,"b",function(){return V}),P.d(de,"f",function(){return U}),P.d(de,"e",function(){return O}),P.d(de,"c",function(){return G}),P.d(de,"a",function(){return W}),P.d(de,"g",function(){return n}),P.d(de,"i",function(){return I}),P.d(de,"k",function(){return g}),P.d(de,"j",function(){return p});var q=P("ErOA");function z(h){return Object(q.c)("myproblems/".concat(h,".json"),{hidePopLogin:!0})}function D(h,c){return Object(q.f)("myproblems/".concat(h,"/code_submit.json"),c)}function V(h,c){return Object(q.c)("myproblems/".concat(h,"/code_debug.json"),c)}function U(h,c){return Object(q.c)("myproblems/".concat(h,"/submit_records.json"),c)}function O(h){return Object(q.c)("myproblems/record_detail.json",{id:h})}function G(h,c){return Object(q.c)("myproblems/".concat(h,"/result.json"),{mode:c})}function W(h,c){return Object(q.f)("myproblems/".concat(h,"/add_notes.json"),c)}function n(h){return Object(q.f)("myproblems/".concat(h,"/restore_initial_code.json"))}function I(h){return Object(q.f)("myproblems/".concat(h,"/sync_code.json"))}function g(h,c){return Object(q.f)("myproblems/".concat(h,"/update_code.json"),c)}function p(h,c){return Object(q.f)("discusses/".concat(h,"/plus.json"),c)}},OZM5:function(ke,de,P){"use strict";P.d(de,"b",function(){return I}),P.d(de,"a",function(){return g}),P.d(de,"k",function(){return p}),P.d(de,"h",function(){return h}),P.d(de,"i",function(){return c}),P.d(de,"g",function(){return s}),P.d(de,"c",function(){return d}),P.d(de,"d",function(){return i}),P.d(de,"j",function(){return o}),P.d(de,"e",function(){return w}),P.d(de,"f",function(){return T});var q=P("KQm4"),z=P("U8pU"),D=P("Ff2n"),V=P("q1tI"),U=P.n(V),O=P("Kwbf"),G=P("WaYH"),W=.25,n=2;function I(x,L){var A=x.slice(),E=A.indexOf(L);return E>=0&&A.splice(E,1),A}function g(x,L){var A=x.slice();return A.indexOf(L)===-1&&A.push(L),A}function p(x){return x.split("-")}function h(x,L){return"".concat(x,"-").concat(L)}function c(x){return x&&x.type&&x.type.isTreeNode}function s(x,L){var A=[x],E=L[x];function _(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach(function(f){var S=f.key,b=f.children;A.push(S),_(b)})}return _(E.children),A}function d(x,L){var A=x.clientY,E=L.selectHandle.getBoundingClientRect(),_=E.top,m=E.bottom,f=E.height,S=Math.max(f*W,n);return A<=_+S?-1:A>=m-S?1:0}function i(x,L){if(!x)return;var A=L.multiple;return A?x.slice():x.length?[x[0]]:x}var l=function(L){return L};function r(x,L){if(!x)return[];var A=L||{},E=A.processProps,_=E===void 0?l:E,m=Array.isArray(x)?x:[x];return m.map(function(f){var S=f.children,b=Object(D.a)(f,["children"]),y=r(S,L);return U.a.createElement(G.a,Object.assign({},_(b)),y)})}function o(x){if(!x)return null;var L;if(Array.isArray(x))L={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(z.a)(x)==="object")L={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function w(x,L){var A=new Set;function E(_){if(A.has(_))return;var m=L[_];if(!m)return;A.add(_);var f=m.parent,S=m.node;if(S.disabled)return;f&&E(f.key)}return(x||[]).forEach(function(_){E(_)}),Object(q.a)(A)}function T(x){var L={};return Object.keys(x).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(L[A]=x[A])}),L}},Ot1p:function(ke,de,P){"use strict";var q=P("2qtc"),z=P("kLXV"),D=P("rAM+"),V=P("miYZ"),U=P("tsqr"),O=P("9og8"),G=P("tJVT"),W=P("jrin"),n=P("WmNS"),I=P.n(n),g=P("q1tI"),p=P.n(g),h=P("VrN/"),c=P.n(h),s=P("bdgK"),d=P("p77/"),i=P("Bd2K"),l=P("ELLl"),r=P("19Vz"),o=P("lZu9"),w=P("+NIl"),T=P("kSUc"),x=P("9Bee"),L=function(ye){var Se=ye.value,Fe=Se===void 0?"":Se,Ge=ye.className,Ze=ye.showTextOnly,Ye=ye.showLines,Rt=ye.style,lt=Rt===void 0?{}:Rt,it=Object(g.useMemo)(function(){return""},[Fe]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:it}}))},A=P("0Owb"),E=P("dejd"),_=P("C+DQ"),m=P("1vsH"),f=P("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(ye){var Se=ye.onActionCallback,Fe=ye.title,Ge=ye.icon,Ze=ye.actionName,Ye=ye.className,Rt=Ye===void 0?"":Ye,lt=ye.children;function it(){Se(Ze)}return p.a.createElement("a",{title:Fe,className:Rt,onClick:it},p.a.createElement("i",{className:"md-iconfont ".concat(Ge)}),lt)}var y=function(ye){var Se=ye.watch,Fe=ye.showNullButton,Ge=ye.onActionCallback,Ze=ye.fullScreen,Ye=ye.insertTemp,Rt=ye.hidetoolBar,lt=ye.uuid,it=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(m.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(m.F)("_educoder_session"),"&key=").concat(lt,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Wt=[].concat(S,[{title:"".concat(Se?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Se?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Rt&&Wt.map(function(Nt,Ut){return p.a.createElement("li",{key:Ut},Nt.actionName?p.a.createElement(b,Object(A.a)({},Nt,{onActionCallback:Ge})):p.a.createElement("span",{className:"v-line"}))}),Fe?p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ge},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ye&&p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ye),onActionCallback:Ge},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(b,{icon:"".concat(Ze?"icon-shrink":"icon-enlarge"),title:Ze?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ge})))},M=P("M8RZ"),B=P("+L6B"),R=P("2/Rp"),H=P("y8nQ"),N=P("Vl3Y"),C=P("5NDa"),K=P("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},oe=function(ye){var Se=ye.callback,Fe=ye.onCancel;function Ge(Ze){Se(Ze)}return p.a.createElement(N.a,Object(A.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ge}),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(K.a,null)),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(K.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))},fe=P("7ahc"),xe=P("HmJG"),be=P("BjJ7"),Te=N.a.useForm,Ce={width:280,marginRight:10},Le={labelCol:{span:5},wrapperCol:{span:19}},ge=function(ye){var Se=ye.callback,Fe=ye.onCancel,Ge=Te(),Ze=Object(G.a)(Ge,1),Ye=Ze[0];function Rt(Wt){Se(Wt)}function lt(Wt,Nt){if(Wt.status===-1){U.b.error(Wt.message);return}Ye.setFieldsValue({src:"/api/attachments/".concat(Wt.id),type:Nt.type})}function it(Wt){var Nt=Wt.target.files[0];k(Nt,lt)}return p.a.createElement(N.a,Object(A.a)({form:Ye},Le,{className:"upload-image-panel",onFinish:Rt}),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(N.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(K.a,{style:Ce})),p.a.createElement(Y,{onFileChange:it}))),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(K.a,{style:{width:264}})),p.a.createElement(N.a.Item,{style:{textAlign:"right"}},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function Y(ye){var Se=ye.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Se}))}function k(ye,Se){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Fe=new FormData;Fe.append("editormd-image-file",ye),Fe.append("file_param_name","editormd-image-file"),Fe.append("byxhr","true");var Ge=new window.XMLHttpRequest;Ge.withCredentials=!0,Ge.addEventListener("load",function(Ze){Se(JSON.parse(Ze.target.responseText),ye)},!1),Ge.addEventListener("error",function(Ze){console.error(Ze)},!1),Ge.open("POST","".concat(be.a,"/api/attachments.json")),Ge.send(Fe)}var j=P("giR+"),J=P("fyUT"),ie=P("7Kak"),X=P("9yH6"),ve=X.a.Group,Ie={margin:"0 8px"},Ue=function(ye){var Se=ye.callback,Fe=ye.onCancel;function Ge(Ze){Se(Ze)}return p.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ge},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Ie},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Ie},"\u884C\u6570"),p.a.createElement(N.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(J.a,null)),p.a.createElement("span",{style:Ie},"\u5217\u6570"),p.a.createElement(N.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(J.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Ie},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(N.a.Item,{name:"align"},p.a.createElement(ve,null,p.a.createElement(X.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(X.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(X.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(X.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))},pe=P("ErOA"),_e=P("7Cbv"),Ae="link",De="upload-image",je="code-block",ze="add-table",Je="------------",$e={default:Je,left:":".concat(Je),center:":".concat(Je,":"),right:"".concat(Je,":")},tt=P("9VGf"),Qe,Re;function Oe(){}var We=0,He=1e4,ue="\u2581",Q=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function te(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,ce=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=(Qe={},Object(W.a)(Qe,ce+"-B","bold"),Object(W.a)(Qe,ce+"-I","italic"),Qe),he=(Re={},Object(W.a)(Re,Ae,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Re,je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Re,De,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Re,ze,"\u6DFB\u52A0\u8868\u683C"),Re),me=de.a=function(ye){var Se=ye.defaultValue,Fe=Se===void 0?"":Se,Ge=ye.onChange,Ze=ye.width,Ye=Ze===void 0?"100%":Ze,Rt=ye.height,lt=Rt===void 0?400:Rt,it=ye.miniToolbar,Wt=it===void 0?!1:it,Nt=ye.isFocus,Ut=Nt===void 0?!1:Nt,rn=ye.watch,vt=ye.insertTemp,on=ye.mode,an=on===void 0?"markdown":on,Ct=ye.id,Mt=Ct===void 0?"markdown-editor-id":Ct,ht=ye.showResizeBar,Tt=ht===void 0?!1:ht,yt=ye.noStorage,Sn=yt===void 0?!1:yt,Kn=ye.showNullButton,pn=Kn===void 0?!1:Kn,et=ye.hidetoolBar,Kt=et===void 0?!1:et,Yt=ye.fullScreen,xt=Yt===void 0?!1:Yt,Dt=ye.onBlur,jt=ye.onCMBeforeChange,Fn=ye.onFullScreen,En=ye.className,Ve=En===void 0?"":En,nt=ye.disablePaste,rr=nt===void 0?!1:nt,Dr=ye.placeholder,Ur=Dr===void 0?"":Dr,Fr=ye.values,jn=Fr===void 0?"":Fr,Et=Object(g.useState)(null),Be=Object(G.a)(Et,2),Me=Be[0],wt=Be[1],Ht=Object(g.useState)(Fe),_n=Object(G.a)(Ht,2),mn=_n[0],sn=_n[1],Gt=Object(g.useState)(rn),_t=Object(G.a)(Gt,2),Ot=_t[0],Pt=_t[1],St=Object(g.useState)(xt),qt=Object(G.a)(St,2),rt=qt[0],hn=qt[1],Zt=Object(g.useState)(""),Pn=Object(G.a)(Zt,2),Lt=Pn[0],Mn=Pn[1],Un=Object(g.useState)(0),An=Object(G.a)(Un,2),Tn=An[0],In=An[1],ir=Object(g.useState)(lt),cr=Object(G.a)(ir,2),Xn=cr[0],Cn=cr[1],dr=Object(g.useState)(!1),fn=Object(G.a)(dr,2),gn=fn[0],vn=fn[1],zt=Object(g.useRef)(Object(_e.a)()),dt=Object(g.useRef)(!1),kt=Object(g.useRef)(),ut=Object(g.useRef)(),en=Object(g.useRef)(),It=Object(g.useRef)(),ar=Object(g.useRef)(),kn=function(){var pt=Object(O.a)(I.a.mark(function Ft(){var bt,Vt;return I.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:Vt=xn.sent,Vt!=null&&(bt=Vt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",Me,ut),Vt.attachments.map(function(tn){tn.content_type.indexOf("image")>-1?Me.replaceSelection(".concat(tn.content_type,")")):tn.content_type.indexOf("video")>-1?Me.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):tn.content_type.indexOf("pdf")>-1?Me.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Me.replaceSelection("[".concat(tn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(tn.id,"?type=").concat(tn.content_type,")"))}));case 4:case"end":return xn.stop()}},Ft)}));return function(){return pt.apply(this,arguments)}}();Object(g.useEffect)(function(){sn(jn),Me==null||Me.setValue(jn)},[jn]),Object(g.useEffect)(function(){Fn==null||Fn(rt)},[rt]),Object(g.useEffect)(function(){if(ut.current){var pt=c.a.fromTextArea(ut.current,{mode:an,lineNumbers:!Wt,lineWrapping:!0,value:Fe,autoCloseTags:!0,autoCloseBrackets:!0});Ut&&pt.focus();function Ft(bt,Vt){if(rr){Vt.preventDefault();return}var $t=Vt.clipboardData;if($t){var xn=$t.types.toString(),tn=$t.items;if(xn==="Files"||$t.types.indexOf("Files")>-1){if(Vt.preventDefault(),an=="stex")return;try{var Nn,er=tn[1];((Nn=tn[0])===null||Nn===void 0?void 0:Nn.kind)==="file"&&(er=tn[0]);var Xt=er.getAsFile(),yr=Xt.name.split(".").pop();k(Xt,function(yn){if(yn.id){var Yn,$n,fr;(Xt==null||((Yn=Xt.type)===null||Yn===void 0)?void 0:Yn.indexOf("image"))>-1?pt.replaceSelection(".concat(yn.content_type,")")):(Xt==null||(($n=Xt.type)===null||$n===void 0)?void 0:$n.indexOf("video"))>-1?pt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,'"></video>')):(Xt==null||((fr=Xt.type)===null||fr===void 0)?void 0:fr.indexOf("pdf"))>-1?pt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(Xt.type,'&disposition=inline" target="_blank">').concat(Xt.name,"</a>")):re.includes(yr)?pt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,'?type=office&disposition=inline" target="_blank">').concat(Xt.name,"</a>")):pt.replaceSelection("[".concat(Xt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}else(yn==null?void 0:yn.status)===401&&(document.location.href="/user/login")})}catch(yn){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return pt.on("paste",Ft),pt.on("dragleave",function(bt,Vt){en.current.classList.remove("mouse-hover-md")}),pt.on("dragover",function(bt,Vt){en.current.classList.add("mouse-hover-md")}),pt.on("drop",function(bt,Vt){en.current.classList.add("mouse-hover-md");var $t;if($t=Vt.dataTransfer.files,$t.length>0){Vt.preventDefault(),Vt.stopPropagation();for(var xn=function(er){var Xt=$t[er],yr=Xt.name.split(".").pop();k(Xt,function(yn){if(yn.id){var Yn,$n,fr;(Xt==null||((Yn=Xt.type)===null||Yn===void 0)?void 0:Yn.indexOf("image"))>-1?pt.replaceSelection(".concat(yn.content_type,")")):(Xt==null||(($n=Xt.type)===null||$n===void 0)?void 0:$n.indexOf("video"))>-1?pt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,'"></video>')):(Xt==null||((fr=Xt.type)===null||fr===void 0)?void 0:fr.indexOf("pdf"))>-1?pt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(Xt.type,'&disposition=inline" target="_blank">').concat(Xt.name,"</a>")):re.includes(yr)?pt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,'?type=office&disposition=inline" target="_blank">').concat(Xt.name,"</a>")):pt.replaceSelection("[".concat(Xt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}else(yn==null?void 0:yn.status)===401&&(document.location.href="/user/login")})},tn=0;tn<$t.length;tn++)xn(tn)}}),wt(pt),function(){pt.off("paste",Ft)}}},[]);var hr=Object(g.useCallback)(function(){if(en.current)try{}catch(pt){console.log(pt,"---- to set md editor body height")}},[Xn,en,rt]);Object(g.useEffect)(function(){function pt(){var bt=new s.default(function(Vt){var $t=Object(D.a)(Vt),xn;try{for($t.s();!(xn=$t.n()).done;){var tn=xn.value;(tn.target.offsetHeight>0||tn.target.offsetWidth>0)&&(hr(),Me.setSize("100%","100%"),Me.refresh())}}catch(Nn){$t.e(Nn)}finally{$t.f()}});return bt.observe(ut.current.parentElement),bt}if(Me){var Ft=pt();return function(){Ft.unobserve(ut.current.parentElement)}}},[Me,hr]),Object(g.useEffect)(function(){if(Me){for(var pt=[],Ft=function(){var tn=Vt[bt];$t=Object(G.a)(tn,2);var Nn=$t[0],er=$t[1],Xt=Object(W.a)({},Nn,function(){Zr(er)});pt.push(Xt),Me.addKeyMap(Xt)},bt=0,Vt=Object.entries(se);bt<Vt.length;bt++){var $t;Ft()}return kt.current=setInterval(function(){dt.current&&kn()},4e3),function(){clearInterval(kt.current);var xn=Object(D.a)(pt),tn;try{for(xn.s();!(tn=xn.n()).done;){var Nn=tn.value;Me.removeKeyMap(Nn)}}catch(er){xn.e(er)}finally{xn.f()}}}},[Me]),Object(g.useEffect)(function(){xt!==rt&&hn(xt)},[xt]),Object(tt.a)(function(){if(!Sn&&Tn>0){var pt=new Date().getTime(),Ft=window.sessionStorage.getItem(Mt);pt>=Tn+He&&(!Ft||Ft!==mn)&&(window.sessionStorage.setItem(Mt,mn),vn(!0))}},He),Object(g.useEffect)(function(){Pt(rn)},[Me,rn]),Object(g.useEffect)(function(){Me&&(Ut&&Me.focus())},[Me,Ut]),Object(g.useEffect)(function(){if(Ot&&Me){var pt=Me.getScrollerElement();function Ft(bt){var Vt=bt.target;if(ar.current){var $t=Vt.scrollTop/Vt.scrollHeight;ar.current.scrollTop=ar.current.scrollHeight*$t}}return pt.addEventListener("scroll",Ft),function(){pt.removeEventListener("scroll",Ft)}}},[Me,Ot]),Object(g.useEffect)(function(){if(Me&&jt){function pt(Ft,bt){jt(Ft,bt)}return Me.on("beforeChange",pt),function(){Me.off("beforeChange",pt)}}},[Me,jt]),Object(g.useEffect)(function(){if(Me&&Dt){function pt(){Dt(Me.getValue())}return Me.on("blur",pt),function(){Me.off("blur",pt)}}},[Me,Dt]),Object(g.useEffect)(function(){if(Me){function pt(Ft){var bt=Ft.getValue();sn(bt),In(new Date().getTime()),Ft.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ge&&Ge(bt)}return Me.on("change",pt),function(){Me.off("change",pt)}}},[Me,Ge]),Object(g.useEffect)(function(){Me&&(Fe==null?(Me.setValue(""),sn("")):Fe!==Me.getValue()&&(Me.setValue(Fe),sn(Fe),Me.setCursor(Me.lineCount(),0)))},[Me,Fe]);var Zr=Object(g.useCallback)(function(pt){var Ft=Me.getCursor(),bt=Me.getSelection(),Vt=bt.split(`
|
|
`);switch(pt){case"bold":return Me.replaceSelection("**"+bt+"**"),bt===""&&Me.setCursor(Ft.line,Ft.ch+2),Me.focus();case"italic":return Me.replaceSelection("*"+bt+"*"),bt===""&&Me.setCursor(Ft.line,Ft.ch+1),Me.focus();case"code":return Me.replaceSelection("`"+bt+"`"),bt===""&&Me.setCursor(Ft.line,Ft.ch+1),Me.focus();case"inline-latex":return Me.replaceSelection("`$$"+bt+"$$`"),bt===""&&Me.setCursor(Ft.line,Ft.ch+3),Me.focus();case"latex":return Me.replaceSelection("```latex\n"+bt+"\n```"),Me.setCursor(Ft.line+1,bt.length+1),Me.focus();case"line-break":return Me.replaceSelection(`<br/>
|
|
`),Me.focus();case"list-ul":return bt===""?Me.replaceSelection("- "+bt):Me.replaceSelection(Vt.map(function($t){return $t===""?"":"- ".concat($t)}).join(`
|
|
`)),Me.focus();case"list-ol":return bt===""?Me.replaceSelection("1. "+bt):Me.replaceSelection(Vt.map(function($t,xn){return $t===""?"":"".concat(xn+1,". ").concat($t)}).join(`
|
|
`)),Me.focus();case"add-null-ch":return bt===""&&Me.setCursor(Ft.line,Ft.ch+1),Me.replaceSelection(ue),Me.focus();case"inster-template-1":return bt===""&&Me.setCursor(Ft.line,Ft.ch),Me.replaceSelection(Q),Me.focus();case"eraser":return Me.setValue(""),Me.focus();case"trigger-watch":return Pt(!Ot),Me.focus();case"trigger-full-screen":return hn(!rt),Me.focus();case Ae:Mn(Ae);return;case je:Mn(je);return;case De:Mn(De);return;case ze:Mn(ze);return;default:throw new Error}},[Me,Ot,rt]),Pr=Object(g.useCallback)(function(pt){Mn("");switch(Lt){case Ae:var Ft=pt.title,bt=pt.link;return Me.replaceSelection("[".concat(Ft,"](").concat(bt,")")),Me.focus();case je:var Vt=pt.language,$t=pt.content;return Me.replaceSelection(["```"+Vt,$t,"```"].join(`
|
|
`)),Me.focus();case De:var xn=pt.src,tn=pt.alt;return tn?Me.replaceSelection(".concat(xn,' "').concat(tn,'" )')):Me.replaceSelection("")),Me.focus();case ze:for(var Nn=pt.row,er=pt.col,Xt=pt.align,yr=`
|
|
`,yn=0;yn<Nn;yn++){for(var Yn=[],$n=[],fr=0;fr<er;fr++)yn===1&&$n.push($e[Xt]),Yn.push(" ");yn===1&&(yr+="| ".concat($n.join(" | "),` |
|
|
`)),yr+="| ".concat(Yn.join(er===1?"":" | "),` |
|
|
`)}return Me.replaceSelection(yr+`
|
|
`),Me.focus();default:throw new Error}},[Me,Lt]),zr=Object(g.useMemo)(function(){switch(Lt){case Ae:return p.a.createElement(oe,{callback:Pr,onCancel:Mr});case je:return p.a.createElement(fe.b,{callback:Pr,onCancel:Mr});case De:return p.a.createElement(ge,{callback:Pr,onCancel:Mr});case ze:return p.a.createElement(Ue,{callback:Pr,onCancel:Mr});default:return null}},[Lt]);function Mr(){Mn("")}Object(g.useEffect)(function(){if(It.current){var pt=It.current,Ft=!1,bt=0;function Vt(tn){Ft=!0,bt=tn.pageY}function $t(){Ft=!1}function xn(tn){if(Ft){var Nn=tn.pageY-bt;Nn<0&&(Nn=0),Nn>300&&(Nn=300);var er=lt+Nn+"px";Cn(er)}}return pt.addEventListener("mousedown",Vt),document.addEventListener("mousemove",xn),document.addEventListener("mouseup",$t),function(){pt.removeEventListener("mousedown",Vt),document.removeEventListener("mousemove",xn),document.removeEventListener("mouseup",$t)}}},[Me,It]),Object(g.useEffect)(function(){Cn(lt)},[lt]);var Cr=te(Ye),Kr=te(Xn),Wn={width:Cr,height:Kr},gt=Object(g.useMemo)(function(){if(Tn){var pt=new Date(Tn),Ft=pt.getHours(),bt=pt.getMinutes(),Vt=pt.getSeconds();return Ft=Ft<10?"0"+Ft:Ft,bt=bt<10?"0"+bt:bt,Vt=Vt<10?"0"+Vt:Vt,"".concat(Ft,":").concat(bt,":").concat(Vt)}return 0},[Tn]);function Vr(){window.sessionStorage.removeItem(Mt),vn(!1),In(0)}function vr(){vn(!1),In(0),Me.setValue(window.sessionStorage.getItem(Mt))}function ni(pt,Ft){var bt=Me.getValue();bt=bt.replace(pt,Ft),sn(bt),Me==null||Me.setValue(bt)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:en},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ve," ").concat(Ot?"on-preview":""," ").concat(Wt?"mini":""," ").concat(rt?"full-screen":""),style:Wn},p.a.createElement(y,{insertTemp:vt,watch:Ot,fullScreen:rt,showNullButton:pn,onActionCallback:Zr,hidetoolBar:Kt,uuid:zt.current,setOpenPhones:function(){dt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:ut,placeholder:Ur})),Ot?p.a.createElement("div",{ref:ar,className:"preview-container"},an==="stex"&&p.a.createElement(L,{value:mn}),an!=="stex"&&p.a.createElement(x.a,{edit:!0,value:mn,replaces:ni})):null))),Tt?p.a.createElement("a",{ref:It,className:"editor-resize"}):null,p.a.createElement(M.a,null,he[Lt]?p.a.createElement(z.a,{centered:!0,title:he[Lt],visible:!0,onCancel:Mr,footer:null,className:"markdown-popup-form"},zr):null))}},PD8m:function(ke,de){ke.exports={name:"memoryStorage",read:q,write:z,each:D,remove:V,clearAll:U};var P={};function q(O){return P[O]}function z(O,G){P[O]=G}function D(O){for(var G in P)P.hasOwnProperty(G)&&O(P[G],G)}function V(O){delete P[O]}function U(O){P={}}},QUZ3:function(ke,de,P){"use strict";P.r(de);var q=P("0Owb"),z=P("PpiC"),D=P("OaEy"),V=P("2fM7"),U=P("T2oS"),O=P("W9HT"),G=P("+L6B"),W=P("2/Rp"),n=P("9og8"),I=P("2qtc"),g=P("kLXV"),p=P("tJVT"),h=P("k1fw"),c=P("aHsQ"),s=P("sGsY"),d=P("WmNS"),i=P.n(d),l=P("q1tI"),r=P.n(l),o=P("Icgb"),w=P("Fvcw"),T=P("GIiI"),x=P("Ty5D"),L=P("55Ip"),A=P("OJz4"),E=P("V0Rq"),_=P("bntm"),m=P("cDPC"),f=P("m3rI"),S=P("RCxd"),b=P("EHPI"),y=P("S+dL"),M=P.n(y),B=P("J66h"),R=P("uMZB"),H=P.n(R),N=P("p/48"),C=P("JPnl"),K=P("y8nQ"),Z=P("Vl3Y"),oe=P("5NDa"),fe=P("5rEg"),xe=fe.a.TextArea,be=5e3,Te=function(Be){var Me=Be.callback,wt=Be.onCancel,Ht=Be.notes;function _n(mn){Me(mn)}return r.a.createElement(Z.a,{className:"note-form-panel",onFinish:_n,initialValues:{notes:Ht}},r.a.createElement(Z.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:be,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(be)}]},r.a.createElement(xe,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),r.a.createElement(Z.a.Item,{style:{textAlign:"right"}},r.a.createElement(W.a,{type:"ghost",onClick:wt,style:{marginRight:10}}," ","\u53D6\u6D88"," "),r.a.createElement(W.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Ce=P("bbsP"),Le=P("/wGt"),ge=P("DjyN"),Y=P("NUBc"),k=P("H2Ag"),j=P.n(k),J=P("miYZ"),ie=P("tsqr"),X=P("g9YV"),ve=P("wCAj"),Ie=P("+k/U"),Ue=P.n(Ie),pe=P("ye1Q"),_e=P("lfch"),Ae=P("JB8y"),De=P("p5ED"),je=P("ErOA"),ze=P("wd/R"),Je=P.n(ze),$e=ve.a.Column,tt=function(Be){var Me,wt=Be.submitResult,Ht=Be.submitting,_n=Be.submitRecords,mn=Be.page,sn=Be.onPageChange,Gt=Be.topicId,_t=wt||{},Ot=_t.status,Pt=_t.id,St=_t.input,qt=_t.output,rt=_t.expected_output,hn=_t.is_file,Zt=_t.input_file_url,Pn=_t.output_file_url,Lt=_t.expected_output_file_url,Mn=_t.error_msg,Un=_n||{},An=Un.records,Tn=Un.records_count,In=Object(l.useState)(""),ir=Object(p.a)(In,2),cr=ir[0],Xn=ir[1],Cn=Object(l.useState)(""),dr=Object(p.a)(Cn,2),fn=dr[0],gn=dr[1],vn=Object(x.h)(),zt=(vn==null||((Me=vn.query)===null||Me===void 0)?void 0:Me.type)==="1";function dt(){hn?navigator.clipboard.writeText(B.Base64.decode(Mn)).then(function(){ie.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(B.Base64.decode(qt)).then(function(){ie.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return r.a.createElement(O.a,{spinning:Ht,tip:"\u8BC4\u6D4B\u4E2D...",indicator:r.a.createElement(pe.a,{style:{fontSize:24},spin:!0})},Pt?r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:Ue.a.info},r.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",r.a.createElement("span",{className:Ot===Ae.a.OK?"c-green":"c-red"},C.a[Ot])),r.a.createElement("li",{className:Ue.a.error},r.a.createElement("a",{onClick:dt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",r.a.createElement(_e.a,null)," ")),r.a.createElement("li",null,r.a.createElement(L.a,{to:"/myproblems/".concat(Gt,"/record-detail/").concat(Pt)},"\u663E\u793A\u8BE6\u60C5 >"," "))),Ot!==Ae.a.OK?r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),r.a.createElement("pre",null,!hn&&St,hn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function kt(){var ut;return i.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,fetch(Zt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ut=It.sent,It.t0=gn,It.next=6,ut.text();case 6:It.t1=It.sent,(0,It.t0)(It.t1),setTimeout(function(){Xn(Zt)},200);case 9:case"end":return It.stop()}},kt)}))},St)),r.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,(Ot===4||Ot===5)&&B.Base64.decode(Mn),Ot!=4&&Ot!=5&&(hn?r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function kt(){var ut;return i.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(je.a)(Pn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:ut=It.sent;try{gn(ut)}catch(ar){gn("")}setTimeout(function(){Xn(Pn)},200);case 5:case"end":return It.stop()}},kt)}))},qt):B.Base64.decode(qt))),r.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),r.a.createElement("pre",null,!hn&&B.Base64.decode(rt),hn&&r.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(n.a)(i.a.mark(function kt(){var ut;return i.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,fetch(Lt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return ut=It.sent,It.t0=gn,It.next=6,ut.text();case 6:It.t1=It.sent,(0,It.t0)(It.t1),setTimeout(function(){Xn(Lt)},200);case 9:case"end":return It.stop()}},kt)}))},rt))):null):null,(An==null?void 0:An.length)>0?r.a.createElement(ve.a,{dataSource:An,rowKey:"id",pagination:!1},r.a.createElement($e,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ut,en){return r.a.createElement("span",null," ",Je()(ut).format("YYYY-MM-DD HH:mm:ss"))}}),r.a.createElement($e,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ut,en){var It;return r.a.createElement(L.a,{className:ut===0?"c-green":"c-red",to:"/myproblems/".concat(Gt,"/record-detail/").concat(en.id)},(It=C.a[ut])===null||It===void 0?void 0:It.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),r.a.createElement($e,{title:"\u6267\u884C\u7528\u65F6 (".concat(zt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(ut){return ut?zt?ut:ut/1e3:""}}),r.a.createElement($e,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(zt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(ut){return ut?zt?ut:parseFloat((ut/1024).toFixed(2)):""}}),r.a.createElement($e,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),r.a.createElement($e,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(ut,en){return r.a.createElement(L.a,{className:"c-light-primary",to:"/myproblems/".concat(Gt,"/record-detail/").concat(en.id)},"\u67E5\u770B")}})):r.a.createElement("div",{style:{height:300,width:"100%"}}),Tn>15?r.a.createElement(Y.a,{className:Ue.a.pagination,current:mn,pageSize:15,total:Tn,onChange:sn}):null,r.a.createElement(De.a,{close:!0,data:cr,type:cr.length?"txt":"",onClose:function(){return Xn("")},monacoEditor:{value:fn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},Qe=P("BdwD"),Re=P("DYRE"),Oe=P("zeV3"),We=P("+BJd"),He=P("mr32"),ue=P("pPuO"),Q=P.n(ue),te=P("9Bee"),ae={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ce=function(Be){var Me=Be.hack,wt=Be.onTriggerPraise,Ht=Be.toDiscuss,_n=Me.language,mn=Me.difficult,sn=Me.time_limit,Gt=Me.username,_t=Me.user_path,Ot=Me.user_praise,Pt=Me.comments_count,St=Me.praises_count,qt=Me.description,rt=Me.pass_count,hn=Me.submit_count,Zt=Object(x.h)(),Pn=ae[mn];return r.a.createElement(r.a.Fragment,null,r.a.createElement("ul",{className:Q.a.info},r.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",r.a.createElement("b",null,_n)),r.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",r.a.createElement(He.a,{color:Pn.color},Pn.name)),r.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",r.a.createElement("b",null,sn,"\u79D2"))),r.a.createElement(te.a,{value:qt,className:Q.a.desc}),r.a.createElement("ul",{className:Q.a["commit-info"]},r.a.createElement("li",null,r.a.createElement(Oe.a,{size:4},r.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",r.a.createElement("b",null,rt))),r.a.createElement("li",null,r.a.createElement(Oe.a,{size:4},r.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",r.a.createElement("b",null,hn))," "),r.a.createElement("li",{style:{flex:"1 0 0"}}),Zt.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement(Oe.a,{size:4},r.a.createElement("i",{className:"iconfont icon-huifu1",onClick:Ht})," ",r.a.createElement("b",null,Pt))," ")))},re=P("dhSg"),se=P("oBTY"),he=P("M8RZ"),me=P("qJ4+");function ye(Be,Me){return Object(je.c)("/problems/".concat(Be,"/comments.json?page=").concat(Me,"&limit=10"))}function Se(Be){return Object(je.f)("/discusses/".concat(Be,"/plus.json"),{container_type:"Discuss",type:1})}function Fe(Be,Me,wt){return Object(je.f)("/problems/".concat(Be,"/comments/reply.json"),{comments:{content:wt,parent_id:Me}})}function Ge(Be,Me){return Object(je.f)("/problems/".concat(Be,"/comments.json"),{comments:{content:Me}})}function Ze(Be,Me,wt){return Object(je.f)("/problems/".concat(Be,"/comments/").concat(Me,"/hidden.json"),wt)}function Ye(Be,Me){return Object(je.b)("/problems/".concat(Be,"/comments/").concat(Me))}var Rt=P("U7T7"),lt=P("AMnG");function it(Be){var Me=Be.author;return r.a.createElement("a",{href:"/users/".concat(Me.login),target:"_blank"},r.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(f.a.IMG_SERVER,"/images/").concat(Me.image_url),width:"50"}))}function Wt(Be){var Me=Be.data,wt=Be.index,Ht=Be.parentDiscussIndex,_n=Be.user,mn=Be.onSetActionType,sn=Me.author,Gt=Me.can_delete,_t=Me.content,Ot=Me.id,Pt=Me.time;function St(){mn({id:Ot,index:wt,type:"delete-discuss",parentDiscussIndex:Ht,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var qt=_n.admin||Gt||sn.user_id===_n.user_id;return r.a.createElement("div",{className:"discuss-item-container second-discuss "},r.a.createElement(it,{author:sn}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(sn.login),target:"_blank"},sn.name),r.a.createElement("span",{className:"grey"},Pt),r.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},qt?r.a.createElement("a",{onClick:St,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),r.a.createElement(te.a,{className:"discuss-content",value:_t})))}var Nt=function(Be){var Me=Be.user,wt=Be.data,Ht=Be.index,_n=Be.onPlusDiscuss,mn=Be.onSetActionType,sn=Be.activeDiscussIndex,Gt=Be.onReplyDiscuss,_t=Be.onSetActiveDiscussIndex,Ot=wt.content,Pt=wt.children,St=wt.hidden,qt=wt.id,rt=wt.praise_count,hn=wt.time,Zt=wt.user_praise,Pn=wt.can_delete,Lt=wt.author;function Mn(){_t(qt)}function Un(){_n(qt,!Zt,Ht)}function An(){mn({id:qt,index:Ht,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Tn(){mn({id:qt,index:Ht,params:{hidden:St?"0":"1"},type:"hidden-discuss",message:St?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var In=Me.admin||Me.user_id===Lt.user_id;return r.a.createElement("div",{className:"discuss-item-container",key:qt},r.a.createElement(it,{author:Lt}),r.a.createElement("section",null,r.a.createElement("div",{className:"discuss-info"},r.a.createElement("a",{href:"/users/".concat(Lt.login),target:"_blank"}," ",Lt.name," "),r.a.createElement("span",{className:"grey"},hn)),r.a.createElement(te.a,{className:"discuss-content",value:Ot}),Pt&&Pt.length>0?r.a.createElement("div",{className:"reply-discuss-container"},Pt.map(function(ir,cr){return r.a.createElement(Wt,{key:ir.id,data:ir,index:cr,user:Me,onSetActionType:mn,parentDiscussIndex:Ht})})):null,r.a.createElement("div",{className:"btn-group"},In?r.a.createElement("a",{onClick:Tn,title:St?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},r.a.createElement("i",{className:St?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Pn&&(!Pt||Pt.length==0)?r.a.createElement("a",{onClick:An,title:"\u5220\u9664"},r.a.createElement("i",{className:"iconfont icon-shanchu"})):null,r.a.createElement("a",{onClick:Mn,title:"\u56DE\u590D"}," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," "),r.a.createElement("a",{onClick:Un,className:Zt?"c-orange":""},r.a.createElement("i",{className:Zt?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),r.a.createElement("span",null,rt||""))),r.a.createElement(lt.a,{id:qt,activeDiscussIndex:sn,onReplyDiscuss:Gt})))},Ut=P("kaH+"),rn=P("uD2n"),vt=P.n(rn),on=P("Ot1p"),an=function(Be){var Me=Be.user_praise,wt=Be.praise_count,Ht=Be.praisePlus,_n=Be.onCreateDiscuss,mn=Be.discuss_count,sn=Object(l.useState)(!1),Gt=Object(p.a)(sn,2),_t=Gt[0],Ot=Gt[1],Pt=Object(l.useState)(""),St=Object(p.a)(Pt,2),qt=St[0],rt=St[1];function hn(Un){rt(Un)}function Zt(){Ot(!0)}function Pn(){Ot(!1)}function Lt(){return Mn.apply(this,arguments)}function Mn(){return Mn=Object(n.a)(i.a.mark(function Un(){return i.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:_n(qt),rt(""),Ot(!1);case 3:case"end":return Tn.stop()}},Un)})),Mn.apply(this,arguments)}return r.a.createElement("div",{className:"".concat(vt.a["dis-input-editor-container"]," ").concat(_t?vt.a.active:""," "),style:{paddingLeft:"100px"}},r.a.createElement("div",{className:_t?"hide ".concat(vt.a["text-area"]):vt.a["text-area"]},r.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Zt}),r.a.createElement("a",null," ",r.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",mn," "),r.a.createElement("a",{className:"c-light-black",onClick:Ht,title:Me?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},r.a.createElement("i",{className:"mr3 ".concat(Me?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),wt?r.a.createElement("span",null,wt):"")),_t?r.a.createElement("div",{className:vt.a["input-mask"],onClick:Pn}):null,r.a.createElement("div",{className:_t?vt.a["md-container"]:"".concat(vt.a["md-container"]," hide")},r.a.createElement(on.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:qt,height:240,onChange:hn}),r.a.createElement("div",{className:vt.a["tip-container"],onClick:Pn},r.a.createElement("a",{className:vt.a["btn-send"],onClick:Lt}," ","\u53D1\u9001"," "))))},Ct={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Mt;(function(Be){Be[Be.GET_DISCUSSES=0]="GET_DISCUSSES",Be[Be.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Be[Be.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Be[Be.PLUS_DISCUSS=3]="PLUS_DISCUSS",Be[Be.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Be[Be.SET_PAGE=5]="SET_PAGE",Be[Be.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Mt||(Mt={}));function ht(Be,Me){switch(Me.type){case Mt.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},Be),{},{loading:!0});case Mt.GET_DISCUSSES:return Object(h.a)(Object(h.a)({},Be),Me.payload);case Mt.TOP_OR_DOWN_DISCUSS:return Object(h.a)(Object(h.a)({},Be),Me.payload);case Mt.SET_ACTION_TYPE:return Object(h.a)(Object(h.a)({},Be),Me.payload);case Mt.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},Be),Me.payload);case Mt.SET_PAGE:return Object(h.a)(Object(h.a)({},Be),{},{page:Me.payload});case Mt.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},Be),Me.payload);default:throw new Error}}var Tt=function(Be){var Me=Be.user,wt=Be.identifier,Ht=Be.hack,_n=Be.onTriggerPraise,mn=Object(l.useReducer)(ht,Ct),sn=Object(p.a)(mn,2),Gt=sn[0],_t=sn[1],Ot=Gt.loading,Pt=Gt.page,St=Gt.data,qt=Gt.count,rt=Gt.actionType,hn=Gt.activeDiscussIndex,Zt=Object(l.useCallback)(Object(n.a)(i.a.mark(function fn(){var gn,vn,zt;return i.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return _t({type:Mt.SHOW_DISCUSSES_LOADING}),kt.next=3,ye(wt,Pt);case 3:gn=kt.sent,vn=gn.comments,zt=gn.disscuss_count,_t({type:Mt.GET_DISCUSSES,payload:{data:vn,count:zt,loading:!1}});case 6:case"end":return kt.stop()}},fn)})),[Pt,wt]);Object(l.useEffect)(function(){Zt()},[wt,Pt]);function Pn(fn){_t({type:Mt.SET_PAGE,page:fn})}function Lt(fn){_t({type:Mt.SET_ACTION_TYPE,payload:{actionType:fn}})}function Mn(fn){hn===fn?_t({type:Mt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):_t({type:Mt.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:fn}})}function Un(fn,gn,vn){return An.apply(this,arguments)}function An(){return An=Object(n.a)(i.a.mark(function fn(gn,vn,zt){var dt;return i.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:return ut.prev=0,ut.next=3,Se(gn);case 3:dt=ut.sent,St[zt].user_praise=vn,St[zt].praise_count=dt.praise_count,_t({type:Mt.PLUS_DISCUSS,payload:{data:Object(se.a)(St)}}),ut.next=12;break;case 9:ut.prev=9,ut.t0=ut.catch(0),console.log(ut.t0);case 12:case"end":return ut.stop()}},fn,null,[[0,9]])})),An.apply(this,arguments)}function Tn(){return In.apply(this,arguments)}function In(){return In=Object(n.a)(i.a.mark(function fn(){var gn,vn,zt,dt,kt,ut,en,It;return i.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(gn=rt.id,vn=rt.params,zt=rt.type,dt=rt.index,kt=rt.parentDiscussIndex,!(zt==="hidden-discuss")){kn.next=6;break}return kn.next=4,Ze(wt,gn,vn);case 4:kt?St[kt].children[dt].hidden=vn.hidden==1:St[dt].hidden=vn.hidden==1,_t({type:Mt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(se.a)(St)}});case 6:if(!(zt==="delete-discuss")){kn.next=31;break}return kn.next=9,Ye(wt,gn);case 9:if(!(kt||kt===0)){kn.next=22;break}ut=St[kt].children,en=ut.length-1;case 12:if(!(en>=0)){kn.next=19;break}if(!(ut[en].id===gn)){kn.next=16;break}return ut.splice(en,1),kn.abrupt("break",19);case 16:en--,kn.next=12;break;case 19:St[kt].children=ut,kn.next=30;break;case 22:It=St.length-1;case 23:if(!(It>=0)){kn.next=30;break}if(!(St[It].id===gn)){kn.next=27;break}return St.splice(It,1),kn.abrupt("break",30);case 27:It--,kn.next=23;break;case 30:_t({type:Mt.SET_ACTION_TYPE,payload:{actionType:null,data:Object(se.a)(St)}});case 31:case"end":return kn.stop()}},fn)})),In.apply(this,arguments)}function ir(){_t({type:Mt.SET_ACTION_TYPE,payload:{actionType:null}})}function cr(fn,gn){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(n.a)(i.a.mark(function fn(gn,vn){return i.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.prev=0,dt.next=3,Fe(wt,gn,vn);case 3:Zt(),dt.next=9;break;case 6:dt.prev=6,dt.t0=dt.catch(0),console.log(dt.t0);case 9:case"end":return dt.stop()}},fn,null,[[0,6]])})),Xn.apply(this,arguments)}function Cn(fn){return dr.apply(this,arguments)}function dr(){return dr=Object(n.a)(i.a.mark(function fn(gn){return i.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return _t({type:Mt.SHOW_DISCUSSES_LOADING}),zt.next=3,Ge(wt,gn);case 3:Zt();case 4:case"end":return zt.stop()}},fn)})),dr.apply(this,arguments)}return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"discuss-panel"},St.length===0?r.a.createElement(Qe.a,null):St.map(function(fn,gn){return r.a.createElement(Nt,{onReplyDiscuss:cr,onPlusDiscuss:Un,onSetActiveDiscussIndex:Mn,onSetActionType:Lt,data:fn,index:gn,user:Me,activeDiscussIndex:hn})}),qt>10?r.a.createElement("div",{className:"pagination-container"},r.a.createElement(Y.a,{showQuickJumper:!0,onChange:Pn,current:Pt,total:qt})):null),r.a.createElement(an,{user_praise:Ht.user_praise,praise_count:Ht.praises_count,praisePlus:_n,discuss_count:Ht.comments_count,onCreateDiscuss:Cn}),r.a.createElement(he.a,null,r.a.createElement(g.a,{centered:!0,title:"\u63D0\u793A",visible:!!rt,onOk:Tn,onCancel:ir},r.a.createElement("p",null,rt?rt.message:"")),r.a.createElement(Ut.a,null)))},yt=P("9kvl"),Sn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Kn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},pn=function(Be){var Me,wt=Be.hack,Ht=Be.onTriggerPraise,_n=Be.topicId,mn=Be.page,sn=Be.onPageChange,Gt=Be.user,_t=Be.submitRecords,Ot=Be.submitting,Pt=Be.submitResult,St=Object(l.useState)("0"),qt=Object(p.a)(St,2),rt=qt[0],hn=qt[1],Zt=Object(x.h)(),Pn=Object(l.useState)(!1),Lt=Object(p.a)(Pn,2),Mn=Lt[0],Un=Lt[1],An=Object(l.useState)([]),Tn=Object(p.a)(An,2),In=Tn[0],ir=Tn[1],cr=Object(l.useState)(Object(h.a)(Object(h.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Xn=Object(p.a)(cr,2),Cn=Xn[0],dr=Xn[1];function fn(dt){var kt=dt.target.id;hn(kt)}Object(l.useEffect)(function(){var dt=re.a.subscribe("to-commit-info",function(){hn("1")});return dt},[]);function gn(){hn("2")}function vn(){return zt.apply(this,arguments)}function zt(){return zt=Object(n.a)(i.a.mark(function dt(){var kt;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(je.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(h.a)({identifier:Cn==null?void 0:Cn.id},Cn)});case 2:kt=en.sent,ir(kt);case 4:case"end":return en.stop()}},dt)})),zt.apply(this,arguments)}return console.log(_t,"submitRecords"),r.a.createElement("div",{className:j.a["left-panel"]},r.a.createElement("ul",{className:"".concat(j.a["s-navs"]," ").concat(j.a["bg-white"]," ").concat(j.a.b1)},r.a.createElement("li",null,r.a.createElement("a",{className:rt==="0"?j.a.active:"",id:"0",onClick:fn},"\u4EFB\u52A1\u63CF\u8FF0")),r.a.createElement("li",null,r.a.createElement("a",{className:rt==="1"?j.a.active:"",id:"1",onClick:fn},"\u63D0\u4EA4\u8BB0\u5F55")),Zt.query.type!=="exercises"&&r.a.createElement("li",null,r.a.createElement("a",{className:rt==="2"?j.a.active:"",id:"2",onClick:fn},"\u8BC4\u8BBA"))),r.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat(rt==="0"?"":"hide")},r.a.createElement(ce,{hack:wt,onTriggerPraise:Ht,toDiscuss:gn})),r.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(j.a["tab-panel-body"]," ").concat(rt==="1"?"":"hide")},!!(_t!=null&&_t.records_count)||Ot?r.a.createElement(tt,{page:mn,onPageChange:sn,topicId:_n,submitting:Ot,submitRecords:_t,submitResult:Pt}):r.a.createElement(Qe.a,null)),r.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat(rt==="2"?"":"hide"),style:{padding:0}},r.a.createElement(Tt,{user:Gt,identifier:wt.identifier,hack:wt,onTriggerPraise:Ht})),r.a.createElement(Le.a,{className:j.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:r.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),r.a.createElement(fe.a.Search,{onSearch:function(kt){Cn.name=kt,Cn.page=1,dr(Object(h.a)({},Cn)),vn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),r.a.createElement(V.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(kt){Cn.page=1,Cn.difficult=kt||null,dr(Object(h.a)({},Cn)),vn()}},r.a.createElement(V.a.Option,{value:0},"\u5168\u90E8"),r.a.createElement(V.a.Option,{value:1},"\u7B80\u5355"),r.a.createElement(V.a.Option,{value:2},"\u9002\u4E2D"),r.a.createElement(V.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:r.a.createElement("div",null,r.a.createElement(Y.a,{current:Cn.page,className:"mt10 mb10",hideOnSinglePage:!0,total:In==null?void 0:In.count,pageSize:Cn.per_page,onChange:function(kt,ut){Cn.page=kt,Cn.per_page=ut,vn()}})),width:530,placement:"left",onClose:function(){return Un(!1)},visible:Mn},In==null||((Me=In.data)===null||Me===void 0)?void 0:Me.map(function(dt,kt){return r.a.createElement("div",{onClick:Object(n.a)(i.a.mark(function ut(){var en;return i.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return ar.next=2,Object(je.a)("/api/problems/".concat(dt==null?void 0:dt.identifier,"/start.json"),{method:"get",params:{hack_user_id:Gt==null?void 0:Gt.user_id}});case 2:en=ar.sent,en&&(yt.d.replace("/myproblems/".concat(en==null?void 0:en.identifier,"?type=1")),window.location.reload());case 4:case"end":return ar.stop()}},ut)})),className:"".concat(j.a.list," ").concat(dt!=null&&dt.checked?j.a.active:"")},r.a.createElement("div",null,(dt==null?void 0:dt.opened)&&(dt==null?void 0:dt.passed)&&r.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(dt==null?void 0:dt.opened)&&!(dt!=null&&dt.passed)&&r.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),r.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},dt.name)),r.a.createElement("span",{style:{color:Kn[dt.difficult]}},Sn[dt.difficult]))})),(wt==null?void 0:wt.is_program)&&r.a.createElement("div",{onClick:function(){vn(),Un(!0)},className:j.a.btns},r.a.createElement("i",{className:"iconfont icon-timuliebiao"}),r.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},et=P("oFv4"),Kt=P.n(et),Yt=P("+aKw"),xt=P("S/kP"),Dt=P.n(xt),jt=P("t/PP"),Fn=P.n(jt),En=s.a.Countdown,Ve={Java:"java",C:"c",Python:"py","C++":"c"},nt;(function(Be){Be[Be.SET_LOADING=0]="SET_LOADING",Be[Be.GET_DATA=1]="GET_DATA",Be[Be.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Be[Be.SET_DATA=3]="SET_DATA",Be[Be.SET_DEBUGING=4]="SET_DEBUGING",Be[Be.SET_SUBMITING=5]="SET_SUBMITING",Be[Be.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Be[Be.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Be[Be.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Be[Be.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Be[Be.SET_PAGE=10]="SET_PAGE"})(nt||(nt={}));function rr(){return new Date().getTime()}var Dr={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function Ur(Be,Me){switch(Me.type){case nt.GET_DATA:return Object(h.a)(Object(h.a)({},Be),Me.payload);case nt.SET_DATA:return Object(h.a)(Object(h.a)({},Be),{},{data:Me.payload});case nt.SET_LOADING:return Object(h.a)(Object(h.a)({},Be),{},{loading:Me.payload});case nt.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},Be),{},{showNote:Me.payload});case nt.SET_DEBUGING:return Object(h.a)(Object(h.a)({},Be),{},{debuging:Me.payload});case nt.SET_SUBMITING:return Object(h.a)(Object(h.a)({},Be),{},{submitting:Me.payload});case nt.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},Be),{},{submitRecords:Me.payload});case nt.SET_PAGE:return Object(h.a)(Object(h.a)({},Be),{},{submitRecordPage:Me.payload});case nt.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},Be),{},{executingMessage:Me.payload});case nt.SET_EXECUTE_RESULT:return Object(h.a)(Object(h.a)({},Be),Me.payload);case nt.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},Be),Me.payload);default:throw new Error}}var Fr=de.default=function(Be){var Me,wt,Ht,_n,mn=Be.children,sn=Object(l.useReducer)(Ur,Dr),Gt=Object(p.a)(sn,2),_t=Gt[0],Ot=Gt[1],Pt=Object(x.i)(),St=Pt.id,qt=Object(x.g)(),rt=Object(x.h)(),hn=_t.loading,Zt=_t.data,Pn=_t.debugResult,Lt=_t.submitResult,Mn=_t.submitRecords,Un=_t.submitRecordPage,An=_t.showNote,Tn=_t.debuging,In=_t.submitting,ir=_t.executingMessage,cr=Object(l.useState)("#FFF"),Xn=Object(p.a)(cr,2),Cn=Xn[0],dr=Xn[1],fn=Object(l.useState)(null),gn=Object(p.a)(fn,2),vn=gn[0],zt=gn[1],dt=Object(l.useState)({}),kt=Object(p.a)(dt,2),ut=kt[0],en=kt[1],It=Object(l.useState)(!0),ar=Object(p.a)(It,2),kn=ar[0],hr=ar[1],Zr=Object(l.useState)(!1),Pr=Object(p.a)(Zr,2),zr=Pr[0],Mr=Pr[1],Cr=Object(l.useRef)(null),Kr=Object(l.useRef)(0),Wn=Zt==null?void 0:Zt.user,gt=Zt==null?void 0:Zt.hack,Vr=Object(l.useRef)(),vr=Object(l.useRef)();Object(l.useEffect)(function(){var Qt;if(clearTimeout(Vr.current),clearTimeout(vr.current),ut!=null&&(Qt=ut.exercise)!==null&&Qt!==void 0&&Qt.left_time){var mt,Jt;if((ut==null||((mt=ut.exercise)===null||mt===void 0)?void 0:mt.left_time)>1800){var ot;vr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:r.a.createElement(o.a,null),okText:"\u77E5\u9053\u4E86"})},((ut==null||((ot=ut.exercise)===null||ot===void 0)?void 0:ot.left_time)-1800)*1e3)}if((ut==null||((Jt=ut.exercise)===null||Jt===void 0)?void 0:Jt.left_time)>900){var un;Vr.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:r.a.createElement(o.a,null),okText:"\u77E5\u9053\u4E86"})},((ut==null||((un=ut.exercise)===null||un===void 0)?void 0:un.left_time)-900)*1e3)}}},[ut]),Object(l.useEffect)(function(){function Qt(){return mt.apply(this,arguments)}function mt(){return mt=Object(n.a)(i.a.mark(function Jt(){var ot,un,Rn,Jn,xr,Zn,dn,Ln,Xr,Br,zn,mr;return i.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return hr(!0),tr.next=3,Object(A.d)(St);case 3:if(ot=tr.sent,setTimeout(function(){hr(!1)},800),ot.status===401)document.location.href="/user/login";else{try{ot.hack.code=B.Base64.decode(ot.hack.code)}catch(Gr){console.log(Gr)}ot.hack=Object(h.a)(Object(h.a)({},ot.hack),{},{is_program:(rt==null||((un=rt.query)===null||un===void 0)?void 0:un.type)==="1"}),Ot({type:nt.GET_DATA,payload:{loading:!1,data:ot}})}if(!(rt.query.type==="exercises")){tr.next=18;break}if(!(rt.query.coursesId=="coursesId")){tr.next=13;break}return tr.next=10,Object(E.Z)({categoryId:rt.query.exercisesId,login:rt.query.login});case 10:Zn=tr.sent,tr.next=16;break;case 13:return tr.next=15,Object(E.z)({categoryId:rt.query.exercisesId,login:rt.query.login});case 15:Zn=tr.sent;case 16:en(Object(h.a)({},Zn)),(Rn=Zn)!==null&&Rn!==void 0&&Rn.left_banner_id&&(Jn=Zn)!==null&&Jn!==void 0&&(xr=Jn.exercise)!==null&&xr!==void 0&&xr.left_time&&(zt(Date.now()+((dn=Zn)===null||dn===void 0||((Ln=dn.exercise)===null||Ln===void 0)?void 0:Ln.left_time)*1e3),setTimeout(function(){dr("red")},(((Xr=Zn)===null||Xr===void 0||((Br=Xr.exercise)===null||Br===void 0)?void 0:Br.left_time)-300>0?((zn=Zn)===null||zn===void 0||((mr=zn.exercise)===null||mr===void 0)?void 0:mr.left_time)-300:0)*1e3));case 18:case"end":return tr.stop()}},Jt)})),mt.apply(this,arguments)}St&&Qt()},[St]),Object(l.useEffect)(function(){return rt.query.type==="exercises"&&(window.addEventListener(Object(_.c)(),pt),window.focus(),window.onblur=function(){Object(_.a)()&&Object(_.b)()}),function(){document.removeEventListener(Object(_.c)(),pt)}},[St]),Object(l.useEffect)(function(){St&>!==null&>!==void 0&>.language&&Ft()},[St,Un,gt==null?void 0:gt.language]),Object(l.useEffect)(function(){return gt!=null&>.is_program&&(Kr.current=0,Cr.current=setInterval(function(){ni()},15e3)),function(){clearInterval(Cr.current)}},[gt==null?void 0:gt.is_program]);var ni=function(){var Qt=Object(n.a)(i.a.mark(function mt(){var Jt;return i.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(je.a)("/api/myproblems/".concat(St,"/save_long_time.json"),{method:"get",params:{answer_long_time:Kr.current}});case 2:Jt=un.sent;case 3:case"end":return un.stop()}},mt)}));return function(){return Qt.apply(this,arguments)}}(),pt=function(){window.parent.postMessage("backExercise","*")};function Ft(){return bt.apply(this,arguments)}function bt(){return bt=Object(n.a)(i.a.mark(function Qt(){var mt;return i.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.prev=0,ot.next=3,Object(A.f)(St,{limit:15,page:Un,language:gt==null?void 0:gt.language});case 3:mt=ot.sent,Ot({type:nt.GET_SUBMIT_RECORDS,payload:mt}),ot.next=10;break;case 7:ot.prev=7,ot.t0=ot.catch(0),console.log(ot.t0);case 10:case"end":return ot.stop()}},Qt,null,[[0,7]])})),bt.apply(this,arguments)}function Vt(Qt){Ot({type:nt.SET_PAGE,payload:Qt})}function $t(){return xn.apply(this,arguments)}function xn(){return xn=Object(n.a)(i.a.mark(function Qt(){var mt;return i.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(A.k)(St,{code:B.Base64.encode(gt.code),language:gt==null?void 0:gt.language});case 2:return mt=ot.sent,ot.abrupt("return",mt);case 4:case"end":return ot.stop()}},Qt)})),xn.apply(this,arguments)}function tn(){return Nn.apply(this,arguments)}function Nn(){return Nn=Object(n.a)(i.a.mark(function Qt(){var mt,Jt,ot,un,Rn,Jn,xr,Zn;return i.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(!In){Ln.next=2;break}return Ln.abrupt("return");case 2:return Ot({type:nt.SET_SUBMITING,payload:!0}),Ln.prev=3,re.a.publish("to-commit-info"),Ln.next=7,$t();case 7:if(mt=Ln.sent,console.log(mt,1),!(mt.status===0)){Ln.next=23;break}return Zn=function(){return Zn=Object(n.a)(i.a.mark(function Br(){var zn,mr,Tr,tr,Gr,wi,jr;return i.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Object(A.c)(St,"submit");case 2:if(zn=br.sent,mr=zn.status,Tr=zn.data,tr=rr(),Gr=tr-Jn>(Rn+3)*1e3,mr!==0&&!Gr&&setTimeout(xr,1e3),!Gr){br.next=12;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Ot({type:nt.SET_SUBMITING,payload:!1}),br.abrupt("return");case 12:if(!(mr===0)){br.next=19;break}return Tr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(Tr==null?void 0:Tr.status)===0&&(rt==null||((wi=rt.query)===null||wi===void 0)?void 0:wi.type)==="1"&&Mr(!0),br.next=17,Object(A.f)(St,{limit:15,page:Un,language:gt==null?void 0:gt.language});case 17:jr=br.sent,Ot({type:nt.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},_t),{},{submitResult:Tr,submitting:!1,submitRecords:jr})});case 19:case"end":return br.stop()}},Br)})),Zn.apply(this,arguments)},xr=function(){return Zn.apply(this,arguments)},ot={},rt.query.type==="exercises"&&(ot.extras={exercise_id:rt.query.exercisesId,question_id:rt.query.questionId}),Ln.next=16,Object(A.h)(St,ot);case 16:if(un=Ln.sent,!(un.status===-1&&rt!==null&&rt!==void 0&&(Jt=rt.query)!==null&&Jt!==void 0&&Jt.coursesId)){Ln.next=20;break}return window.parent.location.href="/classrooms/".concat(rt.query.coursesId,"/exercise/").concat(rt.query.exercisesId,"/detail"),Ln.abrupt("return");case 20:Rn=gt.time_limit,Jn=rr(),xr();case 23:Ln.next=29;break;case 25:Ln.prev=25,Ln.t0=Ln.catch(3),console.log(Ln.t0),Ot({type:nt.SET_SUBMITING,payload:!1});case 29:case"end":return Ln.stop()}},Qt,null,[[3,25]])})),Nn.apply(this,arguments)}function er(){return Xt.apply(this,arguments)}function Xt(){return Xt=Object(n.a)(i.a.mark(function Qt(){var mt,Jt,ot,un,Rn,Jn,xr;return i.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return _t.debuging=!0,Ot({type:nt.SET_DEBUGING,payload:!0}),dn.prev=2,dn.next=5,$t();case 5:if(mt=dn.sent,!(mt.status===0)){dn.next=22;break}return xr=function(){return xr=Object(n.a)(i.a.mark(function Xr(){var Br,zn,mr,Tr,tr,Gr;return i.a.wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:return jr.next=2,Object(A.c)(St,"debug");case 2:if(Br=jr.sent,zn=Br.status,mr=Br.message,Tr=Br.data,tr=rr(),Gr=tr-Rn>(Jt+3)*1e3,zn!==0&&!Gr&&(Ot({type:nt.SET_EXECUTE_MESSAGE,payload:mr}),setTimeout(Jn,1e3)),!Gr){jr.next=13;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Ot({type:nt.SET_DEBUGING,payload:!1}),jr.abrupt("return");case 13:zn===0&&(Ot({type:nt.SET_DEBUGING,payload:!1}),Tr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Tr.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),Ot({type:nt.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},_t),{},{debugResult:Tr,debuging:!1})}));case 14:case"end":return jr.stop()}},Xr)})),xr.apply(this,arguments)},Jn=function(){return xr.apply(this,arguments)},Jt=gt.time_limit,ot={input:encodeURIComponent(Zt.test_case.input)},rt.query.type==="exercises"&&(ot.exercise_id=rt.query.exercisesId),dn.next=14,Object(A.b)(St,ot);case 14:if(un=dn.sent,!(un.status===-1&&rt.query.coursesId)){dn.next=18;break}return window.parent.location.href="/classrooms/".concat(rt.query.coursesId,"/exercise/").concat(rt.query.exercisesId,"/detail"),dn.abrupt("return");case 18:Rn=rr(),Jn(),dn.next=23;break;case 22:Ot({type:nt.SET_DEBUGING,payload:!1});case 23:dn.next=28;break;case 25:dn.prev=25,dn.t0=dn.catch(2),console.log(dn.t0);case 28:return dn.prev=28,dn.finish(28);case 30:case"end":return dn.stop()}},Qt,null,[[2,25,28,30]])})),Xt.apply(this,arguments)}function yr(Qt){Ot({type:nt.SET_DATA,payload:Object(h.a)(Object(h.a)({},Zt),{},{hack:Object(h.a)(Object(h.a)({},gt),{},{code:Qt})})})}var yn=function(){var Qt=Object(n.a)(i.a.mark(function mt(Jt){var ot,un;return i.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(je.a)("/api/problems/".concat(gt==null?void 0:gt.identifier,"/start.json"),{method:"get",params:{language:Jt==="C++"||Jt==="c++"?encodeURIComponent(Jt):Jt,hack_user_id:Wn==null?void 0:Wn.user_id}});case 2:ot=Jn.sent,ot.status!==-1&&qt.replace("/myproblems/".concat(ot==null?void 0:ot.identifier,"?type=").concat(rt==null||((un=rt.query)===null||un===void 0)?void 0:un.type));case 4:case"end":return Jn.stop()}},mt)}));return function(Jt){return Qt.apply(this,arguments)}}();function Yn(Qt){var mt=Qt.target.value;Ot({type:nt.SET_DATA,payload:Object(h.a)(Object(h.a)({},Zt),{},{test_case:{input:mt}})})}function $n(){return fr.apply(this,arguments)}function fr(){return fr=Object(n.a)(i.a.mark(function Qt(){var mt;return i.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.prev=0,ot.next=3,Object(A.g)(St);case 3:mt=ot.sent,mt.status===401?qt.replace("/login",{from:rt.pathname}):yr(B.Base64.decode(mt.code)),ot.next=10;break;case 7:ot.prev=7,ot.t0=ot.catch(0),console.log(ot.t0);case 10:case"end":return ot.stop()}},Qt,null,[[0,7]])})),fr.apply(this,arguments)}function Wi(){g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",r.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(n.a)(i.a.mark(function mt(){var Jt;return i.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(A.i)(St);case 2:Jt=un.sent,Jt.status===401?qt.replace("/login",{from:rt.pathname}):yr(B.Base64.decode(Jt.code));case 4:case"end":return un.stop()}},mt)}))()}})}function bn(){Ot({type:nt.SET_SHOW_NOTE,payload:!0})}function ln(){Ot({type:nt.SET_SHOW_NOTE,payload:!1})}function cn(Qt){return pr.apply(this,arguments)}function pr(){return pr=Object(n.a)(i.a.mark(function Qt(mt){return i.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:return ot.next=2,Object(A.a)(St,mt);case 2:Ot({type:nt.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},Zt),{},{hack:Object(h.a)(Object(h.a)({},gt),{},{notes:mt.notes})})}});case 3:case"end":return ot.stop()}},Qt)})),pr.apply(this,arguments)}var Qr={hack:gt,isLoading:kn,input:Zt==null||((Me=Zt.test_case)===null||Me===void 0)?void 0:Me.input,language:gt==null?void 0:gt.language,code:gt==null?void 0:gt.code,title:"main."+Ve[gt==null?void 0:gt.language],modify_code:gt==null?void 0:gt.modify_code,notes:gt==null?void 0:gt.notes,debugResult:Pn,debuging:Tn,submitting:In,executingMessage:ir,onCancelNote:ln,onAddNote:cn,showNote:An,user:Wn,onShowNote:bn,onSubmitCode:tn,onChangeCode:yr,onChangeInput:Yn,onDebugCode:er,onResetCode:$n,onSyncCode:Wi,onUpdateCode:$t,onChangeLanguage:yn};function qr(){return ri.apply(this,arguments)}function ri(){return ri=Object(n.a)(i.a.mark(function Qt(){var mt,Jt,ot;return i.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(A.j)(gt.id,{container_type:"Hack",type:1});case 2:mt=Rn.sent,Jt=mt.praise_count,ot=Object(h.a)(Object(h.a)({},Zt),{},{hack:Object(h.a)(Object(h.a)({},gt),{},{praises_count:Jt,user_praise:!gt.user_praise})}),Ot({type:nt.SET_DATA,payload:ot});case 6:case"end":return Rn.stop()}},Qt)})),ri.apply(this,arguments)}var Ti={topicId:St,submitResult:Lt,submitRecords:Mn,submitting:In,page:Un,onPageChange:Vt,hack:gt,user:Zt==null?void 0:Zt.user,onTriggerPraise:qr};return r.a.createElement(r.a.Fragment,null,r.a.createElement(O.a,{spinning:hn,delay:500},Zt?r.a.createElement(r.a.Fragment,null,r.a.createElement("header",{className:H.a.header},rt.query.type!=="exercises"&&r.a.createElement("div",null,r.a.createElement("img",{src:"".concat(f.a.IMG_SERVER,"/images/").concat(Wn.image_url),alt:"user",width:30}),r.a.createElement("span",null,Wn.name)),r.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},r.a.createElement("div",null,gt.name),(gt==null?void 0:gt.is_program)&&r.a.createElement(Yt.a,{defaultValue:gt==null?void 0:gt.answer_long_time,onChange:function(mt){console.log(mt),Kr.current=mt},className:"font12 c-grey-999"})),Wn.hack_manager?r.a.createElement(L.a,{className:H.a.btn_back,to:(rt==null||((wt=rt.query)===null||wt===void 0)?void 0:wt.type)==="1"?"/problems/".concat(gt.identifier,"/edit?type=1"):"/problems/".concat(gt.identifier,"/edit"),style:{marginRight:10}}," ",r.a.createElement(w.a,null)," \u7F16\u8F91"):null,(ut==null||((Ht=ut.exercise)===null||Ht===void 0)?void 0:Ht.left_time)&&r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{style:{color:Cn},className:"iconfont icon-kaoshishichang mr5"}),r.a.createElement("span",{className:"c-white mr20"},r.a.createElement(En,{valueStyle:{color:Cn,fontSize:16,fontWeight:"normal"},title:r.a.createElement("span",{style:{color:Cn,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:vn,onFinish:Object(n.a)(i.a.mark(function Qt(){var mt,Jt;return i.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(E.ab)({categoryId:rt.query.exercisesId,commit_method:2});case 2:mt=un.sent,(mt==null?void 0:mt.status)===0&&($t(),g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:r.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",r.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Rn=Object(n.a)(i.a.mark(function xr(){return i.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:window.parent.location.href="/classrooms/".concat(rt.query.coursesId,"/exercise/").concat(rt.query.exercisesId,"/detail");case 1:case"end":return dn.stop()}},xr)}));function Jn(){return Rn.apply(this,arguments)}return Jn}()})),(mt==null?void 0:mt.status)===-3&&(Jt=parseInt(mt==null?void 0:mt.message),zt(Date.now()+Jt*1e3));case 5:case"end":return un.stop()}},Qt)}))}))),(rt==null||((_n=rt.query)===null||_n===void 0)?void 0:_n.type)==="exercises"?r.a.createElement(W.a,{type:"primary",onClick:function(){$t(),g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){pt()}})}},r.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," ","\u8FD4\u56DE\u8BD5\u5377"):r.a.createElement("span",{className:H.a.btn_back,onClick:function(){var mt;if((rt==null||((mt=rt.query)===null||mt===void 0)?void 0:mt.type)==="1"){var Jt,ot=(Jt=localStorage.getItem("program_homework"))===null||Jt===void 0?void 0:Jt.split(",");qt.push("/classrooms/".concat(ot==null?void 0:ot[0],"/program_homework/").concat(ot==null?void 0:ot[1],"/detail"))}else qt.push("/problemset")}}," ",r.a.createElement(T.a,null),"\u9000\u51FA")),r.a.createElement(O.a,{size:"large",spinning:kn},r.a.createElement(m.a,{className:"my-problems",leftChild:r.a.createElement(pn,Ti),rightChild:r.a.createElement(Et,Qr)}))):null,r.a.createElement(g.a,{centered:!0,closable:!1,width:680,footer:null,visible:zr,className:"oj-modal"},r.a.createElement("section",{className:"oj-modal-content"},r.a.createElement("div",{className:"oj-modal-head"},r.a.createElement("img",{src:Kt.a,alt:""}),r.a.createElement("i",{onClick:function(){return Mr(!1)},className:"iconfont icon-guanbi1"})),r.a.createElement("aside",null,r.a.createElement("img",{className:"mr30",src:Fn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",r.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Lt==null?void 0:Lt.execute_time,"ms"),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Lt==null?void 0:Lt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("aside",{className:"mb50"},r.a.createElement("img",{src:Dt.a,className:"mr30"}),r.a.createElement("span",{className:"oj-modal-tt"},r.a.createElement("span",null,r.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),r.a.createElement("span",{className:"c-light-primary"},Lt==null?void 0:Lt.execute_memory,"kb")),r.a.createElement("span",null,r.a.createElement("span",null))),"\u4F18\u4E8E",r.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Lt==null?void 0:Lt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),r.a.createElement("div",{id:"oj-modal-next",onClick:Object(n.a)(i.a.mark(function Qt(){var mt,Jt,ot;return i.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:if(!(Lt!=null&&Lt.next_identifier)){Rn.next=7;break}return Rn.next=3,Object(je.a)("/api/problems/".concat(Lt==null?void 0:Lt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Wn==null?void 0:Wn.user_id}});case 3:mt=Rn.sent,mt&&(qt.replace("/myproblems/".concat(mt==null?void 0:mt.identifier,"?type=1")),window.location.reload()),Rn.next=9;break;case 7:ot=(Jt=localStorage.getItem("program_homework"))===null||Jt===void 0?void 0:Jt.split(","),qt.push("/classrooms/".concat(ot==null?void 0:ot[0],"/program_homework/").concat(ot==null?void 0:ot[1],"/detail"));case 9:case"end":return Rn.stop()}},Qt)})),className:"oj-modal-btn"},Lt!=null&&Lt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function jn(Be){var Me,wt=Be.title,Ht=Be.modify_code,_n=Be.onSyncCode,mn=Be.onShowCodeSetting,sn=Be.onResetCode,Gt=Be.hack,_t=Be.onChangeLanguage,Ot=function(){g.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:r.a.createElement(S.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:sn})};return console.log(Gt,"hack"),r.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(Gt==null?void 0:Gt.is_program)&&r.a.createElement(V.a,{className:"oj-select",value:Gt==null?void 0:Gt.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:_t},Gt==null||((Me=Gt.all_language)===null||Me===void 0)?void 0:Me.map(function(Pt){return r.a.createElement(V.a.Option,{key:Pt,value:Pt},Pt)})),r.a.createElement("span",null),Ht?r.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:_n},r.a.createElement("img",{src:M.a,alt:"notice"})):null,r.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:Ot},r.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),r.a.createElement("a",{onClick:mn},r.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Et(Be){var Me=Be.input,wt=Be.showNote,Ht=Be.onShowNote,_n=Be.notes,mn=Be.onCancelNote,sn=Be.onAddNote,Gt=Be.debugResult,_t=Be.language,Ot=Be.debuging,Pt=Be.submitting,St=Be.executingMessage,qt=Be.code,rt=Be.onSubmitCode,hn=Be.onDebugCode,Zt=Be.onChangeCode,Pn=Be.onChangeInput,Lt=Be.onUpdateCode,Mn=Be.user,Un=Be.isLoading,An=Object(z.a)(Be,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function Tn(ir){return r.a.createElement(jn,Object(q.a)({},An,{onShowCodeSetting:ir}))}var In=Object(h.a)({input:Me,debugResult:Gt,debuging:Ot,submitting:Pt,executingMessage:St,onDebugCode:hn,onChangeCode:Zt,onSubmitCode:rt,onChangeInput:Pn,user:Mn},An);return r.a.createElement("div",{className:"right-panel"},r.a.createElement(b.a,{isLoading:Un,language:_t,value:qt,onChange:Zt,ActionBarRender:Tn}),r.a.createElement("div",{className:"note-form-area ".concat(wt?"active":"")},r.a.createElement(Te,{onCancel:mn,notes:_n,callback:sn})),r.a.createElement(C.b,In))}},RELg:function(ke,de,P){var q=P("MFOe"),z=q.Global;ke.exports={name:"oldIE-userDataStorage",write:G,read:W,each:n,remove:I,clearAll:g};var D="storejs",V=z.document,U=c(),O=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function G(s,d){if(O)return;var i=h(s);U(function(l){l.setAttribute(i,d),l.save(D)})}function W(s){if(O)return;var d=h(s),i=null;return U(function(l){i=l.getAttribute(d)}),i}function n(s){U(function(d){for(var i=d.XMLDocument.documentElement.attributes,l=i.length-1;l>=0;l--){var r=i[l];s(d.getAttribute(r.name),r.name)}})}function I(s){var d=h(s);U(function(i){i.removeAttribute(d),i.save(D)})}function g(){U(function(s){var d=s.XMLDocument.documentElement.attributes;s.load(D);for(var i=d.length-1;i>=0;i--)s.removeAttribute(d[i].name);s.save(D)})}var p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function h(s){return s.replace(/^\d/,"___$&").replace(p,"___")}function c(){if(!V||!V.documentElement||!V.documentElement.addBehavior)return null;var s="script",d,i,l;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),i.close(),d=i.w.frames[0].document,l=d.createElement("div")}catch(r){l=V.createElement("div"),d=V.body}return function(r){var o=[].slice.call(arguments,0);o.unshift(l),d.appendChild(l),l.addBehavior("#default#userData"),l.load(D),r.apply(this,o),d.removeChild(l);return}}},"S+dL":function(ke,de){ke.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"S/kP":function(ke,de,P){ke.exports=P.p+"static/time.a3dc82f3.svg"},"SA+Z":function(ke,de,P){var q=P("wTVA"),z=P("EbDI"),D=P("ZhPi"),V=P("wkBT");function U(O){return q(O)||z(O)||D(O)||V()}ke.exports=U,ke.exports.__esModule=!0,ke.exports.default=ke.exports},SJMd:function(ke,de){/**
|
|
* @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 P,q,z,D=!1,V,U;window.PR_SHOULD_USE_CONTINUATION=!0;var O,G;(function(){var W=window,n=["break,continue,do,else,for,if,return,while"],I=[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"],g=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"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"],h=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[g,"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"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",l=[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"],r=[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"],o=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[p,c,h,d,i,l,r,o],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",L="kwd",A="com",E="typ",_="lit",m="pun",f="pln",S="tag",b="dec",y="src",M="atn",B="atv",R="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function N(ve){for(var Ie=0,Ue=!1,pe=!1,_e=0,Ae=ve.length;_e<Ae;++_e){var De=ve[_e];if(De.ignoreCase)pe=!0;else if(/[a-z]/i.test(De.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ue=!0,pe=!1;break}}var je={b:8,t:9,n:10,v:11,f:12,r:13};function ze(Re){var Oe=Re.charCodeAt(0);if(Oe!==92)return Oe;var We=Re.charAt(1);return Oe=je[We],Oe||("0"<=We&&We<="7"?parseInt(Re.substring(1),8):We==="u"||We==="x"?parseInt(Re.substring(2),16):Re.charCodeAt(1))}function Je(Re){if(Re<32)return(Re<16?"\\x0":"\\x")+Re.toString(16);var Oe=String.fromCharCode(Re);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function $e(Re){var Oe=Re.substring(1,Re.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")),We=[],He=Oe[0]==="^",ue=["["];He&&ue.push("^");for(var Q=He?1:0,te=Oe.length;Q<te;++Q){var ae=Oe[Q];if(/\\[bdsw]/i.test(ae))ue.push(ae);else{var ce=ze(ae),re;Q+2<te&&Oe[Q+1]==="-"?(re=ze(Oe[Q+2]),Q+=2):re=ce,We.push([ce,re]),re<65||ce>122||(re<65||ce>90||We.push([Math.max(65,ce)|32,Math.min(re,90)|32]),re<97||ce>122||We.push([Math.max(97,ce)&~32,Math.min(re,122)&~32]))}}We.sort(function(ye,Se){return ye[0]-Se[0]||Se[1]-ye[1]});for(var se=[],he=[],Q=0;Q<We.length;++Q){var me=We[Q];me[0]<=he[1]+1?he[1]=Math.max(he[1],me[1]):se.push(he=me)}for(var Q=0;Q<se.length;++Q){var me=se[Q];ue.push(Je(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&ue.push("-"),ue.push(Je(me[1])))}return ue.push("]"),ue.join("")}function tt(Re){for(var Oe=Re.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")),We=Oe.length,He=[],ue=0,Q=0;ue<We;++ue){var te=Oe[ue];if(te==="(")++Q;else if(te.charAt(0)==="\\"){var ae=+te.substring(1);ae&&(ae<=Q?He[ae]=-1:Oe[ue]=Je(ae))}}for(var ue=1;ue<He.length;++ue)He[ue]===-1&&(He[ue]=++Ie);for(var ue=0,Q=0;ue<We;++ue){var te=Oe[ue];if(te==="(")++Q,He[Q]||(Oe[ue]="(?:");else if(te.charAt(0)==="\\"){var ae=+te.substring(1);ae&&ae<=Q&&(Oe[ue]="\\"+He[ae])}}for(var ue=0;ue<We;++ue)Oe[ue]==="^"&&Oe[ue+1]!=="^"&&(Oe[ue]="");if(Re.ignoreCase&&Ue)for(var ue=0;ue<We;++ue){var te=Oe[ue],ce=te.charAt(0);te.length>=2&&ce==="["?Oe[ue]=$e(te):ce!=="\\"&&(Oe[ue]=te.replace(/[a-zA-Z]/g,function(he){var me=he.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return Oe.join("")}for(var Qe=[],_e=0,Ae=ve.length;_e<Ae;++_e){var De=ve[_e];if(De.global||De.multiline)throw new Error(""+De);Qe.push("(?:"+tt(De)+")")}return new RegExp(Qe.join("|"),pe?"gi":"g")}function C(ve,Ie){var Ue=/(?:^|\s)nocode(?:\s|$)/,pe=[],_e=0,Ae=[],De=0;function je(ze){var Je=ze.nodeType;if(Je==1){if(Ue.test(ze.className))return;for(var $e=ze.firstChild;$e;$e=$e.nextSibling)je($e);var tt=ze.nodeName.toLowerCase();(tt==="br"||tt==="li")&&(pe[De]=`
|
|
`,Ae[De<<1]=_e++,Ae[De++<<1|1]=ze)}else if(Je==3||Je==4){var Qe=ze.nodeValue;Qe.length&&(Ie?Qe=Qe.replace(/\r\n?/g,`
|
|
`):Qe=Qe.replace(/[ \t\r\n]+/g," "),pe[De]=Qe,Ae[De<<1]=_e,_e+=Qe.length,Ae[De++<<1|1]=ze)}}return je(ve),{sourceCode:pe.join("").replace(/\n$/,""),spans:Ae}}function K(ve,Ie,Ue,pe,_e){if(!Ue)return;var Ae={sourceNode:ve,pre:1,langExtension:null,numberLines:null,sourceCode:Ue,spans:null,basePos:Ie,decorations:null};pe(Ae),_e.push.apply(_e,Ae.decorations)}var Z=/\S/;function oe(ve){for(var Ie=void 0,Ue=ve.firstChild;Ue;Ue=Ue.nextSibling){var pe=Ue.nodeType;Ie=pe===1?Ie?ve:Ue:pe===3&&Z.test(Ue.nodeValue)?ve:Ie}return Ie===ve?void 0:Ie}function fe(ve,Ie){var Ue={},pe;(function(){for(var De=ve.concat(Ie),je=[],ze={},Je=0,$e=De.length;Je<$e;++Je){var tt=De[Je],Qe=tt[3];if(Qe)for(var Re=Qe.length;--Re>=0;)Ue[Qe.charAt(Re)]=tt;var Oe=tt[1],We=""+Oe;ze.hasOwnProperty(We)||(je.push(Oe),ze[We]=null)}je.push(/[\0-\uffff]/),pe=N(je)})();var _e=Ie.length,Ae=function(De){for(var je=De.sourceCode,ze=De.basePos,Je=De.sourceNode,$e=[ze,f],tt=0,Qe=je.match(pe)||[],Re={},Oe=0,We=Qe.length;Oe<We;++Oe){var He=Qe[Oe],ue=Re[He],Q=void 0,te;if(typeof ue=="string")te=!1;else{var ae=Ue[He.charAt(0)];if(ae)Q=He.match(ae[1]),ue=ae[0];else{for(var ce=0;ce<_e;++ce)if(ae=Ie[ce],Q=He.match(ae[1]),Q){ue=ae[0];break}Q||(ue=f)}te=ue.length>=5&&ue.substring(0,5)==="lang-",te&&!(Q&&typeof Q[1]=="string")&&(te=!1,ue=y),te||(Re[He]=ue)}var re=tt;if(tt+=He.length,!te)$e.push(ze+re,ue);else{var se=Q[1],he=He.indexOf(se),me=he+se.length;Q[2]&&(me=He.length-Q[2].length,he=me-se.length);var ye=ue.substring(5);K(Je,ze+re,He.substring(0,he),Ae,$e),K(Je,ze+re+he,se,Y(ye,se),$e),K(Je,ze+re+me,He.substring(me),Ae,$e)}}De.decorations=$e};return Ae}function xe(ve){var Ie=[],Ue=[];ve.tripleQuotedStrings?Ie.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ve.multiLineStrings?Ie.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ie.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ve.verbatimStrings&&Ue.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=ve.hashComments;pe&&(ve.cStyleComments?(pe>1?Ie.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ie.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ie.push([A,/^#[^\r\n]*/,null,"#"])),ve.cStyleComments&&(Ue.push([A,/^\/\/[^\r\n]*/,null]),Ue.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=ve.regexLiterals;if(_e){var Ae=_e>1?"":`
|
|
\r`,De=Ae?".":"[\\S\\s]",je="/(?=[^/*"+Ae+"])(?:[^/\\x5B\\x5C"+Ae+"]|\\x5C"+De+"|\\x5B(?:[^\\x5C\\x5D"+Ae+"]|\\x5C"+De+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+H+"("+je+")")])}var ze=ve.types;ze&&Ue.push([E,ze]);var Je=(""+ve.keywords).replace(/^ | $/g,"");Je.length&&Ue.push([L,new RegExp("^(?:"+Je.replace(/[\s,]+/g,"|")+")\\b"),null]),Ie.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var $e="^.[^\\s\\w.$@'\"`/\\\\]*";return ve.regexLiterals&&($e+="(?!s*/)"),Ue.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[E,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[m,new RegExp($e),null]),fe(Ie,Ue)}var be=xe({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(ve,Ie,Ue){for(var pe=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Ae=ve.ownerDocument,De=Ae.createElement("li");ve.firstChild;)De.appendChild(ve.firstChild);var je=[De];function ze(Oe){var We=Oe.nodeType;if(We==1&&!pe.test(Oe.className))if(Oe.nodeName==="br")Je(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var He=Oe.firstChild;He;He=He.nextSibling)ze(He);else if((We==3||We==4)&&Ue){var ue=Oe.nodeValue,Q=ue.match(_e);if(Q){var te=ue.substring(0,Q.index);Oe.nodeValue=te;var ae=ue.substring(Q.index+Q[0].length);if(ae){var ce=Oe.parentNode;ce.insertBefore(Ae.createTextNode(ae),Oe.nextSibling)}Je(Oe),te||Oe.parentNode.removeChild(Oe)}}}function Je(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function We(Q,te){var ae=te?Q.cloneNode(!1):Q,ce=Q.parentNode;if(ce){var re=We(ce,1),se=Q.nextSibling;re.appendChild(ae);for(var he=se;he;he=se)se=he.nextSibling,re.appendChild(he)}return ae}for(var He=We(Oe.nextSibling,0),ue;(ue=He.parentNode)&&ue.nodeType===1;)He=ue;je.push(He)}for(var $e=0;$e<je.length;++$e)ze(je[$e]);Ie===(Ie|0)&&je[0].setAttribute("value",Ie);var tt=Ae.createElement("ol");tt.className="linenums";for(var Qe=Math.max(0,Ie-1|0)||0,$e=0,Re=je.length;$e<Re;++$e)De=je[$e],De.className="L"+($e+Qe)%10,De.firstChild||De.appendChild(Ae.createTextNode("\xA0")),tt.appendChild(De);ve.appendChild(tt)}function Ce(ve){var Ie=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ie=Ie&&+Ie[1]<=8;var Ue=/\n/g,pe=ve.sourceCode,_e=pe.length,Ae=0,De=ve.spans,je=De.length,ze=0,Je=ve.decorations,$e=Je.length,tt=0;Je[$e]=_e;var Qe,Re;for(Re=Qe=0;Re<$e;)Je[Re]!==Je[Re+2]?(Je[Qe++]=Je[Re++],Je[Qe++]=Je[Re++]):Re+=2;for($e=Qe,Re=Qe=0;Re<$e;){for(var Oe=Je[Re],We=Je[Re+1],He=Re+2;He+2<=$e&&Je[He+1]===We;)He+=2;Je[Qe++]=Oe,Je[Qe++]=We,Re=He}$e=Je.length=Qe;var ue=ve.sourceNode,Q="";ue&&(Q=ue.style.display,ue.style.display="none");try{for(var te=null;ze<je;){var ae=De[ze],ce=De[ze+2]||_e,re=Je[tt+2]||_e,He=Math.min(ce,re),se=De[ze+1],he;if(se.nodeType!==1&&(he=pe.substring(Ae,He))){Ie&&(he=he.replace(Ue,"\r")),se.nodeValue=he;var me=se.ownerDocument,ye=me.createElement("span");ye.className=Je[tt+1];var Se=se.parentNode;Se.replaceChild(ye,se),ye.appendChild(se),Ae<ce&&(De[ze+1]=se=me.createTextNode(pe.substring(He,ce)),Se.insertBefore(se,ye.nextSibling))}Ae=He,Ae>=ce&&(ze+=2),Ae>=re&&(tt+=2)}}finally{ue&&(ue.style.display=Q)}}var Le={};function ge(ve,Ie){for(var Ue=Ie.length;--Ue>=0;){var pe=Ie[Ue];Le.hasOwnProperty(pe)?W.console&&console.warn("cannot override language handler %s",pe):Le[pe]=ve}}function Y(ve,Ie){return ve&&Le.hasOwnProperty(ve)||(ve=/^\s*</.test(Ie)?"default-markup":"default-code"),Le[ve]}ge(be,["default-code"]),ge(fe([],[[f,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[m,/^(?:<[%?]|[%?]>)/],["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"]),ge(fe([[f,/^[\s]+/,null,` \r
|
|
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[m,/^[=<>\/]+/],["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"]),ge(fe([],[[B,/^[\s\S]+/]]),["uq.val"]),ge(xe({keywords:p,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),ge(xe({keywords:"null,true,false"}),["json"]),ge(xe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),ge(xe({keywords:h,cStyleComments:!0}),["java"]),ge(xe({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ge(xe({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ge(xe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ge(xe({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ge(xe({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ge(xe({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ge(fe([],[[x,/^[\s\S]+/]]),["regex"]);function k(ve){var Ie=ve.langExtension;try{var Ue=C(ve.sourceNode,ve.pre),pe=Ue.sourceCode;ve.sourceCode=pe,ve.spans=Ue.spans,ve.basePos=0,Y(Ie,pe)(ve),Ce(ve)}catch(_e){W.console&&console.log(_e&&_e.stack||_e)}}function j(ve,Ie,Ue){var pe=Ue||!1,_e=Ie||null,Ae=document.createElement("div");Ae.innerHTML="<pre>"+ve+"</pre>",Ae=Ae.firstChild,pe&&Te(Ae,pe,!0);var De={langExtension:_e,numberLines:pe,sourceNode:Ae,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return k(De),Ae.innerHTML}function J(ve,Ie){var Ue=Ie||document.body,pe=Ue.ownerDocument||document;function _e(ae){return Ue.getElementsByTagName(ae)}for(var Ae=[_e("pre"),_e("code"),_e("xmp")],De=[],je=0;je<Ae.length;++je)for(var ze=0,Je=Ae[je].length;ze<Je;++ze)De.push(Ae[je][ze]);Ae=null;var $e=Date;$e.now||($e={now:function(){return+new Date}});var tt=0,Qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,Re=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,We=/pre|xmp/i,He=/^code$/i,ue=/^(?:pre|code|xmp)$/i,Q={};function te(){for(var ae=W.PR_SHOULD_USE_CONTINUATION?$e.now()+250:Infinity;tt<De.length&&$e.now()<ae;tt++){for(var ce=De[tt],re=Q,se=ce;se=se.previousSibling;){var he=se.nodeType,me=(he===7||he===8)&&se.nodeValue;if(me?!/^\??prettify\b/.test(me):he!==3||/\S/.test(se.nodeValue))break;if(me){re={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(rn,vt,on){re[vt]=on});break}}var ye=ce.className;if((re!==Q||Re.test(ye))&&!Oe.test(ye)){for(var Se=!1,Fe=ce.parentNode;Fe;Fe=Fe.parentNode){var Ge=Fe.tagName;if(ue.test(Ge)&&Fe.className&&Re.test(Fe.className)){Se=!0;break}}if(!Se){ce.className+=" prettyprinted";var Ze=re.lang;if(!Ze){Ze=ye.match(Qe);var Ye;!Ze&&(Ye=oe(ce))&&He.test(Ye.tagName)&&(Ze=Ye.className.match(Qe)),Ze&&(Ze=Ze[1])}var Rt;if(We.test(ce.tagName))Rt=1;else{var lt=ce.currentStyle,it=pe.defaultView,Wt=lt?lt.whiteSpace:it&&it.getComputedStyle?it.getComputedStyle(ce,null).getPropertyValue("white-space"):0;Rt=Wt&&Wt.substring(0,3)==="pre"}var Nt=re.linenums;(Nt=Nt==="true"||+Nt)||(Nt=ye.match(/\blinenums\b(?::(\d+))?/),Nt=Nt?Nt[1]&&Nt[1].length?+Nt[1]:!0:!1),Nt&&Te(ce,Nt,Rt);var Ut={langExtension:Ze,sourceNode:ce,numberLines:Nt,pre:Rt,sourceCode:null,basePos:null,spans:null,decorations:null};k(Ut)}}}tt<De.length?W.setTimeout(te,250):typeof ve=="function"&&ve()}te()}var ie=W.PR={createSimpleLexer:fe,registerLangHandler:ge,sourceDecorator:xe,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:B,PR_COMMENT:A,PR_DECLARATION:b,PR_KEYWORD:L,PR_LITERAL:_,PR_NOCODE:R,PR_PLAIN:f,PR_PUNCTUATION:m,PR_SOURCE:y,PR_STRING:x,PR_TAG:S,PR_TYPE:E,prettyPrintOne:D?W.prettyPrintOne=j:O=j,prettyPrint:G=D?W.prettyPrint=J:G=J},X=W.define;typeof X=="function"&&X.amd&&X("google-code-prettify",[],function(){return ie})})()},STEk:function(ke,de,P){"use strict";P.d(de,"a",function(){return ge});/*! *****************************************************************************
|
|
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 q=function(Y,k){return(q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,J){j.__proto__=J}||function(j,J){for(var ie in J)Object.prototype.hasOwnProperty.call(J,ie)&&(j[ie]=J[ie])})(Y,k)};function z(Y,k){function j(){this.constructor=Y}q(Y,k),Y.prototype=k===null?Object.create(k):(j.prototype=k.prototype,new j)}function D(Y,k,j,J){return new(j||(j=Promise))(function(ie,X){function ve(pe){try{Ue(J.next(pe))}catch(_e){X(_e)}}function Ie(pe){try{Ue(J.throw(pe))}catch(_e){X(_e)}}function Ue(pe){var _e;pe.done?ie(pe.value):(_e=pe.value,_e instanceof j?_e:new j(function(Ae){Ae(_e)})).then(ve,Ie)}Ue((J=J.apply(Y,k||[])).next())})}function V(Y,k){var j,J,ie,X,ve={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return X={next:Ie(0),throw:Ie(1),return:Ie(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function Ie(Ue){return function(pe){return function(_e){if(j)throw new TypeError("Generator is already executing.");for(;ve;)try{if(j=1,J&&(ie=2&_e[0]?J.return:_e[0]?J.throw||((ie=J.return)&&ie.call(J),0):J.next)&&!(ie=ie.call(J,_e[1])).done)return ie;switch(J=0,ie&&(_e=[2&_e[0],ie.value]),_e[0]){case 0:case 1:ie=_e;break;case 4:return ve.label++,{value:_e[1],done:!1};case 5:ve.label++,J=_e[1],_e=[0];continue;case 7:_e=ve.ops.pop(),ve.trys.pop();continue;default:if(!(ie=ve.trys,(ie=ie.length>0&&ie[ie.length-1])||_e[0]!==6&&_e[0]!==2)){ve=0;continue}if(_e[0]===3&&(!ie||_e[1]>ie[0]&&_e[1]<ie[3])){ve.label=_e[1];break}if(_e[0]===6&&ve.label<ie[1]){ve.label=ie[1],ie=_e;break}if(ie&&ve.label<ie[2]){ve.label=ie[2],ve.ops.push(_e);break}ie[2]&&ve.ops.pop(),ve.trys.pop();continue}_e=k.call(Y,ve)}catch(Ae){_e=[6,Ae],J=0}finally{j=ie=0}if(5&_e[0])throw _e[1];return{value:_e[0]?_e[1]:void 0,done:!0}}([Ue,pe])}}}function U(){for(var Y=0,k=0,j=arguments.length;k<j;k++)Y+=arguments[k].length;var J=Array(Y),ie=0;for(k=0;k<j;k++)for(var X=arguments[k],ve=0,Ie=X.length;ve<Ie;ve++,ie++)J[ie]=X[ve];return J}var O=function(){function Y(){}return Y.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Y.setAttributes=function(k,j){for(var J=0,ie=j;J<ie.length;J++){var X=ie[J],ve=X[0],Ie=X[1];k.setAttribute(ve,Ie)}},Y.createRect=function(k,j,J){var ie=document.createElementNS("http://www.w3.org/2000/svg","rect");return ie.setAttribute("width",k.toString()),ie.setAttribute("height",j.toString()),J&&Y.setAttributes(ie,J),ie},Y.createLine=function(k,j,J,ie,X){var ve=document.createElementNS("http://www.w3.org/2000/svg","line");return ve.setAttribute("x1",k.toString()),ve.setAttribute("y1",j.toString()),ve.setAttribute("x2",J.toString()),ve.setAttribute("y2",ie.toString()),X&&Y.setAttributes(ve,X),ve},Y.createPolygon=function(k,j){var J=document.createElementNS("http://www.w3.org/2000/svg","polygon");return J.setAttribute("points",k),j&&Y.setAttributes(J,j),J},Y.createCircle=function(k,j){var J=document.createElementNS("http://www.w3.org/2000/svg","circle");return J.setAttribute("cx",(k/2).toString()),J.setAttribute("cy",(k/2).toString()),J.setAttribute("r",k.toString()),j&&Y.setAttributes(J,j),J},Y.createEllipse=function(k,j,J){var ie=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ie.setAttribute("cx",(k/2).toString()),ie.setAttribute("cy",(j/2).toString()),ie.setAttribute("rx",(k/2).toString()),ie.setAttribute("ry",(j/2).toString()),J&&Y.setAttributes(ie,J),ie},Y.createGroup=function(k){var j=document.createElementNS("http://www.w3.org/2000/svg","g");return k&&Y.setAttributes(j,k),j},Y.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Y.createMarker=function(k,j,J,ie,X,ve,Ie){var Ue=document.createElementNS("http://www.w3.org/2000/svg","marker");return Y.setAttributes(Ue,[["id",k],["orient",j],["markerWidth",J.toString()],["markerHeight",ie.toString()],["refX",X.toString()],["refY",ve.toString()]]),Ue.appendChild(Ie),Ue},Y.createText=function(k){var j=document.createElementNS("http://www.w3.org/2000/svg","text");return j.setAttribute("x","0"),j.setAttribute("y","0"),k&&Y.setAttributes(j,k),j},Y.createTSpan=function(k,j){var J=document.createElementNS("http://www.w3.org/2000/svg","tspan");return J.textContent=k,j&&Y.setAttributes(J,j),J},Y.createImage=function(k){var j=document.createElementNS("http://www.w3.org/2000/svg","image");return k&&Y.setAttributes(j,k),j},Y.createPoint=function(k,j){var J=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return J.x=k,J.y=j,J},Y.createPath=function(k,j){var J=document.createElementNS("http://www.w3.org/2000/svg","path");return J.setAttribute("d",k),j&&Y.setAttributes(J,j),J},Y}(),G=function(){function Y(){}return Y.addKey=function(k){Y.key=k},Object.defineProperty(Y,"isLicensed",{get:function(){return!!Y.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Y.key)},enumerable:!1,configurable:!0}),Y}(),W=function(){function Y(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Y.prototype.rasterize=function(k,j,J){var ie=this;return new Promise(function(X){var ve=J!==void 0?J:document.createElement("canvas");k===null&&(ie.markersOnly=!0,ie.naturalSize=!1);var Ie=document.createElementNS("http://www.w3.org/2000/svg","svg");Ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ie.setAttribute("width",j.width.baseVal.valueAsString),Ie.setAttribute("height",j.height.baseVal.valueAsString),Ie.setAttribute("viewBox","0 0 "+j.viewBox.baseVal.width.toString()+" "+j.viewBox.baseVal.height.toString()),Ie.innerHTML=j.innerHTML,ie.naturalSize===!0?(Ie.width.baseVal.value=k.naturalWidth,Ie.height.baseVal.value=k.naturalHeight):ie.width!==void 0&&ie.height!==void 0&&(Ie.width.baseVal.value=ie.width,Ie.height.baseVal.value=ie.height),ve.width=Ie.width.baseVal.value,ve.height=Ie.height.baseVal.value;var Ue=Ie.outerHTML,pe=ve.getContext("2d");ie.markersOnly!==!0&&pe.drawImage(k,0,0,ve.width,ve.height);var _e=window.URL,Ae=new Image(ve.width,ve.height);Ae.setAttribute("crossOrigin","anonymous");var De=new Blob([Ue],{type:"image/svg+xml"}),je=_e.createObjectURL(De);Ae.onload=function(){pe.drawImage(Ae,0,0),_e.revokeObjectURL(je);var ze=ve.toDataURL(ie.imageType,ie.imageQuality);X(ze)},Ae.src=je})},Y}(),n=function(){},I=function(){function Y(k){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+k+"_"}return Object.defineProperty(Y.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Y.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(Y.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Y.prototype.addClass=function(k){return this.styleSheet===void 0&&this.addStyleSheet(),k.name=""+this.classNamePrefix+k.localName,this.classes.push(k),this.styleSheet.sheet.insertRule("."+k.name+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length),k},Y.prototype.addRule=function(k){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(k),this.styleSheet.sheet.insertRule(k.selector+" {"+k.style+"}",this.styleSheet.sheet.cssRules.length)},Y.prototype.addStyleSheet=function(){var k;this.styleSheet=document.createElement("style"),((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new p("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new p("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Y.prototype.removeStyleSheet=function(){var k;this.styleSheet&&(((k=this.styleSheetRoot)!==null&&k!==void 0?k:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Y}(),g=function(Y,k){this.selector=Y,this.style=k},p=function(Y,k){this.localName=Y,this.style=k},h=function(){function Y(k,j,J,ie,X){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=k,this.displayMode=j,this.markerItems=J,this.uiStyleSettings=ie,this.styles=X,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Y.prototype.show=function(k){var j=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",this.uiContainer.appendChild(J),this.addActionButton(J,'<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(J,'<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(J,'<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(J,'<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(J,'<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(J,'<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(J,'<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(J,'<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(X){var ve=document.createElement("div");ve.className=""+j.toolbarButtonStyleClass.name,ve.setAttribute("data-type-name",X.typeName),ve.innerHTML=X.icon,ve.addEventListener("click",function(){j.markerToolbarButtonClicked(ve,X)}),j.buttons.push(ve),j.markerButtons.push(ve)}),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 ie=document.createElement("div");ie.className=this.toolbarBlockStyleClass.name,ie.style.whiteSpace="nowrap",ie.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ie),this.addActionButton(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>',"render"),this.addActionButton(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"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Y.prototype.addButtonClickListener=function(k){this.buttonClickListeners.push(k)},Y.prototype.removeButtonClickListener=function(k){this.buttonClickListeners.indexOf(k)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(k),1)},Y.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Y.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var k=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var j=0;j<this.markerButtons.length;j++)j<k||j===k&&this.markerButtons.length-1===k?this.markerButtonBlock.appendChild(this.markerButtons[j]):(j===k&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[j]))}},Y.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")},Y.prototype.resetButtonStyles=function(){var k=this;this.buttons.forEach(function(j){j.className=j.className.replace(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name,"").trim(),j.className=j.className.replace(k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?k.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:k.toolbarActiveButtonStyleColorsClass.name,"").trim(),j.className+=" "+(k.uiStyleSettings.toolbarButtonStyleColorsClassName?k.uiStyleSettings.toolbarButtonStyleColorsClassName:k.toolbarButtonStyleColorsClass.name)})},Y.prototype.addActionButton=function(k,j,J){var ie=this,X=document.createElement("div");switch(X.className=""+this.toolbarButtonStyleClass.name,X.innerHTML=j,X.setAttribute("data-action",J),X.addEventListener("click",function(){ie.actionToolbarButtonClicked(X,J)}),J){case"select":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":X.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":X.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":X.style.fill=this.uiStyleSettings.closeButtonColor}k.appendChild(X),this.buttons.push(X)},Y.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("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 p("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Y.prototype.markerToolbarButtonClicked=function(k,j){this.setActiveButton(k),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("marker",j)}),this.markerButtonOverflowBlock.style.display="none"},Y.prototype.actionToolbarButtonClicked=function(k,j){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(J){return J("action",j)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Y.prototype.setActiveButton=function(k){this.resetButtonStyles(),k.className=k.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),k.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Y.prototype.setActiveMarkerButton=function(k){var j=this.markerButtons.find(function(J){return J.getAttribute("data-type-name")===k});j&&this.setActiveButton(j)},Y.prototype.setCurrentMarker=function(k){var j=this;this.currentMarker=k,this.buttons.filter(function(J){return/delete|notes/.test(J.getAttribute("data-action"))}).forEach(function(J){j.currentMarker===void 0?(J.style.fillOpacity="0.4",J.style.pointerEvents="none"):(J.style.fillOpacity="1",J.style.pointerEvents="all")})},Y}(),c=function(){function Y(k,j,J,ie){this.panels=[],this.panelButtons=[],this.markerjsContainer=k,this.displayMode=j,this.uiStyleSettings=J,this.styles=ie,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Y.prototype.addStyles=function(){var k;this.toolboxStyleClass=this.styles.addClass(new p("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 p("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var j=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("toolbox-panel-row_colors",`
|
|
background-color: `+((k=this.uiStyleSettings.toolboxBackgroundColor)!==null&&k!==void 0?k:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
|
|
padding: `+j+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new p("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Y.prototype.show=function(k){var j;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=k,this.uiContainer.className=this.toolboxStyleClass.name+" "+((j=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Y.prototype.setPanelButtons=function(k){var j,J,ie=this;this.panels=k,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((j=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((J=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&J!==void 0?J:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(X){var ve;X.uiStyleSettings=ie.uiStyleSettings;var Ie=document.createElement("div");Ie.className=ie.toolboxButtonStyleClass.name+" "+((ve=ie.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ve!==void 0?ve:ie.toolboxButtonStyleColorsClass.name),Ie.innerHTML=X.icon,Ie.title=X.title,Ie.addEventListener("click",function(){ie.panelButtonClick(X)}),ie.panelButtons.push(Ie),ie.buttonRow.appendChild(Ie)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Y.prototype.panelButtonClick=function(k){var j=this,J=-1;if(k!==this.activePanel){J=this.panels.indexOf(k),this.panelRow.innerHTML="";var ie=k.getUi();ie.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ie),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=k}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){j.displayMode==="inline"?j.panelRow.style.display="none":j.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,ve){var Ie,Ue;X.className=j.toolboxButtonStyleClass.name+" "+(ve===J?""+((Ie=j.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:j.toolboxActiveButtonStyleColorsClass.name):""+((Ue=j.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:j.toolboxButtonStyleColorsClass.name))})},Y}(),s=function(Y,k){this.title=Y,this.icon=k},d=function(Y){function k(j,J,ie,X){var ve=Y.call(this,j,X||'<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 ve.colors=[],ve.addTransparent=!1,ve.colorBoxes=[],ve.colors=J,ve.currentColor=ie,ve.setCurrentColor=ve.setCurrentColor.bind(ve),ve.getColorBox=ve.getColorBox.bind(ve),ve}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.whiteSpace="nowrap",this.colors.forEach(function(ie){var X=j.getColorBox(ie);J.appendChild(X),j.colorBoxes.push(X)}),J},k.prototype.getColorBox=function(j){var J=this,ie=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-ie,ve=document.createElement("div");ve.style.display="inline-block",ve.style.boxSizing="content-box",ve.style.width=X-2+"px",ve.style.height=X-2+"px",ve.style.padding="1px",ve.style.marginRight="2px",ve.style.marginBottom="2px",ve.style.borderWidth="2px",ve.style.borderStyle="solid",ve.style.borderRadius=(X+2)/2+"px",ve.style.borderColor=j===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ve.addEventListener("click",function(){J.setCurrentColor(j,ve)});var Ie=document.createElement("div");return Ie.style.display="inline-block",Ie.style.width=X-2+"px",Ie.style.height=X-2+"px",Ie.style.backgroundColor=j,Ie.style.borderRadius=X/2+"px",j==="transparent"&&(Ie.style.fill=this.uiStyleSettings.toolboxAccentColor,Ie.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>`),ve.appendChild(Ie),ve},k.prototype.setCurrentColor=function(j,J){var ie=this;this.currentColor=j,this.colorBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(j)},k}(s),i=function(){function Y(k,j,J){this._state="new",this._isSelected=!1,this._container=k,this._overlayContainer=j,this.globalSettings=J,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Y.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Y.prototype.ownsTarget=function(k){return!1},Object.defineProperty(Y.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Y.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Y.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Y.prototype.pointerDown=function(k,j){},Y.prototype.dblClick=function(k,j){},Y.prototype.manipulate=function(k){},Y.prototype.pointerUp=function(k){this.stateChanged()},Y.prototype.dispose=function(){},Y.prototype.addMarkerVisualToContainer=function(k){this.container.childNodes.length>0?this.container.insertBefore(k,this.container.childNodes[0]):this.container.appendChild(k)},Y.prototype.getState=function(){return{typeName:Y.typeName,state:this.state,notes:this.notes}},Y.prototype.restoreState=function(k){this._state=k.state,this.notes=k.notes},Y.prototype.scale=function(k,j){},Y.prototype.colorChanged=function(k){this.onColorChanged&&this.onColorChanged(k),this.stateChanged()},Y.prototype.fillColorChanged=function(k){this.onFillColorChanged&&this.onFillColorChanged(k),this.stateChanged()},Y.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var k=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),k.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(k)&&this.onStateChanged(this)}},Y.typeName="MarkerBase",Y}(),l=function(){function Y(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Y.prototype.findGripByVisual=function(k){return this.topLeft.ownsTarget(k)?this.topLeft:this.topCenter.ownsTarget(k)?this.topCenter:this.topRight.ownsTarget(k)?this.topRight:this.centerLeft.ownsTarget(k)?this.centerLeft:this.centerRight.ownsTarget(k)?this.centerRight:this.bottomLeft.ownsTarget(k)?this.bottomLeft:this.bottomCenter.ownsTarget(k)?this.bottomCenter:this.bottomRight.ownsTarget(k)?this.bottomRight:void 0},Y}(),r=function(){function Y(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Y.prototype.ownsTarget=function(k){return k===this.visual||k===this.visual.childNodes[0]||k===this.visual.childNodes[1]},Y}(),o=function(){function Y(){}return Y.toITransformMatrix=function(k){return{a:k.a,b:k.b,c:k.c,d:k.d,e:k.e,f:k.f}},Y.toSVGMatrix=function(k,j){return k.a=j.a,k.b=j.b,k.c=j.c,k.d=j.d,k.e=j.e,k.f=j.f,k},Y}(),w=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.left=0,X.top=0,X.width=0,X.height=0,X.defaultSize={x:50,y:20},X.offsetX=0,X.offsetY=0,X.rotationAngle=0,X.CB_DISTANCE=10,X._suppressMarkerCreateEvent=!1,X.container.transform.baseVal.appendItem(O.createTransform()),X.setupControlBox(),X}return z(k,Y),Object.defineProperty(k.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"visual",{get:function(){return this._visual},set:function(j){this._visual=j;var J=O.createTransform();this._visual.transform.baseVal.appendItem(J)},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(j){return!!Y.prototype.ownsTarget.call(this,j)||!!(this.controlGrips.findGripByVisual(j)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(j))},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="new"&&(this.left=j.x,this.top=j.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ie=this.unrotatePoint(j);if(this.manipulationStartX=ie.x,this.manipulationStartY=ie.y,this.offsetX=ie.x-this.left,this.offsetY=ie.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(J),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(J)){this.activeGrip=this.rotatorGrip;var X=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=X.x-this.width/2,this.top=X.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ve=this.container.transform.baseVal.getItem(0);ve.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ve,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},k.prototype.pointerUp=function(j){var J=this.state;Y.prototype.pointerUp.call(this,j),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(j),this._state="select",J==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},k.prototype.moveVisual=function(j){this.visual.style.transform="translate("+j.x+"px, "+j.y+"px)"},k.prototype.manipulate=function(j){var J=this.unrotatePoint(j);this.state==="creating"?this.resize(j):this.state==="move"?(this.left=this.manipulationStartLeft+(J.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(J.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(J):this.state==="rotate"&&this.rotate(j)},k.prototype.resize=function(j){var J=this.manipulationStartLeft,ie=this.manipulationStartWidth,X=this.manipulationStartTop,ve=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:J=this.manipulationStartLeft+j.x-this.manipulationStartX,ie=this.manipulationStartWidth+this.manipulationStartLeft-J;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ie=this.manipulationStartWidth+j.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+j.y-this.manipulationStartY,ve=this.manipulationStartHeight+this.manipulationStartTop-X;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ve=this.manipulationStartHeight+j.y-this.manipulationStartY}ie>=0?(this.left=J,this.width=ie):(this.left=J+ie,this.width=-ie),ve>=0?(this.top=X,this.height=ve):(this.top=X+ve,this.height=-ve),this.setSize()},k.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},k.prototype.rotate=function(j){if(Math.abs(j.x-this.centerX)>.1){var J=Math.sign(j.x-this.centerX);this.rotationAngle=180*Math.atan((j.y-this.centerY)/(j.x-this.centerX))/Math.PI+90*J,this.applyRotation()}},k.prototype.applyRotation=function(){var j=this.container.transform.baseVal.getItem(0);j.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(j,0)},k.prototype.rotatePoint=function(j){if(this.rotationAngle===0)return j;var J=this.container.getCTM(),ie=O.createPoint(j.x,j.y);return{x:(ie=ie.matrixTransform(J)).x,y:ie.y}},k.prototype.unrotatePoint=function(j){if(this.rotationAngle===0)return j;var J=this.container.getCTM();J=J.inverse();var ie=O.createPoint(j.x,j.y);return{x:(ie=ie.matrixTransform(J)).x,y:ie.y}},k.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=O.createGroup();var j=O.createTransform();j.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(j),this.container.appendChild(this.controlBox),this.controlRect=O.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=O.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 l,this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){var j=this.controlBox.transform.baseVal.getItem(0);j.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(j,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()},k.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()},k.prototype.createGrip=function(){var j=new r;return j.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(j.visual),j},k.prototype.positionGrips=function(){var j=this.controlGrips.topLeft.GRIP_SIZE,J=-j/2,ie=J,X=(this.width+this.CB_DISTANCE)/2-j/2,ve=(this.height+this.CB_DISTANCE)/2-j/2,Ie=this.height+this.CB_DISTANCE-j/2,Ue=this.width+this.CB_DISTANCE-j/2;this.positionGrip(this.controlGrips.topLeft.visual,J,ie),this.positionGrip(this.controlGrips.topCenter.visual,X,ie),this.positionGrip(this.controlGrips.topRight.visual,Ue,ie),this.positionGrip(this.controlGrips.centerLeft.visual,J,ve),this.positionGrip(this.controlGrips.centerRight.visual,Ue,ve),this.positionGrip(this.controlGrips.bottomLeft.visual,J,Ie),this.positionGrip(this.controlGrips.bottomCenter.visual,X,Ie),this.positionGrip(this.controlGrips.bottomRight.visual,Ue,Ie),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,ie-3*this.CB_DISTANCE)},k.prototype.positionGrip=function(j,J,ie){var X=j.transform.baseVal.getItem(0);X.setTranslate(J,ie),j.transform.baseVal.replaceItem(X,0)},k.prototype.hideControlBox=function(){this.controlBox.style.display="none"},k.prototype.showControlBox=function(){this.controlBox.style.display=""},k.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:o.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:o.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Y.prototype.getState.call(this))},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j);var J=j;this.left=J.left,this.top=J.top,this.width=J.width,this.height=J.height,this.rotationAngle=J.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,J.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(o.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,J.containerTransformMatrix))},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J);var ie=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:ie.x*j,y:ie.y*J});this.left=X.x,this.top=X.y,this.width=this.width*j,this.height=this.height*J,this.adjustControlBox()},k}(i),T=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.createVisual=X.createVisual.bind(X),X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.visual)},k.prototype.createVisual=function(){this.visual=O.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)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},k.prototype.manipulate=function(j){Y.prototype.manipulate.call(this,j)},k.prototype.resize=function(j){Y.prototype.resize.call(this,j),this.setSize()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(j){Y.prototype.pointerUp.call(this,j),this.setSize()},k.prototype.setStrokeColor=function(j){this.strokeColor=j,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(j),this.stateChanged()},k.prototype.setFillColor=function(j){this.fillColor=j,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},k.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this))},k.prototype.restoreState=function(j){var J=j;this.fillColor=J.fillColor,this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.opacity=J.opacity,this.createVisual(),Y.prototype.restoreState.call(this,j),this.setSize()},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.setSize()},k.title="Rectangle marker",k}(w),x=function(Y){function k(j,J,ie,X){var ve=Y.call(this,j,X||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ve.widths=[],ve.widthBoxes=[],ve.widths=J,ve.currentWidth=ie,ve.setCurrentWidth=ve.setCurrentWidth.bind(ve),ve}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.widths.forEach(function(ie){var X=document.createElement("div");X.style.display="flex",X.style.flexGrow="2",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=ie===j.currentWidth?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentWidth(ie,X)}),J.appendChild(X);var ve=document.createElement("div");ve.innerText=ie.toString(),ve.style.marginRight="5px",X.appendChild(ve);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.display="flex",Ie.style.alignItems="center";var Ue=document.createElement("hr");Ue.style.minWidth="20px",Ue.style.border="0px",Ue.style.borderTop=ie+"px solid "+j.uiStyleSettings.toolboxColor,Ue.style.flexGrow="2",Ie.appendChild(Ue),X.appendChild(Ie),j.widthBoxes.push(X)}),J},k.prototype.setCurrentWidth=function(j,J){var ie=this;this.currentWidth=j,this.widthBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},k}(s),L=function(Y){function k(j,J,ie,X){var ve=Y.call(this,j,X||'<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 ve.styles=[],ve.styleBoxes=[],ve.styles=J,ve.currentStyle=ie,ve.setCurrentStyle=ve.setCurrentStyle.bind(ve),ve}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",this.styles.forEach(function(ie){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.styles.length-5+"%",X.style.borderColor=ie===j.currentStyle?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentStyle(ie,X)}),J.appendChild(X);var ve=document.createElement("div");ve.style.minHeight="20px",ve.style.flexGrow="2",ve.style.overflow="hidden";var Ie=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+j.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ie!==""?'stroke-dasharray="'+ie+'"':"")+` />
|
|
</svg>`;ve.innerHTML=Ie,X.appendChild(ve),j.styleBoxes.push(X)}),J},k.prototype.setCurrentStyle=function(j,J){var ie=this;this.currentStyle=j,this.styleBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},k}(s),A=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.strokeColor=ie.defaultColor,X.strokeWidth=ie.defaultStrokeWidth,X.strokeDasharray=ie.defaultStrokeDasharray,X.strokePanel=new d("Line color",ie.defaultColorSet,ie.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Y.prototype.getState.call(this);return j.typeName=k.typeName,j},k.typeName="FrameMarker",k.title="Frame marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',k}(T),E=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},_=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.x1=0,X.y1=0,X.x2=0,X.y2=0,X.defaultLength=50,X.manipulationStartX=0,X.manipulationStartY=0,X.manipulationStartX1=0,X.manipulationStartY1=0,X.manipulationStartX2=0,X.manipulationStartY2=0,X.setupControlBox(),X}return z(k,Y),k.prototype.ownsTarget=function(j){return!!Y.prototype.ownsTarget.call(this,j)||!(!this.grip1.ownsTarget(j)&&!this.grip2.ownsTarget(j))},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.manipulationStartX=j.x,this.manipulationStartY=j.y,this.state==="new"&&(this.x1=j.x,this.y1=j.y,this.x2=j.x,this.y2=j.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(J)?this.activeGrip=this.grip1:this.grip2.ownsTarget(J)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},k.prototype.pointerUp=function(j){var J=this.state;Y.prototype.pointerUp.call(this,j),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(j),this._state="select",J==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},k.prototype.adjustVisual=function(){},k.prototype.manipulate=function(j){this.state==="creating"?this.resize(j):this.state==="move"?(this.x1=this.manipulationStartX1+j.x-this.manipulationStartX,this.y1=this.manipulationStartY1+j.y-this.manipulationStartY,this.x2=this.manipulationStartX2+j.x-this.manipulationStartX,this.y2=this.manipulationStartY2+j.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(j)},k.prototype.resize=function(j){switch(this.activeGrip){case this.grip1:this.x1=j.x,this.y1=j.y;break;case this.grip2:case void 0:this.x2=j.x,this.y2=j.y}this.adjustVisual(),this.adjustControlBox()},k.prototype.select=function(){Y.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},k.prototype.deselect=function(){Y.prototype.deselect.call(this),this.controlBox.style.display="none"},k.prototype.setupControlBox=function(){this.controlBox=O.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},k.prototype.adjustControlBox=function(){this.positionGrips()},k.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},k.prototype.createGrip=function(){var j=new r;return j.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(j.visual),j},k.prototype.positionGrips=function(){var j=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-j/2,this.y1-j/2),this.positionGrip(this.grip2.visual,this.x2-j/2,this.y2-j/2)},k.prototype.positionGrip=function(j,J,ie){var X=j.transform.baseVal.getItem(0);X.setTranslate(J,ie),j.transform.baseVal.replaceItem(X,0)},k.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Y.prototype.getState.call(this))},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j);var J=j;this.x1=J.x1,this.y1=J.y1,this.x2=J.x2,this.y2=J.y2},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.x1=this.x1*j,this.y1=this.y1*J,this.x2=this.x2*j,this.y2=this.y2*J,this.adjustVisual(),this.adjustControlBox()},k}(i),m=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.strokeColor=ie.defaultColor,X.strokeWidth=ie.defaultStrokeWidth,X.strokeDasharray=ie.defaultStrokeDasharray,X.strokePanel=new d("Line color",ie.defaultColorSet,ie.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorLine&&j!==this.visibleLine)},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.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)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},k.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()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},k.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},k.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j);var J=j;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.createVisual(),this.adjustVisual()},k.typeName="LineMarker",k.title="Line marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',k}(_),f=function(Y){function k(j,J,ie,X){var ve=Y.call(this,j,X||'<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 ve.fonts=[],ve.fontBoxes=[],ve.fonts=J,ve.currentFont=ie,ve.setCurrentFont=ve.setCurrentFont.bind(ve),ve}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");return J.style.overflow="hidden",J.style.flexGrow="2",this.fonts.forEach(function(ie){var X=document.createElement("div");X.style.display="inline-block",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.fonts.length-5+"%",X.style.borderColor=ie===j.currentFont?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentFont(ie,X)}),J.appendChild(X);var ve=document.createElement("div");ve.style.display="flex",ve.style.minHeight="20px",ve.style.flexGrow="2",ve.style.fontFamily=ie,ve.style.overflow="hidden";var Ie=document.createElement("div");Ie.style.whiteSpace="nowrap",Ie.style.overflow="hidden",Ie.style.textOverflow="ellipsis",Ie.innerHTML="The quick brown fox jumps over the lazy dog",ve.appendChild(Ie),X.appendChild(ve),j.fontBoxes.push(X)}),J},k.prototype.setCurrentFont=function(j,J){var ie=this;this.currentFont=j,this.fontBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},k}(s),S=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=ie.defaultColor,X.fontFamily=ie.defaultFontFamily,X.defaultSize={x:100,y:30},X.setColor=X.setColor.bind(X),X.setFont=X.setFont.bind(X),X.renderText=X.renderText.bind(X),X.sizeText=X.sizeText.bind(X),X.textEditDivClicked=X.textEditDivClicked.bind(X),X.showTextEditor=X.showTextEditor.bind(X),X.setSize=X.setSize.bind(X),X.positionTextEditor=X.positionTextEditor.bind(X),X.colorPanel=new d("Color",ie.defaultColorSet,ie.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new f("Font",ie.defaultFontFamilies,ie.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return z(k,Y),k.prototype.ownsTarget=function(j){if(Y.prototype.ownsTarget.call(this,j)||j===this.visual||j===this.textElement||j===this.bgRectangle)return!0;var J=!1;return this.textElement.childNodes.forEach(function(ie){ie===j&&(J=!0)}),J},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.isMoved=!1,this.pointerDownPoint=j,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},k.prototype.renderText=function(){var j=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(J){j.textElement.appendChild(O.createTSpan(J.trim()===""?" ":J.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},k.prototype.getTextScale=function(){var j=this.textElement.getBBox(),J=1;if(j.width>0&&j.height>0){var ie=(1*this.width-this.width*this.padding*2/100)/j.width,X=(1*this.height-this.height*this.padding*2/100)/j.height;J=Math.min(ie,X)}return J},k.prototype.getTextPosition=function(j){var J=this.textElement.getBBox(),ie=0,X=0;return J.width>0&&J.height>0&&(ie=(this.width-J.width*j)/2,X=this.height/2-J.height*j/2),{x:ie,y:X}},k.prototype.sizeText=function(){var j=this.textElement.getBBox(),J=this.getTextScale(),ie=this.getTextPosition(J);ie.y-=j.y*J,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ie.x+"px, "+ie.y+"px) scale("+J+", "+J+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ie.x,ie.y),this.textElement.transform.baseVal.getItem(1).setScale(J,J))},k.prototype.manipulate=function(j){Y.prototype.manipulate.call(this,j),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(j.x-this.pointerDownPoint.x)>5||Math.abs(j.y-this.pointerDownPoint.y)>5)},k.prototype.resize=function(j){Y.prototype.resize.call(this,j),this.isMoved=!0,this.setSize(),this.sizeText()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},k.prototype.pointerUp=function(j){var J=this.state;J==="creating"&&(this._suppressMarkerCreateEvent=!0),Y.prototype.pointerUp.call(this,j),this.setSize(),(J==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},k.prototype.showTextEditor=function(){var j=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(J){J.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var J=Number.parseFloat(j.textEditor.style.fontSize);j.textEditor.clientWidth>=Number.parseInt(j.textEditor.style.maxWidth)&&J>.9;)J-=.1,j.textEditor.style.fontSize=Math.max(J,.9)+"em"}),this.textEditor.addEventListener("keyup",function(J){J.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(J){if(J.clipboardData){var ie=J.clipboardData.getData("text"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(ie)),J.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){j.textEditDivClicked(j.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},k.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var j=this.getTextScale(),J=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ie=this.textElement.getBBox(),X={x:ie.width*j,y:ie.height*j};J.x-=X.x/2,J.y-=X.y/2,this.textEditor.style.top=J.y+"px",this.textEditor.style.left=J.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-J.x+"px",this.textEditor.style.fontSize=Math.max(16*j,12)+"px",this.textElement.style.display="none"}},k.prototype.textEditDivClicked=function(j){this.text=j.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},k.prototype.select=function(){Y.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},k.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Y.prototype.deselect.call(this)},k.prototype.dblClick=function(j,J){Y.prototype.dblClick.call(this,j,J),this.showTextEditor()},k.prototype.setColor=function(j){this.textElement&&O.setAttributes(this.textElement,[["fill",j]]),this.color=j,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(j)},k.prototype.setFont=function(j){this.textElement&&O.setAttributes(this.textElement,[["font-family",j]]),this.fontFamily=j,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},k.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},k.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){var J=j;this.color=J.color,this.fontFamily=J.fontFamily,this.padding=J.padding,this.text=J.text,this.createVisual(),Y.prototype.restoreState.call(this,j),this.setSize()},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.setSize(),this.sizeText(),this.positionTextEditor()},k.typeName="TextMarker",k.title="Text marker",k.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>',k}(w),b=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=ie.defaultColor,X.lineWidth=ie.defaultStrokeWidth,X.pixelRatio=ie.freehandPixelRatio,X.setColor=X.setColor.bind(X),X.addCanvas=X.addCanvas.bind(X),X.finishCreation=X.finishCreation.bind(X),X.setLineWidth=X.setLineWidth.bind(X),X.colorPanel=new d("Color",ie.defaultColorSet,ie.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new x("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.drawingImage)},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var j=O.createTransform();this.visual.transform.baseVal.appendItem(j),this.addMarkerVisualToContainer(this.visual)},k.prototype.pointerDown=function(j,J){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(j.x,j.y),this.drawing=!0):Y.prototype.pointerDown.call(this,j,J)},k.prototype.manipulate=function(j){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(j.x,j.y),this.canvasContext.stroke()):Y.prototype.manipulate.call(this,j)},k.prototype.resize=function(j){Y.prototype.resize.call(this,j),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},k.prototype.pointerUp=function(j){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Y.prototype.pointerUp.call(this,j)},k.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},k.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.select.call(this)},k.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Y.prototype.deselect.call(this)},k.prototype.finishCreation=function(){for(var j=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),J=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ie=J[0],X=J[1],ve=J[2],Ie=J[3],Ue=!1,pe=0;pe<this.canvasElement.height;pe++)for(var _e=0;_e<this.canvasElement.width;_e++)j.data[pe*this.canvasElement.width*4+4*_e+3]>0&&(Ue=!0,pe<X&&(X=pe),_e<ie&&(ie=_e),pe>Ie&&(Ie=pe),_e>ve&&(ve=_e));if(Ue){this.left=ie/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(ve-ie)/this.pixelRatio,this.height=(Ie-X)/this.pixelRatio;var Ae=document.createElement("canvas");Ae.width=ve-ie,Ae.height=Ie-X,Ae.getContext("2d").putImageData(this.canvasContext.getImageData(ie,X,ve-ie,Ie-X),0,0),this.drawingImgUrl=Ae.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},k.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},k.prototype.setColor=function(j){this.color=j,this.colorChanged(j)},k.prototype.setLineWidth=function(j){this.lineWidth=j},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({drawingImgUrl:this.drawingImgUrl},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){this.createVisual(),Y.prototype.restoreState.call(this,j),this.drawingImgUrl=j.drawingImgUrl,this.setDrawingImage()},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.setDrawingImage()},k.typeName="FreehandMarker",k.title="Freehand marker",k.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>',k}(w),y=function(Y){function k(j,J,ie){var X=Y.call(this,j,ie||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return X.typeBoxes=[],X.currentType=J,X.setCurrentType=X.setCurrentType.bind(X),X}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2";for(var ie=function(Ie){var Ue="both";switch(Ie){case 0:Ue="both";break;case 1:Ue="start";break;case 2:Ue="end";break;case 3:Ue="none"}var pe=document.createElement("div");if(pe.style.display="flex",pe.style.flexGrow="2",pe.style.alignItems="center",pe.style.justifyContent="space-between",pe.style.padding="5px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderColor=Ue===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){j.setCurrentType(Ue,pe)}),J.appendChild(pe),Ue==="both"||Ue==="start"){var _e=document.createElement("div");_e.style.display="flex",_e.style.alignItems="center",_e.style.minHeight="20px",_e.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,_e.style.marginLeft="5px",pe.appendChild(_e)}var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.alignItems="center",Ae.style.minHeight="20px",Ae.style.flexGrow="2";var De=document.createElement("hr");if(De.style.minWidth="20px",De.style.border="0px",De.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),De.style.flexGrow="2",Ae.appendChild(De),pe.appendChild(Ae),Ue==="both"||Ue==="end"){var je=document.createElement("div");je.style.display="flex",je.style.alignItems="center",je.style.minHeight="20px",je.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,je.style.marginRight="5px",pe.appendChild(je)}X.typeBoxes.push(pe)},X=this,ve=0;ve<4;ve++)ie(ve);return J},k.prototype.setCurrentType=function(j,J){var ie=this;this.currentType=j,this.typeBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings!==void 0?ie.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},k}(s),M=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.arrowType="end",X.arrowBaseHeight=10,X.arrowBaseWidth=10,X.getArrowPoints=X.getArrowPoints.bind(X),X.setArrowType=X.setArrowType.bind(X),X.arrowTypePanel=new y("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.arrow1&&j!==this.arrow2)},k.prototype.getArrowPoints=function(j,J){var ie=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return j-ie/2+","+(J+X/2)+" "+j+","+(J-X/2)+" "+(j+ie/2)+","+(J+X/2)},k.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow2)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.arrow1.transform.baseVal.getItem(0);J.setRotate(j,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(J,0);var ie=this.arrow2.transform.baseVal.getItem(0);ie.setRotate(j+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ie,0)}},k.prototype.setArrowType=function(j){this.arrowType=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({arrowType:this.arrowType},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j);var J=j;this.arrowType=J.arrowType,this.createTips(),this.adjustVisual()},k.typeName="ArrowMarker",k.title="Arrow marker",k.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',k}(m),B=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.fillColor=ie.defaultFillColor,X.strokeWidth=0,X.fillPanel=new d("Color",ie.defaultColorSet,ie.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Y.prototype.getState.call(this);return j.typeName=k.typeName,j},k.typeName="CoverMarker",k.title="Cover marker",k.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',k}(T),R=function(Y){function k(j,J,ie,X){var ve=Y.call(this,j,X||'<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 ve.opacities=[],ve.opacityBoxes=[],ve.opacities=J,ve.currentOpacity=ie,ve.setCurrentOpacity=ve.setCurrentOpacity.bind(ve),ve}return z(k,Y),k.prototype.getUi=function(){var j=this,J=document.createElement("div");return J.style.display="flex",J.style.overflow="hidden",J.style.flexGrow="2",J.style.justifyContent="space-between",this.opacities.forEach(function(ie){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="center",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=ie===j.currentOpacity?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentOpacity(ie,X)}),J.appendChild(X);var ve=document.createElement("div");ve.innerText=100*ie+"%",X.appendChild(ve),j.opacityBoxes.push(X)}),J},k.prototype.setCurrentOpacity=function(j,J){var ie=this;this.currentOpacity=j,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===J?ie.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},k}(s),H=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=ie.defaultHighlightColor,X.strokeWidth=0,X.opacity=ie.defaultHighlightOpacity,X.fillPanel=new d("Color",ie.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new R("Opacity",ie.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return z(k,Y),k.prototype.setOpacity=function(j){this.opacity=j,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Y.prototype.getState.call(this);return j.typeName=k.typeName,j},k.typeName="HighlightMarker",k.title="Highlight marker",k.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>',k}(B),N='<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>',C=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.bgColor="transparent",X.tipPosition={x:0,y:0},X.tipBase1Position={x:0,y:0},X.tipBase2Position={x:0,y:0},X.tipMoving=!1,X.color=ie.defaultStrokeColor,X.bgColor=ie.defaultFillColor,X.fontFamily=ie.defaultFontFamily,X.defaultSize={x:100,y:30},X.setBgColor=X.setBgColor.bind(X),X.getTipPoints=X.getTipPoints.bind(X),X.positionTip=X.positionTip.bind(X),X.setTipPoints=X.setTipPoints.bind(X),X.colorPanel=new d("Text color",ie.defaultColorSet,X.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>'),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new d("Fill color",ie.defaultColorSet,X.bgColor,N),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new f("Font",ie.defaultFontFamilies,ie.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new r,X.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return z(k,Y),k.prototype.ownsTarget=function(j){return Y.prototype.ownsTarget.call(this,j)||this.tipGrip.ownsTarget(j)||this.tip===j},k.prototype.createTip=function(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},k.prototype.pointerDown=function(j,J){this.state==="new"&&Y.prototype.pointerDown.call(this,j,J),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(J)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Y.prototype.pointerDown.call(this,j,J)},k.prototype.pointerUp=function(j){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Y.prototype.pointerUp.call(this,j);else{var J=this.state==="creating";Y.prototype.pointerUp.call(this,j),this.setTipPoints(J),this.positionTip()}},k.prototype.manipulate=function(j){if(this.tipMoving){var J=this.unrotatePoint(j);this.tipPosition={x:J.x-this.manipulationStartLeft,y:J.y-this.manipulationStartTop},this.positionTip()}else Y.prototype.manipulate.call(this,j)},k.prototype.setBgColor=function(j){this.bgRectangle&&this.tip&&(O.setAttributes(this.bgRectangle,[["fill",j]]),O.setAttributes(this.tip,[["fill",j]])),this.bgColor=j,this.fillColorChanged(j)},k.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},k.prototype.setTipPoints=function(j){j===void 0&&(j=!1);var J=Math.min(this.height/2,15),ie=this.height/5;j&&(this.tipPosition={x:J+ie/2,y:this.height+20});var X=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:J,y:0},this.tipBase2Position={x:J+ie,y:0}):(this.tipBase1Position={x:0,y:J},this.tipBase2Position={x:0,y:J+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-J-ie,y:0},this.tipBase2Position={x:this.width-J,y:0}):(this.tipBase1Position={x:this.width,y:J},this.tipBase2Position={x:this.width,y:J+ie}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?X<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ie=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-J-ie,y:this.height},this.tipBase2Position={x:this.width-J,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-J-ie},this.tipBase2Position={x:this.width,y:this.height-J}):X<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ie=this.width/5,J=Math.min(this.width/2,15),this.tipBase1Position={x:J,y:this.height},this.tipBase2Position={x:J+ie,y:this.height}):(this.tipBase1Position={x:0,y:this.height-J},this.tipBase2Position={x:0,y:this.height-J-ie})},k.prototype.resize=function(j){Y.prototype.resize.call(this,j),this.positionTip()},k.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var j=this.tipGrip.visual.transform.baseVal.getItem(0);j.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(j,0)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.positionTip(),Y.prototype.select.call(this)},k.prototype.getState=function(){var j=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){var J=j;this.bgColor=J.bgColor,this.tipPosition=J.tipPosition,Y.prototype.restoreState.call(this,j),this.createTip(),this.setTipPoints()},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.tipPosition={x:this.tipPosition.x*j,y:this.tipPosition.y*J},this.positionTip()},k.typeName="CalloutMarker",k.title="Callout marker",k.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>',k}(S),K=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.strokeColor=ie.defaultColor,X.strokeWidth=ie.defaultStrokeWidth,X.strokeDasharray=ie.defaultStrokeDasharray,X.fillColor=ie.defaultFillColor,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.setOpacity=X.setOpacity.bind(X),X.createVisual=X.createVisual.bind(X),X.strokePanel=new d("Line color",U(ie.defaultColorSet,["transparent"]),ie.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.fillPanel=new d("Fill color",U(ie.defaultColorSet,["transparent"]),X.fillColor,N),X.fillPanel.onColorChanged=X.setFillColor,X.strokeWidthPanel=new x("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X.opacityPanel=new R("Opacity",ie.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.visual)},k.prototype.createVisual=function(){this.visual=O.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)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},k.prototype.manipulate=function(j){Y.prototype.manipulate.call(this,j)},k.prototype.resize=function(j){Y.prototype.resize.call(this,j),this.setSize()},k.prototype.setSize=function(){Y.prototype.setSize.call(this),O.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},k.prototype.pointerUp=function(j){Y.prototype.pointerUp.call(this,j),this.setSize()},k.prototype.setStrokeColor=function(j){this.strokeColor=j,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(j),this.stateChanged()},k.prototype.setFillColor=function(j){this.fillColor=j,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(j),this.stateChanged()},k.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},k.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},k.prototype.setOpacity=function(j){this.opacity=j,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){var J=j;this.fillColor=J.fillColor,this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.opacity=J.opacity,this.createVisual(),Y.prototype.restoreState.call(this,j),this.setSize()},k.prototype.scale=function(j,J){Y.prototype.scale.call(this,j,J),this.setSize()},k.typeName="EllipseMarker",k.title="Ellipse marker",k.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>',k}(w),Z=function(Y){function k(j,J,ie){return Y.call(this,j,J,ie)||this}return z(k,Y),Object.defineProperty(k.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.tip1&&j!==this.tip2)},k.prototype.createTips=function(){this.tip1=O.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(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.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(O.createTransform()),this.visual.appendChild(this.tip2)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.state==="creating"&&this.createTips()},k.prototype.adjustVisual=function(){if(Y.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.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()]]),O.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 j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),J=this.tip1.transform.baseVal.getItem(0);J.setRotate(j,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(J,0);var ie=this.tip2.transform.baseVal.getItem(0);ie.setRotate(j+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ie,0)}},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Y.prototype.getState.call(this);return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j),this.createTips(),this.adjustVisual()},k.typeName="MeasurementMarker",k.title="Measurement marker",k.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>',k}(m),oe=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.strokePanel.colors=ie.defaultColorSet,X.fillColor="transparent",X}return z(k,Y),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Y.prototype.getState.call(this);return j.typeName=k.typeName,j},k.typeName="EllipseFrameMarker",k.title="Ellipse frame marker",k.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>',k}(K),fe=function(){function Y(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Y.prototype.addUndoStep=function(k){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(k)||(this.undoStack.push(k),JSON.stringify(this.lastRedoStep)!==JSON.stringify(k)&&this.redoStack.splice(0,this.redoStack.length))},Y.prototype.replaceLastUndoStep=function(k){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=k)},Y.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Y.prototype.undo=function(){if(this.undoStack.length>1){var k=this.undoStack.pop();return k!==void 0&&this.redoStack.push(k),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Y.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Y}(),xe=function(Y){function k(j,J,ie){var X=Y.call(this,j,J,ie)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.curveX=0,X.curveY=0,X.manipulationStartCurveX=0,X.manipulationStartCurveY=0,X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.positionGrips=X.positionGrips.bind(X),X.addControlGrips=X.addControlGrips.bind(X),X.adjustVisual=X.adjustVisual.bind(X),X.setupControlBox=X.setupControlBox.bind(X),X.resize=X.resize.bind(X),X.strokeColor=ie.defaultColor,X.strokeWidth=ie.defaultStrokeWidth,X.strokeDasharray=ie.defaultStrokeDasharray,X.strokePanel=new d("Line color",ie.defaultColorSet,ie.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new x("Line width",ie.defaultStrokeWidths,ie.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new L("Line style",ie.defaultStrokeDasharrays,ie.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return z(k,Y),k.prototype.ownsTarget=function(j){return!(!Y.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorCurve&&j!==this.visibleCurve&&!this.curveGrip.ownsTarget(j))},k.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},k.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.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)},k.prototype.pointerDown=function(j,J){Y.prototype.pointerDown.call(this,j,J),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=j.x,this.curveY=j.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(J)&&(this.activeGrip=this.curveGrip,this._state="resize")},k.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},k.prototype.setupControlBox=function(){Y.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.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)},k.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Y.prototype.addControlGrips.call(this)},k.prototype.positionGrips=function(){Y.prototype.positionGrips.call(this);var j=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-j/2,this.curveY-j/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()))},k.prototype.manipulate=function(j){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+j.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+j.y-this.manipulationStartY),Y.prototype.manipulate.call(this,j)},k.prototype.resize=function(j){this.activeGrip===this.curveGrip&&(this.curveX=j.x,this.curveY=j.y),Y.prototype.resize.call(this,j),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},k.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},k.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},k.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual()},k.prototype.scale=function(j,J){this.curveX=this.curveX*j,this.curveY=this.curveY*J,Y.prototype.scale.call(this,j,J)},Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),k.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Y.prototype.getState.call(this));return j.typeName=k.typeName,j},k.prototype.restoreState=function(j){Y.prototype.restoreState.call(this,j);var J=j;this.strokeColor=J.strokeColor,this.strokeWidth=J.strokeWidth,this.strokeDasharray=J.strokeDasharray,this.curveX=J.curveX,this.curveY=J.curveY,this.createVisual(),this.adjustVisual()},k.typeName="CurveMarker",k.title="Curve marker",k.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>',k}(_),be=function(){function Y(k,j){j===void 0&&(j=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=k,this.cancelable=j}return Object.defineProperty(Y.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Y.prototype.preventDefault=function(){this._defaultPrevented=!0},Y}(),Te=function(Y){function k(j,J,ie){var X=Y.call(this,j,!1)||this;return X.dataUrl=J,X.state=ie,X}return z(k,Y),k}(be),Ce=function(Y){function k(j,J,ie){ie===void 0&&(ie=!1);var X=Y.call(this,j,ie)||this;return X.marker=J,X}return z(k,Y),k}(be),Le=function(){function Y(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Y.prototype.addEventListener=function(k,j){this[k].push(j)},Y.prototype.removeEventListener=function(k,j){var J=this[k].indexOf(j);J>-1&&this[k].splice(J,1)},Y}(),ge=function(){function Y(k){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new E,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=Y.instanceCounter++,this.styles=new I(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=k,this.targetRoot=document.body,this.width=k.clientWidth,this.height=k.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Y.prototype,"ALL_MARKER_TYPES",{get:function(){return[A,b,M,S,oe,K,H,C,Z,B,m,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[A,b,M,S,K,H,C]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"BASIC_MARKER_TYPES",{get:function(){return[A,b,M,S,H]},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(k){var j=this;this._availableMarkerTypes.splice(0),k.forEach(function(J){if(typeof J=="string"){var ie=j.ALL_MARKER_TYPES.find(function(X){return X.typeName===J});ie!==void 0&&j._availableMarkerTypes.push(ie)}else j._availableMarkerTypes.push(J)})},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(k){this._zoomLevel=k,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Y.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Y.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),G.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Y.prototype.show=function(){var k=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(j){return j(new be(k))})},Y.prototype.render=function(){return D(this,void 0,void 0,function(){var k;return V(this,function(j){switch(j.label){case 0:return this.setCurrentMarker(),(k=new W).naturalSize=this.renderAtNaturalSize,k.imageType=this.renderImageType,k.imageQuality=this.renderImageQuality,k.markersOnly=this.renderMarkersOnly,k.width=this.renderWidth,k.height=this.renderHeight,[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return j.sent(),[4,k.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,j.sent()]}})})},Y.prototype.close=function(k){var j=this;if(k===void 0&&(k=!1),this.isOpen){var J=!1;k||this.eventListeners.beforeclose.forEach(function(ie){var X=new be(j,!0);ie(X),X.defaultPrevented&&(J=!0)}),J||(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(ie){return ie(new be(j))}),this.detachEvents(),this._isOpen=!1)}},Y.prototype.addMarkersToToolbar=function(){for(var k,j=[],J=0;J<arguments.length;J++)j[J]=arguments[J];(k=this._availableMarkerTypes).push.apply(k,j)},Y.prototype.addRenderEventListener=function(k){this.addEventListener("render",function(j){k(j.dataUrl,j.state)})},Y.prototype.removeRenderEventListener=function(k){},Y.prototype.addCloseEventListener=function(k){this.addEventListener("close",function(){k()})},Y.prototype.removeCloseEventListener=function(k){},Y.prototype.setupResizeObserver=function(){var k=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){k.resize(k.target.clientWidth,k.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return k.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Y.prototype.onPopupTargetResize=function(){var k=1*this.target.clientWidth/this.target.clientHeight,j=this.editorCanvas.clientWidth/k>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*k:this.editorCanvas.clientWidth,J=j<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/k;this.resize(j,J)},Y.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Y.prototype.resize=function(k,j){this._isResizing=!0;var J=k/this.imageWidth,ie=j/this.imageHeight;this.imageWidth=Math.round(k),this.imageHeight=Math.round(j),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(J,ie),this._isResizing=!1},Y.prototype.scaleMarkers=function(k,j){var J,ie=this;this._currentMarker&&this._currentMarker instanceof S?this._currentMarker.scale(k,j):(J=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(X){X!==ie._currentMarker&&X.scale(k,j)}),J!==void 0&&this.setCurrentMarker(J)},Y.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"},Y.prototype.setTopLeft=function(){var k=this.editingTarget.getBoundingClientRect(),j=this.editorCanvas.getBoundingClientRect();this.left=k.left-j.left,this.top=k.top-j.top},Y.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)},Y.prototype.addDefs=function(){for(var k,j=[],J=0;J<arguments.length;J++)j[J]=arguments[J];this.defs=O.createDefs(),this.addDefsToImage(),(k=this.defs).append.apply(k,j)},Y.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Y.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)},Y.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Y.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Y.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)},Y.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Y.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)},Y.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 k=document.createElement("a");k.href="https://markerjs.com/",k.target="_blank",k.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>',k.title="Powered by marker.js",k.style.display="grid",k.style.alignItems="center",k.style.justifyItems="center",k.style.padding="3px",k.style.width="20px",k.style.height="20px",this.logoUI.appendChild(k),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Y.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Y.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Y.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Y.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var k=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=k+"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 h(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 c(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Y.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Y.prototype.removeMarker=function(k){this.markerImage.removeChild(k.container),this.markers.indexOf(k)>-1&&this.markers.splice(this.markers.indexOf(k),1),k.dispose()},Y.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Y.prototype.toolbarButtonClicked=function(k,j){if(k==="marker"&&j!==void 0)this.createNewMarker(j);else if(k==="action")switch(j){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Y.prototype.deleteSelectedMarker=function(){var k=this;if(this._currentMarker!==void 0){var j=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ie){var X=new Ce(k,k._currentMarker,!0);ie(X),X.defaultPrevented&&(j=!0)}),!j){var J=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(ie){return ie(new Ce(k,J))})}}},Y.prototype.clear=function(){var k=this,j=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ve){var Ie=new Ce(k,void 0,!0);ve(Ie),Ie.defaultPrevented&&(j=!0)}),!j)){this.setCurrentMarker();for(var J=function(ve){var Ie=ie.markers[ve];ie.setCurrentMarker(ie.markers[ve]),ie._currentMarker.dispose(),ie.markerImage.removeChild(ie._currentMarker.container),ie.markers.splice(ie.markers.indexOf(ie._currentMarker),1),ie.eventListeners.markerdelete.forEach(function(Ue){return Ue(new Ce(k,Ie))})},ie=this,X=this.markers.length-1;X>=0;X--)J(X);this.addUndoStep()}},Object.defineProperty(Y.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Y.prototype.showNotesEditor=function(){var k;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=(k=this._currentMarker.notes)!==null&&k!==void 0?k:"",this.overlayContainer.appendChild(this.notesArea))},Y.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Y.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Y.prototype.addUndoStep=function(){var k=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var j=this.getState(),J=this.undoRedoManager.getLastUndoStep();if(!J||J.width===j.width&&J.height===j.height){var ie=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(j),ie<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(X){return X(new be(k))})}else this.undoRedoManager.replaceLastUndoStep(j),this.eventListeners.statechange.forEach(function(X){return X(new be(k))})}},Y.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Y.prototype.undoStep=function(){var k=this,j=this.undoRedoManager.undo();j!==void 0&&(this.restoreState(j),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(J){return J(new be(k))}))},Y.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Y.prototype.redoStep=function(){var k=this,j=this.undoRedoManager.redo();j!==void 0&&(this.restoreState(j),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(J){return J(new be(k))}))},Y.prototype.stepZoom=function(){var k=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=k<this.zoomSteps.length-1?this.zoomSteps[k+1]:this.zoomSteps[0]},Y.prototype.panTo=function(k){this.contentDiv.scrollBy({left:this.prevPanPoint.x-k.x,top:this.prevPanPoint.y-k.y}),this.prevPanPoint=k},Y.prototype.startRenderAndClose=function(){return D(this,void 0,void 0,function(){var k,j,J=this;return V(this,function(ie){switch(ie.label){case 0:return[4,this.render()];case 1:return k=ie.sent(),j=this.getState(),this.eventListeners.render.forEach(function(X){return X(new Te(J,k,j))}),this.close(!0),[2]}})})},Y.prototype.getState=function(k){k===!0&&this.setCurrentMarker();var j={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(J){return j.markers.push(J.getState())}),j},Y.prototype.restoreState=function(k){var j=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);k.markers.forEach(function(J){var ie=j._availableMarkerTypes.find(function(ve){return ve.typeName===J.typeName});if(ie!==void 0){var X=j.addNewMarker(ie);X.restoreState(J),j.markers.push(X)}}),k.width&&k.height&&(k.width!==this.imageWidth||k.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/k.width,this.imageHeight/k.height),this.eventListeners.restorestate.forEach(function(J){return J(new be(j))})},Y.prototype.addNewMarker=function(k){var j=O.createGroup();return this.markerImage.appendChild(j),new k(j,this.overlayContainer,this.settings)},Y.prototype.createNewMarker=function(k){var j,J=this;(j=typeof k=="string"?this._availableMarkerTypes.find(function(ie){return ie.typeName===k}):k)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(j),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(j.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ie){return ie(new Ce(J,J._currentMarker))}))},Y.prototype.markerCreated=function(k){var j=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(k),this.setCurrentMarker(k),k instanceof b&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(b):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(J){return J(new Ce(j,j._currentMarker))})},Y.prototype.colorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=k,this.settings.defaultStrokeColor=k)},Y.prototype.fillColorChanged=function(k){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=k)},Y.prototype.markerStateChanged=function(k){var j=this;this.eventListeners.markerchange.forEach(function(J){return J(new Ce(j,k))})},Y.prototype.setCurrentMarker=function(k){var j=this;this._currentMarker!==k&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(J){return J(new Ce(j,j._currentMarker))})),this._currentMarker=k,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(J){return J(new Ce(j,j._currentMarker))}))},Y.prototype.onPointerDown=function(k){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||k.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var j=this.markers.find(function(J){return J.ownsTarget(k.target)});j!==void 0?(this.setCurrentMarker(j),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:k.clientX,y:k.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(k.clientX,k.clientY))},Y.prototype.onDblClick=function(k){if(this._isFocused||this.focus(),this.mode==="select"){var j=this.markers.find(function(J){return J.ownsTarget(k.target)});j!==void 0&&j!==this._currentMarker&&this.setCurrentMarker(j),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(k.clientX,k.clientY),k.target):this.setCurrentMarker()}},Y.prototype.onPointerMove=function(k){this.touchPoints!==1&&k.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||k.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(k.clientX,k.clientY)):this.zoomLevel>1&&this.panTo({x:k.clientX,y:k.clientY}))},Y.prototype.onPointerUp=function(k){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(k.clientX,k.clientY)),this.isDragging=!1,this.addUndoStep()},Y.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Y.prototype.onKeyUp=function(k){this._currentMarker===void 0||this.notesArea!==void 0||k.key!=="Delete"&&k.key!=="Backspace"||this.deleteSelectedMarker()},Y.prototype.clientToLocalCoordinates=function(k,j){var J=this.markerImage.getBoundingClientRect();return{x:(k-J.left)/this.zoomLevel,y:(j-J.top)/this.zoomLevel}},Y.prototype.onWindowResize=function(){this.positionUI()},Y.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var k=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Y.prototype.addLicenseKey=function(k){G.addKey(k)},Y.prototype.addEventListener=function(k,j){this.eventListeners.addEventListener(k,j)},Y.prototype.removeEventListener=function(k,j){this.eventListeners.removeEventListener(k,j)},Y.prototype.renderState=function(k){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(k),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Y.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Y.prototype.focus=function(){var k=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(j){return j(new be(k))}))},Y.prototype.blur=function(){var k=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(j){return j(new be(k))}))},Y.instanceCounter=0,Y}()},T8No:function(ke,de,P){"use strict";P.d(de,"a",function(){return G}),P.d(de,"e",function(){return W}),P.d(de,"c",function(){return m}),P.d(de,"b",function(){return f}),P.d(de,"d",function(){return S}),P.d(de,"f",function(){return M});var q=P("MNsG"),z=P("N0LK"),D=P("Cg/j");let V=q.k||"";const U=new Map;U.set("false",!1),U.set("true",!0),U.set("isMac",q.f),U.set("isLinux",q.d),U.set("isWindows",q.i),U.set("isWeb",q.h),U.set("isMacNative",q.f&&!q.h),U.set("isEdge",V.indexOf("Edg/")>=0),U.set("isFirefox",V.indexOf("Firefox")>=0),U.set("isChrome",V.indexOf("Chrome")>=0),U.set("isSafari",V.indexOf("Safari")>=0);const O=Object.prototype.hasOwnProperty;class G{static has(R){return p.create(R)}static equals(R,H){return h.create(R,H)}static regex(R,H){return x.create(R,H)}static not(R){return i.create(R)}static and(...R){return E.create(R,null)}static or(...R){return _.create(R,null,!0)}static deserialize(R,H=!1){return R?this._deserializeOrExpression(R,H):void 0}static _deserializeOrExpression(R,H){let N=R.split("||");return _.create(N.map(C=>this._deserializeAndExpression(C,H)),null,!0)}static _deserializeAndExpression(R,H){let N=R.split("&&");return E.create(N.map(C=>this._deserializeOne(C,H)),null)}static _deserializeOne(R,H){if(R=R.trim(),R.indexOf("!=")>=0){let N=R.split("!=");return d.create(N[0].trim(),this._deserializeValue(N[1],H))}if(R.indexOf("==")>=0){let N=R.split("==");return h.create(N[0].trim(),this._deserializeValue(N[1],H))}if(R.indexOf("=~")>=0){let N=R.split("=~");return x.create(N[0].trim(),this._deserializeRegexValue(N[1],H))}if(R.indexOf(" in ")>=0){let N=R.split(" in ");return c.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const N=R.split(">=");return o.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const N=R.split(">");return r.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const N=R.split("<=");return T.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const N=R.split("<");return w.create(N[0].trim(),N[1].trim())}return/^\!\s*/.test(R)?i.create(R.substr(1).trim()):p.create(R)}static _deserializeValue(R,H){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let N=/^'([^']*)'$/.exec(R);return N?N[1].trim():R}static _deserializeRegexValue(R,H){if(Object(z.C)(R)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let N=R.indexOf("/"),C=R.lastIndexOf("/");if(N===C||N<0){if(H)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let K=R.slice(N+1,C),Z=R[C+1]==="i"?"i":"";try{return new RegExp(K,Z)}catch(oe){if(H)throw new Error(`bad regexp-value '${R}', parse error: ${oe}`);return console.warn(`bad regexp-value '${R}', parse error: ${oe}`),null}}}function W(R,H){const N=R?R.substituteConstants():void 0,C=H?H.substituteConstants():void 0;return!N&&!C?!0:!N||!C?!1:N.equals(C)}function n(R,H){return R.cmp(H)}class I{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}I.INSTANCE=new I;class g{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}g.INSTANCE=new g;class p{constructor(R,H){this.key=R,this.negated=H,this.type=2}static create(R,H=null){const N=U.get(R);return typeof N=="boolean"?N?g.INSTANCE:I.INSTANCE:new p(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?g.INSTANCE:I.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class h{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=4}static create(R,H,N=null){if(typeof H=="boolean")return H?p.create(R,N):i.create(R,N);const C=U.get(R);if(typeof C=="boolean"){const K=C?"true":"false";return H===K?g.INSTANCE:I.INSTANCE}return new h(R,H,N)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const H=R?"true":"false";return this.value===H?g.INSTANCE:I.INSTANCE}return this}evaluate(R){return R.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class c{constructor(R,H){this.key=R,this.valueKey=H,this.type=10,this.negated=null}static create(R,H){return new c(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const H=R.getValue(this.valueKey),N=R.getValue(this.key);return Array.isArray(H)?H.indexOf(N)>=0:typeof N=="string"&&typeof H=="object"&&H!==null?O.call(H,N):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=s.create(this)),this.negated}}class s{constructor(R){this._actual=R,this.type=11}static create(R){return new s(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=5}static create(R,H,N=null){if(typeof H=="boolean")return H?i.create(R,N):p.create(R,N);const C=U.get(R);if(typeof C=="boolean"){const K=C?"true":"false";return H===K?I.INSTANCE:g.INSTANCE}return new d(R,H,N)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const H=R?"true":"false";return this.value===H?I.INSTANCE:g.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class i{constructor(R,H){this.key=R,this.negated=H,this.type=3}static create(R,H=null){const N=U.get(R);return typeof N=="boolean"?N?I.INSTANCE:g.INSTANCE:new i(R,H)}cmp(R){return R.type!==this.type?this.type-R.type:b(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?I.INSTANCE:g.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function l(R,H){if(typeof R=="string"){const N=parseFloat(R);isNaN(N)||(R=N)}return typeof R=="string"||typeof R=="number"?H(R):I.INSTANCE}class r{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=12}static create(R,H,N=null){return l(H,C=>new r(R,C,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class o{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=13}static create(R,H,N=null){return l(H,C=>new o(R,C,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class w{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=14}static create(R,H,N=null){return l(H,C=>new w(R,C,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class T{constructor(R,H,N){this.key=R,this.value=H,this.negated=N,this.type=15}static create(R,H,N=null){return l(H,C=>new T(R,C,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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 x{constructor(R,H){this.key=R,this.regexp=H,this.type=7,this.negated=null}static create(R,H){return new x(R,H)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const H=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return H<N?-1:H>N?1:0}equals(R){if(R.type===this.type){const H=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return this.key===R.key&&H===N}return!1}substituteConstants(){return this}evaluate(R){let H=R.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function A(R){let H=null;for(let N=0,C=R.length;N<C;N++){const K=R[N].substituteConstants();if(R[N]!==K&&H===null){H=[];for(let Z=0;Z<N;Z++)H[Z]=R[Z]}H!==null&&(H[N]=K)}return H===null?R:H}class E{constructor(R,H){this.expr=R,this.negated=H,this.type=6}static create(R,H){return E._normalizeArr(R,H)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let H=0,N=this.expr.length;H<N;H++){const C=n(this.expr[H],R.expr[H]);if(C!==0)return C}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let H=0,N=this.expr.length;H<N;H++)if(!this.expr[H].equals(R.expr[H]))return!1;return!0}return!1}substituteConstants(){const R=A(this.expr);return R===this.expr?this:E.create(R,this.negated)}evaluate(R){for(let H=0,N=this.expr.length;H<N;H++)if(!this.expr[H].evaluate(R))return!1;return!0}static _normalizeArr(R,H){const N=[];let C=!1;for(const K of R){if(!K)continue;if(K.type===1){C=!0;continue}if(K.type===0)return I.INSTANCE;if(K.type===6){N.push(...K.expr);continue}N.push(K)}if(N.length===0&&C)return g.INSTANCE;if(N.length===0)return;if(N.length===1)return N[0];N.sort(n);for(let K=1;K<N.length;K++)N[K-1].equals(N[K])&&(N.splice(K,1),K--);if(N.length===1)return N[0];for(;N.length>1;){const K=N[N.length-1];if(K.type!==9)break;N.pop();const Z=N.pop(),oe=N.length===0,fe=_.create(K.expr.map(xe=>E.create([xe,Z],null)),null,oe);fe&&(N.push(fe),N.sort(n))}return N.length===1?N[0]:new E(N,H)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let H of this.expr)R.push(...H.keys());return R}negate(){if(!this.negated){const R=[];for(let H of this.expr)R.push(H.negate());this.negated=_.create(R,this,!0)}return this.negated}}class _{constructor(R,H){this.expr=R,this.negated=H,this.type=9}static create(R,H,N){return _._normalizeArr(R,H,N)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let H=0,N=this.expr.length;H<N;H++){const C=n(this.expr[H],R.expr[H]);if(C!==0)return C}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let H=0,N=this.expr.length;H<N;H++)if(!this.expr[H].equals(R.expr[H]))return!1;return!0}return!1}substituteConstants(){const R=A(this.expr);return R===this.expr?this:_.create(R,this.negated,!1)}evaluate(R){for(let H=0,N=this.expr.length;H<N;H++)if(this.expr[H].evaluate(R))return!0;return!1}static _normalizeArr(R,H,N){let C=[],K=!1;if(R){for(let Z=0,oe=R.length;Z<oe;Z++){const fe=R[Z];if(!fe)continue;if(fe.type===0){K=!0;continue}if(fe.type===1)return g.INSTANCE;if(fe.type===9){C=C.concat(fe.expr);continue}C.push(fe)}if(C.length===0&&K)return I.INSTANCE;C.sort(n)}if(C.length===0)return;if(C.length===1)return C[0];for(let Z=1;Z<C.length;Z++)C[Z-1].equals(C[Z])&&(C.splice(Z,1),Z--);if(C.length===1)return C[0];if(N){for(let Z=0;Z<C.length;Z++)for(let oe=Z+1;oe<C.length;oe++)M(C[Z],C[oe])&&(C.splice(oe,1),oe--);if(C.length===1)return C[0]}return new _(C,H)}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let H of this.expr)R.push(...H.keys());return R}negate(){if(!this.negated){let R=[];for(let H of this.expr)R.push(H.negate());for(;R.length>1;){const H=R.shift(),N=R.shift(),C=[];for(const Z of B(H))for(const oe of B(N))C.push(E.create([Z,oe],null));const K=R.length===0;R.unshift(_.create(C,null,K))}this.negated=R[0]}return this.negated}}class m extends p{constructor(R,H,N){super(R,null);this._defaultValue=H,typeof N=="object"?m._info.push(Object.assign(Object.assign({},N),{key:R})):N!==!0&&m._info.push({key:R,description:N,type:H!=null?typeof H:void 0})}static all(){return m._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return h.create(this.key,R)}}m._info=[];const f=Object(D.c)("contextKeyService"),S="setContext";function b(R,H){return R<H?-1:R>H?1:0}function y(R,H,N,C){return R<N?-1:R>N?1:H<C?-1:H>C?1:0}function M(R,H){if(H.type===6&&R.type!==9&&R.type!==6){for(const K of H.expr)if(R.equals(K))return!0}const N=R.negate(),C=B(N).concat(B(H));C.sort(n);for(let K=0;K<C.length;K++){const Z=C[K],oe=Z.negate();for(let fe=K+1;fe<C.length;fe++){const xe=C[fe];if(oe.equals(xe))return!0}}return!1}function B(R){return R.type===9?R.expr:[R]}},TXwP:function(ke,de,P){var q,z;(function(){var D;(function(){"use strict";var U=[,,function(n){function I(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=[]}I.prototype.clone_empty=function(){var h=new I(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},I.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},I.prototype.has_match=function(h){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(h))return!0;return!1},I.prototype.set_indent=function(h,c){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.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},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(h){this.__items.push(h);var c=h.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=h.length-c:this.__character_count+=h.length},I.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.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,c){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)),c=c||"",h.indent_level>0&&(c=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}g.prototype.get_indent_size=function(h,c){var s=this.__base_string_length;return c=c||0,h<0&&(s=0),s+=h*this.__indent_size,s+=c,s},g.prototype.get_indent_string=function(h,c){var s=this.__base_string;return c=c||0,h<0&&(h=0,s=""),c+=h*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},g.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var h=this.__cache.length,c=0,s="";this.__indent_size&&h>=this.__indent_size&&(c=Math.floor(h/this.__indent_size),h-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),h&&(s+=new Array(h+1).join(" ")),this.__cache.push(s)};function p(h,c){this.__indent_cache=new g(h,c),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 I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(h,c){return this.__indent_cache.get_indent_string(h,c)},p.prototype.get_indent_size=function(h,c){return this.__indent_cache.get_indent_size(h,c)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(h){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return h!==`
|
|
`&&(s=s.replace(/[\n]/g,h)),s},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(h,c){return h=h||0,c=c||0,this.next_line.set_indent(h,c),this.__lines.length>1?(this.current_line.set_indent(h,c),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(h){for(var c=0;c<h.newlines;c++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(h){for(var c=this.__lines.length;h<c;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(h,c){for(var s=this.__lines.length-2;s>=0;){var d=this.__lines[s];if(d.is_empty())break;if(d.item(0).indexOf(h)!==0&&d.item(-1)!==c){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},n.exports.Output=p},,,,function(n){function I(h,c){this.raw_options=g(h,c),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"])}I.prototype._get_array=function(h,c){var s=this.raw_options[h],d=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(d=s.concat()):typeof s=="string"&&(d=s.split(/[^a-zA-Z0-9_\/\-]+/)),d},I.prototype._get_boolean=function(h,c){var s=this.raw_options[h],d=s===void 0?!!c:!!s;return d},I.prototype._get_characters=function(h,c){var s=this.raw_options[h],d=c||"";return typeof s=="string"&&(d=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),d},I.prototype._get_number=function(h,c){var s=this.raw_options[h];c=parseInt(c,10),isNaN(c)&&(c=0);var d=parseInt(s,10);return isNaN(d)&&(d=c),d},I.prototype._get_selection=function(h,c,s){var d=this._get_selection_list(h,c,s);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d[0]},I.prototype._get_selection_list=function(h,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var d=this._get_array(h,s);if(!this._is_valid_selection(d,c))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[h]+"'");return d},I.prototype._is_valid_selection=function(h,c){return h.length&&c.length&&!h.some(function(s){return c.indexOf(s)===-1})};function g(h,c){var s={};h=p(h);var d;for(d in h)d!==c&&(s[d]=h[d]);if(c&&h[c])for(d in h[c])s[d]=h[c][d];return s}function p(h){var c={},s;for(s in h){var d=s.replace(/-/g,"_");c[d]=h[s]}return c}n.exports.Options=I,n.exports.normalizeOpts=p,n.exports.mergeOpts=g},,function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",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 p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},g.prototype.peek=function(p){var h=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(h=this.__input.charAt(p)),h},g.prototype.__match=function(p,h){p.lastIndex=h;var c=p.exec(this.__input);return c&&!(I&&p.sticky)&&(c.index!==h&&(c=null)),c},g.prototype.test=function(p,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(p,h):!1},g.prototype.testChar=function(p,h){var c=this.peek(h);return p.lastIndex=0,c!==null&&p.test(c)},g.prototype.match=function(p){var h=this.__match(p,this.__position);return h?this.__position+=h[0].length:h=null,h},g.prototype.read=function(p,h,c){var s="",d;return p&&(d=this.match(p),d&&(s+=d[0])),h&&(d||!p)&&(s+=this.readUntil(h,c)),s},g.prototype.readUntil=function(p,h){var c="",s=this.__position;p.lastIndex=this.__position;var d=p.exec(this.__input);return d?(s=d.index,h&&(s+=d[0].length)):s=this.__input_length,c=this.__input.substring(this.__position,s),this.__position=s,c},g.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},g.prototype.get_regexp=function(p,h){var c=null,s="g";return h&&I&&(s="y"),typeof p=="string"&&p!==""?c=new RegExp(p,s):p&&(c=new RegExp(p.source,s)),c},g.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(p){var h=this.__position,c=this.readUntilAfter(p);return this.__position=h,c},g.prototype.lookBack=function(p){var h=this.__position-1;return h>=p.length&&this.__input.substring(h-p.length,h).toLowerCase()===p},n.exports.InputScanner=g},,,,,function(n){function I(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}I.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(g);h;)p[h[1]]=h[2],h=this.__directive_pattern.exec(g);return p},I.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,g){var p=g(16).Beautifier,h=g(17).Options;function c(s,d){var i=new p(s,d);return i.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new h}},function(n,I,g){var p=g(17).Options,h=g(2).Output,c=g(8).InputScanner,s=g(13).Directives,d=new s(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,r=/\s/,o=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(L,A){this._source_text=L||"",this._options=new p(A),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"]}x.prototype.eatString=function(L){var A="";for(this._ch=this._input.next();this._ch;){if(A+=this._ch,this._ch==="\\")A+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return A},x.prototype.eatWhitespace=function(L){for(var A=r.test(this._input.peek()),E=0;r.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
|
|
`&&((E===0||E<this._options.max_preserve_newlines)&&(E++,this._output.add_new_line(!0)));return A},x.prototype.foundNestedPseudoClass=function(){for(var L=0,A=1,E=this._input.peek(A);E;){if(E==="{")return!0;if(E==="(")L+=1;else if(E===")"){if(L===0)return!1;L-=1}else if(E===";"||E==="}")return!1;A++,E=this._input.peek(A)}return!1},x.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},x.prototype.preserveSingleSpace=function(L){L&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,A=this._options.eol;A==="auto"&&(A=`
|
|
`,L&&i.test(L||"")&&(A=L.match(i)[0])),L=L.replace(l,`
|
|
`);var E=L.match(/^[\t ]*/)[0];this._output=new h(this._options,E),this._input=new c(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,m=!1,f=!1,S=!1,b=!1,y=!1,M=!1,B=this._ch,R=!1,H,N,C;H=this._input.read(o),N=H!=="",C=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var K=this._input.read(w),Z=d.get_directives(K);Z&&Z.ignore==="start"&&(K+=d.readIgnored(this._input)),this.print_string(K),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(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(N),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"&&(y=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!m&&_===0&&oe.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(N),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),S?(S=!1,m=this._indentLevel>=this._nestedLevel):m=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&m&&(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)):(C==="("?this._output.space_before_token=!1:C!==","&&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(),C==="{"&&this._output.trim(!0),y=!1,b=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),m=!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])){R=!0;break}(m||S)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&_===0?(this.print_string(":"),f||(f=!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 xe=C==='"'||C==="'";this.preserveSingleSpace(xe||N),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,_===0?(f&&(this.outdent(),f=!1),b=!1,y=!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(),_++,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(")")),_&&(_--,this.outdent()));else{var be=!1;this._input.lookBack("with")&&(be=!0),this.preserveSingleSpace(N||be),this.print_string(this._ch),f&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!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&&(!f||M)&&_===0&&!y&&!b?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&_===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&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(N),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Te=C==='"'||C==="'";this.preserveSingleSpace(Te||N),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&R&&this._output.add_new_line()}var Ce=this._output.get_code(A);return Ce},n.exports.Beautifier=x},function(n,I,g){var p=g(6).Options;function h(c){p.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<d.length;i++)d[i]!=="expand"?this.brace_style="collapse":this.brace_style=d[i]}h.prototype=new p,n.exports.Options=h}],O={};function G(n){var I=O[n];if(I!==void 0)return I.exports;var g=O[n]={exports:{}};return U[n](g,g.exports,G),g.exports}var W=G(15);D=W})();var V=D;!(q=[],z=function(){return{css_beautify:V}}.apply(de,q),z!==void 0&&(ke.exports=z))})()},U7T7:function(ke,de,P){},UZu5:function(ke,de,P){},Vhoy:function(ke,de,P){"use strict";P.d(de,"d",function(){return V}),P.d(de,"e",function(){return U}),P.d(de,"c",function(){return O}),P.d(de,"b",function(){return G}),P.d(de,"a",function(){return W});var q=P("MI8n");class z{constructor(){this._icons=new Map,this._onDidRegister=new q.b}add(n){const I=this._icons.get(n.id);I?n.description?I.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 D=new z,V=D;function U(n,I){return new G(n,I)}function O(n){return n?n.replace(/\$\((.*?)\)/g,(I,g)=>` ${g} `).trim():""}class G{constructor(n,I,g){this.id=n,this.definition=I,this.description=g,D.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var W;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function g(c){if(c instanceof G)return["codicon","codicon-"+c.id];const s=I.exec(c.id);if(!s)return g(G.error);let[,d,i]=s;const l=["codicon","codicon-"+d];return i&&l.push("codicon-modifier-"+i.substr(1)),l}n.asClassNameArray=g;function p(c){return g(c).join(" ")}n.asClassName=p;function h(c){return"."+g(c).join(".")}n.asCSSSelector=h})(W||(W={})),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"})}(G||(G={}))},"VrN/":function(ke,de,P){(function(q,z){ke.exports=z()})(this,function(){"use strict";var q=navigator.userAgent,z=navigator.platform,D=/gecko\/\d/i.test(q),V=/MSIE \d/.test(q),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),O=/Edge\/(\d+)/.exec(q),G=V||U||O,W=G&&(V?document.documentMode||6:+(O||U)[1]),n=!O&&/WebKit\//.test(q),I=n&&/Qt\/\d+\.\d+/.test(q),g=!O&&/Chrome\//.test(q),p=/Opera\//.test(q),h=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),s=/PhantomJS/.test(q),d=!O&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),i=/Android/.test(q),l=d||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),r=d||/Mac/.test(z),o=/\bCrOS\b/.test(q),w=/win/i.test(z),T=p&&q.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(p=!1,n=!0);var x=r&&(I||p&&(T==null||T<12.11)),L=D||G&&W>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E=function(e,t){var u=e.className,a=A(t).exec(u);if(a){var v=u.slice(a.index+a[0].length);e.className=u.slice(0,a.index)+(v?a[1]+v:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function m(e,t){return _(e).appendChild(t)}function f(e,t,u,a){var v=document.createElement(e);if(u&&(v.className=u),a&&(v.style.cssText=a),typeof t=="string")v.appendChild(document.createTextNode(t));else if(t)for(var F=0;F<t.length;++F)v.appendChild(t[F]);return v}function S(e,t,u,a){var v=f(e,t,u,a);return v.setAttribute("role","presentation"),v}var b;document.createRange?b=function(e,t,u,a){var v=document.createRange();return v.setEnd(a||e,u),v.setStart(e,t),v}:b=function(e,t,u){var a=document.body.createTextRange();try{a.moveToElementText(e.parentNode)}catch(v){return a}return a.collapse(!0),a.moveEnd("character",u),a.moveStart("character",t),a};function y(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 M(){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 B(e,t){var u=e.className;A(t).test(u)||(e.className+=(u?" ":"")+t)}function R(e,t){for(var u=e.split(" "),a=0;a<u.length;a++)u[a]&&!A(u[a]).test(t)&&(t+=" "+u[a]);return t}var H=function(e){e.select()};d?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(H=function(e){try{e.select()}catch(t){}});function N(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function C(e,t,u){t||(t={});for(var a in e)e.hasOwnProperty(a)&&(u!==!1||!t.hasOwnProperty(a))&&(t[a]=e[a]);return t}function K(e,t,u,a,v){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=a||0,$=v||0;;){var ee=e.indexOf(" ",F);if(ee<0||ee>=t)return $+(t-F);$+=ee-F,$+=u-$%u,F=ee+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=N(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 u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function oe(e,t){for(var u=0;u<e.length;++u)if(e[u]==t)return u;return-1}var fe=50,xe={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Te={origin:"*mouse"},Ce={origin:"+move"};function Le(e,t,u){for(var a=0,v=0;;){var F=e.indexOf(" ",a);F==-1&&(F=e.length);var $=F-a;if(F==e.length||v+$>=t)return a+Math.min($,t-v);if(v+=F-a,v+=u-v%u,a=F+1,v>=t)return a}}var ge=[""];function Y(e){for(;ge.length<=e;)ge.push(k(ge)+" ");return ge[e]}function k(e){return e[e.length-1]}function j(e,t){for(var u=[],a=0;a<e.length;a++)u[a]=t(e[a],a);return u}function J(e,t,u){for(var a=0,v=u(t);a<e.length&&u(e[a])<=v;)a++;e.splice(a,0,t)}function ie(){}function X(e,t){var u;return Object.create?u=Object.create(e):(ie.prototype=e,u=new ie),t&&C(t,u),u}var ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ie(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ve.test(e))}function Ue(e,t){return t?t.source.indexOf("\\w")>-1&&Ie(e)?!0:t.test(e):Ie(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var _e=/[\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 Ae(e){return e.charCodeAt(0)>=768&&_e.test(e)}function De(e,t,u){for(;(u<0?t>0:t<e.length)&&Ae(e.charAt(t));)t+=u;return t}function je(e,t,u){for(var a=t>u?-1:1;;){if(t==u)return t;var v=(t+u)/2,F=a<0?Math.ceil(v):Math.floor(v);if(F==t)return e(F)?t:u;e(F)?u=F:t=F+a}}function ze(e,t,u,a){if(!e)return a(t,u,"ltr",0);for(var v=!1,F=0;F<e.length;++F){var $=e[F];($.from<u&&$.to>t||t==u&&$.to==t)&&(a(Math.max($.from,t),Math.min($.to,u),$.level==1?"rtl":"ltr",F),v=!0)}v||a(t,u,"ltr")}var Je=null;function $e(e,t,u){var a;Je=null;for(var v=0;v<e.length;++v){var F=e[v];if(F.from<t&&F.to>t)return v;F.to==t&&(F.from!=F.to&&u=="before"?a=v:Je=v),F.from==t&&(F.from!=F.to&&u!="before"?a=v:Je=v)}return a!=null?a:Je}var tt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(le){return le<=247?e.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?t.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var a=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,v=/[stwN]/,F=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function ne(le,Ee,we){this.level=le,this.from=Ee,this.to=we}return function(le,Ee){var we=Ee=="ltr"?"L":"R";if(le.length==0||Ee=="ltr"&&!a.test(le))return!1;for(var Ne=le.length,Pe=[],Ke=0;Ke<Ne;++Ke)Pe.push(u(le.charCodeAt(Ke)));for(var Xe=0,qe=we;Xe<Ne;++Xe){var at=Pe[Xe];at=="m"?Pe[Xe]=qe:qe=at}for(var ct=0,st=we;ct<Ne;++ct){var ft=Pe[ct];ft=="1"&&st=="r"?Pe[ct]="n":F.test(ft)&&(st=ft,ft=="r"&&(Pe[ct]="R"))}for(var Bt=1,At=Pe[0];Bt<Ne-1;++Bt){var nn=Pe[Bt];nn=="+"&&At=="1"&&Pe[Bt+1]=="1"?Pe[Bt]="1":nn==","&&At==Pe[Bt+1]&&(At=="1"||At=="n")&&(Pe[Bt]=At),At=nn}for(var Dn=0;Dn<Ne;++Dn){var lr=Pe[Dn];if(lr==",")Pe[Dn]="N";else if(lr=="%"){var Hn=void 0;for(Hn=Dn+1;Hn<Ne&&Pe[Hn]=="%";++Hn);for(var Nr=Dn&&Pe[Dn-1]=="!"||Hn<Ne&&Pe[Hn]=="1"?"1":"N",Rr=Dn;Rr<Hn;++Rr)Pe[Rr]=Nr;Dn=Hn-1}}for(var Qn=0,Lr=we;Qn<Ne;++Qn){var gr=Pe[Qn];Lr=="L"&&gr=="1"?Pe[Qn]="L":F.test(gr)&&(Lr=gr)}for(var nr=0;nr<Ne;++nr)if(v.test(Pe[nr])){var qn=void 0;for(qn=nr+1;qn<Ne&&v.test(Pe[qn]);++qn);for(var Gn=(nr?Pe[nr-1]:we)=="L",Ir=(qn<Ne?Pe[qn]:we)=="L",Bi=Gn==Ir?Gn?"L":"R":we,fi=nr;fi<qn;++fi)Pe[fi]=Bi;nr=qn-1}for(var Er=[],ti,ur=0;ur<Ne;)if($.test(Pe[ur])){var cs=ur;for(++ur;ur<Ne&&$.test(Pe[ur]);++ur);Er.push(new ne(0,cs,ur))}else{var ai=ur,Ei=Er.length,xi=Ee=="rtl"?1:0;for(++ur;ur<Ne&&Pe[ur]!="L";++ur);for(var Sr=ai;Sr<ur;)if(ee.test(Pe[Sr])){ai<Sr&&(Er.splice(Ei,0,new ne(1,ai,Sr)),Ei+=xi);var ji=Sr;for(++Sr;Sr<ur&&ee.test(Pe[Sr]);++Sr);Er.splice(Ei,0,new ne(2,ji,Sr)),Ei+=xi,ai=Sr}else++Sr;ai<ur&&Er.splice(Ei,0,new ne(1,ai,ur))}return Ee=="ltr"&&(Er[0].level==1&&(ti=le.match(/^\s+/))&&(Er[0].from=ti[0].length,Er.unshift(new ne(0,0,ti[0].length))),k(Er).level==1&&(ti=le.match(/\s+$/))&&(k(Er).to-=ti[0].length,Er.push(new ne(0,Ne-ti[0].length,Ne)))),Ee=="rtl"?Er.reverse():Er}}();function Qe(e,t){var u=e.order;return u==null&&(u=e.order=tt(e.text,t)),u}var Re=[],Oe=function(e,t,u){if(e.addEventListener)e.addEventListener(t,u,!1);else if(e.attachEvent)e.attachEvent("on"+t,u);else{var a=e._handlers||(e._handlers={});a[t]=(a[t]||Re).concat(u)}};function We(e,t){return e._handlers&&e._handlers[t]||Re}function He(e,t,u){if(e.removeEventListener)e.removeEventListener(t,u,!1);else if(e.detachEvent)e.detachEvent("on"+t,u);else{var a=e._handlers,v=a&&a[t];if(v){var F=oe(v,u);F>-1&&(a[t]=v.slice(0,F).concat(v.slice(F+1)))}}}function ue(e,t){var u=We(e,t);if(!u.length)return;for(var a=Array.prototype.slice.call(arguments,2),v=0;v<u.length;++v)u[v].apply(null,a)}function Q(e,t,u){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ue(e,u||t.type,e,t),he(t)||t.codemirrorIgnore}function te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),a=0;a<t.length;++a)oe(u,t[a])==-1&&u.push(t[a])}function ae(e,t){return We(e,t).length>0}function ce(e){e.prototype.on=function(t,u){Oe(this,t,u)},e.prototype.off=function(t,u){He(this,t,u)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){re(e),se(e)}function ye(e){return e.target||e.srcElement}function Se(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),r&&e.ctrlKey&&t==1&&(t=3),t}var Fe=function(){if(G&&W<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Ge;function Ze(e){if(Ge==null){var t=f("span","\u200B");m(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ge=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var u=Ge?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var Ye;function Rt(e){if(Ye!=null)return Ye;var t=m(e,document.createTextNode("A\u062EA")),u=b(t,0,1).getBoundingClientRect(),a=b(t,1,2).getBoundingClientRect();return _(e),!u||u.left==u.right?!1:Ye=a.right-u.right<3}var lt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,u=[],a=e.length;t<=a;){var v=e.indexOf(`
|
|
`,t);v==-1&&(v=e.length);var F=e.slice(t,e.charAt(v-1)=="\r"?v-1:v),$=F.indexOf("\r");$!=-1?(u.push(F.slice(0,$)),t+=$+1):(u.push(F),t=v+1)}return u}:function(e){return e.split(/\r\n?|\n/)},it=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(u){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Nt=null;function Ut(e){if(Nt!=null)return Nt;var t=m(e,f("span","x")),u=t.getBoundingClientRect(),a=b(t,0,1).getBoundingClientRect();return Nt=Math.abs(u.left-a.left)>1}var rn={},vt={};function on(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),rn[e]=t}function an(e,t){vt[e]=t}function Ct(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var t=vt[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ct("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ct("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Mt(e,t){t=Ct(t);var u=rn[t.name];if(!u)return Mt(e,"text/plain");var a=u(e,t);if(ht.hasOwnProperty(t.name)){var v=ht[t.name];for(var F in v){if(!v.hasOwnProperty(F))continue;a.hasOwnProperty(F)&&(a["_"+F]=a[F]),a[F]=v[F]}}if(a.name=t.name,t.helperType&&(a.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)a[$]=t.modeProps[$];return a}var ht={};function Tt(e,t){var u=ht.hasOwnProperty(e)?ht[e]:ht[e]={};C(t,u)}function yt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var u={};for(var a in t){var v=t[a];v instanceof Array&&(v=v.concat([])),u[a]=v}return u}function Sn(e,t){for(var u;e.innerMode&&!(u=e.innerMode(t),!u||u.mode==e);)t=u.state,e=u.mode;return u||{mode:e,state:t}}function Kn(e,t,u){return e.startState?e.startState(t,u):!0}var pn=function(e,t,u){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};pn.prototype.eol=function(){return this.pos>=this.string.length},pn.prototype.sol=function(){return this.pos==this.lineStart},pn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},pn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},pn.prototype.eat=function(e){var t=this.string.charAt(this.pos),u;if(typeof e=="string"?u=t==e:u=t&&(e.test?e.test(t):e(t)),u)return++this.pos,t},pn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},pn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},pn.prototype.skipToEnd=function(){this.pos=this.string.length},pn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},pn.prototype.backUp=function(e){this.pos-=e},pn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=K(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},pn.prototype.indentation=function(){return K(this.string,null,this.tabSize)-(this.lineStart?K(this.string,this.lineStart,this.tabSize):0)},pn.prototype.match=function(e,t,u){if(typeof e=="string"){var a=function($){return u?$.toLowerCase():$},v=this.string.substr(this.pos,e.length);if(a(v)==a(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)}},pn.prototype.current=function(){return this.string.slice(this.start,this.pos)},pn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},pn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},pn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function et(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 u=e;!u.lines;)for(var a=0;;++a){var v=u.children[a],F=v.chunkSize();if(t<F){u=v;break}t-=F}return u.lines[t]}function Kt(e,t,u){var a=[],v=t.line;return e.iter(t.line,u.line+1,function(F){var $=F.text;v==u.line&&($=$.slice(0,u.ch)),v==t.line&&($=$.slice(t.ch)),a.push($),++v}),a}function Yt(e,t,u){var a=[];return e.iter(t,u,function(v){a.push(v.text)}),a}function xt(e,t){var u=t-e.height;if(u)for(var a=e;a;a=a.parent)a.height+=u}function Dt(e){if(e.parent==null)return null;for(var t=e.parent,u=oe(t.lines,e),a=t.parent;a;t=a,a=a.parent)for(var v=0;!(a.children[v]==t);++v)u+=a.children[v].chunkSize();return u+t.first}function jt(e,t){var u=e.first;e:do{for(var a=0;a<e.children.length;++a){var v=e.children[a],F=v.height;if(t<F){e=v;continue e}t-=F,u+=v.chunkSize()}return u}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],ne=ee.height;if(t<ne)break;t-=ne}return u+$}function Fn(e,t){return t>=e.first&&t<e.first+e.size}function En(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ve(e,t,u){if(u===void 0&&(u=null),!(this instanceof Ve))return new Ve(e,t,u);this.line=e,this.ch=t,this.sticky=u}function nt(e,t){return e.line-t.line||e.ch-t.ch}function rr(e,t){return e.sticky==t.sticky&&nt(e,t)==0}function Dr(e){return Ve(e.line,e.ch)}function Ur(e,t){return nt(e,t)<0?t:e}function Fr(e,t){return nt(e,t)<0?e:t}function jn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Et(e,t){if(t.line<e.first)return Ve(e.first,0);var u=e.first+e.size-1;return t.line>u?Ve(u,et(e,u).text.length):Be(t,et(e,t.line).text.length)}function Be(e,t){var u=e.ch;return u==null||u>t?Ve(e.line,t):u<0?Ve(e.line,0):e}function Me(e,t){for(var u=[],a=0;a<t.length;a++)u[a]=Et(e,t[a]);return u}var wt=function(e,t){this.state=e,this.lookAhead=t},Ht=function(e,t,u,a){this.state=t,this.doc=e,this.line=u,this.maxLookAhead=a||0,this.baseTokens=null,this.baseTokenPos=1};Ht.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ht.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}},Ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ht.fromSaved=function(e,t,u){return t instanceof wt?new Ht(e,yt(e.mode,t.state),u,t.lookAhead):new Ht(e,yt(e.mode,t),u)},Ht.prototype.save=function(e){var t=e!==!1?yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wt(t,this.maxLookAhead):t};function _n(e,t,u,a){var v=[e.state.modeGen],F={};rt(e,t.text,e.doc.mode,u,function(le,Ee){return v.push(le,Ee)},F,a);for(var $=u.state,ee=function(le){u.baseTokens=v;var Ee=e.state.overlays[le],we=1,Ne=0;u.state=!0,rt(e,t.text,Ee.mode,u,function(Pe,Ke){for(var Xe=we;Ne<Pe;){var qe=v[we];qe>Pe&&v.splice(we,1,Pe,v[we+1],qe),we+=2,Ne=Math.min(Pe,qe)}if(!Ke)return;if(Ee.opaque)v.splice(Xe,we-Xe,Pe,"overlay "+Ke),we=Xe+2;else for(;Xe<we;Xe+=2){var at=v[Xe+1];v[Xe+1]=(at?at+" ":"")+"overlay "+Ke}},F),u.state=$,u.baseTokens=null,u.baseTokenPos=1},ne=0;ne<e.state.overlays.length;++ne)ee(ne);return{styles:v,classes:F.bgClass||F.textClass?F:null}}function mn(e,t,u){if(!t.styles||t.styles[0]!=e.state.modeGen){var a=sn(e,Dt(t)),v=t.text.length>e.options.maxHighlightLength&&yt(e.doc.mode,a.state),F=_n(e,t,a);v&&(a.state=v),t.stateAfter=a.save(!v),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function sn(e,t,u){var a=e.doc,v=e.display;if(!a.mode.startState)return new Ht(a,!0,t);var F=hn(e,t,u),$=F>a.first&&et(a,F-1).stateAfter,ee=$?Ht.fromSaved(a,$,F):new Ht(a,Kn(a.mode),F);return a.iter(F,t,function(ne){Gt(e,ne.text,ee);var le=ee.line;ne.stateAfter=le==t-1||le%5==0||le>=v.viewFrom&&le<v.viewTo?ee.save():null,ee.nextLine()}),u&&(a.modeFrontier=ee.line),ee}function Gt(e,t,u,a){var v=e.doc.mode,F=new pn(t,e.options.tabSize,u);for(F.start=F.pos=a||0,t==""&&_t(v,u.state);!F.eol();)Ot(v,F,u.state),F.start=F.pos}function _t(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var u=Sn(e,t);if(u.mode.blankLine)return u.mode.blankLine(u.state)}function Ot(e,t,u,a){for(var v=0;v<10;v++){a&&(a[0]=Sn(e,u).mode);var F=e.token(t,u);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pt=function(e,t,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=u};function St(e,t,u,a){var v=e.doc,F=v.mode,$;t=Et(v,t);var ee=et(v,t.line),ne=sn(e,t.line,u),le=new pn(ee.text,e.options.tabSize,ne),Ee;for(a&&(Ee=[]);(a||le.pos<t.ch)&&!le.eol();)le.start=le.pos,$=Ot(F,le,ne.state),a&&Ee.push(new Pt(le,$,yt(v.mode,ne.state)));return a?Ee:new Pt(le,$,ne.state)}function qt(e,t){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var a=u[1]?"bgClass":"textClass";t[a]==null?t[a]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(t[a])||(t[a]+=" "+u[2])}return e}function rt(e,t,u,a,v,F,$){var ee=u.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var ne=0,le=null,Ee=new pn(t,e.options.tabSize,a),we,Ne=e.options.addModeClass&&[null];for(t==""&&qt(_t(u,a.state),F);!Ee.eol();){if(Ee.pos>e.options.maxHighlightLength?(ee=!1,$&&Gt(e,t,a,Ee.pos),Ee.pos=t.length,we=null):we=qt(Ot(u,Ee,a.state,Ne),F),Ne){var Pe=Ne[0].name;Pe&&(we="m-"+(we?Pe+" "+we:Pe))}if(!ee||le!=we){for(;ne<Ee.start;)ne=Math.min(Ee.start,ne+5e3),v(ne,le);le=we}Ee.start=Ee.pos}for(;ne<Ee.pos;){var Ke=Math.min(Ee.pos,ne+5e3);v(Ke,le),ne=Ke}}function hn(e,t,u){for(var a,v,F=e.doc,$=u?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=F.first)return F.first;var ne=et(F,ee-1),le=ne.stateAfter;if(le&&(!u||ee+(le instanceof wt?le.lookAhead:0)<=F.modeFrontier))return ee;var Ee=K(ne.text,null,e.options.tabSize);(v==null||a>Ee)&&(v=ee-1,a=Ee)}return v}function Zt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var u=e.first,a=t-1;a>u;a--){var v=et(e,a).stateAfter;if(v&&(!(v instanceof wt)||a+v.lookAhead<t)){u=a+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}var Pn=!1,Lt=!1;function Mn(){Pn=!0}function Un(){Lt=!0}function An(e,t,u){this.marker=e,this.from=t,this.to=u}function Tn(e,t){if(e)for(var u=0;u<e.length;++u){var a=e[u];if(a.marker==t)return a}}function In(e,t){for(var u,a=0;a<e.length;++a)e[a]!=t&&(u||(u=[])).push(e[a]);return u}function ir(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,u){var a;if(e)for(var v=0;v<e.length;++v){var F=e[v],$=F.marker,ee=F.from==null||($.inclusiveLeft?F.from<=t:F.from<t);if(ee||F.from==t&&$.type=="bookmark"&&(!u||!F.marker.insertLeft)){var ne=F.to==null||($.inclusiveRight?F.to>=t:F.to>t);(a||(a=[])).push(new An($,F.from,ne?null:F.to))}}return a}function Xn(e,t,u){var a;if(e)for(var v=0;v<e.length;++v){var F=e[v],$=F.marker,ee=F.to==null||($.inclusiveRight?F.to>=t:F.to>t);if(ee||F.from==t&&$.type=="bookmark"&&(!u||F.marker.insertLeft)){var ne=F.from==null||($.inclusiveLeft?F.from<=t:F.from<t);(a||(a=[])).push(new An($,ne?null:F.from-t,F.to==null?null:F.to-t))}}return a}function Cn(e,t){if(t.full)return null;var u=Fn(e,t.from.line)&&et(e,t.from.line).markedSpans,a=Fn(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!u&&!a)return null;var v=t.from.ch,F=t.to.ch,$=nt(t.from,t.to)==0,ee=cr(u,v,$),ne=Xn(a,F,$),le=t.text.length==1,Ee=k(t.text).length+(le?v:0);if(ee)for(var we=0;we<ee.length;++we){var Ne=ee[we];if(Ne.to==null){var Pe=Tn(ne,Ne.marker);Pe?le&&(Ne.to=Pe.to==null?null:Pe.to+Ee):Ne.to=v}}if(ne)for(var Ke=0;Ke<ne.length;++Ke){var Xe=ne[Ke];if(Xe.to!=null&&(Xe.to+=Ee),Xe.from==null){var qe=Tn(ee,Xe.marker);qe||(Xe.from=Ee,le&&(ee||(ee=[])).push(Xe))}else Xe.from+=Ee,le&&(ee||(ee=[])).push(Xe)}ee&&(ee=dr(ee)),ne&&ne!=ee&&(ne=dr(ne));var at=[ee];if(!le){var ct=t.text.length-2,st;if(ct>0&&ee)for(var ft=0;ft<ee.length;++ft)ee[ft].to==null&&(st||(st=[])).push(new An(ee[ft].marker,null,null));for(var Bt=0;Bt<ct;++Bt)at.push(st);at.push(ne)}return at}function dr(e){for(var t=0;t<e.length;++t){var u=e[t];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function fn(e,t,u){var a=null;if(e.iter(t.line,u.line+1,function(Pe){if(Pe.markedSpans)for(var Ke=0;Ke<Pe.markedSpans.length;++Ke){var Xe=Pe.markedSpans[Ke].marker;Xe.readOnly&&(!a||oe(a,Xe)==-1)&&(a||(a=[])).push(Xe)}}),!a)return null;for(var v=[{from:t,to:u}],F=0;F<a.length;++F)for(var $=a[F],ee=$.find(0),ne=0;ne<v.length;++ne){var le=v[ne];if(nt(le.to,ee.from)<0||nt(le.from,ee.to)>0)continue;var Ee=[ne,1],we=nt(le.from,ee.from),Ne=nt(le.to,ee.to);(we<0||!$.inclusiveLeft&&!we)&&Ee.push({from:le.from,to:ee.from}),(Ne>0||!$.inclusiveRight&&!Ne)&&Ee.push({from:ee.to,to:le.to}),v.splice.apply(v,Ee),ne+=Ee.length-3}return v}function gn(e){var t=e.markedSpans;if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.detachLine(e);e.markedSpans=null}function vn(e,t){if(!t)return;for(var u=0;u<t.length;++u)t[u].marker.attachLine(e);e.markedSpans=t}function zt(e){return e.inclusiveLeft?-1:0}function dt(e){return e.inclusiveRight?1:0}function kt(e,t){var u=e.lines.length-t.lines.length;if(u!=0)return u;var a=e.find(),v=t.find(),F=nt(a.from,v.from)||zt(e)-zt(t);if(F)return-F;var $=nt(a.to,v.to)||dt(e)-dt(t);return $||t.id-e.id}function ut(e,t){var u=Lt&&e.markedSpans,a;if(u)for(var v=void 0,F=0;F<u.length;++F)v=u[F],v.marker.collapsed&&(t?v.from:v.to)==null&&(!a||kt(a,v.marker)<0)&&(a=v.marker);return a}function en(e){return ut(e,!0)}function It(e){return ut(e,!1)}function ar(e,t){var u=Lt&&e.markedSpans,a;if(u)for(var v=0;v<u.length;++v){var F=u[v];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!a||kt(a,F.marker)<0)&&(a=F.marker)}return a}function kn(e,t,u,a,v){var F=et(e,t),$=Lt&&F.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var ne=$[ee];if(!ne.marker.collapsed)continue;var le=ne.marker.find(0),Ee=nt(le.from,u)||zt(ne.marker)-zt(v),we=nt(le.to,a)||dt(ne.marker)-dt(v);if(Ee>=0&&we<=0||Ee<=0&&we>=0)continue;if(Ee<=0&&(ne.marker.inclusiveRight&&v.inclusiveLeft?nt(le.to,u)>=0:nt(le.to,u)>0)||Ee>=0&&(ne.marker.inclusiveRight&&v.inclusiveLeft?nt(le.from,a)<=0:nt(le.from,a)<0))return!0}}function hr(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Zr(e){for(var t;t=It(e);)e=t.find(1,!0).line;return e}function Pr(e){for(var t,u;t=It(e);)e=t.find(1,!0).line,(u||(u=[])).push(e);return u}function zr(e,t){var u=et(e,t),a=hr(u);return u==a?t:Dt(a)}function Mr(e,t){if(t>e.lastLine())return t;var u=et(e,t),a;if(!Cr(e,u))return t;for(;a=It(u);)u=a.find(1,!0).line;return Dt(u)+1}function Cr(e,t){var u=Lt&&t.markedSpans;if(u)for(var a=void 0,v=0;v<u.length;++v){if(a=u[v],!a.marker.collapsed)continue;if(a.from==null)return!0;if(a.marker.widgetNode)continue;if(a.from==0&&a.marker.inclusiveLeft&&Kr(e,t,a))return!0}}function Kr(e,t,u){if(u.to==null){var a=u.marker.find(1,!0);return Kr(e,a.line,Tn(a.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==t.text.length)return!0;for(var v=void 0,F=0;F<t.markedSpans.length;++F)if(v=t.markedSpans[F],v.marker.collapsed&&!v.marker.widgetNode&&v.from==u.to&&(v.to==null||v.to!=u.from)&&(v.marker.inclusiveLeft||u.marker.inclusiveRight)&&Kr(e,t,v))return!0}function Wn(e){e=hr(e);for(var t=0,u=e.parent,a=0;a<u.lines.length;++a){var v=u.lines[a];if(v==e)break;t+=v.height}for(var F=u.parent;F;u=F,F=u.parent)for(var $=0;$<F.children.length;++$){var ee=F.children[$];if(ee==u)break;t+=ee.height}return t}function gt(e){if(e.height==0)return 0;for(var t=e.text.length,u,a=e;u=en(a);){var v=u.find(0,!0);a=v.from.line,t+=v.from.ch-v.to.ch}for(a=e;u=It(a);){var F=u.find(0,!0);t-=a.text.length-F.from.ch,a=F.to.line,t+=a.text.length-F.to.ch}return t}function Vr(e){var t=e.display,u=e.doc;t.maxLine=et(u,u.first),t.maxLineLength=gt(t.maxLine),t.maxLineChanged=!0,u.iter(function(a){var v=gt(a);v>t.maxLineLength&&(t.maxLineLength=v,t.maxLine=a)})}var vr=function(e,t,u){this.text=e,vn(this,t),this.height=u?u(this):1};vr.prototype.lineNo=function(){return Dt(this)},ce(vr);function ni(e,t,u,a){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),gn(e),vn(e,u);var v=a?a(e):1;v!=e.height&&xt(e,v)}function pt(e){e.parent=null,gn(e)}var Ft={},bt={};function Vt(e,t){if(!e||/^\s*$/.test(e))return null;var u=t.addModeClass?bt:Ft;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function $t(e,t){var u=S("span",null,null,n?"padding-right: .1px":null),a={pre:S("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var v=0;v<=(t.rest?t.rest.length:0);v++){var F=v?t.rest[v-1]:t.line,$=void 0;a.pos=0,a.addToken=tn,Rt(e.display.measure)&&($=Qe(F,e.doc.direction))&&(a.addToken=er(a.addToken,$)),a.map=[];var ee=t!=e.display.externalMeasured&&Dt(F);yr(F,a,mn(e,F,ee)),F.styleClasses&&(F.styleClasses.bgClass&&(a.bgClass=R(F.styleClasses.bgClass,a.bgClass||"")),F.styleClasses.textClass&&(a.textClass=R(F.styleClasses.textClass,a.textClass||""))),a.map.length==0&&a.map.push(0,0,a.content.appendChild(Ze(e.display.measure))),v==0?(t.measure.map=a.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(a.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var ne=a.content.lastChild;(/\bcm-tab\b/.test(ne.className)||ne.querySelector&&ne.querySelector(".cm-tab"))&&(a.content.className="cm-tab-wrap-hack")}return ue(e,"renderLine",e,t.line,a.pre),a.pre.className&&(a.textClass=R(a.pre.className,a.textClass||"")),a}function xn(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tn(e,t,u,a,v,F,$){if(!t)return;var ee=e.splitSpaces?Nn(t,e.trailingSpace):t,ne=e.cm.state.specialChars,le=!1,Ee;if(!ne.test(t))e.col+=t.length,Ee=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Ee),G&&W<9&&(le=!0),e.pos+=t.length;else{Ee=document.createDocumentFragment();for(var we=0;;){ne.lastIndex=we;var Ne=ne.exec(t),Pe=Ne?Ne.index-we:t.length-we;if(Pe){var Ke=document.createTextNode(ee.slice(we,we+Pe));G&&W<9?Ee.appendChild(f("span",[Ke])):Ee.appendChild(Ke),e.map.push(e.pos,e.pos+Pe,Ke),e.col+=Pe,e.pos+=Pe}if(!Ne)break;we+=Pe+1;var Xe=void 0;if(Ne[0]==" "){var qe=e.cm.options.tabSize,at=qe-e.col%qe;Xe=Ee.appendChild(f("span",Y(at),"cm-tab")),Xe.setAttribute("role","presentation"),Xe.setAttribute("cm-text"," "),e.col+=at}else Ne[0]=="\r"||Ne[0]==`
|
|
`?(Xe=Ee.appendChild(f("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xe.setAttribute("cm-text",Ne[0]),e.col+=1):(Xe=e.cm.options.specialCharPlaceholder(Ne[0]),Xe.setAttribute("cm-text",Ne[0]),G&&W<9?Ee.appendChild(f("span",[Xe])):Ee.appendChild(Xe),e.col+=1);e.map.push(e.pos,e.pos+1,Xe),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,u||a||v||le||F||$){var ct=u||"";a&&(ct+=a),v&&(ct+=v);var st=f("span",[Ee],ct,F);if($)for(var ft in $)$.hasOwnProperty(ft)&&ft!="style"&&ft!="class"&&st.setAttribute(ft,$[ft]);return e.content.appendChild(st)}e.content.appendChild(Ee)}function Nn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var u=t,a="",v=0;v<e.length;v++){var F=e.charAt(v);F==" "&&u&&(v==e.length-1||e.charCodeAt(v+1)==32)&&(F="\xA0"),a+=F,u=F==" "}return a}function er(e,t){return function(u,a,v,F,$,ee,ne){v=v?v+" cm-force-border":"cm-force-border";for(var le=u.pos,Ee=le+a.length;;){for(var we=void 0,Ne=0;Ne<t.length&&!(we=t[Ne],we.to>le&&we.from<=le);Ne++);if(we.to>=Ee)return e(u,a,v,F,$,ee,ne);e(u,a.slice(0,we.to-le),v,F,null,ee,ne),F=null,a=a.slice(we.to-le),le=we.to}}}function Xt(e,t,u,a){var v=!a&&u.widgetNode;v&&e.map.push(e.pos,e.pos+t,v),!a&&e.cm.display.input.needsContentAttribute&&(v||(v=e.content.appendChild(document.createElement("span"))),v.setAttribute("cm-marker",u.id)),v&&(e.cm.display.input.setUneditable(v),e.content.appendChild(v)),e.pos+=t,e.trailingSpace=!1}function yr(e,t,u){var a=e.markedSpans,v=e.text,F=0;if(!a){for(var $=1;$<u.length;$+=2)t.addToken(t,v.slice(F,F=u[$]),Vt(u[$+1],t.cm.options));return}for(var ee=v.length,ne=0,le=1,Ee="",we,Ne,Pe=0,Ke,Xe,qe,at,ct;;){if(Pe==ne){Ke=Xe=qe=Ne="",ct=null,at=null,Pe=Infinity;for(var st=[],ft=void 0,Bt=0;Bt<a.length;++Bt){var At=a[Bt],nn=At.marker;if(nn.type=="bookmark"&&At.from==ne&&nn.widgetNode)st.push(nn);else if(At.from<=ne&&(At.to==null||At.to>ne||nn.collapsed&&At.to==ne&&At.from==ne)){if(At.to!=null&&At.to!=ne&&Pe>At.to&&(Pe=At.to,Xe=""),nn.className&&(Ke+=" "+nn.className),nn.css&&(Ne=(Ne?Ne+";":"")+nn.css),nn.startStyle&&At.from==ne&&(qe+=" "+nn.startStyle),nn.endStyle&&At.to==Pe&&(ft||(ft=[])).push(nn.endStyle,At.to),nn.title&&((ct||(ct={})).title=nn.title),nn.attributes)for(var Dn in nn.attributes)(ct||(ct={}))[Dn]=nn.attributes[Dn];nn.collapsed&&(!at||kt(at.marker,nn)<0)&&(at=At)}else At.from>ne&&Pe>At.from&&(Pe=At.from)}if(ft)for(var lr=0;lr<ft.length;lr+=2)ft[lr+1]==Pe&&(Xe+=" "+ft[lr]);if(!at||at.from==ne)for(var Hn=0;Hn<st.length;++Hn)Xt(t,0,st[Hn]);if(at&&(at.from||0)==ne){if(Xt(t,(at.to==null?ee+1:at.to)-ne,at.marker,at.from==null),at.to==null)return;at.to==ne&&(at=!1)}}if(ne>=ee)break;for(var Nr=Math.min(ee,Pe);;){if(Ee){var Rr=ne+Ee.length;if(!at){var Qn=Rr>Nr?Ee.slice(0,Nr-ne):Ee;t.addToken(t,Qn,we?we+Ke:Ke,qe,ne+Qn.length==Pe?Xe:"",Ne,ct)}if(Rr>=Nr){Ee=Ee.slice(Nr-ne),ne=Nr;break}ne=Rr,qe=""}Ee=v.slice(F,F=u[le++]),we=Vt(u[le++],t.cm.options)}}}function yn(e,t,u){this.line=t,this.rest=Pr(t),this.size=this.rest?Dt(k(this.rest))-u+1:1,this.node=this.text=null,this.hidden=Cr(e,t)}function Yn(e,t,u){for(var a=[],v,F=t;F<u;F=v){var $=new yn(e.doc,et(e.doc,F),F);v=F+$.size,a.push($)}return a}var $n=null;function fr(e){$n?$n.ops.push(e):e.ownsGroup=$n={ops:[e],delayedCallbacks:[]}}function Wi(e){var t=e.delayedCallbacks,u=0;do{for(;u<t.length;u++)t[u].call(null);for(var a=0;a<e.ops.length;a++){var v=e.ops[a];if(v.cursorActivityHandlers)for(;v.cursorActivityCalled<v.cursorActivityHandlers.length;)v.cursorActivityHandlers[v.cursorActivityCalled++].call(null,v.cm)}}while(u<t.length)}function bn(e,t){var u=e.ownsGroup;if(!u)return;try{Wi(u)}finally{$n=null,t(u)}}var ln=null;function cn(e,t){var u=We(e,t);if(!u.length)return;var a=Array.prototype.slice.call(arguments,2),v;$n?v=$n.delayedCallbacks:ln?v=ln:(v=ln=[],setTimeout(pr,0));for(var F=function(ee){v.push(function(){return u[ee].apply(null,a)})},$=0;$<u.length;++$)F($)}function pr(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function Qr(e,t,u,a){for(var v=0;v<t.changes.length;v++){var F=t.changes[v];F=="text"?Qt(e,t):F=="gutter"?Jt(e,t,u,a):F=="class"?mt(e,t):F=="widget"&&ot(e,t,a)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&W<8&&(e.node.style.zIndex=2)),e.node}function ri(e,t){var u=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),t.background)u?t.background.className=u:(t.background.parentNode.removeChild(t.background),t.background=null);else if(u){var a=qr(t);t.background=a.insertBefore(f("div",null,u),a.firstChild),e.display.input.setUneditable(t.background)}}function Ti(e,t){var u=e.display.externalMeasured;return u&&u.line==t.line?(e.display.externalMeasured=null,t.measure=u.measure,u.built):$t(e,t)}function Qt(e,t){var u=t.text.className,a=Ti(e,t);t.text==t.node&&(t.node=a.pre),t.text.parentNode.replaceChild(a.pre,t.text),t.text=a.pre,a.bgClass!=t.bgClass||a.textClass!=t.textClass?(t.bgClass=a.bgClass,t.textClass=a.textClass,mt(e,t)):u&&(t.text.className=u)}function mt(e,t){ri(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var u=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=u||""}function Jt(e,t,u,a){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 v=qr(t);t.gutterBackground=f("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px; width: "+a.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),v.insertBefore(t.gutterBackground,t.text)}var F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var $=qr(t),ee=t.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(f("div",En(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+a.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var ne=0;ne<e.display.gutterSpecs.length;++ne){var le=e.display.gutterSpecs[ne].className,Ee=F.hasOwnProperty(le)&&F[le];Ee&&ee.appendChild(f("div",[Ee],"CodeMirror-gutter-elt","left: "+a.gutterLeft[le]+"px; width: "+a.gutterWidth[le]+"px"))}}}function ot(e,t,u){t.alignable&&(t.alignable=null);for(var a=A("CodeMirror-linewidget"),v=t.node.firstChild,F=void 0;v;v=F)F=v.nextSibling,a.test(v.className)&&t.node.removeChild(v);Rn(e,t,u)}function un(e,t,u,a){var v=Ti(e,t);return t.text=t.node=v.pre,v.bgClass&&(t.bgClass=v.bgClass),v.textClass&&(t.textClass=v.textClass),mt(e,t),Jt(e,t,u,a),Rn(e,t,a),t.node}function Rn(e,t,u){if(Jn(e,t.line,t,u,!0),t.rest)for(var a=0;a<t.rest.length;a++)Jn(e,t.rest[a],t,u,!1)}function Jn(e,t,u,a,v){if(!t.widgets)return;for(var F=qr(u),$=0,ee=t.widgets;$<ee.length;++$){var ne=ee[$],le=f("div",[ne.node],"CodeMirror-linewidget"+(ne.className?" "+ne.className:""));ne.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),xr(ne,le,u,a),e.display.input.setUneditable(le),v&&ne.above?F.insertBefore(le,u.gutter||u.text):F.appendChild(le),cn(ne,"redraw")}}function xr(e,t,u,a){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(t);var v=a.wrapperWidth;t.style.left=a.fixedPos+"px",e.coverGutter||(v-=a.gutterTotalWidth,t.style.paddingLeft=a.gutterTotalWidth+"px"),t.style.width=v+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-a.gutterTotalWidth+"px"))}function Zn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+t.display.wrapper.clientWidth+"px;"),m(t.display.measure,f("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function dn(e,t){for(var u=ye(t);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function Ln(e){return e.lineSpace.offsetTop}function Xr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Br(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=m(e.measure,f("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,a={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(a.left)&&!isNaN(a.right)&&(e.cachedPaddingH=a),a}function zn(e){return fe-e.display.nativeBarWidth}function mr(e){return e.display.scroller.clientWidth-zn(e)-e.display.barWidth}function Tr(e){return e.display.scroller.clientHeight-zn(e)-e.display.barHeight}function tr(e,t,u){var a=e.options.lineWrapping,v=a&&mr(e);if(!t.measure.heights||a&&t.measure.width!=v){var F=t.measure.heights=[];if(a){t.measure.width=v;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var ne=$[ee],le=$[ee+1];Math.abs(ne.bottom-le.bottom)>2&&F.push((ne.bottom+le.top)/2-u.top)}}F.push(u.bottom-u.top)}}function Gr(e,t,u){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var a=0;a<e.rest.length;a++)if(e.rest[a]==t)return{map:e.measure.maps[a],cache:e.measure.caches[a]};for(var v=0;v<e.rest.length;v++)if(Dt(e.rest[v])>u)return{map:e.measure.maps[v],cache:e.measure.caches[v],before:!0}}function wi(e,t){t=hr(t);var u=Dt(t),a=e.display.externalMeasured=new yn(e.doc,t,u);a.lineN=u;var v=a.built=$t(e,a);return a.text=v.pre,m(e.display.lineMeasure,v.pre),a}function jr(e,t,u,a){return ei(e,br(e,t),u,a)}function ca(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gi(e,t)];var u=e.display.externalMeasured;if(u&&t>=u.lineN&&t<u.lineN+u.size)return u}function br(e,t){var u=Dt(t),a=ca(e,u);a&&!a.text?a=null:a&&a.changes&&(Qr(e,a,u,Ua(e)),e.curOp.forceUpdate=!0),a||(a=wi(e,t));var v=Gr(a,t,u);return{line:t,view:a,rect:null,map:v.map,cache:v.cache,before:v.before,hasHeights:!1}}function ei(e,t,u,a,v){t.before&&(u=-1);var F=u+(a||""),$;return t.cache.hasOwnProperty(F)?$=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tr(e,t.view,t.rect),t.hasHeights=!0),$=Wo(e,t,u,a),$.bogus||(t.cache[F]=$)),{left:$.left,right:$.right,top:v?$.rtop:$.top,bottom:v?$.rbottom:$.bottom}}var hs={left:0,right:0,top:0,bottom:0};function fs(e,t,u){for(var a,v,F,$,ee,ne,le=0;le<e.length;le+=3)if(ee=e[le],ne=e[le+1],t<ee?(v=0,F=1,$="left"):t<ne?(v=t-ee,F=v+1):(le==e.length-3||t==ne&&e[le+3]>t)&&(F=ne-ee,v=F-1,t>=ne&&($="right")),v!=null){if(a=e[le+2],ee==ne&&u==(a.insertLeft?"left":"right")&&($=u),u=="left"&&v==0)for(;le&&e[le-2]==e[le-3]&&e[le-1].insertLeft;)a=e[(le-=3)+2],$="left";if(u=="right"&&v==ne-ee)for(;le<e.length-3&&e[le+3]==e[le+4]&&!e[le+5].insertLeft;)a=e[(le+=3)+2],$="right";break}return{node:a,start:v,end:F,collapse:$,coverStart:ee,coverEnd:ne}}function jo(e,t){var u=hs;if(t=="left")for(var a=0;a<e.length&&!((u=e[a]).left!=u.right);a++);else for(var v=e.length-1;v>=0&&!((u=e[v]).left!=u.right);v--);return u}function Wo(e,t,u,a){var v=fs(t.map,u,a),F=v.node,$=v.start,ee=v.end,ne=v.collapse,le;if(F.nodeType==3){for(var Ee=0;Ee<4;Ee++){for(;$&&Ae(t.line.text.charAt(v.coverStart+$));)--$;for(;v.coverStart+ee<v.coverEnd&&Ae(t.line.text.charAt(v.coverStart+ee));)++ee;if(G&&W<9&&$==0&&ee==v.coverEnd-v.coverStart?le=F.parentNode.getBoundingClientRect():le=jo(b(F,$,ee).getClientRects(),a),le.left||le.right||$==0)break;ee=$,$=$-1,ne="right"}G&&W<11&&(le=Ho(e.display.measure,le))}else{$>0&&(ne=a="right");var we;e.options.lineWrapping&&(we=F.getClientRects()).length>1?le=we[a=="right"?we.length-1:0]:le=F.getBoundingClientRect()}if(G&&W<9&&!$&&(!le||!le.left&&!le.right)){var Ne=F.parentNode.getClientRects()[0];Ne?le={left:Ne.left,right:Ne.left+Ci(e.display),top:Ne.top,bottom:Ne.bottom}:le=hs}for(var Pe=le.top-t.rect.top,Ke=le.bottom-t.rect.top,Xe=(Pe+Ke)/2,qe=t.view.measure.heights,at=0;at<qe.length-1&&!(Xe<qe[at]);at++);var ct=at?qe[at-1]:0,st=qe[at],ft={left:(ne=="right"?le.right:le.left)-t.rect.left,right:(ne=="left"?le.left:le.right)-t.rect.left,top:ct,bottom:st};return!le.left&&!le.right&&(ft.bogus=!0),e.options.singleCursorHeightPerLine||(ft.rtop=Pe,ft.rbottom=Ke),ft}function Ho(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ut(e))return t;var u=screen.logicalXDPI/screen.deviceXDPI,a=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*u,right:t.right*u,top:t.top*a,bottom:t.bottom*a}}function ps(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 ms(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ps(e.display.view[t])}function Hi(e){ms(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function gs(){return g&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function vs(){return g&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Da(e){var t=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(t+=Zn(e.widgets[u]));return t}function da(e,t,u,a,v){if(!v){var F=Da(t);u.top+=F,u.bottom+=F}if(a=="line")return u;a||(a="local");var $=Wn(t);if(a=="local"?$+=Ln(e.display):$-=e.display.viewOffset,a=="page"||a=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(a=="window"?0:vs());var ne=ee.left+(a=="window"?0:gs());u.left+=ne,u.right+=ne}return u.top+=$,u.bottom+=$,u}function ys(e,t,u){if(u=="div")return t;var a=t.left,v=t.top;if(u=="page")a-=gs(),v-=vs();else if(u=="local"||!u){var F=e.display.sizer.getBoundingClientRect();a+=F.left,v+=F.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:a-$.left,top:v-$.top}}function Pa(e,t,u,a,v){return a||(a=et(e.doc,t.line)),da(e,a,jr(e,a,t.ch,v),u)}function Yr(e,t,u,a,v,F){a=a||et(e.doc,t.line),v||(v=br(e,a));function $(Ke,Xe){var qe=ei(e,v,Ke,Xe?"right":"left",F);return Xe?qe.left=qe.right:qe.right=qe.left,da(e,a,qe,u)}var ee=Qe(a,e.doc.direction),ne=t.ch,le=t.sticky;if(ne>=a.text.length?(ne=a.text.length,le="before"):ne<=0&&(ne=0,le="after"),!ee)return $(le=="before"?ne-1:ne,le=="before");function Ee(Ke,Xe,qe){var at=ee[Xe],ct=at.level==1;return $(qe?Ke-1:Ke,ct!=qe)}var we=$e(ee,ne,le),Ne=Je,Pe=Ee(ne,we,le=="before");return Ne!=null&&(Pe.other=Ee(ne,Ne,le!="before")),Pe}function bs(e,t){var u=0;t=Et(e.doc,t),e.options.lineWrapping||(u=Ci(e.display)*t.ch);var a=et(e.doc,t.line),v=Wn(a)+Ln(e.display);return{left:u,right:u,top:v,bottom:v+a.height}}function Ma(e,t,u,a,v){var F=Ve(e,t,u);return F.xRel=v,a&&(F.outside=a),F}function ka(e,t,u){var a=e.doc;if(u+=e.display.viewOffset,u<0)return Ma(a.first,0,null,-1,-1);var v=jt(a,u),F=a.first+a.size-1;if(v>F)return Ma(a.first+a.size-1,et(a,F).text.length,null,1,1);t<0&&(t=0);for(var $=et(a,v);;){var ee=Ko(e,$,v,t,u),ne=ar($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!ne)return ee;var le=ne.find(1);if(le.line==v)return le;$=et(a,v=le.line)}}function _s(e,t,u,a){a-=Da(t);var v=t.text.length,F=je(function($){return ei(e,u,$-1).bottom<=a},v,0);return v=je(function($){return ei(e,u,$).top>a},F,v),{begin:F,end:v}}function Es(e,t,u,a){u||(u=br(e,t));var v=da(e,t,ei(e,u,a),"line").top;return _s(e,t,u,v)}function Na(e,t,u,a){return e.bottom<=u?!1:e.top>u?!0:(a?e.left:e.right)>t}function Ko(e,t,u,a,v){v-=Wn(t);var F=br(e,t),$=Da(t),ee=0,ne=t.text.length,le=!0,Ee=Qe(t,e.doc.direction);if(Ee){var we=(e.options.lineWrapping?zo:Go)(e,t,u,F,Ee,a,v);le=we.level!=1,ee=le?we.from:we.to-1,ne=le?we.to:we.from-1}var Ne=null,Pe=null,Ke=je(function(Bt){var At=ei(e,F,Bt);return At.top+=$,At.bottom+=$,Na(At,a,v,!1)?(At.top<=v&&At.left<=a&&(Ne=Bt,Pe=At),!0):!1},ee,ne),Xe,qe,at=!1;if(Pe){var ct=a-Pe.left<Pe.right-a,st=ct==le;Ke=Ne+(st?0:1),qe=st?"after":"before",Xe=ct?Pe.left:Pe.right}else{!le&&(Ke==ne||Ke==ee)&&Ke++,qe=Ke==0?"after":Ke==t.text.length?"before":ei(e,F,Ke-(le?1:0)).bottom+$<=v==le?"after":"before";var ft=Yr(e,Ve(u,Ke,qe),"line",t,F);Xe=ft.left,at=v<ft.top?-1:v>=ft.bottom?1:0}return Ke=De(t.text,Ke,1),Ma(u,Ke,qe,at,a-Xe)}function Go(e,t,u,a,v,F,$){var ee=je(function(we){var Ne=v[we],Pe=Ne.level!=1;return Na(Yr(e,Ve(u,Pe?Ne.to:Ne.from,Pe?"before":"after"),"line",t,a),F,$,!0)},0,v.length-1),ne=v[ee];if(ee>0){var le=ne.level!=1,Ee=Yr(e,Ve(u,le?ne.from:ne.to,le?"after":"before"),"line",t,a);Na(Ee,F,$,!0)&&Ee.top>$&&(ne=v[ee-1])}return ne}function zo(e,t,u,a,v,F,$){var ee=_s(e,t,a,$),ne=ee.begin,le=ee.end;/\s/.test(t.text.charAt(le-1))&&le--;for(var Ee=null,we=null,Ne=0;Ne<v.length;Ne++){var Pe=v[Ne];if(Pe.from>=le||Pe.to<=ne)continue;var Ke=Pe.level!=1,Xe=ei(e,a,Ke?Math.min(le,Pe.to)-1:Math.max(ne,Pe.from)).right,qe=Xe<F?F-Xe+1e9:Xe-F;(!Ee||we>qe)&&(Ee=Pe,we=qe)}return Ee||(Ee=v[v.length-1]),Ee.from<ne&&(Ee={from:ne,to:Ee.to,level:Ee.level}),Ee.to>le&&(Ee={from:Ee.from,to:le,level:Ee.level}),Ee}var pi;function Si(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(pi==null){pi=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)pi.appendChild(document.createTextNode("x")),pi.appendChild(f("br"));pi.appendChild(document.createTextNode("x"))}m(e.measure,pi);var u=pi.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),_(e.measure),u||1}function Ci(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),u=f("pre",[t],"CodeMirror-line-like");m(e.measure,u);var a=t.getBoundingClientRect(),v=(a.right-a.left)/10;return v>2&&(e.cachedCharWidth=v),v||10}function Ua(e){for(var t=e.display,u={},a={},v=t.gutters.clientLeft,F=t.gutters.firstChild,$=0;F;F=F.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;u[ee]=F.offsetLeft+F.clientLeft+v,a[ee]=F.clientWidth}return{fixedPos:Fa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:u,gutterWidth:a,wrapperWidth:t.wrapper.clientWidth}}function Fa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xs(e){var t=Si(e.display),u=e.options.lineWrapping,a=u&&Math.max(5,e.display.scroller.clientWidth/Ci(e.display)-3);return function(v){if(Cr(e.doc,v))return 0;var F=0;if(v.widgets)for(var $=0;$<v.widgets.length;$++)v.widgets[$].height&&(F+=v.widgets[$].height);return u?F+(Math.ceil(v.text.length/a)||1)*t:F+t}}function Ba(e){var t=e.doc,u=xs(e);t.iter(function(a){var v=u(a);v!=a.height&&xt(a,v)})}function mi(e,t,u,a){var v=e.display;if(!u&&ye(t).getAttribute("cm-not-content")=="true")return null;var F,$,ee=v.lineSpace.getBoundingClientRect();try{F=t.clientX-ee.left,$=t.clientY-ee.top}catch(we){return null}var ne=ka(e,F,$),le;if(a&&ne.xRel>0&&(le=et(e.doc,ne.line).text).length==ne.ch){var Ee=K(le,le.length,e.options.tabSize)-le.length;ne=Ve(ne.line,Math.max(0,Math.round((F-Br(e.display).left)/Ci(e.display))-Ee))}return ne}function gi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var u=e.display.view,a=0;a<u.length;a++)if(t-=u[a].size,t<0)return a}function Or(e,t,u,a){t==null&&(t=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),a||(a=0);var v=e.display;if(a&&u<v.viewTo&&(v.updateLineNumbers==null||v.updateLineNumbers>t)&&(v.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=v.viewTo)Lt&&zr(e.doc,t)<v.viewTo&&oi(e);else if(u<=v.viewFrom)Lt&&Mr(e.doc,u+a)>v.viewFrom?oi(e):(v.viewFrom+=a,v.viewTo+=a);else if(t<=v.viewFrom&&u>=v.viewTo)oi(e);else if(t<=v.viewFrom){var F=ha(e,u,u+a,1);F?(v.view=v.view.slice(F.index),v.viewFrom=F.lineN,v.viewTo+=a):oi(e)}else if(u>=v.viewTo){var $=ha(e,t,t,-1);$?(v.view=v.view.slice(0,$.index),v.viewTo=$.lineN):oi(e)}else{var ee=ha(e,t,t,-1),ne=ha(e,u,u+a,1);ee&&ne?(v.view=v.view.slice(0,ee.index).concat(Yn(e,ee.lineN,ne.lineN)).concat(v.view.slice(ne.index)),v.viewTo+=a):oi(e)}var le=v.externalMeasured;le&&(u<le.lineN?le.lineN+=a:t<le.lineN+le.size&&(v.externalMeasured=null))}function si(e,t,u){e.curOp.viewChanged=!0;var a=e.display,v=e.display.externalMeasured;if(v&&t>=v.lineN&&t<v.lineN+v.size&&(a.externalMeasured=null),t<a.viewFrom||t>=a.viewTo)return;var F=a.view[gi(e,t)];if(F.node==null)return;var $=F.changes||(F.changes=[]);oe($,u)==-1&&$.push(u)}function oi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ha(e,t,u,a){var v=gi(e,t),F,$=e.display.view;if(!Lt||u==e.doc.first+e.doc.size)return{index:v,lineN:u};for(var ee=e.display.viewFrom,ne=0;ne<v;ne++)ee+=$[ne].size;if(ee!=t){if(a>0){if(v==$.length-1)return null;F=ee+$[v].size-t,v++}else F=ee-t;t+=F,u+=F}for(;zr(e.doc,u)!=u;){if(v==(a<0?0:$.length-1))return null;u+=a*$[v-(a<0?1:0)].size,v+=a}return{index:v,lineN:u}}function Vo(e,t,u){var a=e.display,v=a.view;v.length==0||t>=a.viewTo||u<=a.viewFrom?(a.view=Yn(e,t,u),a.viewFrom=t):(a.viewFrom>t?a.view=Yn(e,t,a.viewFrom).concat(a.view):a.viewFrom<t&&(a.view=a.view.slice(gi(e,t))),a.viewFrom=t,a.viewTo<u?a.view=a.view.concat(Yn(e,a.viewTo,u)):a.viewTo>u&&(a.view=a.view.slice(0,gi(e,u)))),a.viewTo=u}function Ts(e){for(var t=e.display.view,u=0,a=0;a<t.length;a++){var v=t[a];!v.hidden&&(!v.node||v.changes)&&++u}return u}function Ki(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ws(e,t){t===void 0&&(t=!0);for(var u=e.doc,a={},v=a.cursors=document.createDocumentFragment(),F=a.selection=document.createDocumentFragment(),$=0;$<u.sel.ranges.length;$++){if(!t&&$==u.sel.primIndex)continue;var ee=u.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var ne=ee.empty();(ne||e.options.showCursorWhenSelecting)&&Ss(e,ee.head,v),ne||Xo(e,ee,F)}return a}function Ss(e,t,u){var a=Yr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),v=u.appendChild(f("div","\xA0","CodeMirror-cursor"));if(v.style.left=a.left+"px",v.style.top=a.top+"px",v.style.height=Math.max(0,a.bottom-a.top)*e.options.cursorHeight+"px",a.other){var F=u.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=a.other.left+"px",F.style.top=a.other.top+"px",F.style.height=(a.other.bottom-a.other.top)*.85+"px"}}function fa(e,t){return e.top-t.top||e.left-t.left}function Xo(e,t,u){var a=e.display,v=e.doc,F=document.createDocumentFragment(),$=Br(e.display),ee=$.left,ne=Math.max(a.sizerWidth,mr(e)-a.sizer.offsetLeft)-$.right,le=v.direction=="ltr";function Ee(st,ft,Bt,At){ft<0&&(ft=0),ft=Math.round(ft),At=Math.round(At),F.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+st+`px;
|
|
top: `+ft+"px; width: "+(Bt==null?ne-st:Bt)+`px;
|
|
height: `+(At-ft)+"px"))}function we(st,ft,Bt){var At=et(v,st),nn=At.text.length,Dn,lr;function Hn(Qn,Lr){return Pa(e,Ve(st,Qn),"div",At,Lr)}function Nr(Qn,Lr,gr){var nr=Es(e,At,null,Qn),qn=Lr=="ltr"==(gr=="after")?"left":"right",Gn=gr=="after"?nr.begin:nr.end-(/\s/.test(At.text.charAt(nr.end-1))?2:1);return Hn(Gn,qn)[qn]}var Rr=Qe(At,v.direction);return ze(Rr,ft||0,Bt==null?nn:Bt,function(Qn,Lr,gr,nr){var qn=gr=="ltr",Gn=Hn(Qn,qn?"left":"right"),Ir=Hn(Lr-1,qn?"right":"left"),Bi=ft==null&&Qn==0,fi=Bt==null&&Lr==nn,Er=nr==0,ti=!Rr||nr==Rr.length-1;if(Ir.top-Gn.top<=3){var ur=(le?Bi:fi)&&Er,cs=(le?fi:Bi)&&ti,ai=ur?ee:(qn?Gn:Ir).left,Ei=cs?ne:(qn?Ir:Gn).right;Ee(ai,Gn.top,Ei-ai,Gn.bottom)}else{var xi,Sr,ji,ds;qn?(xi=le&&Bi&&Er?ee:Gn.left,Sr=le?ne:Nr(Qn,gr,"before"),ji=le?ee:Nr(Lr,gr,"after"),ds=le&&fi&&ti?ne:Ir.right):(xi=le?Nr(Qn,gr,"before"):ee,Sr=!le&&Bi&&Er?ne:Gn.right,ji=!le&&fi&&ti?ee:Ir.left,ds=le?Nr(Lr,gr,"after"):ne),Ee(xi,Gn.top,Sr-xi,Gn.bottom),Gn.bottom<Ir.top&&Ee(ee,Gn.bottom,null,Ir.top),Ee(ji,Ir.top,ds-ji,Ir.bottom)}(!Dn||fa(Gn,Dn)<0)&&(Dn=Gn),fa(Ir,Dn)<0&&(Dn=Ir),(!lr||fa(Gn,lr)<0)&&(lr=Gn),fa(Ir,lr)<0&&(lr=Ir)}),{start:Dn,end:lr}}var Ne=t.from(),Pe=t.to();if(Ne.line==Pe.line)we(Ne.line,Ne.ch,Pe.ch);else{var Ke=et(v,Ne.line),Xe=et(v,Pe.line),qe=hr(Ke)==hr(Xe),at=we(Ne.line,Ne.ch,qe?Ke.text.length+1:null).end,ct=we(Pe.line,qe?0:null,Pe.ch).start;qe&&(at.top<ct.top-2?(Ee(at.right,at.top,null,at.bottom),Ee(ee,ct.top,ct.left,ct.bottom)):Ee(at.right,at.top,ct.left-at.right,at.bottom)),at.bottom<ct.top&&Ee(ee,at.bottom,null,ct.top)}u.appendChild(F)}function ja(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var u=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Oi(e),t.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Cs(e){e.state.focused||(e.display.input.focus(),Wa(e))}function Os(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Oi(e))},100)}function Wa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ue(e,"focus",e,t),e.state.focused=!0,B(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()),ja(e)}function Oi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ue(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function pa(e){for(var t=e.display,u=t.lineDiv.offsetTop,a=0;a<t.view.length;a++){var v=t.view[a],F=e.options.lineWrapping,$=void 0,ee=0;if(v.hidden)continue;if(G&&W<8){var ne=v.node.offsetTop+v.node.offsetHeight;$=ne-u,u=ne}else{var le=v.node.getBoundingClientRect();$=le.bottom-le.top,!F&&v.text.firstChild&&(ee=v.text.firstChild.getBoundingClientRect().right-le.left-1)}var Ee=v.line.height-$;if((Ee>.005||Ee<-.005)&&(xt(v.line,$),As(v.line),v.rest))for(var we=0;we<v.rest.length;we++)As(v.rest[we]);if(ee>e.display.sizerWidth){var Ne=Math.ceil(ee/Ci(e.display));Ne>e.display.maxLineLength&&(e.display.maxLineLength=Ne,e.display.maxLine=v.line,e.display.maxLineChanged=!0)}}}function As(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var u=e.widgets[t],a=u.node.parentNode;a&&(u.height=a.offsetHeight)}}function ma(e,t,u){var a=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;a=Math.floor(a-Ln(e));var v=u&&u.bottom!=null?u.bottom:a+e.wrapper.clientHeight,F=jt(t,a),$=jt(t,v);if(u&&u.ensure){var ee=u.ensure.from.line,ne=u.ensure.to.line;ee<F?(F=ee,$=jt(t,Wn(et(t,ee))+e.wrapper.clientHeight)):Math.min(ne,t.lastLine())>=$&&(F=jt(t,Wn(et(t,ne))-e.wrapper.clientHeight),$=ne)}return{from:F,to:Math.max($,F+1)}}function Yo(e,t){if(Q(e,"scrollCursorIntoView"))return;var u=e.display,a=u.sizer.getBoundingClientRect(),v=null;if(t.top+a.top<0?v=!0:t.bottom+a.top>(window.innerHeight||document.documentElement.clientHeight)&&(v=!1),v!=null&&!s){var F=f("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-u.viewOffset-Ln(e.display))+`px;
|
|
height: `+(t.bottom-t.top+zn(e)+u.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(v),e.display.lineSpace.removeChild(F)}}function $o(e,t,u,a){a==null&&(a=0);var v;!e.options.lineWrapping&&t==u&&(t=t.ch?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,u=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var $=!1,ee=Yr(e,t),ne=!u||u==t?ee:Yr(e,u);v={left:Math.min(ee.left,ne.left),top:Math.min(ee.top,ne.top)-a,right:Math.max(ee.left,ne.left),bottom:Math.max(ee.bottom,ne.bottom)+a};var le=Ha(e,v),Ee=e.doc.scrollTop,we=e.doc.scrollLeft;if(le.scrollTop!=null&&(zi(e,le.scrollTop),Math.abs(e.doc.scrollTop-Ee)>1&&($=!0)),le.scrollLeft!=null&&(vi(e,le.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&($=!0)),!$)break}return v}function Jo(e,t){var u=Ha(e,t);u.scrollTop!=null&&zi(e,u.scrollTop),u.scrollLeft!=null&&vi(e,u.scrollLeft)}function Ha(e,t){var u=e.display,a=Si(e.display);t.top<0&&(t.top=0);var v=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,F=Tr(e),$={};t.bottom-t.top>F&&(t.bottom=t.top+F);var ee=e.doc.height+Xr(u),ne=t.top<a,le=t.bottom>ee-a;if(t.top<v)$.scrollTop=ne?0:t.top;else if(t.bottom>v+F){var Ee=Math.min(t.top,(le?ee:t.bottom)-F);Ee!=v&&($.scrollTop=Ee)}var we=e.options.fixedGutter?0:u.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-we,Pe=mr(e)-u.gutters.offsetWidth,Ke=t.right-t.left>Pe;return Ke&&(t.right=t.left+Pe),t.left<10?$.scrollLeft=0:t.left<Ne?$.scrollLeft=Math.max(0,t.left+we-(Ke?0:10)):t.right>Pe+Ne-3&&($.scrollLeft=t.right+(Ke?0:10)-Pe),$}function Ka(e,t){if(t==null)return;ga(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ai(e){ga(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Gi(e,t,u){(t!=null||u!=null)&&ga(e),t!=null&&(e.curOp.scrollLeft=t),u!=null&&(e.curOp.scrollTop=u)}function Zo(e,t){ga(e),e.curOp.scrollToPos=t}function ga(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var u=bs(e,t.from),a=bs(e,t.to);Rs(e,u,a,t.margin)}}function Rs(e,t,u,a){var v=Ha(e,{left:Math.min(t.left,u.left),top:Math.min(t.top,u.top)-a,right:Math.max(t.right,u.right),bottom:Math.max(t.bottom,u.bottom)+a});Gi(e,v.scrollLeft,v.scrollTop)}function zi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||za(e,{top:t}),Ls(e,t,!0),D&&za(e),Yi(e,100)}function Ls(e,t,u){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!u)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function vi(e,t,u,a){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(u?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!a)return;e.doc.scrollLeft=t,ks(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vi(e){var t=e.display,u=t.gutters.offsetWidth,a=Math.round(e.doc.height+Xr(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?u:0,docHeight:a,scrollHeight:a+zn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:u}}var yi=function(e,t,u){this.cm=u;var a=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),v=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a.tabIndex=v.tabIndex=-1,e(a),e(v),Oe(a,"scroll",function(){a.clientHeight&&t(a.scrollTop,"vertical")}),Oe(v,"scroll",function(){v.clientWidth&&t(v.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,a=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=t?a+"px":"0";var v=e.viewHeight-(t?a:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+v)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=u?a+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(u?a: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&&(a==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?a:0,bottom:t?a:0}},yi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yi.prototype.zeroWidthHack=function(){var e=r&&!c?"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},yi.prototype.enableZeroWidthBar=function(e,t,u){e.style.pointerEvents="auto";function a(){var v=e.getBoundingClientRect(),F=u=="vert"?document.elementFromPoint(v.right-1,(v.top+v.bottom)/2):document.elementFromPoint((v.right+v.left)/2,v.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,a)}t.set(1e3,a)},yi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xi=function(){};Xi.prototype.update=function(){return{bottom:0,right:0}},Xi.prototype.setScrollLeft=function(){},Xi.prototype.setScrollTop=function(){},Xi.prototype.clear=function(){};function Ri(e,t){t||(t=Vi(e));var u=e.display.barWidth,a=e.display.barHeight;Is(e,t);for(var v=0;v<4&&u!=e.display.barWidth||a!=e.display.barHeight;v++)u!=e.display.barWidth&&e.options.lineWrapping&&pa(e),Is(e,Vi(e)),u=e.display.barWidth,a=e.display.barHeight}function Is(e,t){var u=e.display,a=u.scrollbars.update(t);u.sizer.style.paddingRight=(u.barWidth=a.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=a.bottom)+"px",u.heightForcer.style.borderBottom=a.bottom+"px solid transparent",a.right&&a.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=a.bottom+"px",u.scrollbarFiller.style.width=a.right+"px"):u.scrollbarFiller.style.display="",a.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=a.bottom+"px",u.gutterFiller.style.width=t.gutterWidth+"px"):u.gutterFiller.style.display=""}var Ds={native:yi,null:Xi};function Ps(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ds[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,u){u=="horizontal"?vi(e,t):zi(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function bi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qo},fr(e.curOp)}function _i(e){var t=e.curOp;t&&bn(t,function(u){for(var a=0;a<u.ops.length;a++)u.ops[a].cm.curOp=null;qo(u)})}function qo(e){for(var t=e.ops,u=0;u<t.length;u++)el(t[u]);for(var a=0;a<t.length;a++)tl(t[a]);for(var v=0;v<t.length;v++)nl(t[v]);for(var F=0;F<t.length;F++)rl(t[F]);for(var $=0;$<t.length;$++)il(t[$])}function el(e){var t=e.cm,u=t.display;sl(t),e.updateMaxLine&&Vr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new va(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ga(e.cm,e.update)}function nl(e){var t=e.cm,u=t.display;e.updatedDisplay&&pa(t),e.barMeasure=Vi(t),u.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jr(t,u.maxLine,u.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+zn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.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&&vi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var u=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ri(t,e.barMeasure),e.updatedDisplay&&Xa(t,e.barMeasure),e.selectionChanged&&ja(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),u&&Cs(e.cm)}function il(e){var t=e.cm,u=t.display,a=t.doc;if(e.updatedDisplay&&Ms(t,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&Ls(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&vi(t,e.scrollLeft,!0,!0),e.scrollToPos){var v=$o(t,Et(a,e.scrollToPos.from),Et(a,e.scrollToPos.to),e.scrollToPos.margin);Yo(t,v)}var F=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(F)for(var ee=0;ee<F.length;++ee)F[ee].lines.length||ue(F[ee],"hide");if($)for(var ne=0;ne<$.length;++ne)$[ne].lines.length&&ue($[ne],"unhide");u.wrapper.offsetHeight&&(a.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function kr(e,t){if(e.curOp)return t();bi(e);try{return t()}finally{_i(e)}}function sr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bi(e);try{return t.apply(e,arguments)}finally{_i(e)}}}function wr(e){return function(){if(this.curOp)return e.apply(this,arguments);bi(this);try{return e.apply(this,arguments)}finally{_i(this)}}}function or(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bi(t);try{return e.apply(this,arguments)}finally{_i(t)}}}function Yi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,N(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var u=+new Date+e.options.workTime,a=sn(e,t.highlightFrontier),v=[];t.iter(a.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(a.line>=e.display.viewFrom){var $=F.styles,ee=F.text.length>e.options.maxHighlightLength?yt(t.mode,a.state):null,ne=_n(e,F,a,!0);ee&&(a.state=ee),F.styles=ne.styles;var le=F.styleClasses,Ee=ne.classes;Ee?F.styleClasses=Ee:le&&(F.styleClasses=null);for(var we=!$||$.length!=F.styles.length||le!=Ee&&(!le||!Ee||le.bgClass!=Ee.bgClass||le.textClass!=Ee.textClass),Ne=0;!we&&Ne<$.length;++Ne)we=$[Ne]!=F.styles[Ne];we&&v.push(a.line),F.stateAfter=a.save(),a.nextLine()}else F.text.length<=e.options.maxHighlightLength&&Gt(e,F.text,a),F.stateAfter=a.line%5==0?a.save():null,a.nextLine();if(+new Date>u)return Yi(e,e.options.workDelay),!0}),t.highlightFrontier=a.line,t.modeFrontier=Math.max(t.modeFrontier,a.line),v.length&&kr(e,function(){for(var F=0;F<v.length;F++)si(e,v[F],"text")})}var va=function(e,t,u){var a=e.display;this.viewport=t,this.visible=ma(a,e.doc,t),this.editorIsHidden=!a.wrapper.offsetWidth,this.wrapperHeight=a.wrapper.clientHeight,this.wrapperWidth=a.wrapper.clientWidth,this.oldDisplayWidth=mr(e),this.force=u,this.dims=Ua(e),this.events=[]};va.prototype.signal=function(e,t){ae(e,t)&&this.events.push(arguments)},va.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ue.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=zn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=zn(e)+"px",t.scrollbarsClipped=!0)}function ol(e){if(e.hasFocus())return null;var t=M();if(!t||!y(e.display.lineDiv,t))return null;var u={activeElt:t};if(window.getSelection){var a=window.getSelection();a.anchorNode&&a.extend&&y(e.display.lineDiv,a.anchorNode)&&(u.anchorNode=a.anchorNode,u.anchorOffset=a.anchorOffset,u.focusNode=a.focusNode,u.focusOffset=a.focusOffset)}return u}function ll(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),t.removeAllRanges(),t.addRange(u),t.extend(e.focusNode,e.focusOffset)}}function Ga(e,t){var u=e.display,a=e.doc;if(t.editorIsHidden)return oi(e),!1;if(!t.force&&t.visible.from>=u.viewFrom&&t.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Ts(e)==0)return!1;Ns(e)&&(oi(e),t.dims=Ua(e));var v=a.first+a.size,F=Math.max(t.visible.from-e.options.viewportMargin,a.first),$=Math.min(v,t.visible.to+e.options.viewportMargin);u.viewFrom<F&&F-u.viewFrom<20&&(F=Math.max(a.first,u.viewFrom)),u.viewTo>$&&u.viewTo-$<20&&($=Math.min(v,u.viewTo)),Lt&&(F=zr(e.doc,F),$=Mr(e.doc,$));var ee=F!=u.viewFrom||$!=u.viewTo||u.lastWrapHeight!=t.wrapperHeight||u.lastWrapWidth!=t.wrapperWidth;Vo(e,F,$),u.viewOffset=Wn(et(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var ne=Ts(e);if(!ee&&ne==0&&!t.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var le=ol(e);return ne>4&&(u.lineDiv.style.display="none"),ul(e,u.updateLineNumbers,t.dims),ne>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,ll(le),_(u.cursorDiv),_(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,ee&&(u.lastWrapHeight=t.wrapperHeight,u.lastWrapWidth=t.wrapperWidth,Yi(e,400)),u.updateLineNumbers=null,!0}function Ms(e,t){for(var u=t.viewport,a=!0;;a=!1){if(!a||!e.options.lineWrapping||t.oldDisplayWidth==mr(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Xr(e.display)-Tr(e),u.top)}),t.visible=ma(e.display,e.doc,u),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else a&&(t.visible=ma(e.display,e.doc,u));if(!Ga(e,t))break;pa(e);var v=Vi(e);Ki(e),Ri(e,v),Xa(e,v),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 za(e,t){var u=new va(e,t);if(Ga(e,u)){pa(e),Ms(e,u);var a=Vi(e);Ki(e),Ri(e,a),Xa(e,a),u.finish()}}function ul(e,t,u){var a=e.display,v=e.options.lineNumbers,F=a.lineDiv,$=F.firstChild;function ee(Ke){var Xe=Ke.nextSibling;return n&&r&&e.display.currentWheelTarget==Ke?Ke.style.display="none":Ke.parentNode.removeChild(Ke),Xe}for(var ne=a.view,le=a.viewFrom,Ee=0;Ee<ne.length;Ee++){var we=ne[Ee];if(!we.hidden)if(!we.node||we.node.parentNode!=F){var Ne=un(e,we,le,u);F.insertBefore(Ne,$)}else{for(;$!=we.node;)$=ee($);var Pe=v&&t!=null&&t<=le&&we.lineNumber;we.changes&&(oe(we.changes,"gutter")>-1&&(Pe=!1),Qr(e,we,le,u)),Pe&&(_(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(En(e.options,le)))),$=we.node.nextSibling}le+=we.size}for(;$;)$=ee($)}function Va(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Xa(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+zn(e)+"px"}function ks(e){var t=e.display,u=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var a=Fa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,v=t.gutters.offsetWidth,F=a+"px",$=0;$<u.length;$++)if(!u[$].hidden){e.options.fixedGutter&&(u[$].gutter&&(u[$].gutter.style.left=F),u[$].gutterBackground&&(u[$].gutterBackground.style.left=F));var ee=u[$].alignable;if(ee)for(var ne=0;ne<ee.length;ne++)ee[ne].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=a+v+"px")}function Ns(e){if(!e.options.lineNumbers)return!1;var t=e.doc,u=En(e.options,t.first+t.size-1),a=e.display;if(u.length!=a.lineNumChars){var v=a.measure.appendChild(f("div",[f("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=v.firstChild.offsetWidth,$=v.offsetWidth-F;return a.lineGutter.style.width="",a.lineNumInnerWidth=Math.max(F,a.lineGutter.offsetWidth-$)+1,a.lineNumWidth=a.lineNumInnerWidth+$,a.lineNumChars=a.lineNumInnerWidth?u.length:-1,a.lineGutter.style.width=a.lineNumWidth+"px",Va(e.display),!0}return!1}function Ya(e,t){for(var u=[],a=!1,v=0;v<e.length;v++){var F=e[v],$=null;if(typeof F!="string"&&($=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)a=!0;else continue;u.push({className:F,style:$})}return t&&!a&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Us(e){var t=e.gutters,u=e.gutterSpecs;_(t),e.lineGutter=null;for(var a=0;a<u.length;++a){var v=u[a],F=v.className,$=v.style,ee=t.appendChild(f("div",null,"CodeMirror-gutter "+F));$&&(ee.style.cssText=$),F=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=u.length?"":"none",Va(e)}function $i(e){Us(e.display),Or(e),ks(e)}function cl(e,t,u,a){var v=this;this.input=u,v.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),v.scrollbarFiller.setAttribute("cm-not-content","true"),v.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),v.gutterFiller.setAttribute("cm-not-content","true"),v.lineDiv=S("div",null,"CodeMirror-code"),v.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),v.cursorDiv=f("div",null,"CodeMirror-cursors"),v.measure=f("div",null,"CodeMirror-measure"),v.lineMeasure=f("div",null,"CodeMirror-measure"),v.lineSpace=S("div",[v.measure,v.lineMeasure,v.selectionDiv,v.cursorDiv,v.lineDiv],null,"position: relative; outline: none");var F=S("div",[v.lineSpace],"CodeMirror-lines");v.mover=f("div",[F],null,"position: relative"),v.sizer=f("div",[v.mover],"CodeMirror-sizer"),v.sizerWidth=null,v.heightForcer=f("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),v.gutters=f("div",null,"CodeMirror-gutters"),v.lineGutter=null,v.scroller=f("div",[v.sizer,v.heightForcer,v.gutters],"CodeMirror-scroll"),v.scroller.setAttribute("tabIndex","-1"),v.wrapper=f("div",[v.scrollbarFiller,v.gutterFiller,v.scroller],"CodeMirror"),G&&W<8&&(v.gutters.style.zIndex=-1,v.scroller.style.paddingRight=0),!n&&!(D&&l)&&(v.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(v.wrapper):e(v.wrapper)),v.viewFrom=v.viewTo=t.first,v.reportedViewFrom=v.reportedViewTo=t.first,v.view=[],v.renderedView=null,v.externalMeasured=null,v.viewOffset=0,v.lastWrapHeight=v.lastWrapWidth=0,v.updateLineNumbers=null,v.nativeBarWidth=v.barHeight=v.barWidth=0,v.scrollbarsClipped=!1,v.lineNumWidth=v.lineNumInnerWidth=v.lineNumChars=null,v.alignWidgets=!1,v.cachedCharWidth=v.cachedTextHeight=v.cachedPaddingH=null,v.maxLine=null,v.maxLineLength=0,v.maxLineChanged=!1,v.wheelDX=v.wheelDY=v.wheelStartX=v.wheelStartY=null,v.shift=!1,v.selForContextMenu=null,v.activeTouch=null,v.gutterSpecs=Ya(a.gutters,a.lineNumbers),Us(v),u.init(v)}var ya=0,Wr=null;G?Wr=-.53:D?Wr=15:g?Wr=-.7:h&&(Wr=-1/3);function Fs(e){var t=e.wheelDeltaX,u=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:t,y:u}}function dl(e){var t=Fs(e);return t.x*=Wr,t.y*=Wr,t}function Bs(e,t){var u=Fs(t),a=u.x,v=u.y,F=e.display,$=F.scroller,ee=$.scrollWidth>$.clientWidth,ne=$.scrollHeight>$.clientHeight;if(!(a&&ee||v&&ne))return;if(v&&r&&n){e:for(var le=t.target,Ee=F.view;le!=$;le=le.parentNode)for(var we=0;we<Ee.length;we++)if(Ee[we].node==le){e.display.currentWheelTarget=le;break e}}if(a&&!D&&!p&&Wr!=null){v&&ne&&zi(e,Math.max(0,$.scrollTop+v*Wr)),vi(e,Math.max(0,$.scrollLeft+a*Wr)),(!v||v&&ne)&&re(t),F.wheelStartX=null;return}if(v&&Wr!=null){var Ne=v*Wr,Pe=e.doc.scrollTop,Ke=Pe+F.wrapper.clientHeight;Ne<0?Pe=Math.max(0,Pe+Ne-50):Ke=Math.min(e.doc.height,Ke+Ne+50),za(e,{top:Pe,bottom:Ke})}ya<20&&(F.wheelStartX==null?(F.wheelStartX=$.scrollLeft,F.wheelStartY=$.scrollTop,F.wheelDX=a,F.wheelDY=v,setTimeout(function(){if(F.wheelStartX==null)return;var Xe=$.scrollLeft-F.wheelStartX,qe=$.scrollTop-F.wheelStartY,at=qe&&F.wheelDY&&qe/F.wheelDY||Xe&&F.wheelDX&&Xe/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!at)return;Wr=(Wr*ya+at)/(ya+1),++ya},200)):(F.wheelDX+=a,F.wheelDY+=v))}var Hr=function(e,t){this.ranges=e,this.primIndex=t};Hr.prototype.primary=function(){return this.ranges[this.primIndex]},Hr.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 u=this.ranges[t],a=e.ranges[t];if(!rr(u.anchor,a.anchor)||!rr(u.head,a.head))return!1}return!0},Hr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(Dr(this.ranges[t].anchor),Dr(this.ranges[t].head));return new Hr(e,this.primIndex)},Hr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Hr.prototype.contains=function(e,t){t||(t=e);for(var u=0;u<this.ranges.length;u++){var a=this.ranges[u];if(nt(t,a.from())>=0&&nt(e,a.to())<=0)return u}return-1};var wn=function(e,t){this.anchor=e,this.head=t};wn.prototype.from=function(){return Fr(this.anchor,this.head)},wn.prototype.to=function(){return Ur(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,u){var a=e&&e.options.selectionsMayTouch,v=t[u];t.sort(function(Ne,Pe){return nt(Ne.from(),Pe.from())}),u=oe(t,v);for(var F=1;F<t.length;F++){var $=t[F],ee=t[F-1],ne=nt(ee.to(),$.from());if(a&&!$.empty()?ne>0:ne>=0){var le=Fr(ee.from(),$.from()),Ee=Ur(ee.to(),$.to()),we=ee.empty()?$.from()==$.head:ee.from()==ee.head;F<=u&&--u,t.splice(--F,2,new wn(we?Ee:le,we?le:Ee))}}return new Hr(t,u)}function li(e,t){return new Hr([new wn(e,t||e)],0)}function ui(e){return e.text?Ve(e.from.line+e.text.length-1,k(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function js(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return ui(t);var u=e.line+t.text.length-(t.to.line-t.from.line)-1,a=e.ch;return e.line==t.to.line&&(a+=ui(t).ch-t.to.ch),Ve(u,a)}function $a(e,t){for(var u=[],a=0;a<e.sel.ranges.length;a++){var v=e.sel.ranges[a];u.push(new wn(js(v.anchor,t),js(v.head,t)))}return $r(e.cm,u,e.sel.primIndex)}function Ws(e,t,u){return e.line==t.line?Ve(u.line,e.ch-t.ch+u.ch):Ve(u.line+(e.line-t.line),e.ch)}function hl(e,t,u){for(var a=[],v=Ve(e.first,0),F=v,$=0;$<t.length;$++){var ee=t[$],ne=Ws(ee.from,v,F),le=Ws(ui(ee),v,F);if(v=ee.to,F=le,u=="around"){var Ee=e.sel.ranges[$],we=nt(Ee.head,Ee.anchor)<0;a[$]=new wn(we?le:ne,we?ne:le)}else a[$]=new wn(ne,ne)}return new Hr(a,e.sel.primIndex)}function Ja(e){e.doc.mode=Mt(e.options,e.doc.modeOption),Ji(e)}function Ji(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,Yi(e,100),e.state.modeGen++,e.curOp&&Or(e)}function Hs(e,t){return t.from.ch==0&&t.to.ch==0&&k(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Za(e,t,u,a){function v(ct){return u?u[ct]:null}function F(ct,st,ft){ni(ct,st,ft,a),cn(ct,"change",ct,t)}function $(ct,st){for(var ft=[],Bt=ct;Bt<st;++Bt)ft.push(new vr(le[Bt],v(Bt),a));return ft}var ee=t.from,ne=t.to,le=t.text,Ee=et(e,ee.line),we=et(e,ne.line),Ne=k(le),Pe=v(le.length-1),Ke=ne.line-ee.line;if(t.full)e.insert(0,$(0,le.length)),e.remove(le.length,e.size-le.length);else if(Hs(e,t)){var Xe=$(0,le.length-1);F(we,we.text,Pe),Ke&&e.remove(ee.line,Ke),Xe.length&&e.insert(ee.line,Xe)}else if(Ee==we)if(le.length==1)F(Ee,Ee.text.slice(0,ee.ch)+Ne+Ee.text.slice(ne.ch),Pe);else{var qe=$(1,le.length-1);qe.push(new vr(Ne+Ee.text.slice(ne.ch),Pe,a)),F(Ee,Ee.text.slice(0,ee.ch)+le[0],v(0)),e.insert(ee.line+1,qe)}else if(le.length==1)F(Ee,Ee.text.slice(0,ee.ch)+le[0]+we.text.slice(ne.ch),v(0)),e.remove(ee.line+1,Ke);else{F(Ee,Ee.text.slice(0,ee.ch)+le[0],v(0)),F(we,Ne+we.text.slice(ne.ch),Pe);var at=$(1,le.length-1);Ke>1&&e.remove(ee.line+1,Ke-1),e.insert(ee.line+1,at)}cn(e,"change",e,t)}function ci(e,t,u){function a(v,F,$){if(v.linked)for(var ee=0;ee<v.linked.length;++ee){var ne=v.linked[ee];if(ne.doc==F)continue;var le=$&&ne.sharedHist;if(u&&!le)continue;t(ne.doc,le),a(ne.doc,v,le)}}a(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,Ba(e),Ja(e),Gs(e),e.options.lineWrapping||Vr(e),e.options.mode=t.modeOption,Or(e)}function Gs(e){(e.doc.direction=="rtl"?B:E)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){kr(e,function(){Gs(e),Or(e)})}function ba(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 Qa(e,t){var u={from:Dr(t.from),to:ui(t),text:Kt(e,t.from,t.to)};return Xs(e,u,t.from.line,t.to.line+1),ci(e,function(a){return Xs(a,u,t.from.line,t.to.line+1)},!0),u}function zs(e){for(;e.length;){var t=k(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return zs(e.done),k(e.done);if(e.done.length&&!k(e.done).ranges)return k(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),k(e.done)}function Vs(e,t,u,a){var v=e.history;v.undone.length=0;var F=+new Date,$,ee;if((v.lastOp==a||v.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&v.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(v,v.lastOp==a)))ee=k($.changes),nt(t.from,t.to)==0&&nt(t.from,ee.to)==0?ee.to=ui(t):$.changes.push(Qa(e,t));else{var ne=k(v.done);for((!ne||!ne.ranges)&&_a(e.sel,v.done),$={changes:[Qa(e,t)],generation:v.generation},v.done.push($);v.done.length>v.undoDepth;)v.done.shift(),v.done[0].ranges||v.done.shift()}v.done.push(u),v.generation=++v.maxGeneration,v.lastModTime=v.lastSelTime=F,v.lastOp=v.lastSelOp=a,v.lastOrigin=v.lastSelOrigin=t.origin,ee||ue(e,"historyAdded")}function ml(e,t,u,a){var v=t.charAt(0);return v=="*"||v=="+"&&u.ranges.length==a.ranges.length&&u.somethingSelected()==a.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,u,a){var v=e.history,F=a&&a.origin;u==v.lastSelOp||F&&v.lastSelOrigin==F&&(v.lastModTime==v.lastSelTime&&v.lastOrigin==F||ml(e,F,k(v.done),t))?v.done[v.done.length-1]=t:_a(t,v.done),v.lastSelTime=+new Date,v.lastSelOrigin=F,v.lastSelOp=u,a&&a.clearRedo!==!1&&zs(v.undone)}function _a(e,t){var u=k(t);u&&u.ranges&&u.equals(e)||t.push(e)}function Xs(e,t,u,a){var v=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,a),function($){$.markedSpans&&((v||(v=t["spans_"+e.id]={}))[F]=$.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?t||(t=e.slice(0,u)):t&&t.push(e[u]);return t?t.length?t:null:e}function yl(e,t){var u=t["spans_"+e.id];if(!u)return null;for(var a=[],v=0;v<t.text.length;++v)a.push(vl(u[v]));return a}function Ys(e,t){var u=yl(e,t),a=Cn(e,t);if(!u)return a;if(!a)return u;for(var v=0;v<u.length;++v){var F=u[v],$=a[v];if(F&&$){e:for(var ee=0;ee<$.length;++ee){for(var ne=$[ee],le=0;le<F.length;++le)if(F[le].marker==ne.marker)continue e;F.push(ne)}}else $&&(u[v]=$)}return u}function Li(e,t,u){for(var a=[],v=0;v<e.length;++v){var F=e[v];if(F.ranges){a.push(u?Hr.prototype.deepCopy.call(F):F);continue}var $=F.changes,ee=[];a.push({changes:ee});for(var ne=0;ne<$.length;++ne){var le=$[ne],Ee=void 0;if(ee.push({from:le.from,to:le.to,text:le.text}),t)for(var we in le)(Ee=we.match(/^spans_(\d+)$/))&&(oe(t,Number(Ee[1]))>-1&&(k(ee)[we]=le[we],delete le[we]))}}return a}function qa(e,t,u,a){if(a){var v=e.anchor;if(u){var F=nt(t,v)<0;F!=nt(u,v)<0?(v=t,t=u):F!=nt(t,u)<0&&(t=u)}return new wn(v,t)}else return new wn(u||t,t)}function Ea(e,t,u,a,v){v==null&&(v=e.cm&&(e.cm.display.shift||e.extend)),_r(e,new Hr([qa(e.sel.primary(),t,u,v)],0),a)}function $s(e,t,u){for(var a=[],v=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)a[F]=qa(e.sel.ranges[F],t[F],null,v);var $=$r(e.cm,a,e.sel.primIndex);_r(e,$,u)}function es(e,t,u,a){var v=e.sel.ranges.slice(0);v[t]=u,_r(e,$r(e.cm,v,e.sel.primIndex),a)}function Js(e,t,u,a){_r(e,li(t,u),a)}function bl(e,t,u){var a={ranges:t.ranges,update:function(v){this.ranges=[];for(var F=0;F<v.length;F++)this.ranges[F]=new wn(Et(e,v[F].anchor),Et(e,v[F].head))},origin:u&&u.origin};return ue(e,"beforeSelectionChange",e,a),e.cm&&ue(e.cm,"beforeSelectionChange",e.cm,a),a.ranges!=t.ranges?$r(e.cm,a.ranges,a.ranges.length-1):t}function Zs(e,t,u){var a=e.history.done,v=k(a);v&&v.ranges?(a[a.length-1]=t,xa(e,t,u)):_r(e,t,u)}function _r(e,t,u){xa(e,t,u),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function xa(e,t,u){(ae(e,"beforeSelectionChange")||e.cm&&ae(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,u));var a=u&&u.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);Qs(e,eo(e,t,a,!0)),!(u&&u.scroll===!1)&&e.cm&&Ai(e.cm)}function Qs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,te(e.cm)),cn(e,"cursorActivity",e)}function qs(e){Qs(e,eo(e,e.sel,null,!1))}function eo(e,t,u,a){for(var v,F=0;F<t.ranges.length;F++){var $=t.ranges[F],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],ne=Ta(e,$.anchor,ee&&ee.anchor,u,a),le=Ta(e,$.head,ee&&ee.head,u,a);(v||ne!=$.anchor||le!=$.head)&&(v||(v=t.ranges.slice(0,F)),v[F]=new wn(ne,le))}return v?$r(e.cm,v,t.primIndex):t}function Ii(e,t,u,a,v){var F=et(e,t.line);if(F.markedSpans)for(var $=0;$<F.markedSpans.length;++$){var ee=F.markedSpans[$],ne=ee.marker,le="selectLeft"in ne?!ne.selectLeft:ne.inclusiveLeft,Ee="selectRight"in ne?!ne.selectRight:ne.inclusiveRight;if((ee.from==null||(le?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(Ee?ee.to>=t.ch:ee.to>t.ch))){if(v&&(ue(ne,"beforeCursorEnter"),ne.explicitlyCleared))if(F.markedSpans){--$;continue}else break;if(!ne.atomic)continue;if(u){var we=ne.find(a<0?1:-1),Ne=void 0;if((a<0?Ee:le)&&(we=to(e,we,-a,we&&we.line==t.line?F:null)),we&&we.line==t.line&&(Ne=nt(we,u))&&(a<0?Ne<0:Ne>0))return Ii(e,we,t,a,v)}var Pe=ne.find(a<0?-1:1);return(a<0?le:Ee)&&(Pe=to(e,Pe,a,Pe.line==t.line?F:null)),Pe?Ii(e,Pe,t,a,v):null}}return t}function Ta(e,t,u,a,v){var F=a||1,$=Ii(e,t,u,F,v)||!v&&Ii(e,t,u,F,!0)||Ii(e,t,u,-F,v)||!v&&Ii(e,t,u,-F,!0);return $||(e.cantEdit=!0,Ve(e.first,0))}function to(e,t,u,a){return u<0&&t.ch==0?t.line>e.first?Et(e,Ve(t.line-1)):null:u>0&&t.ch==(a||et(e,t.line)).text.length?t.line<e.first+e.size-1?Ve(t.line+1,0):null:new Ve(t.line,t.ch+u)}function no(e){e.setSelection(Ve(e.firstLine(),0),Ve(e.lastLine()),be)}function ro(e,t,u){var a={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return a.canceled=!0}};return u&&(a.update=function(v,F,$,ee){v&&(a.from=Et(e,v)),F&&(a.to=Et(e,F)),$&&(a.text=$),ee!==void 0&&(a.origin=ee)}),ue(e,"beforeChange",e,a),e.cm&&ue(e.cm,"beforeChange",e.cm,a),a.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:a.from,to:a.to,text:a.text,origin:a.origin}}function Di(e,t,u){if(e.cm){if(!e.cm.curOp)return sr(e.cm,Di)(e,t,u);if(e.cm.state.suppressEdits)return}if((ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"))&&(t=ro(e,t,!0),!t))return;var a=Pn&&!u&&fn(e,t.from,t.to);if(a)for(var v=a.length-1;v>=0;--v)io(e,{from:a[v].from,to:a[v].to,text:v?[""]:t.text,origin:t.origin});else io(e,t)}function io(e,t){if(t.text.length==1&&t.text[0]==""&&nt(t.from,t.to)==0)return;var u=$a(e,t);Vs(e,t,u,e.cm?e.cm.curOp.id:NaN),Zi(e,t,u,Cn(e,t));var a=[];ci(e,function(v,F){!F&&oe(a,v.history)==-1&&(lo(v.history,t),a.push(v.history)),Zi(v,t,null,Cn(v,t))})}function wa(e,t,u){var a=e.cm&&e.cm.state.suppressEdits;if(a&&!u)return;for(var v=e.history,F,$=e.sel,ee=t=="undo"?v.done:v.undone,ne=t=="undo"?v.undone:v.done,le=0;le<ee.length&&!(F=ee[le],u?F.ranges&&!F.equals(e.sel):!F.ranges);le++);if(le==ee.length)return;for(v.lastOrigin=v.lastSelOrigin=null;;)if(F=ee.pop(),F.ranges){if(_a(F,ne),u&&!F.equals(e.sel)){_r(e,F,{clearRedo:!1});return}$=F}else if(a){ee.push(F);return}else break;var Ee=[];_a($,ne),ne.push({changes:Ee,generation:v.generation}),v.generation=F.generation||++v.maxGeneration;for(var we=ae(e,"beforeChange")||e.cm&&ae(e.cm,"beforeChange"),Ne=function(Xe){var qe=F.changes[Xe];if(qe.origin=t,we&&!ro(e,qe,!1))return ee.length=0,{};Ee.push(Qa(e,qe));var at=Xe?$a(e,qe):k(ee);Zi(e,qe,at,Ys(e,qe)),!Xe&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:ui(qe)});var ct=[];ci(e,function(st,ft){!ft&&oe(ct,st.history)==-1&&(lo(st.history,qe),ct.push(st.history)),Zi(st,qe,null,Ys(st,qe))})},Pe=F.changes.length-1;Pe>=0;--Pe){var Ke=Ne(Pe);if(Ke)return Ke.v}}function ao(e,t){if(t==0)return;if(e.first+=t,e.sel=new Hr(j(e.sel.ranges,function(v){return new wn(Ve(v.anchor.line+t,v.anchor.ch),Ve(v.head.line+t,v.head.ch))}),e.sel.primIndex),e.cm){Or(e.cm,e.first,e.first-t,t);for(var u=e.cm.display,a=u.viewFrom;a<u.viewTo;a++)si(e.cm,a,"gutter")}}function Zi(e,t,u,a){if(e.cm&&!e.cm.curOp)return sr(e.cm,Zi)(e,t,u,a);if(t.to.line<e.first){ao(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 v=t.text.length-1-(e.first-t.from.line);ao(e,v),t={from:Ve(e.first,0),to:Ve(t.to.line+v,t.to.ch),text:[k(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:Ve(F,et(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Kt(e,t.from,t.to),u||(u=$a(e,t)),e.cm?_l(e.cm,t,a):Za(e,t,a),xa(e,u,be),e.cantEdit&&Ta(e,Ve(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,u){var a=e.doc,v=e.display,F=t.from,$=t.to,ee=!1,ne=F.line;e.options.lineWrapping||(ne=Dt(hr(et(a,F.line))),a.iter(ne,$.line+1,function(Pe){if(Pe==v.maxLine)return ee=!0,!0})),a.sel.contains(t.from,t.to)>-1&&te(e),Za(a,t,u,xs(e)),e.options.lineWrapping||(a.iter(ne,F.line+t.text.length,function(Pe){var Ke=gt(Pe);Ke>v.maxLineLength&&(v.maxLine=Pe,v.maxLineLength=Ke,v.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Zt(a,F.line),Yi(e,400);var le=t.text.length-($.line-F.line)-1;t.full?Or(e):F.line==$.line&&t.text.length==1&&!Hs(e.doc,t)?si(e,F.line,"text"):Or(e,F.line,$.line+1,le);var Ee=ae(e,"changes"),we=ae(e,"change");if(we||Ee){var Ne={from:F,to:$,text:t.text,removed:t.removed,origin:t.origin};we&&cn(e,"change",e,Ne),Ee&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function Pi(e,t,u,a,v){var F;a||(a=u),nt(a,u)<0&&(F=[a,u],u=F[0],a=F[1]),typeof t=="string"&&(t=e.splitLines(t)),Di(e,{from:u,to:a,text:t,origin:v})}function so(e,t,u,a){u<e.line?e.line+=a:t<e.line&&(e.line=t,e.ch=0)}function oo(e,t,u,a){for(var v=0;v<e.length;++v){var F=e[v],$=!0;if(F.ranges){F.copied||(F=e[v]=F.deepCopy(),F.copied=!0);for(var ee=0;ee<F.ranges.length;ee++)so(F.ranges[ee].anchor,t,u,a),so(F.ranges[ee].head,t,u,a);continue}for(var ne=0;ne<F.changes.length;++ne){var le=F.changes[ne];if(u<le.from.line)le.from=Ve(le.from.line+a,le.from.ch),le.to=Ve(le.to.line+a,le.to.ch);else if(t<=le.to.line){$=!1;break}}$||(e.splice(0,v+1),v=0)}}function lo(e,t){var u=t.from.line,a=t.to.line,v=t.text.length-(a-u)-1;oo(e.done,u,a,v),oo(e.undone,u,a,v)}function Qi(e,t,u,a){var v=t,F=t;return typeof t=="number"?F=et(e,jn(e,t)):v=Dt(t),v==null?null:(a(F,v)&&e.cm&&si(e.cm,v,u),F)}function qi(e){this.lines=e,this.parent=null;for(var t=0,u=0;u<e.length;++u)e[u].parent=this,t+=e[u].height;this.height=t}qi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var u=e,a=e+t;u<a;++u){var v=this.lines[u];this.height-=v.height,pt(v),cn(v,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var a=0;a<t.length;++a)t[a].parent=this},iterN:function(e,t,u){for(var a=e+t;e<a;++e)if(u(this.lines[e]))return!0}};function ea(e){this.children=e;for(var t=0,u=0,a=0;a<e.length;++a){var v=e[a];t+=v.chunkSize(),u+=v.height,v.parent=this}this.size=t,this.height=u,this.parent=null}ea.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var u=0;u<this.children.length;++u){var a=this.children[u],v=a.chunkSize();if(e<v){var F=Math.min(t,v-e),$=a.height;if(a.removeInner(e,F),this.height-=$-a.height,v==F&&(this.children.splice(u--,1),a.parent=null),(t-=F)==0)break;e=0}else e-=v}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof qi))){var ee=[];this.collapse(ee),this.children=[new qi(ee)],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,u){this.size+=t.length,this.height+=u;for(var a=0;a<this.children.length;++a){var v=this.children[a],F=v.chunkSize();if(e<=F){if(v.insertInner(e,t,u),v.lines&&v.lines.length>50){for(var $=v.lines.length%25+25,ee=$;ee<v.lines.length;){var ne=new qi(v.lines.slice(ee,ee+=25));v.height-=ne.height,this.children.splice(++a,0,ne),ne.parent=this}v.lines=v.lines.slice(0,$),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),u=new ea(t);if(e.parent){e.size-=u.size,e.height-=u.height;var v=oe(e.parent.children,e);e.parent.children.splice(v+1,0,u)}else{var a=new ea(e.children);a.parent=e,e.children=[a,u],e=a}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,u){for(var a=0;a<this.children.length;++a){var v=this.children[a],F=v.chunkSize();if(e<F){var $=Math.min(t,F-e);if(v.iterN(e,$,u))return!0;if((t-=$)==0)break;e=0}else e-=F}}};var ta=function(e,t,u){if(u)for(var a in u)u.hasOwnProperty(a)&&(this[a]=u[a]);this.doc=e,this.node=t};ta.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,u=this.line,a=Dt(u);if(a==null||!t)return;for(var v=0;v<t.length;++v)t[v]==this&&t.splice(v--,1);t.length||(u.widgets=null);var F=Zn(this);xt(u,Math.max(0,u.height-F)),e&&(kr(e,function(){uo(e,u,-F),si(e,a,"widget")}),cn(e,"lineWidgetCleared",e,this,a))},ta.prototype.changed=function(){var e=this,t=this.height,u=this.doc.cm,a=this.line;this.height=null;var v=Zn(this)-t;if(!v)return;Cr(this.doc,a)||xt(a,a.height+v),u&&kr(u,function(){u.curOp.forceUpdate=!0,uo(u,a,v),cn(u,"lineWidgetChanged",u,e,Dt(a))})},ce(ta);function uo(e,t,u){Wn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ka(e,u)}function El(e,t,u,a){var v=new ta(e,u,a),F=e.cm;return F&&v.noHScroll&&(F.display.alignWidgets=!0),Qi(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(v.insertAt==null?ee.push(v):ee.splice(Math.min(ee.length-1,Math.max(0,v.insertAt)),0,v),v.line=$,F&&!Cr(e,$)){var ne=Wn($)<e.scrollTop;xt($,$.height+Zn(v)),ne&&Ka(F,v.height),F.curOp.forceUpdate=!0}return!0}),F&&cn(F,"lineWidgetAdded",F,v,typeof t=="number"?t:Dt(t)),v}var co=0,di=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++co};di.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&bi(e),ae(this,"clear")){var u=this.find();u&&cn(this,"clear",u.from,u.to)}for(var a=null,v=null,F=0;F<this.lines.length;++F){var $=this.lines[F],ee=Tn($.markedSpans,this);e&&!this.collapsed?si(e,Dt($),"text"):e&&(ee.to!=null&&(v=Dt($)),ee.from!=null&&(a=Dt($))),$.markedSpans=In($.markedSpans,ee),ee.from==null&&this.collapsed&&!Cr(this.doc,$)&&e&&xt($,Si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ne=0;ne<this.lines.length;++ne){var le=hr(this.lines[ne]),Ee=gt(le);Ee>e.display.maxLineLength&&(e.display.maxLine=le,e.display.maxLineLength=Ee,e.display.maxLineChanged=!0)}a!=null&&e&&this.collapsed&&Or(e,a,v+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&qs(e.doc)),e&&cn(e,"markerCleared",e,this,a,v),t&&_i(e),this.parent&&this.parent.clear()},di.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var u,a,v=0;v<this.lines.length;++v){var F=this.lines[v],$=Tn(F.markedSpans,this);if($.from!=null&&(u=Ve(t?F:Dt(F),$.from),e==-1))return u;if($.to!=null&&(a=Ve(t?F:Dt(F),$.to),e==1))return a}return u&&{from:u,to:a}},di.prototype.changed=function(){var e=this,t=this.find(-1,!0),u=this,a=this.doc.cm;if(!t||!a)return;kr(a,function(){var v=t.line,F=Dt(t.line),$=ca(a,F);if($&&(ps($),a.curOp.selectionChanged=a.curOp.forceUpdate=!0),a.curOp.updateMaxLine=!0,!Cr(u.doc,v)&&u.height!=null){var ee=u.height;u.height=null;var ne=Zn(u)-ee;ne&&xt(v,v.height+ne)}cn(a,"markerChanged",a,e)})},di.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)},di.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)}},ce(di);function Mi(e,t,u,a,v){if(a&&a.shared)return xl(e,t,u,a,v);if(e.cm&&!e.cm.curOp)return sr(e.cm,Mi)(e,t,u,a,v);var F=new di(e,v),$=nt(t,u);if(a&&C(a,F,!1),$>0||$==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=S("span",[F.replacedWith],"CodeMirror-widget"),a.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),a.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(kn(e,t.line,t,u,F)||t.line!=u.line&&kn(e,u.line,t,u,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");Un()}F.addToHistory&&Vs(e,{from:t,to:u,origin:"markText"},e.sel,NaN);var ee=t.line,ne=e.cm,le;if(e.iter(ee,u.line+1,function(we){ne&&F.collapsed&&!ne.options.lineWrapping&&hr(we)==ne.display.maxLine&&(le=!0),F.collapsed&&ee!=t.line&&xt(we,0),ir(we,new An(F,ee==t.line?t.ch:null,ee==u.line?u.ch:null)),++ee}),F.collapsed&&e.iter(t.line,u.line+1,function(we){Cr(e,we)&&xt(we,0)}),F.clearOnEnter&&Oe(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(Mn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++co,F.atomic=!0),ne){if(le&&(ne.curOp.updateMaxLine=!0),F.collapsed)Or(ne,t.line,u.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var Ee=t.line;Ee<=u.line;Ee++)si(ne,Ee,"text");F.atomic&&qs(ne.doc),cn(ne,"markerAdded",ne,F)}return F}var na=function(e,t){this.markers=e,this.primary=t;for(var u=0;u<e.length;++u)e[u].parent=this};na.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")},na.prototype.find=function(e,t){return this.primary.find(e,t)},ce(na);function xl(e,t,u,a,v){a=C(a),a.shared=!1;var F=[Mi(e,t,u,a,v)],$=F[0],ee=a.widgetNode;return ci(e,function(ne){ee&&(a.widgetNode=ee.cloneNode(!0)),F.push(Mi(ne,Et(ne,t),Et(ne,u),a,v));for(var le=0;le<ne.linked.length;++le)if(ne.linked[le].isParent)return;$=k(F)}),new na(F,$)}function ho(e){return e.findMarks(Ve(e.first,0),e.clipPos(Ve(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var u=0;u<t.length;u++){var a=t[u],v=a.find(),F=e.clipPos(v.from),$=e.clipPos(v.to);if(nt(F,$)){var ee=Mi(e,F,$,a.primary,a.primary.type);a.markers.push(ee),ee.parent=a}}}function wl(e){for(var t=function(a){var v=e[a],F=[v.primary.doc];ci(v.primary.doc,function(ne){return F.push(ne)});for(var $=0;$<v.markers.length;$++){var ee=v.markers[$];oe(F,ee.doc)==-1&&(ee.parent=null,v.markers.splice($--,1))}},u=0;u<e.length;u++)t(u)}var Sl=0,Ar=function(e,t,u,a,v){if(!(this instanceof Ar))return new Ar(e,t,u,a,v);u==null&&(u=0),ea.call(this,[new qi([new vr("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var F=Ve(u,0);this.sel=li(F),this.history=new ba(null),this.id=++Sl,this.modeOption=t,this.lineSep=a,this.direction=v=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Za(this,{from:F,to:F,text:e}),_r(this,li(F),be)};Ar.prototype=X(ea.prototype,{constructor:Ar,iter:function(e,t,u){u?this.iterN(e-this.first,t-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var u=0,a=0;a<t.length;++a)u+=t[a].height;this.insertInner(e-this.first,t,u)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Yt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:or(function(e){var t=Ve(this.first,0),u=this.first+this.size-1;Di(this,{from:t,to:Ve(u,et(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Gi(this.cm,0,0),_r(this,li(t),be)}),replaceRange:function(e,t,u,a){t=Et(this,t),u=u?Et(this,u):t,Pi(this,e,t,u,a)},getRange:function(e,t,u){var a=Kt(this,Et(this,e),Et(this,t));return u===!1?a:a.join(u||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Fn(this,e))return et(this,e)},getLineNumber:function(e){return Dt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=et(this,e)),hr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Et(this,e)},getCursor:function(e){var t=this.sel.primary(),u;return e==null||e=="head"?u=t.head:e=="anchor"?u=t.anchor:e=="end"||e=="to"||e===!1?u=t.to():u=t.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:or(function(e,t,u){Js(this,Et(this,typeof e=="number"?Ve(e,t||0):e),null,u)}),setSelection:or(function(e,t,u){Js(this,Et(this,e),Et(this,t||e),u)}),extendSelection:or(function(e,t,u){Ea(this,Et(this,e),t&&Et(this,t),u)}),extendSelections:or(function(e,t){$s(this,Me(this,e),t)}),extendSelectionsBy:or(function(e,t){var u=j(this.sel.ranges,e);$s(this,Me(this,u),t)}),setSelections:or(function(e,t,u){if(!e.length)return;for(var a=[],v=0;v<e.length;v++)a[v]=new wn(Et(this,e[v].anchor),Et(this,e[v].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),_r(this,$r(this.cm,a,t),u)}),addSelection:or(function(e,t,u){var a=this.sel.ranges.slice(0);a.push(new wn(Et(this,e),Et(this,t||e))),_r(this,$r(this.cm,a,a.length-1),u)}),getSelection:function(e){for(var t=this.sel.ranges,u,a=0;a<t.length;a++){var v=Kt(this,t[a].from(),t[a].to());u=u?u.concat(v):v}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],u=this.sel.ranges,a=0;a<u.length;a++){var v=Kt(this,u[a].from(),u[a].to());e!==!1&&(v=v.join(e||this.lineSeparator())),t[a]=v}return t},replaceSelection:function(e,t,u){for(var a=[],v=0;v<this.sel.ranges.length;v++)a[v]=e;this.replaceSelections(a,t,u||"+input")},replaceSelections:or(function(e,t,u){for(var a=[],v=this.sel,F=0;F<v.ranges.length;F++){var $=v.ranges[F];a[F]={from:$.from(),to:$.to(),text:this.splitLines(e[F]),origin:u}}for(var ee=t&&t!="end"&&hl(this,a,t),ne=a.length-1;ne>=0;ne--)Di(this,a[ne]);ee?Zs(this,ee):this.cm&&Ai(this.cm)}),undo:or(function(){wa(this,"undo")}),redo:or(function(){wa(this,"redo")}),undoSelection:or(function(){wa(this,"undo",!0)}),redoSelection:or(function(){wa(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,u=0,a=0;a<e.done.length;a++)e.done[a].ranges||++t;for(var v=0;v<e.undone.length;v++)e.undone[v].ranges||++u;return{undo:t,redo:u}},clearHistory:function(){var e=this;this.history=new ba(this.history.maxGeneration),ci(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:Li(this.history.done),undone:Li(this.history.undone)}},setHistory:function(e){var t=this.history=new ba(this.history.maxGeneration);t.done=Li(e.done.slice(0),null,!0),t.undone=Li(e.undone.slice(0),null,!0)},setGutterMarker:or(function(e,t,u){return Qi(this,e,"gutter",function(a){var v=a.gutterMarkers||(a.gutterMarkers={});return v[t]=u,!u&&pe(v)&&(a.gutterMarkers=null),!0})}),clearGutter:or(function(e){var t=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&Qi(t,u,"gutter",function(){return u.gutterMarkers[e]=null,pe(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Fn(this,e))return null;if(t=e,e=et(this,e),!e)return null}else if(t=Dt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:or(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(a){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!a[v])a[v]=u;else{if(A(u).test(a[v]))return!1;a[v]+=" "+u}return!0})}),removeLineClass:or(function(e,t,u){return Qi(this,e,t=="gutter"?"gutter":"class",function(a){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=a[v];if(F)if(u==null)a[v]=null;else{var $=F.match(A(u));if(!$)return!1;var ee=$.index+$[0].length;a[v]=F.slice(0,$.index)+(!$.index||ee==F.length?"":" ")+F.slice(ee)||null}else return!1;return!0})}),addLineWidget:or(function(e,t,u){return El(this,e,t,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,u){return Mi(this,Et(this,e),Et(this,t),u,u&&u.type||"range")},setBookmark:function(e,t){var u={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Et(this,e),Mi(this,e,e,u,"bookmark")},findMarksAt:function(e){e=Et(this,e);var t=[],u=et(this,e.line).markedSpans;if(u)for(var a=0;a<u.length;++a){var v=u[a];(v.from==null||v.from<=e.ch)&&(v.to==null||v.to>=e.ch)&&t.push(v.marker.parent||v.marker)}return t},findMarks:function(e,t,u){e=Et(this,e),t=Et(this,t);var a=[],v=e.line;return this.iter(e.line,t.line+1,function(F){var $=F.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var ne=$[ee];!(ne.to!=null&&v==e.line&&e.ch>=ne.to||ne.from==null&&v!=e.line||ne.from!=null&&v==t.line&&ne.from>=t.ch)&&(!u||u(ne.marker))&&a.push(ne.marker.parent||ne.marker)}++v}),a},getAllMarks:function(){var e=[];return this.iter(function(t){var u=t.markedSpans;if(u)for(var a=0;a<u.length;++a)u[a].from!=null&&e.push(u[a].marker)}),e},posFromIndex:function(e){var t,u=this.first,a=this.lineSeparator().length;return this.iter(function(v){var F=v.text.length+a;if(F>e)return t=e,!0;e-=F,++u}),Et(this,Ve(u,t))},indexFromPos:function(e){e=Et(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(a){t+=a.text.length+u}),t},copy:function(e){var t=new Ar(Yt(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,u=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<u&&(u=e.to);var a=new Ar(Yt(this,t,u),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(a.history=this.history),(this.linked||(this.linked=[])).push({doc:a,sharedHist:e.sharedHist}),a.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(a,ho(this)),a},unlinkDoc:function(e){if(e instanceof Bn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var u=this.linked[t];if(u.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(ho(this));break}if(e.history==this.history){var a=[e.id];ci(e,function(v){return a.push(v.id)},!0),e.history=new ba(null),e.history.done=Li(this.history.done,a),e.history.undone=Li(this.history.undone,a)}},iterLinkedDocs:function(e){ci(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):lt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:or(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)})}),Ar.prototype.eachLine=Ar.prototype.iter;var fo=0;function Cl(e){var t=this;if(po(t),Q(t,e)||dn(t.display,e))return;re(e),G&&(fo=+new Date);var u=mi(t,e,!0),a=e.dataTransfer.files;if(!u||t.isReadOnly())return;if(a&&a.length&&window.FileReader&&window.File)for(var v=a.length,F=Array(v),$=0,ee=function(){++$==v&&sr(t,function(){u=Et(t.doc,u);var Pe={from:u,to:u,text:t.doc.splitLines(F.filter(function(Ke){return Ke!=null}).join(t.doc.lineSeparator())),origin:"paste"};Di(t.doc,Pe),Zs(t.doc,li(Et(t.doc,u),Et(t.doc,ui(Pe))))})()},ne=function(Pe,Ke){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,Pe.type)==-1){ee();return}var Xe=new FileReader;Xe.onerror=function(){return ee()},Xe.onload=function(){var qe=Xe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){ee();return}F[Ke]=qe,ee()},Xe.readAsText(Pe)},le=0;le<a.length;le++)ne(a[le],le);else{if(t.state.draggingText&&t.doc.sel.contains(u)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ee=e.dataTransfer.getData("Text");if(Ee){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),xa(t.doc,li(u,u)),we)for(var Ne=0;Ne<we.length;++Ne)Pi(t.doc,"",we[Ne].anchor,we[Ne].head,"drag");t.replaceSelection(Ee,"around","paste"),t.display.input.focus()}}catch(Pe){}}}function Ol(e,t){if(G&&(!e.state.draggingText||+new Date-fo<100)){me(t);return}if(Q(e,t)||dn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var u=f("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),t.dataTransfer.setDragImage(u,0,0),p&&u.parentNode.removeChild(u)}}function Al(e,t){var u=mi(e,t);if(!u)return;var a=document.createDocumentFragment();Ss(e,u,a),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),m(e.display.dragCursor,a)}function po(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function mo(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),u=[],a=0;a<t.length;a++){var v=t[a].CodeMirror;v&&u.push(v)}u.length&&u[0].operation(function(){for(var F=0;F<u.length;F++)e(u[F])})}var go=!1;function Rl(){if(go)return;Ll(),go=!0}function Ll(){var e;Oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,mo(Il)},100))}),Oe(window,"blur",function(){return mo(Oi)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var hi={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"},ra=0;ra<10;ra++)hi[ra+48]=hi[ra+96]=String(ra);for(var Sa=65;Sa<=90;Sa++)hi[Sa]=String.fromCharCode(Sa);for(var ia=1;ia<=12;ia++)hi[ia+111]=hi[ia+63235]="F"+ia;var ii={};ii.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"},ii.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"},ii.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"},ii.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"]},ii.default=r?ii.macDefault:ii.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var u,a,v,F,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))F=!0;else if(/^a(lt)?$/i.test(ee))u=!0;else if(/^(c|ctrl|control)$/i.test(ee))a=!0;else if(/^s(hift)?$/i.test(ee))v=!0;else throw new Error("Unrecognized modifier name: "+ee)}return u&&(e="Alt-"+e),a&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),v&&(e="Shift-"+e),e}function Pl(e){var t={};for(var u in e)if(e.hasOwnProperty(u)){var a=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(a=="..."){delete e[u];continue}for(var v=j(u.split(" "),Dl),F=0;F<v.length;F++){var $=void 0,ee=void 0;F==v.length-1?(ee=v.join(" "),$=a):(ee=v.slice(0,F+1).join(" "),$="...");var ne=t[ee];if(!ne)t[ee]=$;else if(ne!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[u]}for(var le in t)e[le]=t[le];return e}function ki(e,t,u,a){t=Ca(t);var v=t.call?t.call(e,a):t[e];if(v===!1)return"nothing";if(v==="...")return"multi";if(v!=null&&u(v))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return ki(e,t.fallthrough,u,a);for(var F=0;F<t.fallthrough.length;F++){var $=ki(e,t.fallthrough[F],u,a);if($)return $}}}function vo(e){var t=typeof e=="string"?e:hi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function yo(e,t,u){var a=e;return t.altKey&&a!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&a!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&a!="Mod"&&(e="Cmd-"+e),!u&&t.shiftKey&&a!="Shift"&&(e="Shift-"+e),e}function bo(e,t){if(p&&e.keyCode==34&&e.char)return!1;var u=hi[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),yo(u,e,t))}function Ca(e){return typeof e=="string"?ii[e]:e}function Ni(e,t){for(var u=e.doc.sel.ranges,a=[],v=0;v<u.length;v++){for(var F=t(u[v]);a.length&&nt(F.from,k(a).to)<=0;){var $=a.pop();if(nt($.from,F.from)<0){F.from=$.from;break}}a.push(F)}kr(e,function(){for(var ee=a.length-1;ee>=0;ee--)Pi(e.doc,"",a[ee].from,a[ee].to,"+delete");Ai(e)})}function ts(e,t,u){var a=De(e.text,t+u,u);return a<0||a>e.text.length?null:a}function ns(e,t,u){var a=ts(e,t.ch,u);return a==null?null:new Ve(t.line,a,u<0?"after":"before")}function rs(e,t,u,a,v){if(e){t.doc.direction=="rtl"&&(v=-v);var F=Qe(u,t.doc.direction);if(F){var $=v<0?k(F):F[0],ee=v<0==($.level==1),ne=ee?"after":"before",le;if($.level>0||t.doc.direction=="rtl"){var Ee=br(t,u);le=v<0?u.text.length-1:0;var we=ei(t,Ee,le).top;le=je(function(Ne){return ei(t,Ee,Ne).top==we},v<0==($.level==1)?$.from:$.to-1,le),ne=="before"&&(le=ts(u,le,1))}else le=v<0?$.to:$.from;return new Ve(a,le,ne)}}return new Ve(a,v<0?u.text.length:0,v<0?"before":"after")}function Ml(e,t,u,a){var v=Qe(t,e.doc.direction);if(!v)return ns(t,u,a);u.ch>=t.text.length?(u.ch=t.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var F=$e(v,u.ch,u.sticky),$=v[F];if(e.doc.direction=="ltr"&&$.level%2==0&&(a>0?$.to>u.ch:$.from<u.ch))return ns(t,u,a);var ee=function(at,ct){return ts(t,at instanceof Ve?at.ch:at,ct)},ne,le=function(at){return e.options.lineWrapping?(ne=ne||br(e,t),Es(e,t,ne,at)):{begin:0,end:t.text.length}},Ee=le(u.sticky=="before"?ee(u,-1):u.ch);if(e.doc.direction=="rtl"||$.level==1){var we=$.level==1==a<0,Ne=ee(u,we?1:-1);if(Ne!=null&&(we?Ne<=$.to&&Ne<=Ee.end:Ne>=$.from&&Ne>=Ee.begin)){var Pe=we?"before":"after";return new Ve(u.line,Ne,Pe)}}var Ke=function(at,ct,st){for(var ft=function(Dn,lr){return lr?new Ve(u.line,ee(Dn,1),"before"):new Ve(u.line,Dn,"after")};at>=0&&at<v.length;at+=ct){var Bt=v[at],At=ct>0==(Bt.level!=1),nn=At?st.begin:ee(st.end,-1);if(Bt.from<=nn&&nn<Bt.to)return ft(nn,At);if(nn=At?Bt.from:ee(Bt.to,-1),st.begin<=nn&&nn<st.end)return ft(nn,At)}},Xe=Ke(F+a,a,Ee);if(Xe)return Xe;var qe=a>0?Ee.end:ee(Ee.begin,-1);return qe!=null&&!(a>0&&qe==t.text.length)&&(Xe=Ke(a>0?0:v.length-1,a,le(qe)),Xe)?Xe:null}var aa={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return Ni(e,function(t){if(t.empty()){var u=et(e.doc,t.head.line).text.length;return t.head.ch==u&&t.head.line<e.lastLine()?{from:t.head,to:Ve(t.head.line+1,0)}:{from:t.head,to:Ve(t.head.line,u)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ni(e,function(t){return{from:Ve(t.from().line,0),to:Et(e.doc,Ve(t.to().line+1,0))}})},delLineLeft:function(e){return Ni(e,function(t){return{from:Ve(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,a=e.coordsChar({left:0,top:u},"div");return{from:a,to:t.from()}})},delWrappedLineRight:function(e){return Ni(e,function(t){var u=e.charCoords(t.head,"div").top+5,a=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:t.from(),to:a}})},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(Ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ve(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return _o(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Eo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var u=e.cursorCoords(t.head,"div").top+5,a=e.coordsChar({left:0,top:u},"div");return a.ch<e.getLine(a.line).search(/\S/)?Eo(e,t.head):a},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=[],u=e.listSelections(),a=e.options.tabSize,v=0;v<u.length;v++){var F=u[v].from(),$=K(e.getLine(F.line),F.ch,a);t.push(Y(a-$%a))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return kr(e,function(){for(var t=e.listSelections(),u=[],a=0;a<t.length;a++){if(!t[a].empty())continue;var v=t[a].head,F=et(e.doc,v.line).text;if(F){if(v.ch==F.length&&(v=new Ve(v.line,v.ch-1)),v.ch>0)v=new Ve(v.line,v.ch+1),e.replaceRange(F.charAt(v.ch-1)+F.charAt(v.ch-2),Ve(v.line,v.ch-2),v,"+transpose");else if(v.line>e.doc.first){var $=et(e.doc,v.line-1).text;$&&(v=new Ve(v.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),Ve(v.line-1,$.length-1),v,"+transpose"))}}u.push(new wn(v,v))}e.setSelections(u)})},newlineAndIndent:function(e){return kr(e,function(){for(var t=e.listSelections(),u=t.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),t[u].anchor,t[u].head,"+input");t=e.listSelections();for(var a=0;a<t.length;a++)e.indentLine(t[a].from().line,null,!0);Ai(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function _o(e,t){var u=et(e.doc,t),a=hr(u);return a!=u&&(t=Dt(a)),rs(!0,e,a,t,1)}function kl(e,t){var u=et(e.doc,t),a=Zr(u);return a!=u&&(t=Dt(a)),rs(!0,e,u,t,-1)}function Eo(e,t){var u=_o(e,t.line),a=et(e.doc,u.line),v=Qe(a,e.doc.direction);if(!v||v[0].level==0){var F=Math.max(u.ch,a.text.search(/\S/)),$=t.line==u.line&&t.ch<=F&&t.ch;return Ve(u.line,$?0:F,u.sticky)}return u}function Oa(e,t,u){if(typeof t=="string"&&(t=aa[t],!t))return!1;e.display.input.ensurePolled();var a=e.display.shift,v=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),v=t(e)!=xe}finally{e.display.shift=a,e.state.suppressEdits=!1}return v}function Nl(e,t,u){for(var a=0;a<e.state.keyMaps.length;a++){var v=ki(t,e.state.keyMaps[a],u,e);if(v)return v}return e.options.extraKeys&&ki(t,e.options.extraKeys,u,e)||ki(t,e.options.keyMap,u,e)}var Ul=new Z;function sa(e,t,u,a){var v=e.state.keySeq;if(v){if(vo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==v&&(e.state.keySeq=null,e.display.input.reset())}),xo(e,v+" "+t,u,a))return!0}return xo(e,t,u,a)}function xo(e,t,u,a){var v=Nl(e,t,a);return v=="multi"&&(e.state.keySeq=t),v=="handled"&&cn(e,"keyHandled",e,t,u),(v=="handled"||v=="multi")&&(re(u),ja(e)),!!v}function To(e,t){var u=bo(t,!0);return u?t.shiftKey&&!e.state.keySeq?sa(e,"Shift-"+u,t,function(a){return Oa(e,a,!0)})||sa(e,u,t,function(a){if(typeof a=="string"?/^go[A-Z]/.test(a):a.motion)return Oa(e,a)}):sa(e,u,t,function(a){return Oa(e,a)}):!1}function Fl(e,t,u){return sa(e,"'"+u+"'",t,function(a){return Oa(e,a,!0)})}var is=null;function wo(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),Q(t,e))return;G&&W<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;t.display.shift=u==16||e.shiftKey;var a=To(t,e);p&&(is=a?u:null,!a&&u==88&&!Wt&&(r?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!r&&!a&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function u(a){(a.keyCode==18||!a.altKey)&&(E(t,"CodeMirror-crosshair"),He(document,"keyup",u),He(document,"mouseover",u))}Oe(document,"keyup",u),Oe(document,"mouseover",u)}function So(e){e.keyCode==16&&(this.doc.sel.shift=!1),Q(this,e)}function Co(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(dn(t.display,e)||Q(t,e)||e.ctrlKey&&!e.altKey||r&&e.metaKey)return;var u=e.keyCode,a=e.charCode;if(p&&u==is){is=null,re(e);return}if(p&&(!e.which||e.which<10)&&To(t,e))return;var v=String.fromCharCode(a==null?u:a);if(v=="\b")return;if(Fl(t,e,v))return;t.display.input.onKeyPress(e)}var jl=400,as=function(e,t,u){this.time=e,this.pos=t,this.button=u};as.prototype.compare=function(e,t,u){return this.time+jl>e&&nt(t,this.pos)==0&&u==this.button};var oa,la;function Wl(e,t){var u=+new Date;return la&&la.compare(u,e,t)?(oa=la=null,"triple"):oa&&oa.compare(u,e,t)?(la=new as(u,e,t),oa=null,"double"):(oa=new as(u,e,t),la=null,"single")}function Oo(e){var t=this,u=t.display;if(Q(t,e)||u.activeTouch&&u.input.supportsTouch())return;if(u.input.ensurePolled(),u.shift=e.shiftKey,dn(u,e)){n||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(ss(t,e))return;var a=mi(t,e),v=Se(e),F=a?Wl(a,v):"single";if(window.focus(),v==1&&t.state.selectingText&&t.state.selectingText(e),a&&Hl(t,v,a,F,e))return;v==1?a?Gl(t,a,F,e):ye(e)==u.scroller&&re(e):v==2?(a&&Ea(t.doc,a),setTimeout(function(){return u.input.focus()},20)):v==3&&(L?t.display.input.onContextMenu(e):Os(t))}function Hl(e,t,u,a,v){var F="Click";return a=="double"?F="Double"+F:a=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,sa(e,yo(F,v),v,function($){if(typeof $=="string"&&($=aa[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,u)!=xe}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,u){var a=e.getOption("configureMouse"),v=a?a(e,t,u):{};if(v.unit==null){var F=o?u.shiftKey&&u.metaKey:u.altKey;v.unit=F?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(v.extend==null||e.doc.extend)&&(v.extend=e.doc.extend||u.shiftKey),v.addNew==null&&(v.addNew=r?u.metaKey:u.ctrlKey),v.moveOnDrag==null&&(v.moveOnDrag=!(r?u.altKey:u.ctrlKey)),v}function Gl(e,t,u,a){G?setTimeout(N(Cs,e),0):e.curOp.focus=M();var v=Kl(e,u,a),F=e.doc.sel,$;e.options.dragDrop&&Fe&&!e.isReadOnly()&&u=="single"&&($=F.contains(t))>-1&&(nt(($=F.ranges[$]).from(),t)<0||t.xRel>0)&&(nt($.to(),t)>0||t.xRel<0)?zl(e,a,t,v):Vl(e,a,t,v)}function zl(e,t,u,a){var v=e.display,F=!1,$=sr(e,function(le){n&&(v.scroller.draggable=!1),e.state.draggingText=!1,He(v.wrapper.ownerDocument,"mouseup",$),He(v.wrapper.ownerDocument,"mousemove",ee),He(v.scroller,"dragstart",ne),He(v.scroller,"drop",$),F||(re(le),a.addNew||Ea(e.doc,u,null,null,a.extend),n&&!h||G&&W==9?setTimeout(function(){v.wrapper.ownerDocument.body.focus({preventScroll:!0}),v.input.focus()},20):v.input.focus())}),ee=function(le){F=F||Math.abs(t.clientX-le.clientX)+Math.abs(t.clientY-le.clientY)>=10},ne=function(){return F=!0};n&&(v.scroller.draggable=!0),e.state.draggingText=$,$.copy=!a.moveOnDrag,v.scroller.dragDrop&&v.scroller.dragDrop(),Oe(v.wrapper.ownerDocument,"mouseup",$),Oe(v.wrapper.ownerDocument,"mousemove",ee),Oe(v.scroller,"dragstart",ne),Oe(v.scroller,"drop",$),Os(e),setTimeout(function(){return v.input.focus()},20)}function Ao(e,t,u){if(u=="char")return new wn(t,t);if(u=="word")return e.findWordAt(t);if(u=="line")return new wn(Ve(t.line,0),Et(e.doc,Ve(t.line+1,0)));var a=u(e,t);return new wn(a.from,a.to)}function Vl(e,t,u,a){var v=e.display,F=e.doc;re(t);var $,ee,ne=F.sel,le=ne.ranges;if(a.addNew&&!a.extend?(ee=F.sel.contains(u),ee>-1?$=le[ee]:$=new wn(u,u)):($=F.sel.primary(),ee=F.sel.primIndex),a.unit=="rectangle")a.addNew||($=new wn(u,u)),u=mi(e,t,!0,!0),ee=-1;else{var Ee=Ao(e,u,a.unit);a.extend?$=qa($,Ee.anchor,Ee.head,a.extend):$=Ee}a.addNew?ee==-1?(ee=le.length,_r(F,$r(e,le.concat([$]),ee),{scroll:!1,origin:"*mouse"})):le.length>1&&le[ee].empty()&&a.unit=="char"&&!a.extend?(_r(F,$r(e,le.slice(0,ee).concat(le.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),ne=F.sel):es(F,ee,$,Te):(ee=0,_r(F,new Hr([$],0),Te),ne=F.sel);var we=u;function Ne(st){if(nt(we,st)==0)return;if(we=st,a.unit=="rectangle"){for(var ft=[],Bt=e.options.tabSize,At=K(et(F,u.line).text,u.ch,Bt),nn=K(et(F,st.line).text,st.ch,Bt),Dn=Math.min(At,nn),lr=Math.max(At,nn),Hn=Math.min(u.line,st.line),Nr=Math.min(e.lastLine(),Math.max(u.line,st.line));Hn<=Nr;Hn++){var Rr=et(F,Hn).text,Qn=Le(Rr,Dn,Bt);Dn==lr?ft.push(new wn(Ve(Hn,Qn),Ve(Hn,Qn))):Rr.length>Qn&&ft.push(new wn(Ve(Hn,Qn),Ve(Hn,Le(Rr,lr,Bt))))}ft.length||ft.push(new wn(u,u)),_r(F,$r(e,ne.ranges.slice(0,ee).concat(ft),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(st)}else{var Lr=$,gr=Ao(e,st,a.unit),nr=Lr.anchor,qn;nt(gr.anchor,nr)>0?(qn=gr.head,nr=Fr(Lr.from(),gr.anchor)):(qn=gr.anchor,nr=Ur(Lr.to(),gr.head));var Gn=ne.ranges.slice(0);Gn[ee]=Xl(e,new wn(Et(F,nr),qn)),_r(F,$r(e,Gn,ee),Te)}}var Pe=v.wrapper.getBoundingClientRect(),Ke=0;function Xe(st){var ft=++Ke,Bt=mi(e,st,!0,a.unit=="rectangle");if(!Bt)return;if(nt(Bt,we)!=0){e.curOp.focus=M(),Ne(Bt);var At=ma(v,F);(Bt.line>=At.to||Bt.line<At.from)&&setTimeout(sr(e,function(){Ke==ft&&Xe(st)}),150)}else{var nn=st.clientY<Pe.top?-20:st.clientY>Pe.bottom?20:0;nn&&setTimeout(sr(e,function(){if(Ke!=ft)return;v.scroller.scrollTop+=nn,Xe(st)}),50)}}function qe(st){e.state.selectingText=!1,Ke=Infinity,st&&(re(st),v.input.focus()),He(v.wrapper.ownerDocument,"mousemove",at),He(v.wrapper.ownerDocument,"mouseup",ct),F.history.lastSelOrigin=null}var at=sr(e,function(st){st.buttons===0||!Se(st)?qe(st):Xe(st)}),ct=sr(e,qe);e.state.selectingText=ct,Oe(v.wrapper.ownerDocument,"mousemove",at),Oe(v.wrapper.ownerDocument,"mouseup",ct)}function Xl(e,t){var u=t.anchor,a=t.head,v=et(e.doc,u.line);if(nt(u,a)==0&&u.sticky==a.sticky)return t;var F=Qe(v);if(!F)return t;var $=$e(F,u.ch,u.sticky),ee=F[$];if(ee.from!=u.ch&&ee.to!=u.ch)return t;var ne=$+(ee.from==u.ch==(ee.level!=1)?0:1);if(ne==0||ne==F.length)return t;var le;if(a.line!=u.line)le=(a.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ee=$e(F,a.ch,a.sticky),we=Ee-$||(a.ch-u.ch)*(ee.level==1?-1:1);Ee==ne-1||Ee==ne?le=we<0:le=we>0}var Ne=F[ne+(le?-1:0)],Pe=le==(Ne.level==1),Ke=Pe?Ne.from:Ne.to,Xe=Pe?"after":"before";return u.ch==Ke&&u.sticky==Xe?t:new wn(new Ve(u.line,Ke,Xe),a)}function Ro(e,t,u,a){var v,F;if(t.touches)v=t.touches[0].clientX,F=t.touches[0].clientY;else try{v=t.clientX,F=t.clientY}catch(Ne){return!1}if(v>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;a&&re(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(F>ee.bottom||!ae(e,u))return he(t);F-=ee.top-$.viewOffset;for(var ne=0;ne<e.display.gutterSpecs.length;++ne){var le=$.gutters.childNodes[ne];if(le&&le.getBoundingClientRect().right>=v){var Ee=jt(e.doc,F),we=e.display.gutterSpecs[ne];return ue(e,u,e,Ee,we.className,t),he(t)}}}function ss(e,t){return Ro(e,t,"gutterClick",!0)}function Lo(e,t){if(dn(e.display,t)||Yl(e,t))return;if(Q(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ae(e,"gutterContextMenu")?Ro(e,t,"gutterContextMenu",!1):!1}function Io(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hi(e)}var Ui={toString:function(){return"CodeMirror.Init"}},Do={},Aa={};function $l(e){var t=e.optionHandlers;function u(a,v,F,$){e.defaults[a]=v,F&&(t[a]=$?function(ee,ne,le){le!=Ui&&F(ee,ne,le)}:F)}e.defineOption=u,e.Init=Ui,u("value","",function(a,v){return a.setValue(v)},!0),u("mode",null,function(a,v){a.doc.modeOption=v,Ja(a)},!0),u("indentUnit",2,Ja,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(a){Ji(a),Hi(a),Or(a)},!0),u("lineSeparator",null,function(a,v){if(a.doc.lineSep=v,!v)return;var F=[],$=a.doc.first;a.doc.iter(function(ne){for(var le=0;;){var Ee=ne.text.indexOf(v,le);if(Ee==-1)break;le=Ee+v.length,F.push(Ve($,Ee))}$++});for(var ee=F.length-1;ee>=0;ee--)Pi(a.doc,v,F[ee],Ve(F[ee].line,F[ee].ch+v.length))}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(a,v,F){a.state.specialChars=new RegExp(v.source+(v.test(" ")?"":"| "),"g"),F!=Ui&&a.refresh()}),u("specialCharPlaceholder",xn,function(a){return a.refresh()},!0),u("electricChars",!0),u("inputStyle",l?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(a,v){return a.getInputField().spellcheck=v},!0),u("autocorrect",!1,function(a,v){return a.getInputField().autocorrect=v},!0),u("autocapitalize",!1,function(a,v){return a.getInputField().autocapitalize=v},!0),u("rtlMoveVisually",!w),u("wholeLineUpdateBefore",!0),u("theme","default",function(a){Io(a),$i(a)},!0),u("keyMap","default",function(a,v,F){var $=Ca(v),ee=F!=Ui&&Ca(F);ee&&ee.detach&&ee.detach(a,$),$.attach&&$.attach(a,ee||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Zl,!0),u("gutters",[],function(a,v){a.display.gutterSpecs=Ya(v,a.options.lineNumbers),$i(a)},!0),u("fixedGutter",!0,function(a,v){a.display.gutters.style.left=v?Fa(a.display)+"px":"0",a.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(a){return Ri(a)},!0),u("scrollbarStyle","native",function(a){Ps(a),Ri(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),u("lineNumbers",!1,function(a,v){a.display.gutterSpecs=Ya(a.options.gutters,v),$i(a)},!0),u("firstLineNumber",1,$i,!0),u("lineNumberFormatter",function(a){return a},$i,!0),u("showCursorWhenSelecting",!1,Ki,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(a,v){v=="nocursor"&&(Oi(a),a.display.input.blur()),a.display.input.readOnlyChanged(v)}),u("screenReaderLabel",null,function(a,v){v=v===""?null:v,a.display.input.screenReaderLabelChanged(v)}),u("disableInput",!1,function(a,v){v||a.display.input.reset()},!0),u("dragDrop",!0,Jl),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,Ki,!0),u("singleCursorHeightPerLine",!0,Ki,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Ji,!0),u("addModeClass",!1,Ji,!0),u("pollInterval",100),u("undoDepth",200,function(a,v){return a.doc.history.undoDepth=v}),u("historyEventDelay",1250),u("viewportMargin",10,function(a){return a.refresh()},!0),u("maxHighlightLength",1e4,Ji,!0),u("moveInputWithCursor",!0,function(a,v){v||a.display.input.resetPosition()}),u("tabindex",null,function(a,v){return a.display.input.getField().tabIndex=v||""}),u("autofocus",null),u("direction","ltr",function(a,v){return a.doc.setDirection(v)},!0),u("phrases",null)}function Jl(e,t,u){var a=u&&u!=Ui;if(!t!=!a){var v=e.display.dragFunctions,F=t?Oe:He;F(e.display.scroller,"dragstart",v.start),F(e.display.scroller,"dragenter",v.enter),F(e.display.scroller,"dragover",v.over),F(e.display.scroller,"dragleave",v.leave),F(e.display.scroller,"drop",v.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),Vr(e)),Ba(e),Or(e),Hi(e),setTimeout(function(){return Ri(e)},100)}function Bn(e,t){var u=this;if(!(this instanceof Bn))return new Bn(e,t);this.options=t=t?C(t):{},C(Do,t,!1);var a=t.value;typeof a=="string"?a=new Ar(a,t.mode,null,t.lineSeparator,t.direction):t.mode&&(a.modeOption=t.mode),this.doc=a;var v=new Bn.inputStyles[t.inputStyle](this),F=this.display=new cl(e,a,v,t);F.wrapper.CodeMirror=this,Io(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ps(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&&!l&&F.input.focus(),G&&W<11&&setTimeout(function(){return u.display.input.reset(!0)},20),Ql(this),Rl(),bi(this),this.curOp.forceUpdate=!0,Ks(this,a),t.autofocus&&!l||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Wa(u)},20):Oi(this);for(var $ in Aa)Aa.hasOwnProperty($)&&Aa[$](this,t[$],Ui);Ns(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<os.length;++ee)os[ee](this);_i(this),n&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}Bn.defaults=Do,Bn.optionHandlers=Aa;function Ql(e){var t=e.display;Oe(t.scroller,"mousedown",sr(e,Oo)),G&&W<11?Oe(t.scroller,"dblclick",sr(e,function(ne){if(Q(e,ne))return;var le=mi(e,ne);if(!le||ss(e,ne)||dn(e.display,ne))return;re(ne);var Ee=e.findWordAt(le);Ea(e.doc,Ee.anchor,Ee.head)})):Oe(t.scroller,"dblclick",function(ne){return Q(e,ne)||re(ne)}),Oe(t.scroller,"contextmenu",function(ne){return Lo(e,ne)}),Oe(t.input.getField(),"contextmenu",function(ne){t.scroller.contains(ne.target)||Lo(e,ne)});var u,a={end:0};function v(){t.activeTouch&&(u=setTimeout(function(){return t.activeTouch=null},1e3),a=t.activeTouch,a.end=+new Date)}function F(ne){if(ne.touches.length!=1)return!1;var le=ne.touches[0];return le.radiusX<=1&&le.radiusY<=1}function $(ne,le){if(le.left==null)return!0;var Ee=le.left-ne.left,we=le.top-ne.top;return Ee*Ee+we*we>20*20}Oe(t.scroller,"touchstart",function(ne){if(!Q(e,ne)&&!F(ne)&&!ss(e,ne)){t.input.ensurePolled(),clearTimeout(u);var le=+new Date;t.activeTouch={start:le,moved:!1,prev:le-a.end<=300?a:null},ne.touches.length==1&&(t.activeTouch.left=ne.touches[0].pageX,t.activeTouch.top=ne.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function(ne){var le=t.activeTouch;if(le&&!dn(t,ne)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Ee=e.coordsChar(t.activeTouch,"page"),we;!le.prev||$(le,le.prev)?we=new wn(Ee,Ee):!le.prev.prev||$(le,le.prev.prev)?we=e.findWordAt(Ee):we=new wn(Ve(Ee.line,0),Et(e.doc,Ve(Ee.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),re(ne)}v()}),Oe(t.scroller,"touchcancel",v),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(zi(e,t.scroller.scrollTop),vi(e,t.scroller.scrollLeft,!0),ue(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function(ne){return Bs(e,ne)}),Oe(t.scroller,"DOMMouseScroll",function(ne){return Bs(e,ne)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ne){Q(e,ne)||me(ne)},over:function(ne){Q(e,ne)||(Al(e,ne),me(ne))},start:function(ne){return Ol(e,ne)},drop:sr(e,Cl),leave:function(ne){Q(e,ne)||po(e)}};var ee=t.input.getField();Oe(ee,"keyup",function(ne){return So.call(e,ne)}),Oe(ee,"keydown",sr(e,wo)),Oe(ee,"keypress",sr(e,Co)),Oe(ee,"focus",function(ne){return Wa(e,ne)}),Oe(ee,"blur",function(ne){return Oi(e,ne)})}var os=[];Bn.defineInitHook=function(e){return os.push(e)};function ua(e,t,u,a){var v=e.doc,F;u==null&&(u="add"),u=="smart"&&(v.mode.indent?F=sn(e,t).state:u="prev");var $=e.options.tabSize,ee=et(v,t),ne=K(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var le=ee.text.match(/^\s*/)[0],Ee;if(!a&&!/\S/.test(ee.text))Ee=0,u="not";else if(u=="smart"&&(Ee=v.mode.indent(F,ee.text.slice(le.length),ee.text),Ee==xe||Ee>150)){if(!a)return;u="prev"}u=="prev"?t>v.first?Ee=K(et(v,t-1).text,null,$):Ee=0:u=="add"?Ee=ne+e.options.indentUnit:u=="subtract"?Ee=ne-e.options.indentUnit:typeof u=="number"&&(Ee=ne+u),Ee=Math.max(0,Ee);var we="",Ne=0;if(e.options.indentWithTabs)for(var Pe=Math.floor(Ee/$);Pe;--Pe)Ne+=$,we+=" ";if(Ne<Ee&&(we+=Y(Ee-Ne)),we!=le)return Pi(v,we,Ve(t,0),Ve(t,le.length),"+input"),ee.stateAfter=null,!0;for(var Ke=0;Ke<v.sel.ranges.length;Ke++){var Xe=v.sel.ranges[Ke];if(Xe.head.line==t&&Xe.head.ch<le.length){var qe=Ve(t,le.length);es(v,Ke,new wn(qe,qe));break}}}var Jr=null;function Ra(e){Jr=e}function ls(e,t,u,a,v){var F=e.doc;e.display.shift=!1,a||(a=F.sel);var $=+new Date-200,ee=v=="paste"||e.state.pasteIncoming>$,ne=lt(t),le=null;if(ee&&a.ranges.length>1)if(Jr&&Jr.text.join(`
|
|
`)==t){if(a.ranges.length%Jr.text.length==0){le=[];for(var Ee=0;Ee<Jr.text.length;Ee++)le.push(F.splitLines(Jr.text[Ee]))}}else ne.length==a.ranges.length&&e.options.pasteLinesPerSelection&&(le=j(ne,function(at){return[at]}));for(var we=e.curOp.updateInput,Ne=a.ranges.length-1;Ne>=0;Ne--){var Pe=a.ranges[Ne],Ke=Pe.from(),Xe=Pe.to();Pe.empty()&&(u&&u>0?Ke=Ve(Ke.line,Ke.ch-u):e.state.overwrite&&!ee?Xe=Ve(Xe.line,Math.min(et(F,Xe.line).text.length,Xe.ch+k(ne).length)):ee&&Jr&&Jr.lineWise&&Jr.text.join(`
|
|
`)==ne.join(`
|
|
`)&&(Ke=Xe=Ve(Ke.line,0)));var qe={from:Ke,to:Xe,text:le?le[Ne%le.length]:ne,origin:v||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};Di(e.doc,qe),cn(e,"inputRead",e,qe)}t&&!ee&&Mo(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Po(e,t){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&kr(t,function(){return ls(t,u,0,null,"paste")}),!0}function Mo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var u=e.doc.sel,a=u.ranges.length-1;a>=0;a--){var v=u.ranges[a];if(v.head.ch>100||a&&u.ranges[a-1].head.line==v.head.line)continue;var F=e.getModeAt(v.head),$=!1;if(F.electricChars){for(var ee=0;ee<F.electricChars.length;ee++)if(t.indexOf(F.electricChars.charAt(ee))>-1){$=ua(e,v.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(et(e.doc,v.head.line).text.slice(0,v.head.ch))&&($=ua(e,v.head.line,"smart")));$&&cn(e,"electricInput",e,v.head.line)}}function ko(e){for(var t=[],u=[],a=0;a<e.doc.sel.ranges.length;a++){var v=e.doc.sel.ranges[a].head.line,F={anchor:Ve(v,0),head:Ve(v+1,0)};u.push(F),t.push(e.getRange(F.anchor,F.head))}return{text:t,ranges:u}}function No(e,t,u,a){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",a?"":"off"),e.setAttribute("spellcheck",!!t)}function Uo(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),No(e),t}function ql(e){var t=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,v){var F=this.options,$=F[a];if(F[a]==v&&a!="mode")return;F[a]=v,t.hasOwnProperty(a)&&sr(this,t[a])(this,v,$),ue(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,v){this.state.keyMaps[v?"push":"unshift"](Ca(a))},removeKeyMap:function(a){for(var v=this.state.keyMaps,F=0;F<v.length;++F)if(v[F]==a||v[F].name==a)return v.splice(F,1),!0},addOverlay:wr(function(a,v){var F=a.token?a:e.getMode(this.options,a);if(F.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:F,modeSpec:a,opaque:v&&v.opaque,priority:v&&v.priority||0},function($){return $.priority}),this.state.modeGen++,Or(this)}),removeOverlay:wr(function(a){for(var v=this.state.overlays,F=0;F<v.length;++F){var $=v[F].modeSpec;if($==a||typeof a=="string"&&$.name==a){v.splice(F,1),this.state.modeGen++,Or(this);return}}}),indentLine:wr(function(a,v,F){typeof v!="string"&&typeof v!="number"&&(v==null?v=this.options.smartIndent?"smart":"prev":v=v?"add":"subtract"),Fn(this.doc,a)&&ua(this,a,v,F)}),indentSelection:wr(function(a){for(var v=this.doc.sel.ranges,F=-1,$=0;$<v.length;$++){var ee=v[$];if(ee.empty())ee.head.line>F&&(ua(this,ee.head.line,a,!0),F=ee.head.line,$==this.doc.sel.primIndex&&Ai(this));else{var ne=ee.from(),le=ee.to(),Ee=Math.max(F,ne.line);F=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var we=Ee;we<F;++we)ua(this,we,a);var Ne=this.doc.sel.ranges;ne.ch==0&&v.length==Ne.length&&Ne[$].from().ch>0&&es(this.doc,$,new wn(ne,Ne[$].to()),be)}}}),getTokenAt:function(a,v){return St(this,a,v)},getLineTokens:function(a,v){return St(this,Ve(a),v,!0)},getTokenTypeAt:function(a){a=Et(this.doc,a);var v=mn(this,et(this.doc,a.line)),F=0,$=(v.length-1)/2,ee=a.ch,ne;if(ee==0)ne=v[2];else for(;;){var le=F+$>>1;if((le?v[le*2-1]:0)>=ee)$=le;else if(v[le*2+1]<ee)F=le+1;else{ne=v[le*2+2];break}}var Ee=ne?ne.indexOf("overlay "):-1;return Ee<0?ne:Ee==0?null:ne.slice(0,Ee-1)},getModeAt:function(a){var v=this.doc.mode;return v.innerMode?e.innerMode(v,this.getTokenAt(a).state).mode:v},getHelper:function(a,v){return this.getHelpers(a,v)[0]},getHelpers:function(a,v){var F=[];if(!u.hasOwnProperty(v))return F;var $=u[v],ee=this.getModeAt(a);if(typeof ee[v]=="string")$[ee[v]]&&F.push($[ee[v]]);else if(ee[v])for(var ne=0;ne<ee[v].length;ne++){var le=$[ee[v][ne]];le&&F.push(le)}else ee.helperType&&$[ee.helperType]?F.push($[ee.helperType]):$[ee.name]&&F.push($[ee.name]);for(var Ee=0;Ee<$._global.length;Ee++){var we=$._global[Ee];we.pred(ee,this)&&oe(F,we.val)==-1&&F.push(we.val)}return F},getStateAfter:function(a,v){var F=this.doc;return a=jn(F,a==null?F.first+F.size-1:a),sn(this,a+1,v).state},cursorCoords:function(a,v){var F,$=this.doc.sel.primary();return a==null?F=$.head:typeof a=="object"?F=Et(this.doc,a):F=a?$.from():$.to(),Yr(this,F,v||"page")},charCoords:function(a,v){return Pa(this,Et(this.doc,a),v||"page")},coordsChar:function(a,v){return a=ys(this,a,v||"page"),ka(this,a.left,a.top)},lineAtHeight:function(a,v){return a=ys(this,{top:a,left:0},v||"page").top,jt(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,v,F){var $=!1,ee;if(typeof a=="number"){var ne=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>ne&&(a=ne,$=!0),ee=et(this.doc,a)}else ee=a;return da(this,ee,{top:0,left:0},v||"page",F||$).top+($?this.doc.height-Wn(ee):0)},defaultTextHeight:function(){return Si(this.display)},defaultCharWidth:function(){return Ci(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,v,F,$,ee){var ne=this.display;a=Yr(this,Et(this.doc,a));var le=a.bottom,Ee=a.left;if(v.style.position="absolute",v.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(v),ne.sizer.appendChild(v),$=="over")le=a.top;else if($=="above"||$=="near"){var we=Math.max(ne.wrapper.clientHeight,this.doc.height),Ne=Math.max(ne.sizer.clientWidth,ne.lineSpace.clientWidth);($=="above"||a.bottom+v.offsetHeight>we)&&a.top>v.offsetHeight?le=a.top-v.offsetHeight:a.bottom+v.offsetHeight<=we&&(le=a.bottom),Ee+v.offsetWidth>Ne&&(Ee=Ne-v.offsetWidth)}v.style.top=le+"px",v.style.left=v.style.right="",ee=="right"?(Ee=ne.sizer.clientWidth-v.offsetWidth,v.style.right="0px"):(ee=="left"?Ee=0:ee=="middle"&&(Ee=(ne.sizer.clientWidth-v.offsetWidth)/2),v.style.left=Ee+"px"),F&&Jo(this,{left:Ee,top:le,right:Ee+v.offsetWidth,bottom:le+v.offsetHeight})},triggerOnKeyDown:wr(wo),triggerOnKeyPress:wr(Co),triggerOnKeyUp:So,triggerOnMouseDown:wr(Oo),execCommand:function(a){if(aa.hasOwnProperty(a))return aa[a].call(null,this)},triggerElectric:wr(function(a){Mo(this,a)}),findPosH:function(a,v,F,$){var ee=1;v<0&&(ee=-1,v=-v);for(var ne=Et(this.doc,a),le=0;le<v&&!(ne=us(this.doc,ne,ee,F,$),ne.hitSide);++le);return ne},moveH:wr(function(a,v){var F=this;this.extendSelectionsBy(function($){return F.display.shift||F.doc.extend||$.empty()?us(F.doc,$.head,a,v,F.options.rtlMoveVisually):a<0?$.from():$.to()},Ce)}),deleteH:wr(function(a,v){var F=this.doc.sel,$=this.doc;F.somethingSelected()?$.replaceSelection("",null,"+delete"):Ni(this,function(ee){var ne=us($,ee.head,a,v,!1);return a<0?{from:ne,to:ee.head}:{from:ee.head,to:ne}})}),findPosV:function(a,v,F,$){var ee=1,ne=$;v<0&&(ee=-1,v=-v);for(var le=Et(this.doc,a),Ee=0;Ee<v;++Ee){var we=Yr(this,le,"div");if(ne==null?ne=we.left:we.left=ne,le=Fo(this,we,ee,F),le.hitSide)break}return le},moveV:wr(function(a,v){var F=this,$=this.doc,ee=[],ne=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Ee){if(ne)return a<0?Ee.from():Ee.to();var we=Yr(F,Ee.head,"div");Ee.goalColumn!=null&&(we.left=Ee.goalColumn),ee.push(we.left);var Ne=Fo(F,we,a,v);return v=="page"&&Ee==$.sel.primary()&&Ka(F,Pa(F,Ne,"div").top-we.top),Ne},Ce),ee.length)for(var le=0;le<$.sel.ranges.length;le++)$.sel.ranges[le].goalColumn=ee[le]}),findWordAt:function(a){var v=this.doc,F=et(v,a.line).text,$=a.ch,ee=a.ch;if(F){var ne=this.getHelper(a,"wordChars");(a.sticky=="before"||ee==F.length)&&$?--$:++ee;for(var le=F.charAt($),Ee=Ue(le,ne)?function(we){return Ue(we,ne)}:/\s/.test(le)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!Ue(we)};$>0&&Ee(F.charAt($-1));)--$;for(;ee<F.length&&Ee(F.charAt(ee));)++ee}return new wn(Ve(a.line,$),Ve(a.line,ee))},toggleOverwrite:function(a){if(a!=null&&a==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),ue(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:wr(function(a,v){Gi(this,a,v)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-zn(this)-this.display.barHeight,width:a.scrollWidth-zn(this)-this.display.barWidth,clientHeight:Tr(this),clientWidth:mr(this)}},scrollIntoView:wr(function(a,v){a==null?(a={from:this.doc.sel.primary().head,to:null},v==null&&(v=this.options.cursorScrollMargin)):typeof a=="number"?a={from:Ve(a,0),to:null}:a.from==null&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=v||0,a.from.line!=null?Zo(this,a):Rs(this,a.from,a.to,a.margin)}),setSize:wr(function(a,v){var F=this,$=function(ne){return typeof ne=="number"||/^\d+$/.test(String(ne))?ne+"px":ne};a!=null&&(this.display.wrapper.style.width=$(a)),v!=null&&(this.display.wrapper.style.height=$(v)),this.options.lineWrapping&&ms(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(ne){if(ne.widgets){for(var le=0;le<ne.widgets.length;le++)if(ne.widgets[le].noHScroll){si(F,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,ue(this,"refresh",this)}),operation:function(a){return kr(this,a)},startOperation:function(){return bi(this)},endOperation:function(){return _i(this)},refresh:wr(function(){var a=this.display.cachedTextHeight;Or(this),this.curOp.forceUpdate=!0,Hi(this),Gi(this,this.doc.scrollLeft,this.doc.scrollTop),Va(this.display),(a==null||Math.abs(a-Si(this.display))>.5||this.options.lineWrapping)&&Ba(this),ue(this,"refresh",this)}),swapDoc:wr(function(a){var v=this.doc;return v.cm=null,this.state.selectingText&&this.state.selectingText(),Ks(this,a),Hi(this),this.display.input.reset(),Gi(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,v),v}),phrase:function(a){var v=this.options.phrases;return v&&Object.prototype.hasOwnProperty.call(v,a)?v[a]:a},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ce(e),e.registerHelper=function(a,v,F){u.hasOwnProperty(a)||(u[a]=e[a]={_global:[]}),u[a][v]=F},e.registerGlobalHelper=function(a,v,F,$){e.registerHelper(a,v,$),u[a]._global.push({pred:F,val:$})}}function us(e,t,u,a,v){var F=t,$=u,ee=et(e,t.line),ne=v&&e.direction=="rtl"?-u:u;function le(){var ct=t.line+ne;return ct<e.first||ct>=e.first+e.size?!1:(t=new Ve(ct,t.ch,t.sticky),ee=et(e,ct))}function Ee(ct){var st;if(a=="codepoint"){var ft=ee.text.charCodeAt(t.ch+(a>0?0:-1));isNaN(ft)?st=null:st=new Ve(t.line,Math.max(0,Math.min(ee.text.length,t.ch+u*(ft>=55296&&ft<56320?2:1))),-u)}else v?st=Ml(e.cm,ee,t,u):st=ns(ee,t,u);if(st==null)if(!ct&&le())t=rs(v,e.cm,ee,t.line,ne);else return!1;else t=st;return!0}if(a=="char"||a=="codepoint")Ee();else if(a=="column")Ee(!0);else if(a=="word"||a=="group")for(var we=null,Ne=a=="group",Pe=e.cm&&e.cm.getHelper(t,"wordChars"),Ke=!0;!(u<0&&!Ee(!Ke));Ke=!1){var Xe=ee.text.charAt(t.ch)||`
|
|
`,qe=Ue(Xe,Pe)?"w":Ne&&Xe==`
|
|
`?"n":!Ne||/\s/.test(Xe)?null:"p";if(Ne&&!Ke&&!qe&&(qe="s"),we&&we!=qe){u<0&&(u=1,Ee(),t.sticky="after");break}if(qe&&(we=qe),u>0&&!Ee(!Ke))break}var at=Ta(e,t,F,$,!0);return rr(F,at)&&(at.hitSide=!0),at}function Fo(e,t,u,a){var v=e.doc,F=t.left,$;if(a=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ne=Math.max(ee-.5*Si(e.display),3);$=(u>0?t.bottom:t.top)+u*ne}else a=="line"&&($=u>0?t.bottom+3:t.top-3);for(var le;!(le=ka(e,F,$),!le.outside);){if(u<0?$<=0:$>=v.height){le.hitSide=!0;break}$+=u*5}return le}var On=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};On.prototype.init=function(e){var t=this,u=this,a=u.cm,v=u.div=e.lineDiv;No(v,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize);function F(ee){for(var ne=ee.target;ne;ne=ne.parentNode){if(ne==v)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ne.className))break}return!1}Oe(v,"paste",function(ee){if(!F(ee)||Q(a,ee)||Po(ee,a))return;W<=11&&setTimeout(sr(a,function(){return t.updateFromDOM()}),20)}),Oe(v,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Oe(v,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Oe(v,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(v,"touchstart",function(){return u.forceCompositionEnd()}),Oe(v,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!F(ee)||Q(a,ee))return;if(a.somethingSelected())Ra({lineWise:!1,text:a.getSelections()}),ee.type=="cut"&&a.replaceSelection("",null,"cut");else if(a.options.lineWiseCopyCut){var ne=ko(a);Ra({lineWise:!0,text:ne.text}),ee.type=="cut"&&a.operation(function(){a.setSelections(ne.ranges,0,be),a.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var le=Jr.text.join(`
|
|
`);if(ee.clipboardData.setData("Text",le),ee.clipboardData.getData("Text")==le){ee.preventDefault();return}}var Ee=Uo(),we=Ee.firstChild;a.display.lineSpace.insertBefore(Ee,a.display.lineSpace.firstChild),we.value=Jr.text.join(`
|
|
`);var Ne=document.activeElement;H(we),setTimeout(function(){a.display.lineSpace.removeChild(Ee),Ne.focus(),Ne==v&&u.showPrimarySelection()},50)}Oe(v,"copy",$),Oe(v,"cut",$)},On.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},On.prototype.prepareSelection=function(){var e=ws(this.cm,!1);return e.focus=document.activeElement==this.div,e},On.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},On.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},On.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,u=t.doc.sel.primary(),a=u.from(),v=u.to();if(t.display.viewTo==t.display.viewFrom||a.line>=t.display.viewTo||v.line<t.display.viewFrom){e.removeAllRanges();return}var F=La(t,e.anchorNode,e.anchorOffset),$=La(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&$&&!$.bad&&nt(Fr(F,$),a)==0&&nt(Ur(F,$),v)==0)return;var ee=t.display.view,ne=a.line>=t.display.viewFrom&&Bo(t,a)||{node:ee[0].measure.map[2],offset:0},le=v.line<t.display.viewTo&&Bo(t,v);if(!le){var Ee=ee[ee.length-1].measure,we=Ee.maps?Ee.maps[Ee.maps.length-1]:Ee.map;le={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!ne||!le){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Pe;try{Pe=b(ne.node,ne.offset,le.offset,le.node)}catch(Ke){}Pe&&(!D&&t.state.focused?(e.collapse(ne.node,ne.offset),Pe.collapsed||(e.removeAllRanges(),e.addRange(Pe))):(e.removeAllRanges(),e.addRange(Pe)),Ne&&e.anchorNode==null?e.addRange(Ne):D&&this.startGracePeriod()),this.rememberSelection()},On.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)},On.prototype.showMultipleSelections=function(e){m(this.cm.display.cursorDiv,e.cursors),m(this.cm.display.selectionDiv,e.selection)},On.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},On.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},On.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},On.prototype.blur=function(){this.div.blur()},On.prototype.getField=function(){return this.div},On.prototype.supportsTouch=function(){return!0},On.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():kr(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)},On.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},On.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&g&&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 u=La(t,e.anchorNode,e.anchorOffset),a=La(t,e.focusNode,e.focusOffset);u&&a&&kr(t,function(){_r(t.doc,li(u,a),be),(u.bad||a.bad)&&(t.curOp.selectionChanged=!0)})},On.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,u=e.doc.sel.primary(),a=u.from(),v=u.to();if(a.ch==0&&a.line>e.firstLine()&&(a=Ve(a.line-1,et(e.doc,a.line-1).length)),v.ch==et(e.doc,v.line).text.length&&v.line<e.lastLine()&&(v=Ve(v.line+1,0)),a.line<t.viewFrom||v.line>t.viewTo-1)return!1;var F,$,ee;a.line==t.viewFrom||(F=gi(e,a.line))==0?($=Dt(t.view[0].line),ee=t.view[0].node):($=Dt(t.view[F].line),ee=t.view[F-1].node.nextSibling);var ne=gi(e,v.line),le,Ee;if(ne==t.view.length-1?(le=t.viewTo-1,Ee=t.lineDiv.lastChild):(le=Dt(t.view[ne+1].line)-1,Ee=t.view[ne+1].node.previousSibling),!ee)return!1;for(var we=e.doc.splitLines(tu(e,ee,Ee,$,le)),Ne=Kt(e.doc,Ve($,0),Ve(le,et(e.doc,le).text.length));we.length>1&&Ne.length>1;)if(k(we)==k(Ne))we.pop(),Ne.pop(),le--;else if(we[0]==Ne[0])we.shift(),Ne.shift(),$++;else break;for(var Pe=0,Ke=0,Xe=we[0],qe=Ne[0],at=Math.min(Xe.length,qe.length);Pe<at&&Xe.charCodeAt(Pe)==qe.charCodeAt(Pe);)++Pe;for(var ct=k(we),st=k(Ne),ft=Math.min(ct.length-(we.length==1?Pe:0),st.length-(Ne.length==1?Pe:0));Ke<ft&&ct.charCodeAt(ct.length-Ke-1)==st.charCodeAt(st.length-Ke-1);)++Ke;if(we.length==1&&Ne.length==1&&$==a.line)for(;Pe&&Pe>a.ch&&ct.charCodeAt(ct.length-Ke-1)==st.charCodeAt(st.length-Ke-1);)Pe--,Ke++;we[we.length-1]=ct.slice(0,ct.length-Ke).replace(/^\u200b+/,""),we[0]=we[0].slice(Pe).replace(/\u200b+$/,"");var Bt=Ve($,Pe),At=Ve(le,Ne.length?k(Ne).length-Ke:0);if(we.length>1||we[0]||nt(Bt,At))return Pi(e.doc,we,Bt,At,"+input"),!0},On.prototype.ensurePolled=function(){this.forceCompositionEnd()},On.prototype.reset=function(){this.forceCompositionEnd()},On.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},On.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)},On.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kr(this.cm,function(){return Or(e.cm)})},On.prototype.setUneditable=function(e){e.contentEditable="false"},On.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||sr(this.cm,ls)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},On.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},On.prototype.onContextMenu=function(){},On.prototype.resetPosition=function(){},On.prototype.needsContentAttribute=!0;function Bo(e,t){var u=ca(e,t.line);if(!u||u.hidden)return null;var a=et(e.doc,t.line),v=Gr(u,a,t.line),F=Qe(a,e.doc.direction),$="left";if(F){var ee=$e(F,t.ch);$=ee%2?"right":"left"}var ne=fs(v.map,t.ch,$);return ne.offset=ne.collapse=="right"?ne.end:ne.start,ne}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Fi(e,t){return t&&(e.bad=!0),e}function tu(e,t,u,a,v){var F="",$=!1,ee=e.doc.lineSeparator(),ne=!1;function le(Pe){return function(Ke){return Ke.id==Pe}}function Ee(){$&&(F+=ee,ne&&(F+=ee),$=ne=!1)}function we(Pe){Pe&&(Ee(),F+=Pe)}function Ne(Pe){if(Pe.nodeType==1){var Ke=Pe.getAttribute("cm-text");if(Ke){we(Ke);return}var Xe=Pe.getAttribute("cm-marker"),qe;if(Xe){var at=e.findMarks(Ve(a,0),Ve(v+1,0),le(+Xe));at.length&&(qe=at[0].find(0))&&we(Kt(e.doc,qe.from,qe.to).join(ee));return}if(Pe.getAttribute("contenteditable")=="false")return;var ct=/^(pre|div|p|li|table|br)$/i.test(Pe.nodeName);if(!/^br$/i.test(Pe.nodeName)&&Pe.textContent.length==0)return;ct&&Ee();for(var st=0;st<Pe.childNodes.length;st++)Ne(Pe.childNodes[st]);/^(pre|p)$/i.test(Pe.nodeName)&&(ne=!0),ct&&($=!0)}else Pe.nodeType==3&&we(Pe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ne(t),t==u);)t=t.nextSibling,ne=!1;return F}function La(e,t,u){var a;if(t==e.display.lineDiv){if(a=e.display.lineDiv.childNodes[u],!a)return Fi(e.clipPos(Ve(e.display.viewTo-1)),!0);t=null,u=0}else for(a=t;;a=a.parentNode){if(!a||a==e.display.lineDiv)return null;if(a.parentNode&&a.parentNode==e.display.lineDiv)break}for(var v=0;v<e.display.view.length;v++){var F=e.display.view[v];if(F.node==a)return nu(F,t,u)}}function nu(e,t,u){var a=e.text.firstChild,v=!1;if(!t||!y(a,t))return Fi(Ve(Dt(e.line),0),!0);if(t==a&&(v=!0,t=a.childNodes[u],u=0,!t)){var F=e.rest?k(e.rest):e.line;return Fi(Ve(Dt(F),F.text.length),v)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,u&&(u=$.nodeValue.length));ee.parentNode!=a;)ee=ee.parentNode;var ne=e.measure,le=ne.maps;function Ee(qe,at,ct){for(var st=-1;st<(le?le.length:0);st++)for(var ft=st<0?ne.map:le[st],Bt=0;Bt<ft.length;Bt+=3){var At=ft[Bt+2];if(At==qe||At==at){var nn=Dt(st<0?e.line:e.rest[st]),Dn=ft[Bt]+ct;return(ct<0||At!=qe)&&(Dn=ft[Bt+(ct?1:0)]),Ve(nn,Dn)}}}var we=Ee($,ee,u);if(we)return Fi(we,v);for(var Ne=ee.nextSibling,Pe=$?$.nodeValue.length-u:0;Ne;Ne=Ne.nextSibling){if(we=Ee(Ne,Ne.firstChild,0),we)return Fi(Ve(we.line,we.ch-Pe),v);Pe+=Ne.textContent.length}for(var Ke=ee.previousSibling,Xe=u;Ke;Ke=Ke.previousSibling){if(we=Ee(Ke,Ke.firstChild,-1),we)return Fi(Ve(we.line,we.ch+Xe),v);Xe+=Ke.textContent.length}}var Vn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};Vn.prototype.init=function(e){var t=this,u=this,a=this.cm;this.createField(e);var v=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),d&&(v.style.width="0px"),Oe(v,"input",function(){G&&W>=9&&t.hasSelection&&(t.hasSelection=null),u.poll()}),Oe(v,"paste",function($){if(Q(a,$)||Po($,a))return;a.state.pasteIncoming=+new Date,u.fastPoll()});function F($){if(Q(a,$))return;if(a.somethingSelected())Ra({lineWise:!1,text:a.getSelections()});else if(a.options.lineWiseCopyCut){var ee=ko(a);Ra({lineWise:!0,text:ee.text}),$.type=="cut"?a.setSelections(ee.ranges,null,be):(u.prevInput="",v.value=ee.text.join(`
|
|
`),H(v))}else return;$.type=="cut"&&(a.state.cutIncoming=+new Date)}Oe(v,"cut",F),Oe(v,"copy",F),Oe(e.scroller,"paste",function($){if(dn(e,$)||Q(a,$))return;if(!v.dispatchEvent){a.state.pasteIncoming=+new Date,u.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,v.dispatchEvent(ee)}),Oe(e.lineSpace,"selectstart",function($){dn(e,$)||re($)}),Oe(v,"compositionstart",function(){var $=a.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:$,range:a.markText($,a.getCursor("to"),{className:"CodeMirror-composing"})}}),Oe(v,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Vn.prototype.createField=function(e){this.wrapper=Uo(),this.textarea=this.wrapper.firstChild},Vn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Vn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,u=e.doc,a=ws(e);if(e.options.moveInputWithCursor){var v=Yr(e,u.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();a.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,v.top+$.top-F.top)),a.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,v.left+$.left-F.left))}return a},Vn.prototype.showSelection=function(e){var t=this.cm,u=t.display;m(u.cursorDiv,e.cursors),m(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Vn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var u=t.getSelection();this.textarea.value=u,t.state.focused&&H(this.textarea),G&&W>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},Vn.prototype.getField=function(){return this.textarea},Vn.prototype.supportsTouch=function(){return!1},Vn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!l||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Vn.prototype.blur=function(){this.textarea.blur()},Vn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Vn.prototype.receivedFocus=function(){this.slowPoll()},Vn.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()})},Vn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function u(){var a=t.poll();!a&&!e?(e=!0,t.polling.set(60,u)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,u)},Vn.prototype.poll=function(){var e=this,t=this.cm,u=this.textarea,a=this.prevInput;if(this.contextMenuPending||!t.state.focused||it(u)&&!a&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var v=u.value;if(v==a&&!t.somethingSelected())return!1;if(G&&W>=9&&this.hasSelection===v||r&&/[\uf700-\uf7ff]/.test(v))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=v.charCodeAt(0);if(F==8203&&!a&&(a="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(a.length,v.length);$<ee&&a.charCodeAt($)==v.charCodeAt($);)++$;return kr(t,function(){ls(t,v.slice($),a.length-$,null,e.composing?"*compose":null),v.length>1e3||v.indexOf(`
|
|
`)>-1?u.value=e.prevInput="":e.prevInput=v,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Vn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Vn.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},Vn.prototype.onContextMenu=function(e){var t=this,u=t.cm,a=u.display,v=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=mi(u,e),$=a.scroller.scrollTop;if(!F||p)return;var ee=u.options.resetSelectionOnContextMenu;ee&&u.doc.sel.contains(F)==-1&&sr(u,_r)(u.doc,li(F),be);var ne=v.style.cssText,le=t.wrapper.style.cssText,Ee=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",v.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Ee.top-5)+"px; left: "+(e.clientX-Ee.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var we;n&&(we=window.scrollY),a.input.focus(),n&&window.scrollTo(null,we),a.input.reset(),u.somethingSelected()||(v.value=t.prevInput=" "),t.contextMenuPending=Pe,a.selForContextMenu=u.doc.sel,clearTimeout(a.detectingSelectAll);function Ne(){if(v.selectionStart!=null){var Xe=u.somethingSelected(),qe="\u200B"+(Xe?v.value:"");v.value="\u21DA",v.value=qe,t.prevInput=Xe?"":"\u200B",v.selectionStart=1,v.selectionEnd=qe.length,a.selForContextMenu=u.doc.sel}}function Pe(){if(t.contextMenuPending!=Pe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=le,v.style.cssText=ne,G&&W<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=$),v.selectionStart!=null){(!G||G&&W<9)&&Ne();var Xe=0,qe=function(){a.selForContextMenu==u.doc.sel&&v.selectionStart==0&&v.selectionEnd>0&&t.prevInput=="\u200B"?sr(u,no)(u):Xe++<10?a.detectingSelectAll=setTimeout(qe,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(qe,200)}}if(G&&W>=9&&Ne(),L){me(e);var Ke=function(){He(window,"mouseup",Ke),setTimeout(Pe,20)};Oe(window,"mouseup",Ke)}else setTimeout(Pe,50)},Vn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Vn.prototype.setUneditable=function(){},Vn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?C(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 u=M();t.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function a(){e.value=ee.getValue()}var v;if(e.form&&(Oe(e.form,"submit",a),!t.leaveSubmitMethodAlone)){var F=e.form;v=F.submit;try{var $=F.submit=function(){a(),F.submit=v,F.submit(),F.submit=$}}catch(ne){}}t.finishInit=function(ne){ne.save=a,ne.getTextArea=function(){return e},ne.toTextArea=function(){ne.toTextArea=isNaN,a(),e.parentNode.removeChild(ne.getWrapperElement()),e.style.display="",e.form&&(He(e.form,"submit",a),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=v))}},e.style.display="none";var ee=Bn(function(ne){return e.parentNode.insertBefore(ne,e.nextSibling)},t);return ee}function iu(e){e.off=He,e.on=Oe,e.wheelEventPixels=dl,e.Doc=Ar,e.splitLines=lt,e.countColumn=K,e.findColumn=Le,e.isWordChar=Ie,e.Pass=xe,e.signal=ue,e.Line=vr,e.changeEnd=ui,e.scrollbarModel=Ds,e.Pos=Ve,e.cmpPos=nt,e.modes=rn,e.mimeModes=vt,e.resolveMode=Ct,e.getMode=Mt,e.modeExtensions=ht,e.extendMode=Tt,e.copyState=yt,e.startState=Kn,e.innerMode=Sn,e.commands=aa,e.keyMap=ii,e.keyName=bo,e.isModifierKey=vo,e.lookupKey=ki,e.normalizeKeyMap=Pl,e.StringStream=pn,e.SharedTextMarker=na,e.TextMarker=di,e.LineWidget=ta,e.e_preventDefault=re,e.e_stopPropagation=se,e.e_stop=me,e.addClass=B,e.contains=y,e.rmClass=E,e.keyNames=hi}$l(Bn),ql(Bn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ia in Ar.prototype)Ar.prototype.hasOwnProperty(Ia)&&oe(au,Ia)<0&&(Bn.prototype[Ia]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ar.prototype[Ia]));return ce(Ar),Bn.inputStyles={textarea:Vn,contenteditable:On},Bn.defineMode=function(e){!Bn.defaults.mode&&e!="null"&&(Bn.defaults.mode=e),on.apply(this,arguments)},Bn.defineMIME=an,Bn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Bn.defineMIME("text/plain","null"),Bn.defineExtension=function(e,t){Bn.prototype[e]=t},Bn.defineDocExtension=function(e,t){Ar.prototype[e]=t},Bn.fromTextArea=ru,iu(Bn),Bn.version="5.58.2",Bn})},WaYH:function(ke,de,P){"use strict";var q=P("rePB"),z=P("Ff2n"),D=P("VTBJ"),V=P("1OyB"),U=P("vuIU"),O=P("JX7q"),G=P("Ji7U"),W=P("LK+K"),n=P("q1tI"),I=P("TSYQ"),g=P.n(I),p=P("sboe"),h=P("OZM5"),c=function(L){var A=L.prefixCls,E=L.level,_=L.isStart,m=L.isEnd;if(!E)return null;for(var f="".concat(A,"-indent-unit"),S=[],b=0;b<E;b+=1){var y;S.push(n.createElement("span",{key:b,className:g()(f,(y={},Object(q.a)(y,"".concat(f,"-start"),_[b+1]),Object(q.a)(y,"".concat(f,"-end"),m[b+1]),Object(q.a)(y,"".concat(f,"-end-first-level"),!b&&m[0]),y))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},S)},s=c,d=P("815F"),i="open",l="close",r="---",o=function(x){Object(G.a)(A,x);var L=Object(W.a)(A);function A(){var E;return Object(V.a)(this,A),E=L.apply(this,arguments),E.state={dragNodeHighlight:!1},E.onSelectorClick=function(_){var m=E.props.context.onNodeClick;m(_,Object(d.b)(E.props)),E.isSelectable()?E.onSelect(_):E.onCheck(_)},E.onSelectorDoubleClick=function(_){var m=E.props.context.onNodeDoubleClick;m(_,Object(d.b)(E.props))},E.onSelect=function(_){if(E.isDisabled())return;var m=E.props.context.onNodeSelect;_.preventDefault(),m(_,Object(d.b)(E.props))},E.onCheck=function(_){if(E.isDisabled())return;var m=E.props,f=m.disableCheckbox,S=m.checked,b=E.props.context.onNodeCheck;if(!E.isCheckable()||f)return;_.preventDefault();var y=!S;b(_,Object(d.b)(E.props),y)},E.onMouseEnter=function(_){var m=E.props.context.onNodeMouseEnter;m(_,Object(d.b)(E.props))},E.onMouseLeave=function(_){var m=E.props.context.onNodeMouseLeave;m(_,Object(d.b)(E.props))},E.onContextMenu=function(_){var m=E.props.context.onNodeContextMenu;m(_,Object(d.b)(E.props))},E.onDragStart=function(_){var m=E.props.context.onNodeDragStart;_.stopPropagation(),E.setState({dragNodeHighlight:!0}),m(_,Object(O.a)(E));try{_.dataTransfer.setData("text/plain","")}catch(f){}},E.onDragEnter=function(_){var m=E.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),m(_,Object(O.a)(E))},E.onDragOver=function(_){var m=E.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),m(_,Object(O.a)(E))},E.onDragLeave=function(_){var m=E.props.context.onNodeDragLeave;_.stopPropagation(),m(_,Object(O.a)(E))},E.onDragEnd=function(_){var m=E.props.context.onNodeDragEnd;_.stopPropagation(),E.setState({dragNodeHighlight:!1}),m(_,Object(O.a)(E))},E.onDrop=function(_){var m=E.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),E.setState({dragNodeHighlight:!1}),m(_,Object(O.a)(E))},E.onExpand=function(_){var m=E.props.context.onNodeExpand;m(_,Object(d.b)(E.props))},E.setSelectHandle=function(_){E.selectHandle=_},E.getNodeState=function(){var _=E.props.expanded;return E.isLeaf()?null:_?i:l},E.hasChildren=function(){var _=E.props.eventKey,m=E.props.context.keyEntities,f=m[_]||{},S=f.children;return!!(S||[]).length},E.isLeaf=function(){var _=E.props,m=_.isLeaf,f=_.loaded,S=E.props.context.loadData,b=E.hasChildren();return m===!1?!1:m||!S&&!b||S&&f&&!b},E.isDisabled=function(){var _=E.props.disabled,m=E.props.context.disabled;return!!(m||_)},E.isCheckable=function(){var _=E.props.checkable,m=E.props.context.checkable;return!m||_===!1?!1:m},E.syncLoadData=function(_){var m=_.expanded,f=_.loading,S=_.loaded,b=E.props.context,y=b.loadData,M=b.onNodeLoad;if(f)return;y&&m&&!E.isLeaf()&&(!E.hasChildren()&&!S&&M(Object(d.b)(E.props)))},E.renderSwitcher=function(){var _=E.props,m=_.expanded,f=_.switcherIcon,S=E.props.context,b=S.prefixCls,y=S.switcherIcon,M=f||y;if(E.isLeaf())return n.createElement("span",{className:g()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof M=="function"?M(Object(D.a)(Object(D.a)({},E.props),{},{isLeaf:!0})):M);var B=g()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(m?i:l));return n.createElement("span",{onClick:E.onExpand,className:B},typeof M=="function"?M(Object(D.a)(Object(D.a)({},E.props),{},{isLeaf:!1})):M)},E.renderCheckbox=function(){var _=E.props,m=_.checked,f=_.halfChecked,S=_.disableCheckbox,b=E.props.context.prefixCls,y=E.isDisabled(),M=E.isCheckable();if(!M)return null;var B=typeof M!="boolean"?M:null;return n.createElement("span",{className:g()("".concat(b,"-checkbox"),m&&"".concat(b,"-checkbox-checked"),!m&&f&&"".concat(b,"-checkbox-indeterminate"),(y||S)&&"".concat(b,"-checkbox-disabled")),onClick:E.onCheck},B)},E.renderIcon=function(){var _=E.props.loading,m=E.props.context.prefixCls;return n.createElement("span",{className:g()("".concat(m,"-iconEle"),"".concat(m,"-icon__").concat(E.getNodeState()||"docu"),_&&"".concat(m,"-icon_loading"))})},E.renderSelector=function(){var _=E.state.dragNodeHighlight,m=E.props,f=m.title,S=m.selected,b=m.icon,y=m.loading,M=m.data,B=E.props.context,R=B.prefixCls,H=B.showIcon,N=B.icon,C=B.draggable,K=B.loadData,Z=B.titleRender,oe=E.isDisabled(),fe="".concat(R,"-node-content-wrapper"),xe;if(H){var be=b||N;xe=be?n.createElement("span",{className:g()("".concat(R,"-iconEle"),"".concat(R,"-icon__customize"))},typeof be=="function"?be(E.props):be):E.renderIcon()}else K&&y&&(xe=E.renderIcon());var Te;typeof f=="function"?Te=f(M):Z?Te=Z(M):Te=f;var Ce=n.createElement("span",{className:"".concat(R,"-title")},Te);return n.createElement("span",{ref:E.setSelectHandle,title:typeof f=="string"?f:"",className:g()("".concat(fe),"".concat(fe,"-").concat(E.getNodeState()||"normal"),!oe&&(S||_)&&"".concat(R,"-node-selected"),!oe&&C&&"draggable"),draggable:!oe&&C||void 0,"aria-grabbed":!oe&&C||void 0,onMouseEnter:E.onMouseEnter,onMouseLeave:E.onMouseLeave,onContextMenu:E.onContextMenu,onClick:E.onSelectorClick,onDoubleClick:E.onSelectorDoubleClick,onDragStart:C?E.onDragStart:void 0},xe,Ce)},E}return Object(U.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,m=this.props.context.selectable;return typeof _=="boolean"?_:m}},{key:"render",value:function(){var _,m=this.props,f=m.eventKey,S=m.className,b=m.style,y=m.dragOver,M=m.dragOverGapTop,B=m.dragOverGapBottom,R=m.isLeaf,H=m.isStart,N=m.isEnd,C=m.expanded,K=m.selected,Z=m.checked,oe=m.halfChecked,fe=m.loading,xe=m.domRef,be=m.active,Te=m.onMouseMove,Ce=Object(z.a)(m,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Le=this.props.context,ge=Le.prefixCls,Y=Le.filterTreeNode,k=Le.draggable,j=Le.keyEntities,J=this.isDisabled(),ie=Object(h.f)(Ce),X=j[f]||{},ve=X.level,Ie=N[N.length-1];return n.createElement("div",Object.assign({ref:xe,className:g()(S,"".concat(ge,"-treenode"),(_={},Object(q.a)(_,"".concat(ge,"-treenode-disabled"),J),Object(q.a)(_,"".concat(ge,"-treenode-switcher-").concat(C?"open":"close"),!R),Object(q.a)(_,"".concat(ge,"-treenode-checkbox-checked"),Z),Object(q.a)(_,"".concat(ge,"-treenode-checkbox-indeterminate"),oe),Object(q.a)(_,"".concat(ge,"-treenode-selected"),K),Object(q.a)(_,"".concat(ge,"-treenode-loading"),fe),Object(q.a)(_,"".concat(ge,"-treenode-active"),be),Object(q.a)(_,"".concat(ge,"-treenode-leaf-last"),Ie),Object(q.a)(_,"drag-over",!J&&y),Object(q.a)(_,"drag-over-gap-top",!J&&M),Object(q.a)(_,"drag-over-gap-bottom",!J&&B),Object(q.a)(_,"filter-node",Y&&Y(Object(d.b)(this.props))),_)),style:b,onDragEnter:k?this.onDragEnter:void 0,onDragOver:k?this.onDragOver:void 0,onDragLeave:k?this.onDragLeave:void 0,onDrop:k?this.onDrop:void 0,onDragEnd:k?this.onDragEnd:void 0,onMouseMove:Te},ie),n.createElement(s,{prefixCls:ge,level:ve,isStart:H,isEnd:N}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(n.Component),w=function(L){return n.createElement(p.a.Consumer,null,function(A){return n.createElement(o,Object.assign({},L,{context:A}))})};w.displayName="TreeNode",w.defaultProps={title:r},w.isTreeNode=1;var T=de.a=w},XIdC:function(ke,de,P){"use strict";var q=P("rePB"),z=P("ODXe"),D=P("Ff2n"),V=P("q1tI"),U=P.n(V),O=P("TSYQ"),G=P.n(O),W=P("6cGi"),n=P("4IlW"),I=V.forwardRef(function(g,p){var h,c=g.prefixCls,s=c===void 0?"rc-switch":c,d=g.className,i=g.checked,l=g.defaultChecked,r=g.disabled,o=g.loadingIcon,w=g.checkedChildren,T=g.unCheckedChildren,x=g.onClick,L=g.onChange,A=g.onKeyDown,E=Object(D.a)(g,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),_=Object(W.a)(!1,{value:i,defaultValue:l}),m=Object(z.a)(_,2),f=m[0],S=m[1];function b(R,H){var N=f;return r||(N=R,S(N),L==null||L(N,H)),N}function y(R){R.which===n.a.LEFT?b(!1,R):R.which===n.a.RIGHT&&b(!0,R),A==null||A(R)}function M(R){var H=b(!f,R);x==null||x(H,R)}var B=G()(s,d,(h={},Object(q.a)(h,"".concat(s,"-checked"),f),Object(q.a)(h,"".concat(s,"-disabled"),r),h));return V.createElement("button",Object.assign({},E,{type:"button",role:"switch","aria-checked":f,disabled:r,className:B,ref:p,onKeyDown:y,onClick:M}),o,V.createElement("span",{className:"".concat(s,"-inner")},f?w:T))});I.displayName="Switch",de.a=I},Y1PL:function(ke,de,P){"use strict";P.r(de),P.d(de,"ResizableTextArea",function(){return oe});var q=P("wx14"),z=P("1OyB"),D=P("vuIU"),V=P("Ji7U"),U=P("LK+K"),O=P("q1tI"),G=P("VTBJ"),W=P("rePB"),n=P("Zm9Q"),I=P("Kwbf"),g=P("c+Xe"),p=P("m+aA"),h=P("bdgK"),c=new Map;function s(be){be.forEach(function(Te){var Ce,Le=Te.target;(Ce=c.get(Le))===null||Ce===void 0||Ce.forEach(function(ge){return ge(Le)})})}var d=new h.default(s),i=null,l=null;function r(be,Te){c.has(be)||(c.set(be,new Set),d.observe(be)),c.get(be).add(Te)}function o(be,Te){c.has(be)&&(c.get(be).delete(Te),c.get(be).size||(d.unobserve(be),c.delete(be)))}var w=function(be){Object(V.a)(Ce,be);var Te=Object(U.a)(Ce);function Ce(){return Object(z.a)(this,Ce),Te.apply(this,arguments)}return Object(D.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(O.Component),T=O.createContext(null);function x(be){var Te=be.children,Ce=be.onBatchResize,Le=O.useRef(0),ge=O.useRef([]),Y=O.useContext(T),k=O.useCallback(function(j,J,ie){Le.current+=1;var X=Le.current;ge.current.push({size:j,element:J,data:ie}),Promise.resolve().then(function(){X===Le.current&&(Ce==null||Ce(ge.current),ge.current=[])}),Y==null||Y(j,J,ie)},[Ce,Y]);return O.createElement(T.Provider,{value:k},Te)}function L(be){var Te=be.children,Ce=be.disabled,Le=O.useRef(null),ge=O.useRef(null),Y=O.useContext(T),k=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),j=O.isValidElement(Te)&&Object(g.c)(Te),J=j?Te.ref:null,ie=O.useMemo(function(){return Object(g.a)(J,Le)},[J,Le]),X=O.useRef(be);X.current=be;var ve=O.useCallback(function(Ie){var Ue=X.current,pe=Ue.onResize,_e=Ue.data,Ae=Ie.getBoundingClientRect(),De=Ae.width,je=Ae.height,ze=Ie.offsetWidth,Je=Ie.offsetHeight,$e=Math.floor(De),tt=Math.floor(je);if(k.current.width!==$e||k.current.height!==tt||k.current.offsetWidth!==ze||k.current.offsetHeight!==Je){var Qe={width:$e,height:tt,offsetWidth:ze,offsetHeight:Je};k.current=Qe;var Re=ze===Math.round(De)?De:ze,Oe=Je===Math.round(je)?je:Je,We=Object(G.a)(Object(G.a)({},Qe),{},{offsetWidth:Re,offsetHeight:Oe});Y==null||Y(We,Ie,_e),pe&&Promise.resolve().then(function(){pe(We,Ie)})}},[]);return O.useEffect(function(){var Ie=Object(p.a)(Le.current)||Object(p.a)(ge.current);return Ie&&!Ce&&r(Ie,ve),function(){return o(Ie,ve)}},[Le.current,Ce]),O.createElement(w,{ref:ge},j?O.cloneElement(Te,{ref:ie}):Te)}var A="rc-observer-key";function E(be){var Te=be.children,Ce=Object(n.a)(Te);return Ce.map(function(Le,ge){var Y=(Le==null?void 0:Le.key)||"".concat(A,"-").concat(ge);return O.createElement(L,Object(q.a)({},be,{key:Y}),Le)})}E.Collection=x;var _=E,m=P("bT9E"),f=P("TSYQ"),S=P.n(f),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
|
|
`,y=["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"],M={},B;function R(be){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Te&&M[Ce])return M[Ce];var Le=window.getComputedStyle(be),ge=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),k=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),j=y.map(function(ie){return"".concat(ie,":").concat(Le.getPropertyValue(ie))}).join(";"),J={sizingStyle:j,paddingSize:Y,borderSize:k,boxSizing:ge};return Te&&Ce&&(M[Ce]=J),J}function H(be){var Te=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;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),be.getAttribute("wrap")?B.setAttribute("wrap",be.getAttribute("wrap")):B.removeAttribute("wrap");var ge=R(be,Te),Y=ge.paddingSize,k=ge.borderSize,j=ge.boxSizing,J=ge.sizingStyle;B.setAttribute("style","".concat(J,";").concat(b)),B.value=be.value||be.placeholder||"";var ie=Number.MIN_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER,ve=B.scrollHeight,Ie;if(j==="border-box"?ve+=k:j==="content-box"&&(ve-=Y),Ce!==null||Le!==null){B.value=" ";var Ue=B.scrollHeight-Y;Ce!==null&&(ie=Ue*Ce,j==="border-box"&&(ie=ie+Y+k),ve=Math.max(ie,ve)),Le!==null&&(X=Ue*Le,j==="border-box"&&(X=X+Y+k),Ie=ve>X?"":"hidden",ve=Math.min(X,ve))}return{height:ve,minHeight:ie,maxHeight:X,overflowY:Ie,resize:"none"}}var N=P("Gytx"),C=P.n(N),K;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(K||(K={}));var Z=function(be){Object(V.a)(Ce,be);var Te=Object(U.a)(Ce);function Ce(Le){var ge;return Object(z.a)(this,Ce),ge=Te.call(this,Le),ge.nextFrameActionId=void 0,ge.resizeFrameId=void 0,ge.textArea=void 0,ge.saveTextArea=function(Y){ge.textArea=Y},ge.handleResize=function(Y){var k=ge.state.resizeStatus,j=ge.props,J=j.autoSize,ie=j.onResize;if(k!==K.NONE)return;typeof ie=="function"&&ie(Y),J&&ge.resizeOnNextFrame()},ge.resizeOnNextFrame=function(){cancelAnimationFrame(ge.nextFrameActionId),ge.nextFrameActionId=requestAnimationFrame(ge.resizeTextarea)},ge.resizeTextarea=function(){var Y=ge.props.autoSize;if(!Y||!ge.textArea)return;var k=Y.minRows,j=Y.maxRows,J=H(ge.textArea,!1,k,j);ge.setState({textareaStyles:J,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(ge.resizeFrameId),ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:K.RESIZED},function(){ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:K.NONE}),ge.fixFirefoxAutoScroll()})})})})},ge.renderTextArea=function(){var Y=ge.props,k=Y.prefixCls,j=k===void 0?"rc-textarea":k,J=Y.autoSize,ie=Y.onResize,X=Y.className,ve=Y.disabled,Ie=ge.state,Ue=Ie.textareaStyles,pe=Ie.resizeStatus,_e=Object(m.a)(ge.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ae=S()(j,X,Object(W.a)({},"".concat(j,"-disabled"),ve));"value"in _e&&(_e.value=_e.value||"");var De=Object(G.a)(Object(G.a)(Object(G.a)({},ge.props.style),Ue),pe===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(_,{onResize:ge.handleResize,disabled:!(J||ie)},O.createElement("textarea",Object(q.a)({},_e,{className:Ae,style:De,ref:ge.saveTextArea})))},ge.state={textareaStyles:{},resizeStatus:K.NONE},ge}return Object(D.a)(Ce,[{key:"componentDidUpdate",value:function(ge){(ge.value!==this.props.value||!C()(ge.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 ge=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(ge,Y)}}catch(k){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(O.Component),oe=Z,fe=function(be){Object(V.a)(Ce,be);var Te=Object(U.a)(Ce);function Ce(Le){var ge;Object(z.a)(this,Ce),ge=Te.call(this,Le),ge.resizableTextArea=void 0,ge.focus=function(){ge.resizableTextArea.textArea.focus()},ge.saveTextArea=function(k){ge.resizableTextArea=k},ge.handleChange=function(k){var j=ge.props.onChange;ge.setValue(k.target.value,function(){ge.resizableTextArea.resizeTextarea()}),j&&j(k)},ge.handleKeyDown=function(k){var j=ge.props,J=j.onPressEnter,ie=j.onKeyDown;k.keyCode===13&&J&&J(k),ie&&ie(k)};var Y=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ge.state={value:Y},ge}return Object(D.a)(Ce,[{key:"setValue",value:function(ge,Y){"value"in this.props||this.setState({value:ge},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(oe,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ge){return"value"in ge?{value:ge.value}:null}}]),Ce}(O.Component),xe=de.default=fe},ZD9Y:function(ke,de,P){"use strict";var q=P("BoS7"),z=P("Sdc0"),D=P("OaEy"),V=P("2fM7"),U=P("q1tI"),O=P.n(U),G=P("lOMy"),W=P.n(G),n=V.a.Option;de.a=function(I){var g=I.onFontSizeChange,p=I.cmFontSize,h=I.cmCodeMode,c=I.onCodeModeChange,s=I.onTabToSpace,d=I.className,i=d===void 0?"":d,l=I.tabToSpace,r=I.children;return O.a.createElement("div",{className:"tpi-code-setting ".concat(i)},O.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),O.a.createElement(V.a,{bordered:!1,size:"small",value:h,onChange:c},O.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),O.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),O.a.createElement(V.a,{bordered:!1,size:"small",value:p,onChange:g},O.a.createElement(n,{value:12},"12px"),O.a.createElement(n,{value:14},"14px"),O.a.createElement(n,{value:16},"16px"),O.a.createElement(n,{value:18},"18px"),O.a.createElement(n,{value:20},"20px"),O.a.createElement(n,{value:22},"22px"))),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"Tab\u8F6C\u6362"),O.a.createElement(z.a,{checked:l,onChange:s}))),O.a.createElement("h3",null,"\u5FEB\u6377\u952E"),O.a.createElement("section",null,O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),O.a.createElement("span",null,"Ctrl + S")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),O.a.createElement("span",null,"F1 / Alt + F1")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),O.a.createElement("span",null,"Ctrl + ]/[")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),O.a.createElement("span",null,"Ctrl + Shift + \\")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),O.a.createElement("span",null,"Home")),O.a.createElement("div",{className:"file-item"},O.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),O.a.createElement("span",null,"End"))),r)}},ZW9T:function(ke,de,P){"use strict";P.d(de,"a",function(){return N});var q=P("k1fw"),z=P("oBTY"),D=P("miYZ"),V=P("tsqr"),U=P("rAM+"),O=P("tJVT"),G=P("PpiC"),W=P("q1tI"),n=P.n(W),I=P("bdgK"),g=P("9og8"),p=P("WmNS"),h=P.n(p),c={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"]},s={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"]},d={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(`
|
|
`)}]},i={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(`
|
|
`)}]},l=P("5VLF"),r=P.n(l),o={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"]}},w=function(K,Z){return Z.map(function(oe){return{label:oe,kind:K.languages.CompletionItemKind.Keyword,insertText:oe}})},T=function(K){return Object.keys(o.tables).map(function(Z){return{label:Z,kind:K.languages.CompletionItemKind.Variable,insertText:Z}})},x=function(K,Z){var oe=o.tables[K];return oe?oe.map(function(fe){return{label:fe,kind:Z.languages.CompletionItemKind.Field,insertText:fe}}):[]};function L(C,K,Z,oe,fe){var xe=K.getWordUntilPosition(Z),be={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Te=oe.map(function(Ce){return{label:Ce,kind:C.languages.CompletionItemKind.Keyword,insertText:Ce,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return fe.map(function(Ce){Te.push(Object(q.a)(Object(q.a)({},Ce),{},{range:be}))}),Te}var A=function(C){o.languages.map(function(fe){return C.languages.registerDocumentFormattingEditProvider(fe,{provideDocumentFormattingEdits:function(be,Te,Ce){return Object(g.a)(h.a.mark(function Le(){var ge;return h.a.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return ge=r()(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}),k.abrupt("return",[{range:be.getFullModelRange(),text:ge}]);case 2:case"end":return k.stop()}},Le)}))()}}),fe});var K=d.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=i.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=s.quickKey.map(function(fe){return{label:fe.label,kind:C.languages.CompletionItemKind.Method,insertText:fe.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}});C.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(xe,be){var Te=xe.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=xe.getLineContent(be.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(z.a)(d.keywords.map(function(ge){return{label:ge,kind:C.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(z.a)(d.quickKey.map(function(ge){return{label:ge.label,kind:C.languages.CompletionItemKind.Function,documentation:ge.content,insertText:Le.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),C.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(xe,be){var Te=xe.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object(z.a)(c.keywords.map(function(Le){return{label:Le,kind:C.languages.CompletionItemKind.Function,documentation:Le,insertText:Le,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}}))}}}),C.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(xe,be){var Te=xe.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=xe.getLineContent(be.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(z.a)(s.keywords.map(function(ge){return{label:ge,kind:C.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(z.a)(s.quickKey.map(function(ge){return{label:ge.label,kind:C.languages.CompletionItemKind.Function,documentation:ge.content,insertText:Le.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}}),C.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(xe,be){var Te=xe.getWordUntilPosition(be),Ce={startLineNumber:be.lineNumber,endLineNumber:be.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Le=xe.getLineContent(be.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(z.a)(i.keywords.map(function(ge){return{label:ge,kind:C.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})),Object(z.a)(i.quickKey.map(function(ge){return{label:ge.label,kind:C.languages.CompletionItemKind.Function,documentation:ge.content,insertText:Le.startsWith("#")?ge.content.replace(/#/,""):ge.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}})))}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=P("fjLI"),m=P("LvDl"),f=P("+ua5");function S(C){return/^\d+$/.test(C)?"".concat(C,"px"):C}function b(){}var y=!1,M={"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 B(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],K=C;if(Array.isArray(C)){for(var Z=0;Z<C.length;Z++){var oe=M[C[Z]];if(oe)return oe}return K[0]}return M[K]||K}var R=null,H=de.b=function(C){var K=C.width,Z=K===void 0?"100%":K,oe=C.height,fe=oe===void 0?"100%":oe,xe=C.value,be=C.language,Te=be===void 0?"javascript":be,Ce=C.style,Le=Ce===void 0?{}:Ce,ge=C.options,Y=ge===void 0?{}:ge,k=C.overrideServices,j=k===void 0?{}:k,J=C.theme,ie=J===void 0?"vs-dark":J,X=C.onEditBlur,ve=C.onSave,Ie=C.autoHeight,Ue=Ie===void 0?!1:Ie,pe=C.forbidCopy,_e=pe===void 0?!1:pe,Ae=C.onChange,De=Ae===void 0?b:Ae,je=C.editorDidMount,ze=je===void 0?b:je,Je=C.onFocus,$e=Je===void 0?b:Je,tt=C.filename,Qe=tt===void 0?"educoder.txt":tt,Re=C.errorLine,Oe=C.errorContent,We=Oe===void 0?"":Oe,He=Object(G.a)(C,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ue=Object(W.useRef)(),Q=Object(W.useRef)({}),te=Object(W.useRef)(),ae=Object(W.useRef)(),ce=Object(W.useRef)(!1),re=Object(W.useRef)(),se=Object(W.useState)(!1),he=Object(O.a)(se,2),me=he[0],ye=he[1];function Se(){var ht;return ue.current&&(ht=new I.default(function(Tt){var yt=Object(U.a)(Tt),Sn;try{for(yt.s();!(Sn=yt.n()).done;){var Kn=Sn.value;(Kn.target.offsetHeight>0||Kn.target.offsetWidth>0)&&Q.current.instance.layout()}}catch(pn){yt.e(pn)}finally{yt.f()}}),ht.observe(ue.current)),ht}function Fe(){V.b.warn(decodeURIComponent(E))}var Ge=function(){var Tt=Q.current.instance;if(xe!=null&&Tt&&me){var yt=Tt.getModel();yt&&xe!==yt.getValue()&&(y=!0,yt.setValue(xe),Tt.layout(),y=!1)}};Object(W.useEffect)(function(){ae.current&&clearTimeout(ae.current),ae.current=setTimeout(function(){Ge()},500)},[xe,me,Q.current]),Object(W.useEffect)(function(){if(Re&&Q.current&&Q.current.instance){var ht=Q.current.instance;ht.changeViewZones(function(yt){var Sn=document.createElement("div");Sn.style.padding="10px 20px",Sn.style.width="calc(100% - 20px)",Sn.className="my-error-line-wrp",Sn.innerHTML=We,yt.addZone({afterLineNumber:Re||11,heightInLines:3,domNode:Sn})});var Tt={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}};ht.addOverlayWidget(Tt),ht.revealPositionInCenter({lineNumber:20,column:1})}},[Re,Q.current,me]);function Ze(){var ht=Q.current.instance;if(ht){var Tt=ht.getSelection(),yt=Q.current.pastePos||{},Sn=new R.Range(yt.startLineNumber||Tt.endLineNumber,yt.startColumn||Tt.endColumn,yt.endLineNumber||Tt.endLineNumber,yt.endColumn||Tt.endColumn);setTimeout(function(){ht.executeEdits("",[{range:Sn,text:""}])},300)}}function Ye(ht){(window.navigator.platform.match("Mac")?ht.metaKey:ht.ctrlKey)&&ht.keyCode==83&&(ht.preventDefault(),ve())}var Rt=function(){if(Ue&&Q.current.instance){var Tt=Q.current.instance.getContentHeight();Ct(Tt<fe?fe:Tt)}else Ct(fe)};function lt(ht){var Tt=document.createEvent("MouseEvents");Tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ht.dispatchEvent(Tt)}function it(ht,Tt){var yt=window.URL||window.webkitURL||window,Sn=new Blob([Tt]),Kn=document.createElementNS("http://www.w3.org/1999/xhtml","a");Kn.href=yt.createObjectURL(Sn),Kn.download=ht,lt(Kn)}Object(W.useEffect)(function(){Rt()},[Rt]),Object(W.useEffect)(function(){ue.current&&!me&&Promise.all([P.e(17),P.e(29)]).then(P.t.bind(null,"M/lh",7)).then(function(ht){try{R=ht,Q.current.instance=R.editor.create(ue.current,{value:xe,language:B(Te),theme:ie,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},j);var Tt=Q.current.instance,yt=_.d._menuItems,Sn=Object(z.a)(yt).find(function(Yt){return Yt[0]._debugName=="EditorContext"}),Kn=Sn[1],pn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],et=function(xt,Dt){var jt=xt._first;do{var Fn,En,Ve=Dt.includes((Fn=jt.element)===null||Fn===void 0||((En=Fn.command)===null||En===void 0)?void 0:En.id);Ve&&xt._remove(jt)}while(jt=jt.next)};if(ze(Tt,R),setTimeout(function(){Rt(),Q.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){it(Qe||"educoder.txt",Tt.getValue())}}),Tt.getDomNode().addEventListener("input",function(){te.current.autoFormat&&Tt.getAction("editor.action.formatDocument").run()})},500),Q.current.subscription=Tt.onDidChangeModelContent(function(Yt){ce.current?clearTimeout(re.current):(Rt(),De(Tt.getValue(),Yt)),re.current=setTimeout(function(){ce.current=!1},500)}),window.Monaco||A(R,B(Te)),_e&&(et(Kn,pn),ue.current.classList.add("noCopyPaste"),Tt.onKeyDown(function(Yt){var xt=Yt.keyCode,Dt=Yt.ctrlKey,jt=Yt.metaKey;(xt===33||xt===52)&&(jt||Dt)&&(Fe(),Yt.preventDefault())})),window.Monaco=R,X&&Tt.onDidBlurEditorWidget(function(){X(Tt.getValue())}),$e&&Tt.onDidFocusEditorText(function(){$e(Tt.getValue())}),_e){Tt.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Fe(),null}),Tt.onDidPaste(function(Yt){Q.current.pastePos=Yt});try{window.addEventListener("paste",Ze)}catch(Yt){}}var Kt=Se();return ye(!0),function(){var Yt=Q.current.instance;Yt.dispose();var xt=Yt.getModel();xt&&xt.dispose(),Q.current.subscription&&Q.current.subscription.dispose(),_e&&window.removeEventListener("paste",Ze),Kt.unobserve(ue.current)}}catch(Yt){}})},[]),Object(W.useEffect)(function(){var ht=Q.current.instance;if(ht&&me)return document.addEventListener("keydown",Ye,!1),function(){document.removeEventListener("keydown",Ye)}},[ve,me]),Object(W.useEffect)(function(){var ht=Q.current.instance;if(ht&&me){var Tt=B(Te);R.editor.setModelLanguage(ht.getModel(),Tt),console.log("language:",Te,ht.getModel(),Tt)}},[Te,me]),Object(W.useEffect)(function(){var ht=Q.current.instance;ht&&me&&R.editor.setTheme(ie)},[ie,me]),Object(W.useEffect)(function(){var ht=Q.current.instance;te.current=Y,ht&&me&&(ht.updateOptions(Object(q.a)({},Y)),setTimeout(function(){ht.getModel().updateOptions(Object(q.a)({},Y))},200))},[JSON.stringify(Y),me]),Object(W.useEffect)(function(){var ht=Q.current.instance;ht&&me&&ht.layout()},[Z,fe,me]);var Wt=Object(W.useState)(S(Z)),Nt=Object(O.a)(Wt,2),Ut=Nt[0],rn=Nt[1],vt=Object(W.useState)(S(fe)),on=Object(O.a)(vt,2),an=on[0],Ct=on[1],Mt=Object(q.a)(Object(q.a)({},Le),{},{width:Ut,height:an});return n.a.createElement("div",{className:"my-monaco-editor",ref:ue,style:Mt})};function N(C){var K=C.width,Z=K===void 0?"100%":K,oe=C.height,fe=oe===void 0?"100%":oe,xe=C.original,be=C.modified,Te=C.language,Ce=C.options,Le=Ce===void 0?{}:Ce,ge=Object(W.useRef)(),Y=Object(W.useState)(null),k=Object(O.a)(Y,2),j=k[0],J=k[1];function ie(Ue){var pe;return ge.current&&(pe=new I.default(function(_e){var Ae=Object(U.a)(_e),De;try{for(Ae.s();!(De=Ae.n()).done;){var je=De.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&Ue.layout()}}catch(ze){Ae.e(ze)}finally{Ae.f()}}),pe.observe(ge.current)),pe}Object(W.useEffect)(function(){ge.current&&Promise.all([P.e(17),P.e(29)]).then(P.t.bind(null,"M/lh",7)).then(function(Ue){R=Ue;var pe=R.editor.createDiffEditor(ge.current,Object(q.a)(Object(q.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}));J(pe);var _e=ie(pe);return function(){pe.dispose();var Ae=pe.getModel();Ae&&Ae.dispose(),_e.unobserve(ge.current)}})},[]),Object(W.useEffect)(function(){j&&j.setModel({original:R.editor.createModel(xe,Te),modified:R.editor.createModel(be,Te)})},[xe,be,Te,j]);var X=S(Z),ve=S(fe),Ie={width:X,height:ve};return n.a.createElement("div",{className:"my-diff-editor",ref:ge,style:Ie})}},a4uL:function(ke,de,P){},bCnd:function(ke,de,P){"use strict";P.d(de,"b",function(){return V}),P.d(de,"a",function(){return U});var q=P("je13"),z=P.n(q),D=!1;function V(O,G){var W=z.a.get("__ec");W||(W={}),W[O]=G,z.a.set("__ec",W)}function U(O,G){var W=z.a.get("__ec");return W?W[O]===void 0?G:W[O]:G}},bT9E:function(ke,de,P){"use strict";P.d(de,"a",function(){return z});var q=P("VTBJ");function z(D,V){var U=Object(q.a)({},D);return Array.isArray(V)&&V.forEach(function(O){delete U[O]}),U}},biw7:function(ke,de,P){"use strict";var q=P("q1tI"),z=P.n(q),D=q.createContext(null);de.a=D},c5Ni:function(ke,de,P){},cDPC:function(ke,de,P){"use strict";var q=P("tJVT"),z=P("q1tI"),D=P.n(z),V=P("i3hx"),U=P.n(V);de.a=function(O){var G=O.defaultX,W=G===void 0?"40%":G,n=O.leftChild,I=O.rightChild,g=O.className,p=O.hideResize,h=p===void 0?!1:p,c=Object(z.useState)(W),s=Object(q.a)(c,2),d=s[0],i=s[1],l=Object(z.useRef)();function r(){l.current=!0}Object(z.useEffect)(function(){function T(L){l.current&&i(L.pageX)}function x(){l.current=!1}return window.addEventListener("mousemove",T),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",x)}},[]);var o=typeof d=="number"&&d!==.01?"".concat(d,"px"):W,w="calc(100% - ".concat(h?"0px":"4px"," - ").concat(o,")");return D.a.createElement("div",{className:"split-panel-container ".concat(g)},D.a.createElement("section",{style:{width:o,display:d===.01?"none":""}},n),D.a.createElement("section",{className:"resize-x-bar",onMouseDown:r},D.a.createElement("a",{className:"btn-resize"},D.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},D.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),D.a.createElement("section",{style:{width:w}},I))}},dejd:function(ke,de,P){},dmUQ:function(ke,de,P){"use strict";var q=P("Ff2n"),z=P("rePB"),D=P("1OyB"),V=P("vuIU"),U=P("Ji7U"),O=P("md7G"),G=P("foSv"),W=P("q1tI"),n=P.n(W),I=P("TSYQ"),g=P.n(I),p=P("4IlW");function h(m,f){var S=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(m,y).enumerable})),S.push.apply(S,b)}return S}function c(m){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?h(Object(S),!0).forEach(function(b){Object(z.a)(m,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(S)):h(Object(S)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(S,b))})}return m}function s(m){var f=d();return function(){var b=Object(G.a)(m),y;if(f){var M=Object(G.a)(this).constructor;y=Reflect.construct(b,arguments,M)}else y=b.apply(this,arguments);return Object(O.a)(this,y)}}function d(){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(m){return!1}}function i(){}function l(m){m.preventDefault()}var r=function(f){return f.replace(/[^\w.-]+/g,"")},o=200,w=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(f){return f!=null},L=function(f,S){return S===f||typeof S=="number"&&typeof f=="number"&&isNaN(S)&&isNaN(f)},A=function(m){Object(U.a)(S,m);var f=s(S);function S(b){var y;Object(D.a)(this,S),y=f.call(this,b),y.onKeyDown=function(R){var H=y.props,N=H.onKeyDown,C=H.onPressEnter;if(R.keyCode===p.a.UP){var K=y.getRatio(R);y.up(R,K,null),y.stop()}else if(R.keyCode===p.a.DOWN){var Z=y.getRatio(R);y.down(R,Z,null),y.stop()}else R.keyCode===p.a.ENTER&&C&&C(R);if(y.recordCursorPosition(),y.lastKeyCode=R.keyCode,N){for(var oe=arguments.length,fe=new Array(oe>1?oe-1:0),xe=1;xe<oe;xe++)fe[xe-1]=arguments[xe];N.apply(void 0,[R].concat(fe))}},y.onKeyUp=function(R){var H=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),H){for(var N=arguments.length,C=new Array(N>1?N-1:0),K=1;K<N;K++)C[K-1]=arguments[K];H.apply(void 0,[R].concat(C))}},y.onChange=function(R){var H=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(R)),y.setState({inputValue:y.rawInput}),H(y.toNumber(y.rawInput))},y.onMouseUp=function(){var R=y.props.onMouseUp;y.recordCursorPosition(),R&&R.apply(void 0,arguments)},y.onFocus=function(){var R;y.setState({focused:!0}),(R=y.props).onFocus.apply(R,arguments)},y.onBlur=function(){var R=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var H=y.getCurrentValidValue(y.state.inputValue),N=y.setValue(H,i);if(R){var C=y.input.value,K=y.getInputDisplayValue({focus:!1,value:N});y.input.value=K&&Number(K),R.apply(void 0,arguments),y.input.value=C}},y.getRatio=function(R){var H=1;return R.metaKey||R.ctrlKey?H=.1:R.shiftKey&&(H=10),H},y.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},y.getPrecision=function(R){if(x(y.props.precision))return y.props.precision;var H=String(R);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var N=0;return H.indexOf(".")>=0&&(N=H.length-H.indexOf(".")-1),N},y.getInputDisplayValue=function(R){var H=R||y.state,N=H.focused,C=H.inputValue,K=H.value,Z;N?Z=C:Z=y.toPrecisionAsStep(K),Z==null&&(Z="");var oe=y.formatWrapper(Z);return x(y.props.decimalSeparator)&&(oe=oe.toString().replace(".",y.props.decimalSeparator)),oe},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(R){}},y.restoreByAfter=function(R){if(R===void 0)return!1;var H=y.input.value,N=H.lastIndexOf(R);if(N===-1)return!1;var C=y.cursorBefore.length;return y.lastKeyCode===p.a.DELETE&&y.cursorBefore.charAt(C-1)===R[0]?(y.fixCaret(C,C),!0):N+R.length===H.length?(y.fixCaret(N,N),!0):!1},y.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(H,N){var C=R.substring(N);return y.restoreByAfter(C)})},y.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(R,H,N){y.pressingUpOrDown=!0,y.step("down",R,H,N)},y.up=function(R,H,N){y.pressingUpOrDown=!0,y.step("up",R,H,N)},y.saveInput=function(R){y.input=R};var M=b.value;M===void 0&&(M=b.defaultValue),y.state={focused:b.autoFocus};var B=y.getValidValue(y.toNumber(M));return y.state=c(c({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(V.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var M=this.props,B=M.value,R=M.onChange,H=M.max,N=M.min,C=this.state.focused;if(y){if(!L(y.value,B)||!L(y.max,H)||!L(y.min,N)){var K=C?B:this.getValidValue(B),Z;this.pressingUpOrDown?Z=K:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(K),this.setState({value:K,inputValue:Z})}var oe="value"in this.props?B:this.state.value;"max"in this.props&&y.max!==H&&typeof oe=="number"&&oe>H&&R&&R(H),"min"in this.props&&y.min!==N&&typeof oe=="number"&&oe<N&&R&&R(N)}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===p.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===p.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 p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(xe){}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(y){var M=y;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(y){var M=y.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(y);return isNaN(R)?y:(R<M&&(R=M),R>B&&(R=B),R)}},{key:"setValue",value:function(y,M){var B=this.props.precision,R=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),H=this.state.value,N=H===void 0?null:H,C=this.state.inputValue,K=C===void 0?null:C,Z=typeof R=="number"?R.toFixed(B):"".concat(R),oe=R!==N||Z!=="".concat(K);return"value"in this.props?(K=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:K},M)):this.setState({value:R,inputValue:this.toPrecisionAsStep(y)},M),oe&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,R=B.precision,H=B.step;if(x(R))return R;var N=this.getPrecision(M),C=this.getPrecision(H),K=this.getPrecision(y);return y?Math.max(K,N+C):N+C}},{key:"getPrecisionFactor",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,M);return Math.pow(10,B)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var M=Math.abs(this.getMaxPrecision(y));return isNaN(M)?y.toString():Number(y).toFixed(M)}},{key:"toNumber",value:function(y){var M=this.props.precision,B=this.state.focused,R=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||R?y:x(M)?Math.round(y*Math.pow(10,M))/Math.pow(10,M):Number(y)}},{key:"upStep",value:function(y,M){var B=this.props.step,R=this.getPrecisionFactor(y,M),H=Math.abs(this.getMaxPrecision(y,M)),N=((R*y+R*B*M)/R).toFixed(H);return this.toNumber(N)}},{key:"downStep",value:function(y,M){var B=this.props.step,R=this.getPrecisionFactor(y,M),H=Math.abs(this.getMaxPrecision(y,M)),N=((R*y-R*B*M)/R).toFixed(H);return this.toNumber(N)}},{key:"step",value:function(y,M){var B=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var N=this.props;if(N.disabled)return;var C=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(C))return;var K=this["".concat(y,"Step")](C,R),Z=K>N.max||K<N.min;if(K>N.max?K=N.max:K<N.min&&(K=N.min),this.setValue(K,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){B[y](M,R,!0)},H?o:w)}},{key:"fixCaret",value:function(y,M){if(y===void 0||M===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,R=this.input.selectionEnd;(y!==B||M!==R)&&this.input.setSelectionRange(y,M)}catch(H){}}},{key:"render",value:function(){var y,M=this.props,B=M.prefixCls,R=M.disabled,H=M.readOnly,N=M.useTouch,C=M.autoComplete,K=M.upHandler,Z=M.downHandler,oe=M.className,fe=M.max,xe=M.min,be=M.style,Te=M.title,Ce=M.onMouseEnter,Le=M.onMouseLeave,ge=M.onMouseOver,Y=M.onMouseOut,k=M.required,j=M.onClick,J=M.tabIndex,ie=M.type,X=M.placeholder,ve=M.id,Ie=M.inputMode,Ue=M.pattern,pe=M.step,_e=M.maxLength,Ae=M.autoFocus,De=M.name,je=M.onPaste,ze=M.onInput,Je=Object(q.a)(M,["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"]),$e=this.state,tt=$e.value,Qe=$e.focused,Re=g()(B,(y={},Object(z.a)(y,oe,!!oe),Object(z.a)(y,"".concat(B,"-disabled"),R),Object(z.a)(y,"".concat(B,"-focused"),Qe),y)),Oe={};Object.keys(Je).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(Oe[me]=Je[me])});var We=!H&&!R,He=this.getInputDisplayValue(null),ue=(tt||tt===0)&&(isNaN(tt)||Number(tt)>=fe),Q=(tt||tt===0)&&(isNaN(tt)||Number(tt)<=xe),te=ue||R||H,ae=Q||R||H,ce=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(z.a)({},"".concat(B,"-handler-up-disabled"),te)),re=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(z.a)({},"".concat(B,"-handler-down-disabled"),ae)),se=N?{onTouchStart:te?i:this.up,onTouchEnd:this.stop}:{onMouseDown:te?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=N?{onTouchStart:ae?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ae?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Re,style:be,title:Te,onMouseEnter:Ce,onMouseLeave:Le,onMouseOver:ge,onMouseOut:Y,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(B,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:ce}),K||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:l})),n.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ae,className:re}),Z||n.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:l}))),n.a.createElement("div",{className:"".concat(B,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":xe,"aria-valuemax":fe,"aria-valuenow":tt,required:k,type:ie,placeholder:X,onPaste:je,onClick:j,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:J,autoComplete:C,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:We?this.onKeyDown:i,onKeyUp:We?this.onKeyUp:i,autoFocus:Ae,maxLength:_e,readOnly:H,disabled:R,max:fe,min:xe,step:pe,name:De,title:Te,id:ve,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(He),pattern:Ue,inputMode:Ie,onInput:ze},Oe))))}}]),S}(n.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:r,required:!1,autoComplete:"off"};var E=A,_=de.a=E},fcSX:function(ke,de,P){"use strict";var q=P("Ff2n"),z=P("1OyB"),D=P("vuIU"),V=P("Ji7U"),U=P("md7G"),O=P("foSv"),G=P("1W/9"),W=P("q1tI"),n=P("rePB"),I=P("JX7q"),g=P("TSYQ"),p=P.n(g),h=P("qx4F"),c=P("4IlW");function s(R){return Array.isArray(R)?R:[R]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(d).filter(function(R){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return R in(H?H.style:{})})[0],l=d[i];function r(R,H,N,C){R.addEventListener?R.addEventListener(H,N,C):R.attachEvent&&R.attachEvent("on".concat(H),N)}function o(R,H,N,C){R.removeEventListener?R.removeEventListener(H,N,C):R.attachEvent&&R.detachEvent("on".concat(H),N)}function w(R,H){var N=typeof R=="function"?R(H):R;return Array.isArray(N)?N.length===2?N:[N[0],N[1]]:[N]}var T=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),L=function R(H,N,C,K){if(!N||N===document||N instanceof Document)return!1;if(N===H.parentNode)return!0;var Z=Math.max(Math.abs(C),Math.abs(K))===Math.abs(K),oe=Math.max(Math.abs(C),Math.abs(K))===Math.abs(C),fe=N.scrollHeight-N.clientHeight,xe=N.scrollWidth-N.clientWidth,be=document.defaultView.getComputedStyle(N),Te=be.overflowY==="auto"||be.overflowY==="scroll",Ce=be.overflowX==="auto"||be.overflowX==="scroll",Le=fe&&Te,ge=xe&&Ce;return Z&&(!Le||Le&&(N.scrollTop>=fe&&K<0||N.scrollTop<=0&&K>0))||oe&&(!ge||ge&&(N.scrollLeft>=xe&&C<0||N.scrollLeft<=0&&C>0))?R(H,N.parentNode,C,K):!1};function A(R){var H=E();return function(){var C=Object(O.a)(R),K;if(H){var Z=Object(O.a)(this).constructor;K=Reflect.construct(C,arguments,Z)}else K=C.apply(this,arguments);return Object(U.a)(this,K)}}function E(){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(R){return!1}}var _={},m=function(R){Object(V.a)(N,R);var H=A(N);function N(C){var K;return Object(z.a)(this,N),K=H.call(this,C),K.domFocus=function(){K.dom&&K.dom.focus()},K.removeStartHandler=function(Z){if(Z.touches.length>1)return;K.startPos={x:Z.touches[0].clientX,y:Z.touches[0].clientY}},K.removeMoveHandler=function(Z){if(Z.changedTouches.length>1)return;var oe=Z.currentTarget,fe=Z.changedTouches[0].clientX-K.startPos.x,xe=Z.changedTouches[0].clientY-K.startPos.y;(oe===K.maskDom||oe===K.handlerDom||oe===K.contentDom&&L(oe,Z.target,fe,xe))&&Z.cancelable&&Z.preventDefault()},K.transitionEnd=function(Z){var oe=Z.target;o(oe,l,K.transitionEnd),oe.style.transition=""},K.onKeyDown=function(Z){if(Z.keyCode===c.a.ESC){var oe=K.props.onClose;Z.stopPropagation(),oe&&oe(Z)}},K.onWrapperTransitionEnd=function(Z){var oe=K.props,fe=oe.open,xe=oe.afterVisibleChange;Z.target===K.contentWrapper&&Z.propertyName.match(/transform$/)&&(K.dom.style.transition="",!fe&&K.getCurrentDrawerSome()&&(document.body.style.overflowX="",K.maskDom&&(K.maskDom.style.left="",K.maskDom.style.width="")),xe&&xe(!!fe))},K.openLevelTransition=function(){var Z=K.props,oe=Z.open,fe=Z.width,xe=Z.height,be=K.getHorizontalBoolAndPlacementName(),Te=be.isHorizontal,Ce=be.placementName,Le=K.contentDom?K.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,ge=(Te?fe:xe)||Le;K.setLevelAndScrolling(oe,Ce,ge)},K.setLevelTransform=function(Z,oe,fe,xe){var be=K.props,Te=be.placement,Ce=be.levelMove,Le=be.duration,ge=be.ease,Y=be.showMask;K.levelDom.forEach(function(k){k.style.transition="transform ".concat(Le," ").concat(ge),r(k,l,K.transitionEnd);var j=Z?fe:0;if(Ce){var J=w(Ce,{target:k,open:Z});j=Z?J[0]:J[1]||0}var ie=typeof j=="number"?"".concat(j,"px"):j,X=Te==="left"||Te==="top"?ie:"-".concat(ie);X=Y&&Te==="right"&&xe?"calc(".concat(X," + ").concat(xe,"px)"):X,k.style.transform=j?"".concat(oe,"(").concat(X,")"):""})},K.setLevelAndScrolling=function(Z,oe,fe){var xe=K.props.onChange;if(!x){var be=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;K.setLevelTransform(Z,oe,fe,be),K.toggleScrollingToDrawerAndBody(be)}xe&&xe(Z)},K.toggleScrollingToDrawerAndBody=function(Z){var oe=K.props,fe=oe.getOpenCount,xe=oe.getContainer,be=oe.showMask,Te=oe.open,Ce=xe&&xe(),Le=fe&&fe();if(Ce&&Ce.parentNode===document.body&&be){var ge=["touchstart"],Y=[document.body,K.maskDom,K.handlerDom,K.contentDom];Te&&document.body.style.overflow!=="hidden"?(Z&&K.addScrollingEffect(Z),Le===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",Y.forEach(function(k,j){if(!k)return;r(k,ge[j]||"touchmove",j?K.removeMoveHandler:K.removeStartHandler,K.passive)})):K.getCurrentDrawerSome()&&(Le||(document.body.style.overflow=""),document.body.style.touchAction="",Z&&K.remScrollingEffect(Z),Y.forEach(function(k,j){if(!k)return;o(k,ge[j]||"touchmove",j?K.removeMoveHandler:K.removeStartHandler,K.passive)}))}},K.addScrollingEffect=function(Z){var oe=K.props,fe=oe.placement,xe=oe.duration,be=oe.ease,Te=oe.getOpenCount,Ce=oe.switchScrollingEffect,Le=Te&&Te();Le===1&&Ce();var ge="width ".concat(xe," ").concat(be),Y="transform ".concat(xe," ").concat(be);K.dom.style.transition="none";switch(fe){case"right":K.dom.style.transform="translateX(-".concat(Z,"px)");break;case"top":case"bottom":K.dom.style.width="calc(100% - ".concat(Z,"px)"),K.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(Y,",").concat(ge),K.dom.style.width="",K.dom.style.transform="")})},K.remScrollingEffect=function(Z){var oe=K.props,fe=oe.placement,xe=oe.duration,be=oe.ease,Te=oe.getOpenCount,Ce=oe.switchScrollingEffect,Le=Te&&Te();Le||Ce(!0),i&&(document.body.style.overflowX="hidden"),K.dom.style.transition="none";var ge,Y="width ".concat(xe," ").concat(be),k="transform ".concat(xe," ").concat(be);switch(fe){case"left":{K.dom.style.width="100%",Y="width 0s ".concat(be," ").concat(xe);break}case"right":{K.dom.style.transform="translateX(".concat(Z,"px)"),K.dom.style.width="100%",Y="width 0s ".concat(be," ").concat(xe),K.maskDom&&(K.maskDom.style.left="-".concat(Z,"px"),K.maskDom.style.width="calc(100% + ".concat(Z,"px)"));break}case"top":case"bottom":{K.dom.style.width="calc(100% + ".concat(Z,"px)"),K.dom.style.height="100%",K.dom.style.transform="translateZ(0)",ge="height 0s ".concat(be," ").concat(xe);break}default:break}clearTimeout(K.timeout),K.timeout=setTimeout(function(){K.dom&&(K.dom.style.transition="".concat(k,",").concat(ge?"".concat(ge,","):"").concat(Y),K.dom.style.transform="",K.dom.style.width="",K.dom.style.height="")})},K.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(Z){return _[Z]})},K.getLevelDom=function(Z){var oe=Z.level,fe=Z.getContainer;if(x)return;var xe=fe&&fe(),be=xe?xe.parentNode:null;if(K.levelDom=[],oe==="all"){var Te=be?Array.prototype.slice.call(be.children):[];Te.forEach(function(Ce){Ce.nodeName!=="SCRIPT"&&Ce.nodeName!=="STYLE"&&Ce.nodeName!=="LINK"&&Ce!==xe&&K.levelDom.push(Ce)})}else oe&&s(oe).forEach(function(Ce){document.querySelectorAll(Ce).forEach(function(Le){K.levelDom.push(Le)})})},K.getHorizontalBoolAndPlacementName=function(){var Z=K.props.placement,oe=Z==="left"||Z==="right",fe="translate".concat(oe?"X":"Y");return{isHorizontal:oe,placementName:fe}},K.state={_self:Object(I.a)(K)},K}return Object(D.a)(N,[{key:"componentDidMount",value:function(){var K=this;if(!x){var Z=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Z=!0,null}}))}catch(Te){}this.passive=Z?{passive:!1}:!1}var oe=this.props,fe=oe.open,xe=oe.getContainer,be=xe&&xe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(be&&be.parentNode===document.body&&(_[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){K.domFocus()}))}},{key:"componentDidUpdate",value:function(K){var Z=this.props,oe=Z.open,fe=Z.getContainer,xe=fe&&fe();oe!==K.open&&(oe&&this.domFocus(),xe&&xe.parentNode===document.body&&(_[this.drawerId]=!!oe),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var K=this.props,Z=K.getOpenCount,oe=K.open,fe=K.switchScrollingEffect,xe=typeof Z=="function"&&Z();delete _[this.drawerId],oe&&(this.setLevelTransform(!1),document.body.style.touchAction=""),xe||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var K,Z=this,oe=this.props,fe=oe.className,xe=oe.children,be=oe.style,Te=oe.width,Ce=oe.height,Le=oe.defaultOpen,ge=oe.open,Y=oe.prefixCls,k=oe.placement,j=oe.level,J=oe.levelMove,ie=oe.ease,X=oe.duration,ve=oe.getContainer,Ie=oe.handler,Ue=oe.onChange,pe=oe.afterVisibleChange,_e=oe.showMask,Ae=oe.maskClosable,De=oe.maskStyle,je=oe.onClose,ze=oe.onHandleClick,Je=oe.keyboard,$e=oe.getOpenCount,tt=oe.switchScrollingEffect,Qe=Object(q.a)(oe,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Re=this.dom?ge:!1,Oe=p()(Y,(K={},Object(n.a)(K,"".concat(Y,"-").concat(k),!0),Object(n.a)(K,"".concat(Y,"-open"),Re),Object(n.a)(K,fe||"",!!fe),Object(n.a)(K,"no-mask",!_e),K)),We=this.getHorizontalBoolAndPlacementName(),He=We.placementName,ue=k==="left"||k==="top"?"-100%":"100%",Q=Re?"":"".concat(He,"(").concat(ue,")"),te=Ie&&W.cloneElement(Ie,{onClick:function(ce){Ie.props.onClick&&Ie.props.onClick(),ze&&ze(ce)},ref:function(ce){Z.handlerDom=ce}});return W.createElement("div",Object.assign({},Qe,{tabIndex:-1,className:Oe,style:be,ref:function(ce){Z.dom=ce},onKeyDown:Re&&Je?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),_e&&W.createElement("div",{className:"".concat(Y,"-mask"),onClick:Ae?je:void 0,style:De,ref:function(ce){Z.maskDom=ce}}),W.createElement("div",{className:"".concat(Y,"-content-wrapper"),style:{transform:Q,msTransform:Q,width:T(Te)?"".concat(Te,"px"):Te,height:T(Ce)?"".concat(Ce,"px"):Ce},ref:function(ce){Z.contentWrapper=ce}},W.createElement("div",{className:"".concat(Y,"-content"),ref:function(ce){Z.contentDom=ce},onTouchStart:Re&&_e?this.removeStartHandler:void 0,onTouchMove:Re&&_e?this.removeMoveHandler:void 0},xe),te))}}],[{key:"getDerivedStateFromProps",value:function(K,Z){var oe=Z.prevProps,fe=Z._self,xe={prevProps:K};if(oe!==void 0){var be=K.placement,Te=K.level;be!==oe.placement&&(fe.contentDom=null),Te!==oe.level&&fe.getLevelDom(K)}return xe}}]),N}(W.Component);m.defaultProps={switchScrollingEffect:function(){}};var f=m;function S(R){var H=b();return function(){var C=Object(O.a)(R),K;if(H){var Z=Object(O.a)(this).constructor;K=Reflect.construct(C,arguments,Z)}else K=C.apply(this,arguments);return Object(U.a)(this,K)}}function b(){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(R){return!1}}var y=function(R){Object(V.a)(N,R);var H=S(N);function N(C){var K;Object(z.a)(this,N),K=H.call(this,C),K.onHandleClick=function(oe){var fe=K.props,xe=fe.onHandleClick,be=fe.open;if(xe&&xe(oe),typeof be=="undefined"){var Te=K.state.open;K.setState({open:!Te})}},K.onClose=function(oe){var fe=K.props,xe=fe.onClose,be=fe.open;xe&&xe(oe),typeof be=="undefined"&&K.setState({open:!1})};var Z=typeof C.open!="undefined"?C.open:!!C.defaultOpen;return K.state={open:Z},"onMaskClick"in C&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),K}return Object(D.a)(N,[{key:"render",value:function(){var K=this,Z=this.props,oe=Z.defaultOpen,fe=Z.getContainer,xe=Z.wrapperClassName,be=Z.forceRender,Te=Z.handler,Ce=Object(q.a)(Z,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Le=this.state.open;if(!fe)return W.createElement("div",{className:xe,ref:function(k){K.dom=k}},W.createElement(f,Object.assign({},Ce,{open:Le,handler:Te,getContainer:function(){return K.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ge=!!Te||be;return W.createElement(G.a,{visible:Le,forceRender:ge,getContainer:fe,wrapperClassName:xe},function(Y){var k=Y.visible,j=Y.afterClose,J=Object(q.a)(Y,["visible","afterClose"]);return W.createElement(f,Object.assign({},Ce,J,{open:k!==void 0?k:Le,afterVisibleChange:j!==void 0?j:Ce.afterVisibleChange,handler:Te,onClose:K.onClose,onHandleClick:K.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(K,Z){var oe=Z.prevProps,fe={prevProps:K};return typeof oe!="undefined"&&K.open!==oe.open&&(fe.open=K.open),fe}}]),N}(W.Component);y.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:W.createElement("div",{className:"drawer-handle"},W.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var M=y,B=de.a=M},fcyK:function(ke,de,P){},fjLI:function(ke,de,P){"use strict";P.d(de,"f",function(){return h}),P.d(de,"b",function(){return c}),P.d(de,"a",function(){return s}),P.d(de,"d",function(){return d}),P.d(de,"e",function(){return i}),P.d(de,"c",function(){return l});var q=P("8HAY"),z=P("Vhoy"),D=P("MI8n"),V=P("JYp7"),U=P("pmY6"),O=P("24hK"),G=P("nnTU"),W=P("T8No"),n=P("Cg/j"),I=P("t9D7"),g=function(r,o,w,T){var x=arguments.length,L=x<3?o:T===null?T=Object.getOwnPropertyDescriptor(o,w):T,A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(r,o,w,T);else for(var E=r.length-1;E>=0;E--)(A=r[E])&&(L=(x<3?A(L):x>3?A(o,w,L):A(o,w))||L);return x>3&&L&&Object.defineProperty(o,w,L),L},p=function(r,o){return function(w,T){o(w,T,r)}};function h(r){return r.command!==void 0}class c{constructor(r){this.id=c._idPool++,this._debugName=r}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const s=Object(n.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new D.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===c.CommandPalette}}addCommand(r){return this.addCommands(V.a.single(r))}addCommands(r){for(const o of r)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(U.i)(()=>{let o=!1;for(const w of r)o=this._commands.delete(w.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((o,w)=>r.set(w,o)),r}appendMenuItem(r,o){return this.appendMenuItems(V.a.single({id:r,item:o}))}appendMenuItems(r){const o=new Set,w=new O.a;for(const{id:T,item:x}of r){let L=this._menuItems.get(T);L||(L=new O.a,this._menuItems.set(T,L)),w.push(L.push(x)),o.add(T)}return this._onDidChangeMenu.fire(o),Object(U.i)(()=>{if(w.size>0){for(let T of w)T();this._onDidChangeMenu.fire(o),w.clear()}})}getMenuItems(r){let o;return this._menuItems.has(r)?o=[...this._menuItems.get(r)]:o=[],r===c.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(r){const o=new Set;for(const w of r)h(w)&&(o.add(w.command.id),w.alt&&o.add(w.alt.id));this._commands.forEach((w,T)=>{o.has(T)||r.push({command:w})})}};class i extends q.e{constructor(r,o,w,T){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=o,this._contextKeyService=w,this._options=T}get actions(){const r=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),w=o.getActions(this._options);o.dispose();for(const[,T]of w)T.length>0&&(r.push(...T),r.push(new q.d));return r.length&&r.pop(),r}}let l=class r{constructor(o,w,T,x,L){var A,E;if(this._commandService=L,this.id=o.id,this.label=(T==null?void 0:T.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(E=typeof o.tooltip=="string"?o.tooltip:(A=o.tooltip)===null||A===void 0?void 0:A.value)!==null&&E!==void 0?E:"",this.enabled=!o.precondition||x.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const _=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=x.contextMatchesRules(_.condition),this.checked&&_.tooltip&&(this.tooltip=typeof _.tooltip=="string"?_.tooltip:_.tooltip.value),_.title&&(this.label=typeof _.title=="string"?_.title:_.title.value)}this.item=o,this.alt=w?new r(w,void 0,T,x,L):void 0,this._options=T,I.d.isThemeIcon(o.icon)&&(this.class=z.a.asClassName(o.icon))}dispose(){}run(...o){var w,T;let x=[];return((w=this._options)===null||w===void 0?void 0:w.arg)&&(x=[...x,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(x=[...x,...o]),this._commandService.executeCommand(this.id,...x)}};l=g([p(3,W.b),p(4,G.b)],l)},fyJ8:function(ke,de,P){"use strict";var q=P("rePB"),z=P("VTBJ"),D=P("Ff2n"),V=P("U8pU"),U=P("q1tI"),O=P.n(U),G=P("TSYQ"),W=P.n(G),n=P("c+Xe"),I=P("sR1s");function g(d){return d&&Object(V.a)(d)==="object"&&!Array.isArray(d)&&!U.isValidElement(d)}function p(d){return typeof d=="string"?!0:Object(n.c)(d)}function h(d,i){var l,r=d.prefixCls,o=d.className,w=d.record,T=d.index,x=d.dataIndex,L=d.render,A=d.children,E=d.component,_=E===void 0?"td":E,m=d.colSpan,f=d.rowSpan,S=d.fixLeft,b=d.fixRight,y=d.firstFixLeft,M=d.lastFixLeft,B=d.firstFixRight,R=d.lastFixRight,H=d.appendNode,N=d.additionalProps,C=N===void 0?{}:N,K=d.ellipsis,Z=d.align,oe=d.rowType,fe=d.isSticky,xe="".concat(r,"-cell"),be,Te;if(A)Te=A;else{var Ce=Object(I.b)(w,x);if(Te=Ce,L){var Le=L(Ce,w,T);g(Le)?(Te=Le.children,be=Le.props):Te=Le}}Object(V.a)(Te)==="object"&&!Array.isArray(Te)&&!U.isValidElement(Te)&&(Te=null),K&&(M||B)&&(Te=U.createElement("span",{className:"".concat(xe,"-content")},Te));var ge=be||{},Y=ge.colSpan,k=ge.rowSpan,j=ge.style,J=ge.className,ie=Object(D.a)(ge,["colSpan","rowSpan","style","className"]),X=Y!==void 0?Y:m,ve=k!==void 0?k:f;if(X===0||ve===0)return null;var Ie={},Ue=typeof S=="number",pe=typeof b=="number";Ue&&(Ie.position="sticky",Ie.left=S),pe&&(Ie.position="sticky",Ie.right=b);var _e={};Z&&(_e.textAlign=Z);var Ae,De=K===!0?{showTitle:!0}:K;De&&(De.showTitle||oe==="header")&&(typeof Te=="string"||typeof Te=="number"?Ae=Te.toString():U.isValidElement(Te)&&typeof Te.props.children=="string"&&(Ae=Te.props.children));var je=Object(z.a)(Object(z.a)(Object(z.a)({title:Ae},ie),C),{},{colSpan:X&&X!==1?X:null,rowSpan:ve&&ve!==1?ve:null,className:W()(xe,o,(l={},Object(q.a)(l,"".concat(xe,"-fix-left"),Ue),Object(q.a)(l,"".concat(xe,"-fix-left-first"),y),Object(q.a)(l,"".concat(xe,"-fix-left-last"),M),Object(q.a)(l,"".concat(xe,"-fix-right"),pe),Object(q.a)(l,"".concat(xe,"-fix-right-first"),B),Object(q.a)(l,"".concat(xe,"-fix-right-last"),R),Object(q.a)(l,"".concat(xe,"-ellipsis"),K),Object(q.a)(l,"".concat(xe,"-with-append"),H),Object(q.a)(l,"".concat(xe,"-fix-sticky"),(Ue||pe)&&fe),l),C.className,J),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},C.style),_e),Ie),j),ref:p(_)?i:null});return U.createElement(_,Object.assign({},je),H,Te)}var c=U.forwardRef(h);c.displayName="Cell";var s=U.memo(c,function(d,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,d.record):!1});de.a=s},gRFJ:function(ke,de,P){ke.exports=[P("rdUC"),P("ynwM"),P("RELg"),P("DlR+"),P("CrYA"),P("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(ke){return ke<10?"0"+ke:ke}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(ke){return rx_escapable.lastIndex=0,rx_escapable.test(ke)?'"'+ke.replace(rx_escapable,function(de){var P=meta[de];return typeof P=="string"?P:"\\u"+("0000"+de.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+ke+'"'}function str(ke,de){var P,q,z,D,V=gap,U,O=de[ke];O&&typeof O=="object"&&typeof O.toJSON=="function"&&(O=O.toJSON(ke)),typeof rep=="function"&&(O=rep.call(de,ke,O));switch(typeof O){case"string":return quote(O);case"number":return isFinite(O)?String(O):"null";case"boolean":case"null":return String(O);case"object":if(!O)return"null";if(gap+=indent,U=[],Object.prototype.toString.apply(O)==="[object Array]"){for(D=O.length,P=0;P<D;P+=1)U[P]=str(P,O)||"null";return z=U.length===0?"[]":gap?`[
|
|
`+gap+U.join(`,
|
|
`+gap)+`
|
|
`+V+"]":"["+U.join(",")+"]",gap=V,z}if(rep&&typeof rep=="object")for(D=rep.length,P=0;P<D;P+=1)typeof rep[P]=="string"&&(q=rep[P],z=str(q,O),z&&U.push(quote(q)+(gap?": ":":")+z));else for(q in O)Object.prototype.hasOwnProperty.call(O,q)&&(z=str(q,O),z&&U.push(quote(q)+(gap?": ":":")+z));return z=U.length===0?"{}":gap?`{
|
|
`+gap+U.join(`,
|
|
`+gap)+`
|
|
`+V+"}":"{"+U.join(",")+"}",gap=V,z}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(ke,de,P){var q;if(gap="",indent="",typeof P=="number")for(q=0;q<P;q+=1)indent+=" ";else typeof P=="string"&&(indent=P);if(rep=de,de&&typeof de!="function"&&(typeof de!="object"||typeof de.length!="number"))throw new Error("JSON.stringify");return str("",{"":ke})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(ke,de){var P,q,z=ke[de];if(z&&typeof z=="object")for(P in z)Object.prototype.hasOwnProperty.call(z,P)&&(q=walk(z,P),q!==void 0?z[P]=q:delete z[P]);return reviver.call(ke,de,z)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(ke){return"\\u"+("0000"+ke.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:function(ke,de,P){"use strict";P.d(de,"a",function(){return V}),P.d(de,"c",function(){return U}),P.d(de,"b",function(){return O});var q=P("VTBJ"),z=P("Ff2n"),D=P("Kwbf"),V="RC_TABLE_INTERNAL_COL_DEFINE";function U(G){var W=G.expandable,n=Object(z.a)(G,["expandable"]);return"expandable"in G?Object(q.a)(Object(q.a)({},n),W):n}function O(G){return Object.keys(G).reduce(function(W,n){return(n.substr(0,5)==="data-"||n.substr(0,5)==="aria-")&&(W[n]=G[n]),W},{})}},i3hx:function(ke,de,P){},ic2d:function(ke,de,P){"use strict";P.d(de,"a",function(){return V});var q=P("FWmy"),z=P("746U");class D{constructor(){this.data=new Map}add(U,O){q.a(z.l(U)),q.a(z.k(O)),q.a(!this.data.has(U),"There is already an extension with this id"),this.data.set(U,O)}as(U){return this.data.get(U)||null}}const V=new D},je13:function(ke,de,P){var q=P("5nXd"),z=P("gRFJ"),D=[P("uQRt")];ke.exports=q.createStore(z,D)},kSUc:function(ke,de,P){},"kaH+":function(ke,de,P){"use strict";var q=P("+L6B"),z=P("2/Rp"),D=P("tJVT"),V=P("q1tI"),U=P.n(V),O=P("UZu5"),G=P.n(O),W=P("dhSg"),n=P("rLCj"),I=P("dF/Y"),g=P("4i/N");de.a=function(){var p=Object(V.useState)(""),h=Object(D.a)(p,2),c=h[0],s=h[1],d=Object(V.useState)(0),i=Object(D.a)(d,2),l=i[0],r=i[1],o=Object(V.useRef)("");Object(V.useEffect)(function(){var _=W.a.subscribe("preview-image",function(m){s(m),document.body.style.overflow="hidden"});return _},[]),Object(V.useEffect)(function(){return document.addEventListener("keydown",w),function(){document.removeEventListener("keydown",w)}},[]),Object(V.useEffect)(function(){o.current=c},[c]);function w(_){_.keyCode==27&&o.current&&T()}function T(){document.body.style.overflow="auto",s("")}function x(){r(l+90)}var L=Object(V.useRef)(),A=Object(V.useRef)(),E=function(m){(m.nativeEvent.target===L.current||m.nativeEvent.target===A.current)&&T()};return U.a.createElement(V.Fragment,null,c?U.a.createElement("div",{className:"image-preview-container",ref:L,onClick:E},U.a.createElement("div",{className:"button-group"},U.a.createElement(z.a,{onClick:x},"\u65CB\u8F6C",U.a.createElement(n.a,null)),U.a.createElement(z.a,{href:c},"\u4E0B\u8F7D",U.a.createElement(I.a,null)),U.a.createElement(z.a,{onClick:T},"\u5173\u95ED",U.a.createElement(g.a,null))),U.a.createElement("div",{className:"preview-wrp-group",ref:A},U.a.createElement("img",{className:"image-preview",src:c,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(l,"deg)")}}))):null)}},lOMy:function(ke,de,P){},lZu9:function(ke,de,P){(function(q){q(P("VrN/"),P("1eCo"),P("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(z,D){var V=q.getMode(z,"text/html"),U=V.name=="null";function O(N){if(q.findModeByName){var C=q.findModeByName(N);C&&(N=C.mime||C.mimes[0])}var K=q.getMode(z,N);return K.name=="null"?null:K}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var W in G)G.hasOwnProperty(W)&&D.tokenTypeOverrides[W]&&(G[W]=D.tokenTypeOverrides[W]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,l=" ";function r(N,C,K){return C.f=C.inline=K,K(N,C)}function o(N,C,K){return C.f=C.block=K,K(N,C)}function w(N){return!N||!/\S/.test(N.string)}function T(N){if(N.linkTitle=!1,N.linkHref=!1,N.linkText=!1,N.em=!1,N.strong=!1,N.strikethrough=!1,N.quote=0,N.indentedCode=!1,N.f==L){var C=U;if(!C){var K=q.innerMode(V,N.htmlState);C=K.mode.name=="xml"&&K.state.tagStart===null&&!K.state.context&&K.state.tokenize.isInText}C&&(N.f=m,N.block=x,N.htmlState=null)}return N.trailingSpace=0,N.trailingSpaceNewLine=!1,N.prevLine=N.thisLine,N.thisLine={stream:null},null}function x(N,C){var K=N.column()===C.indentation,Z=w(C.prevLine.stream),oe=C.indentedCode,fe=C.prevLine.hr,xe=C.list!==!1,be=(C.listStack[C.listStack.length-1]||0)+3;C.indentedCode=!1;var Te=C.indentation;if(C.indentationDiff===null&&(C.indentationDiff=C.indentation,xe)){for(C.list=null;Te<C.listStack[C.listStack.length-1];)C.listStack.pop(),C.listStack.length?C.indentation=C.listStack[C.listStack.length-1]:C.list=!1;C.list!==!1&&(C.indentationDiff=Te-C.listStack[C.listStack.length-1])}var Ce=!Z&&!fe&&!C.prevLine.header&&(!xe||!oe)&&!C.prevLine.fencedCodeEnd,Le=(C.list===!1||fe||Z)&&C.indentation<=be&&N.match(n),ge=null;if(C.indentationDiff>=4&&(oe||C.prevLine.fencedCodeEnd||C.prevLine.header||Z))return N.skipToEnd(),C.indentedCode=!0,G.code;if(N.eatSpace())return null;if(K&&C.indentation<=be&&(ge=N.match(p))&&ge[1].length<=6)return C.quote=0,C.header=ge[1].length,C.thisLine.header=!0,D.highlightFormatting&&(C.formatting="header"),C.f=C.inline,E(C);if(C.indentation<=be&&N.eat(">"))return C.quote=K?1:C.quote+1,D.highlightFormatting&&(C.formatting="quote"),N.eatSpace(),E(C);if(!Le&&!C.setext&&K&&C.indentation<=be&&(ge=N.match(I))){var Y=ge[1]?"ol":"ul";return C.indentation=Te+N.current().length,C.list=!0,C.quote=0,C.listStack.push(C.indentation),C.em=!1,C.strong=!1,C.code=!1,C.strikethrough=!1,D.taskLists&&N.match(g,!1)&&(C.taskList=!0),C.f=C.inline,D.highlightFormatting&&(C.formatting=["list","list-"+Y]),E(C)}else{if(K&&C.indentation<=be&&(ge=N.match(s,!0)))return C.quote=0,C.fencedEndRE=new RegExp(ge[1]+"+ *$"),C.localMode=D.fencedCodeBlockHighlighting&&O(ge[2]||D.fencedCodeBlockDefaultMode),C.localMode&&(C.localState=q.startState(C.localMode)),C.f=C.block=A,D.highlightFormatting&&(C.formatting="code-block"),C.code=-1,E(C);if(C.setext||(!Ce||!xe)&&!C.quote&&C.list===!1&&!C.code&&!Le&&!d.test(N.string)&&(ge=N.lookAhead(1))&&(ge=ge.match(h)))return C.setext?(C.header=C.setext,C.setext=0,N.skipToEnd(),D.highlightFormatting&&(C.formatting="header")):(C.header=ge[0].charAt(0)=="="?1:2,C.setext=C.header),C.thisLine.header=!0,C.f=C.inline,E(C);if(Le)return N.skipToEnd(),C.hr=!0,C.thisLine.hr=!0,G.hr;if(N.peek()==="[")return r(N,C,M)}return r(N,C,C.inline)}function L(N,C){var K=V.token(N,C.htmlState);if(!U){var Z=q.innerMode(V,C.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||C.md_inside&&N.current().indexOf(">")>-1)&&(C.f=m,C.block=x,C.htmlState=null)}return K}function A(N,C){var K=C.listStack[C.listStack.length-1]||0,Z=C.indentation<K,oe=K+3;if(C.fencedEndRE&&C.indentation<=oe&&(Z||N.match(C.fencedEndRE))){D.highlightFormatting&&(C.formatting="code-block");var fe;return Z||(fe=E(C)),C.localMode=C.localState=null,C.block=x,C.f=m,C.fencedEndRE=null,C.code=0,C.thisLine.fencedCodeEnd=!0,Z?o(N,C,C.block):fe}else return C.localMode?C.localMode.token(N,C.localState):(N.skipToEnd(),G.code)}function E(N){var C=[];if(N.formatting){C.push(G.formatting),typeof N.formatting=="string"&&(N.formatting=[N.formatting]);for(var K=0;K<N.formatting.length;K++)C.push(G.formatting+"-"+N.formatting[K]),N.formatting[K]==="header"&&C.push(G.formatting+"-"+N.formatting[K]+"-"+N.header),N.formatting[K]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=N.quote?C.push(G.formatting+"-"+N.formatting[K]+"-"+N.quote):C.push("error"))}if(N.taskOpen)return C.push("meta"),C.length?C.join(" "):null;if(N.taskClosed)return C.push("property"),C.length?C.join(" "):null;if(N.linkHref?C.push(G.linkHref,"url"):(N.strong&&C.push(G.strong),N.em&&C.push(G.em),N.strikethrough&&C.push(G.strikethrough),N.emoji&&C.push(G.emoji),N.linkText&&C.push(G.linkText),N.code&&C.push(G.code),N.image&&C.push(G.image),N.imageAltText&&C.push(G.imageAltText,"link"),N.imageMarker&&C.push(G.imageMarker)),N.header&&C.push(G.header,G.header+"-"+N.header),N.quote&&(C.push(G.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=N.quote?C.push(G.quote+"-"+N.quote):C.push(G.quote+"-"+D.maxBlockquoteDepth)),N.list!==!1){var Z=(N.listStack.length-1)%3;Z?Z===1?C.push(G.list2):C.push(G.list3):C.push(G.list1)}return N.trailingSpaceNewLine?C.push("trailing-space-new-line"):N.trailingSpace&&C.push("trailing-space-"+(N.trailingSpace%2?"a":"b")),C.length?C.join(" "):null}function _(N,C){return N.match(c,!0)?E(C):void 0}function m(N,C){var K=C.text(N,C);if(typeof K!="undefined")return K;if(C.list)return C.list=null,E(C);if(C.taskList){var Z=N.match(g,!0)[1]===" ";return Z?C.taskOpen=!0:C.taskClosed=!0,D.highlightFormatting&&(C.formatting="task"),C.taskList=!1,E(C)}if(C.taskOpen=!1,C.taskClosed=!1,C.header&&N.match(/^#+$/,!0))return D.highlightFormatting&&(C.formatting="header"),E(C);var oe=N.next();if(C.linkTitle){C.linkTitle=!1;var fe=oe;oe==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(N.match(new RegExp(xe),!0))return G.linkHref}if(oe==="`"){var be=C.formatting;D.highlightFormatting&&(C.formatting="code"),N.eatWhile("`");var Te=N.current().length;if(C.code==0&&(!C.quote||Te==1))return C.code=Te,E(C);if(Te==C.code){var Ce=E(C);return C.code=0,Ce}else return C.formatting=be,E(C)}else if(C.code)return E(C);if(oe==="\\"&&(N.next(),D.highlightFormatting)){var Le=E(C),ge=G.formatting+"-escape";return Le?Le+" "+ge:ge}if(oe==="!"&&N.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return C.imageMarker=!0,C.image=!0,D.highlightFormatting&&(C.formatting="image"),E(C);if(oe==="["&&C.imageMarker&&N.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return C.imageMarker=!1,C.imageAltText=!0,D.highlightFormatting&&(C.formatting="image"),E(C);if(oe==="]"&&C.imageAltText){D.highlightFormatting&&(C.formatting="image");var Le=E(C);return C.imageAltText=!1,C.image=!1,C.inline=C.f=S,Le}if(oe==="["&&!C.image)return C.linkText&&N.match(/^.*?\]/)||(C.linkText=!0,D.highlightFormatting&&(C.formatting="link")),E(C);if(oe==="]"&&C.linkText){D.highlightFormatting&&(C.formatting="link");var Le=E(C);return C.linkText=!1,C.inline=C.f=N.match(/\(.*?\)| ?\[.*?\]/,!1)?S:m,Le}if(oe==="<"&&N.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=f,D.highlightFormatting&&(C.formatting="link");var Le=E(C);return Le?Le+=" ":Le="",Le+G.linkInline}if(oe==="<"&&N.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){C.f=C.inline=f,D.highlightFormatting&&(C.formatting="link");var Le=E(C);return Le?Le+=" ":Le="",Le+G.linkEmail}if(D.xml&&oe==="<"&&N.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Y=N.string.indexOf(">",N.pos);if(Y!=-1){var k=N.string.substring(N.start,Y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(C.md_inside=!0)}return N.backUp(1),C.htmlState=q.startState(V),o(N,C,L)}if(D.xml&&oe==="<"&&N.match(/^\/\w*?>/))return C.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var j=1,J=N.pos==1?" ":N.string.charAt(N.pos-2);j<3&&N.eat(oe);)j++;var ie=N.peek()||" ",X=!/\s/.test(ie)&&(!i.test(ie)||/\s/.test(J)||i.test(J)),ve=!/\s/.test(J)&&(!i.test(J)||/\s/.test(ie)||i.test(ie)),Ie=null,Ue=null;if(j%2&&(!C.em&&X&&(oe==="*"||!ve||i.test(J))?Ie=!0:C.em==oe&&ve&&(oe==="*"||!X||i.test(ie))&&(Ie=!1)),j>1&&(!C.strong&&X&&(oe==="*"||!ve||i.test(J))?Ue=!0:C.strong==oe&&ve&&(oe==="*"||!X||i.test(ie))&&(Ue=!1)),Ue!=null||Ie!=null){D.highlightFormatting&&(C.formatting=Ie==null?"strong":Ue==null?"em":"strong em"),Ie===!0&&(C.em=oe),Ue===!0&&(C.strong=oe);var Ce=E(C);return Ie===!1&&(C.em=!1),Ue===!1&&(C.strong=!1),Ce}}else if(oe===" "&&(N.eat("*")||N.eat("_"))){if(N.peek()===" ")return E(C);N.backUp(1)}if(D.strikethrough){if(oe==="~"&&N.eatWhile(oe)){if(C.strikethrough){D.highlightFormatting&&(C.formatting="strikethrough");var Ce=E(C);return C.strikethrough=!1,Ce}else if(N.match(/^[^\s]/,!1))return C.strikethrough=!0,D.highlightFormatting&&(C.formatting="strikethrough"),E(C)}else if(oe===" "&&N.match(/^~~/,!0)){if(N.peek()===" ")return E(C);N.backUp(2)}}if(D.emoji&&oe===":"&&N.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){C.emoji=!0,D.highlightFormatting&&(C.formatting="emoji");var pe=E(C);return C.emoji=!1,pe}return oe===" "&&(N.match(/^ +$/,!1)?C.trailingSpace++:C.trailingSpace&&(C.trailingSpaceNewLine=!0)),E(C)}function f(N,C){var K=N.next();if(K===">"){C.f=C.inline=m,D.highlightFormatting&&(C.formatting="link");var Z=E(C);return Z?Z+=" ":Z="",Z+G.linkInline}return N.match(/^[^>]+/,!0),G.linkInline}function S(N,C){if(N.eatSpace())return null;var K=N.next();return K==="("||K==="["?(C.f=C.inline=y(K==="("?")":"]"),D.highlightFormatting&&(C.formatting="link-string"),C.linkHref=!0,E(C)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(N){return function(C,K){var Z=C.next();if(Z===N){K.f=K.inline=m,D.highlightFormatting&&(K.formatting="link-string");var oe=E(K);return K.linkHref=!1,oe}return C.match(b[N]),K.linkHref=!0,E(K)}}function M(N,C){return N.match(/^([^\]\\]|\\.)*\]:/,!1)?(C.f=B,N.next(),D.highlightFormatting&&(C.formatting="link"),C.linkText=!0,E(C)):r(N,C,m)}function B(N,C){if(N.match(/^\]:/,!0)){C.f=C.inline=R,D.highlightFormatting&&(C.formatting="link");var K=E(C);return C.linkText=!1,K}return N.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function R(N,C){return N.eatSpace()?null:(N.match(/^[^\s]+/,!0),N.peek()===void 0?C.linkTitle=!0:N.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),C.f=C.inline=m,G.linkHref+" url")}var H={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:m,text:_,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(N){return{f:N.f,prevLine:N.prevLine,thisLine:N.thisLine,block:N.block,htmlState:N.htmlState&&q.copyState(V,N.htmlState),indentation:N.indentation,localMode:N.localMode,localState:N.localMode?q.copyState(N.localMode,N.localState):null,inline:N.inline,text:N.text,formatting:!1,linkText:N.linkText,linkTitle:N.linkTitle,linkHref:N.linkHref,code:N.code,em:N.em,strong:N.strong,strikethrough:N.strikethrough,emoji:N.emoji,header:N.header,setext:N.setext,hr:N.hr,taskList:N.taskList,list:N.list,listStack:N.listStack.slice(0),quote:N.quote,indentedCode:N.indentedCode,trailingSpace:N.trailingSpace,trailingSpaceNewLine:N.trailingSpaceNewLine,md_inside:N.md_inside,fencedEndRE:N.fencedEndRE}},token:function(N,C){if(C.formatting=!1,N!=C.thisLine.stream){if(C.header=0,C.hr=!1,N.match(/^\s*$/,!0))return T(C),null;if(C.prevLine=C.thisLine,C.thisLine={stream:N},C.taskList=!1,C.trailingSpace=0,C.trailingSpaceNewLine=!1,!C.localState&&(C.f=C.block,C.f!=L)){var K=N.match(/^\s*/,!0)[0].replace(/\t/g,l).length;if(C.indentation=K,C.indentationDiff=null,K>0)return null}}return C.f(N,C)},innerMode:function(N){return N.block==L?{state:N.htmlState,mode:V}:N.localState?{state:N.localState,mode:N.localMode}:{state:N,mode:H}},indent:function(N,C,K){return N.block==L&&V.indent?V.indent(N.htmlState,C,K):N.localState&&N.localMode.indent?N.localMode.indent(N.localState,C,K):q.Pass},blankLine:T,getType:E,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},n6Qo:function(ke,de,P){"use strict";P.d(de,"a",function(){return W});var q=P("q1tI"),z=P("biw7"),D=P("fyJ8");function V(n){var I=n.className,g=n.index,p=n.children,h=n.colSpan,c=n.rowSpan,s=q.useContext(z.a),d=s.prefixCls,i=s.fixedInfoList,l=i[g];return q.createElement(D.a,Object.assign({className:I,index:g,component:"td",prefixCls:d,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:h,rowSpan:c}}}},l))}function U(n){return q.createElement("tr",Object.assign({},n))}function O(n){var I=n.children,g=q.useContext(z.a),p=g.prefixCls;return q.createElement("tfoot",{className:"".concat(p,"-summary")},I)}var G=de.b=O,W={Cell:V,Row:U}},nEHx:function(ke,de,P){"use strict";P.d(de,"a",function(){return q});var q;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(q||(q={}))},nWbc:function(ke,de,P){},nnTU:function(ke,de,P){"use strict";P.d(de,"b",function(){return G}),P.d(de,"a",function(){return W});var q=P("MI8n"),z=P("JYp7"),D=P("pmY6"),V=P("24hK"),U=P("746U"),O=P("Cg/j");const G=Object(O.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const s=[];for(let i of n.description.args)s.push(i.constraint);const d=n.handler;n.handler=function(i,...l){return Object(U.o)(l,s),d(i,...l)}}const{id:g}=n;let p=this._commands.get(g);p||(p=new V.a,this._commands.set(g,p));let h=p.unshift(n),c=Object(D.i)(()=>{h();const s=this._commands.get(g);(s==null?void 0:s.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),c}registerCommandAlias(n,I){return W.registerCommand(n,(g,...p)=>g.get(G).executeCommand(I,...p))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:z.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const g=this.getCommand(I);g&&n.set(I,g)}return n}};W.registerCommand("noop",()=>{})},oFv4:function(ke,de,P){ke.exports=P.p+"static/internal.da228387.png"},osHv:function(ke,de,P){(function(q){q(P("VrN/"))})(function(q){"use strict";var z=q.Pos;function D(i,l){return i.line-l.line||i.ch-l.ch}var V="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",U=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+V+"]["+U+"]*)","g");function G(i,l,r,o){this.line=l,this.ch=r,this.cm=i,this.text=i.getLine(l),this.min=o?Math.max(o.from,i.firstLine()):i.firstLine(),this.max=o?Math.min(o.to-1,i.lastLine()):i.lastLine()}function W(i,l){var r=i.cm.getTokenTypeAt(z(i.line,l));return r&&/\btag\b/.test(r)}function n(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function I(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function g(i){for(;;){var l=i.text.indexOf(">",i.ch);if(l==-1){if(n(i))continue;return}if(!W(i,l+1)){i.ch=l+1;continue}var r=i.text.lastIndexOf("/",l),o=r>-1&&!/\S/.test(i.text.slice(r+1,l));return i.ch=l+1,o?"selfClose":"regular"}}function p(i){for(;;){var l=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(l==-1){if(I(i))continue;return}if(!W(i,l+1)){i.ch=l;continue}O.lastIndex=l,i.ch=l;var r=O.exec(i.text);if(r&&r.index==l)return r}}function h(i){for(;;){O.lastIndex=i.ch;var l=O.exec(i.text);if(!l){if(n(i))continue;return}if(!W(i,l.index+1)){i.ch=l.index+1;continue}return i.ch=l.index+l[0].length,l}}function c(i){for(;;){var l=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(l==-1){if(I(i))continue;return}if(!W(i,l+1)){i.ch=l;continue}var r=i.text.lastIndexOf("/",l),o=r>-1&&!/\S/.test(i.text.slice(r+1,l));return i.ch=l+1,o?"selfClose":"regular"}}function s(i,l){for(var r=[];;){var o=h(i),w,T=i.line,x=i.ch-(o?o[0].length:0);if(!o||!(w=g(i)))return;if(w=="selfClose")continue;if(o[1]){for(var L=r.length-1;L>=0;--L)if(r[L]==o[2]){r.length=L;break}if(L<0&&(!l||l==o[2]))return{tag:o[2],from:z(T,x),to:z(i.line,i.ch)}}else r.push(o[2])}}function d(i,l){for(var r=[];;){var o=c(i);if(!o)return;if(o=="selfClose"){p(i);continue}var w=i.line,T=i.ch,x=p(i);if(!x)return;if(x[1])r.push(x[2]);else{for(var L=r.length-1;L>=0;--L)if(r[L]==x[2]){r.length=L;break}if(L<0&&(!l||l==x[2]))return{tag:x[2],from:z(i.line,i.ch),to:z(w,T)}}}}q.registerHelper("fold","xml",function(i,l){for(var r=new G(i,l.line,0);;){var o=h(r);if(!o||r.line!=l.line)return;var w=g(r);if(!w)return;if(!o[1]&&w!="selfClose"){var T=z(r.line,r.ch),x=s(r,o[2]);return x&&D(x.from,T)>0?{from:T,to:x.from}:null}}}),q.findMatchingTag=function(i,l,r){var o=new G(i,l.line,l.ch,r);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var w=g(o),T=w&&z(o.line,o.ch),x=w&&p(o);if(!w||!x||D(o,l)>0)return;var L={from:z(o.line,o.ch),to:T,tag:x[2]};return w=="selfClose"?{open:L,close:null,at:"open"}:x[1]?{open:d(o,x[2]),close:L,at:"close"}:(o=new G(i,T.line,T.ch,r),{open:L,close:s(o,x[2]),at:"open"})},q.findEnclosingTag=function(i,l,r,o){for(var w=new G(i,l.line,l.ch,r);;){var T=d(w,o);if(!T)break;var x=new G(i,l.line,l.ch,r),L=s(x,T.tag);if(L)return{open:T,close:L}}},q.scanForClosingTag=function(i,l,r,o){var w=new G(i,l.line,l.ch,o?{from:0,to:o}:null);return s(w,r)}})},"p/48":function(ke,de,P){},p5ED:function(ke,de,P){"use strict";var q=P("+L6B"),z=P("2/Rp"),D=P("5Dmo"),V=P("3S7+"),U=P("k1fw"),O=P("9og8"),G=P("tJVT"),W=P("WmNS"),n=P.n(W),I=P("q1tI"),g=P.n(I),p=P("vHTk"),h=P.n(p),c=P("yEEn"),s=P("ZW9T"),d=P("1vsH"),i=P("V0Rq"),l=P("m3rI");de.a=function(r){var o,w,T,x,L,A,E,_=r.editOffice,m=_===void 0?"view":_,f=r.data,S=r.theme,b=r.type,y=r.filename,M=r.monacoEditor,B=r.className,R=r.style,H=r.close,N=r.onClose,C=r.hasMask,K=r.disabledDownload,Z=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(G.a)(Z,2),fe=oe[0],xe=oe[1],be=Object(I.useState)(""),Te=Object(G.a)(be,2),Ce=Te[0],Le=Te[1],ge=Object(I.useState)(),Y=Object(G.a)(ge,2),k=Y[0],j=Y[1],J=window.ENV==="build"?"/react/build":"",ie=l.a.PROXY_SERVER||location.origin,X,ve=1024*1024,Ie=10*ve,Ue=Object(I.useRef)();(o=f)!==null&&o!==void 0&&o.startsWith("/api")&&b!=="txt"&&(f=(l.a.API_SERVER||location.origin)+f),b==="office"&&(X=Object(d.T)(f).filesize,X>Ie&&(b="other")),y&&M&&(M.filename=y),Object(I.useEffect)(function(){var De,je,ze=(De=document.cookie)===null||De===void 0||((je=De.replace(/\s/g,""))===null||je===void 0)?void 0:je.split(";");ze==null||ze.map(function(Je){var $e=Je.split("=");$e[0]==="_educoder_session"&&Le($e[1])})},[]),Object(I.useEffect)(function(){b==="office"&&pe()},[b,f]);var pe=function(){var De=Object(O.a)(n.a.mark(function je(){var ze,Je,$e;return n.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return console.log("data:",f),ze=f,f.startsWith("http")||(ze=location.origin+ze),Je=new URL(ze).pathname.split("/").pop(),Qe.next=6,Object(i.V)({attachment_id:Je});case 6:$e=Qe.sent,j($e);case 8:case"end":return Qe.stop()}},je)}));return function(){return De.apply(this,arguments)}}(),_e=function(){if(f.startsWith("http")||f.startsWith("blob:")){Ae();return}Object(d.z)(y||"educoder",f,y)},Ae=function(){Object(d.x)(y||"educoder",decodeURIComponent(f))};return g.a.createElement("div",{style:Object(U.a)({},R||{}),className:"".concat(C&&h.a.bgBlack," ").concat(b?h.a.wrp:"hide")},H&&g.a.createElement("div",{className:h.a.close,ref:Ue},!K&&g.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ue.current}},g.a.createElement("span",{onClick:Ae},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ue.current}},g.a.createElement("span",{className:"",onClick:N},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(h.a[B]," ").concat(B," ").concat(h.a.monaco," ").concat(b==="txt"?"show":"hide")},b==="txt"&&g.a.createElement(s.b,M)),b==="audio"&&g.a.createElement("audio",{src:"".concat(((w=f)===null||w===void 0?void 0:w.indexOf("http://"))>-1||((T=f)===null||T===void 0?void 0:T.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),b==="video"&&g.a.createElement(g.a.Fragment,null,((x=f)===null||x===void 0?void 0:x.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),b==="office"&&k&&g.a.createElement("iframe",{src:"".concat(J,"/office.html?key=").concat(k.key,"&url=").concat(ie+k.url,"&callbackUrl=").concat(ie+k.callbackUrl,"&fileType=").concat(k.fileType,"&title=").concat(k.title,"&model=").concat(m,"&officeServer=").concat(l.a.OFFICE_SERVER,"&disabledDownload=").concat(!!K)}),b==="html"&&g.a.createElement("iframe",{src:f+"&disposition=inline"}),b==="pdf"&&g.a.createElement("iframe",{src:"".concat(J,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!K)}),b==="image"&&g.a.createElement("img",{src:"".concat(((L=f)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((A=f)===null||A===void 0?void 0:A.indexOf("https://"))>-1||(E=f)!==null&&E!==void 0&&E.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),b==="other"&&g.a.createElement("div",null,g.a.createElement(z.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),b==="download"&&g.a.createElement(z.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ke,de,P){},pPuO:function(ke,de,P){ke.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},pmY6:function(ke,de,P){"use strict";P.d(de,"h",function(){return I}),P.d(de,"g",function(){return p}),P.d(de,"f",function(){return h}),P.d(de,"e",function(){return c}),P.d(de,"i",function(){return s}),P.d(de,"b",function(){return d}),P.d(de,"a",function(){return i}),P.d(de,"d",function(){return l}),P.d(de,"c",function(){return r});var q=P("C/vA"),z=P("JYp7");const D=!1;let V=null;function U(o){V=o}if(D){const o="__is_disposable_tracked__";U(new class{trackDisposable(w){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{w[o]||console.log(T)},3e3)}setParent(w,T){if(w&&w!==i.None)try{w[o]=!0}catch(x){}}markAsDisposed(w){if(w&&w!==i.None)try{w[o]=!0}catch(T){}}markAsSingleton(w){}})}function O(o){return V==null||V.trackDisposable(o),o}function G(o){V==null||V.markAsDisposed(o)}function W(o,w){V==null||V.setParent(o,w)}function n(o,w){if(!V)return;for(const T of o)V.setParent(T,w)}function I(o){return V==null||V.markAsSingleton(o),o}class g extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function p(o){return typeof o.dispose=="function"&&o.dispose.length===0}function h(o){if(z.a.is(o)){let w=[];for(const T of o)if(T)try{T.dispose()}catch(x){w.push(x)}if(w.length===1)throw w[0];if(w.length>1)throw new g(w);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function c(...o){const w=s(()=>h(o));return n(o,w),w}function s(o){const w=O({dispose:Object(q.a)(()=>{G(w),o()})});return w}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,O(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return W(o,this),this._isDisposed?d.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(o),o}}d.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new d,O(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}i.None=Object.freeze({dispose(){}});class l{constructor(){this._isDisposed=!1,O(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var w;if(this._isDisposed||o===this._value)return;(w=this._value)===null||w===void 0||w.dispose(),o&&W(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,G(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&W(o,null),o}}class r{constructor(o){this.object=o}dispose(){}}},psGv:function(ke,de,P){var q,z;(function(){var D;(function(){"use strict";var G=[,,function(g){function p(s){this.__parent=s,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=[]}p.prototype.clone_empty=function(){var s=new p(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},p.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},p.prototype.has_match=function(s){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(s))return!0;return!1},p.prototype.set_indent=function(s,d){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.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)},p.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},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(s){this.__items.push(s);var d=s.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=s.length-d:this.__character_count+=s.length},p.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function h(s,d){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),d=d||"",s.indent_level>0&&(d=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}h.prototype.get_indent_size=function(s,d){var i=this.__base_string_length;return d=d||0,s<0&&(i=0),i+=s*this.__indent_size,i+=d,i},h.prototype.get_indent_string=function(s,d){var i=this.__base_string;return d=d||0,s<0&&(s=0,i=""),d+=s*this.__indent_size,this.__ensure_cache(d),i+=this.__cache[d],i},h.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var s=this.__cache.length,d=0,i="";this.__indent_size&&s>=this.__indent_size&&(d=Math.floor(s/this.__indent_size),s-=d*this.__indent_size,i=new Array(d+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function c(s,d){this.__indent_cache=new h(s,d),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(s,d){return this.__indent_cache.get_indent_string(s,d)},c.prototype.get_indent_size=function(s,d){return this.__indent_cache.get_indent_size(s,d)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(s){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return s!==`
|
|
`&&(i=i.replace(/[\n]/g,s)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(s,d){return s=s||0,d=d||0,this.next_line.set_indent(s,d),this.__lines.length>1?(this.current_line.set_indent(s,d),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(s){for(var d=0;d<s.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(s){for(var d=this.__lines.length;s<d;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(s,d){for(var i=this.__lines.length-2;i>=0;){var l=this.__lines[i];if(l.is_empty())break;if(l.item(0).indexOf(s)!==0&&l.item(-1)!==d){this.__lines.splice(i+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},g.exports.Output=c},function(g){function p(h,c,s,d){this.type=h,this.text=c,this.comments_before=null,this.newlines=s||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=p},,,function(g){function p(s,d){this.raw_options=h(s,d),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"])}p.prototype._get_array=function(s,d){var i=this.raw_options[s],l=d||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(l=i.concat()):typeof i=="string"&&(l=i.split(/[^a-zA-Z0-9_\/\-]+/)),l},p.prototype._get_boolean=function(s,d){var i=this.raw_options[s],l=i===void 0?!!d:!!i;return l},p.prototype._get_characters=function(s,d){var i=this.raw_options[s],l=d||"";return typeof i=="string"&&(l=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},p.prototype._get_number=function(s,d){var i=this.raw_options[s];d=parseInt(d,10),isNaN(d)&&(d=0);var l=parseInt(i,10);return isNaN(l)&&(l=d),l},p.prototype._get_selection=function(s,d,i){var l=this._get_selection_list(s,d,i);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[s]+"'");return l[0]},p.prototype._get_selection_list=function(s,d,i){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[d[0]],!this._is_valid_selection(i,d))throw new Error("Invalid Default Value!");var l=this._get_array(s,i);if(!this._is_valid_selection(l,d))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[s]+"'");return l},p.prototype._is_valid_selection=function(s,d){return s.length&&d.length&&!s.some(function(i){return d.indexOf(i)===-1})};function h(s,d){var i={};s=c(s);var l;for(l in s)l!==d&&(i[l]=s[l]);if(d&&s[d])for(l in s[d])i[l]=s[d][l];return i}function c(s){var d={},i;for(i in s){var l=i.replace(/-/g,"_");d[l]=s[i]}return d}g.exports.Options=p,g.exports.normalizeOpts=c,g.exports.mergeOpts=h},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function h(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},h.prototype.peek=function(c){var s=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(s=this.__input.charAt(c)),s},h.prototype.__match=function(c,s){c.lastIndex=s;var d=c.exec(this.__input);return d&&!(p&&c.sticky)&&(d.index!==s&&(d=null)),d},h.prototype.test=function(c,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(c,s):!1},h.prototype.testChar=function(c,s){var d=this.peek(s);return c.lastIndex=0,d!==null&&c.test(d)},h.prototype.match=function(c){var s=this.__match(c,this.__position);return s?this.__position+=s[0].length:s=null,s},h.prototype.read=function(c,s,d){var i="",l;return c&&(l=this.match(c),l&&(i+=l[0])),s&&(l||!c)&&(i+=this.readUntil(s,d)),i},h.prototype.readUntil=function(c,s){var d="",i=this.__position;c.lastIndex=this.__position;var l=c.exec(this.__input);return l?(i=l.index,s&&(i+=l[0].length)):i=this.__input_length,d=this.__input.substring(this.__position,i),this.__position=i,d},h.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},h.prototype.get_regexp=function(c,s){var d=null,i="g";return s&&p&&(i="y"),typeof c=="string"&&c!==""?d=new RegExp(c,i):c&&(d=new RegExp(c.source,i)),d},h.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(c){var s=this.__position,d=this.readUntilAfter(c);return this.__position=s,d},h.prototype.lookBack=function(c){var s=this.__position-1;return s>=c.length&&this.__input.substring(s-c.length,s).toLowerCase()===c},g.exports.InputScanner=h},function(g,p,h){var c=h(8).InputScanner,s=h(3).Token,d=h(10).TokenStream,i=h(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(o,w){this._input=new c(o),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var o,w=new s(l.START,""),T=null,x=[],L=new d;w.type!==l.EOF;){for(o=this._get_next_token(w,T);this._is_comment(o);)L.add(o),o=this._get_next_token(w,T);L.isEmpty()||(o.comments_before=L,L=new d),o.parent=T,this._is_opening(o)?(x.push(T),T=o):T&&this._is_closing(o,T)&&(o.opened=T,T.closed=o,T=x.pop(),o.parent=T),o.previous=w,w.next=o,this.__tokens.add(o),w=o}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(o,w){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(l.RAW,T):this._create_token(l.EOF,"")},r.prototype._is_comment=function(o){return!1},r.prototype._is_opening=function(o){return!1},r.prototype._is_closing=function(o,w){return!1},r.prototype._create_token=function(o,w){var T=new s(o,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=r,g.exports.TOKEN=l},function(g){function p(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},p.prototype.peek=function(h){var c=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(c=this.__tokens[h]),c},p.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},g.exports.TokenStream=p},function(g,p,h){var c=h(12).Pattern;function s(d,i){c.call(this,d,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new c,s.prototype.__set_whitespace_patterns=function(d,i){d+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var i=this.__split(this._newline_regexp,d);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return d},s.prototype.matching=function(d,i){var l=this._create();return l.__set_whitespace_patterns(d,i),l._update(),l},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(d,i){d.lastIndex=0;for(var l=0,r=[],o=d.exec(i);o;)r.push(i.substring(l,o.index)),l=o.index+o[0].length,o=d.exec(i);return l<i.length?r.push(i.substring(l,i.length)):r.push(""),r},g.exports.WhitespacePattern=s},function(g){function p(h,c){this._input=h,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}p.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(h){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.until=function(h){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(h),c._update(),c},p.prototype.starting_with=function(h){var c=this._create();return c._starting_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype.matching=function(h){var c=this._create();return c._match_pattern=this._input.get_regexp(h,!0),c._update(),c},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},g.exports.Pattern=p},function(g){function p(h,c){h=typeof h=="string"?h:h.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+c,"g")}p.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(h);s;)c[s[1]]=s[2],s=this.__directive_pattern.exec(h);return c},p.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=p},function(g,p,h){var c=h(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(i,l){c.call(this,i,l),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var r=new c(i);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new c,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(i){var l=this._create();return l._disabled[i]=!0,l._update(),l},d.prototype.read_options=function(i){var l=this._create();for(var r in s)l._disabled[r]=i.templating.indexOf(r)===-1;return l._update(),l},d.prototype.exclude=function(i){var l=this._create();return l._excluded[i]=!0,l._update(),l},d.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),i+=l,l=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},d.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},d.prototype._read_template=function(){var i="",l=this._input.peek();if(l==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(i=i||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},g.exports.TemplatablePattern=d},,,,function(g,p,h){var c=h(19).Beautifier,s=h(20).Options;function d(i,l,r,o){var w=new c(i,l,r,o);return w.beautify()}g.exports=d,g.exports.defaultOptions=function(){return new s}},function(g,p,h){var c=h(20).Options,s=h(2).Output,d=h(21).Tokenizer,i=h(21).TOKEN,l=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,o=function(S,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new s(S,b)};o.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},o.prototype.set_space_before_token=function(S,b){this._output.space_before_token=S,this._output.non_breaking_space=b},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},o.prototype.print_preserved_newlines=function(S){var b=0;S.type!==i.TEXT&&S.previous.type!==i.TEXT&&(b=S.newlines?1:0),this.preserve_newlines&&(b=S.newlines<this.max_preserve_newlines+1?S.newlines:this.max_preserve_newlines+1);for(var y=0;y<b;y++)this.print_newline(y>0);return b!==0},o.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(S){this._output.add_new_line(S)},o.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var w=function(S){for(var b=null,y=S.next;y.type!==i.EOF&&S.closed!==y;){if(y.type===i.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===i.EQUALS&&y.next.next&&y.next.next.type===i.VALUE&&(b=y.next.next.text);break}y=y.next}return b},T=function(S,b){var y=null,M=null;return b.closed?(S==="script"?y="text/javascript":S==="style"&&(y="text/css"),y=w(b)||y,y.search("text/css")>-1?M="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?M="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?M="html":y.search(/test\/null/)>-1&&(M="null"),M):null};function x(S,b){return b.indexOf(S)!==-1}function L(S,b,y){this.parent=S||null,this.tag=b?b.tag_name:"",this.indent_level=y||0,this.parser_token=b||null}function A(S){this._printer=S,this._current_frame=null}A.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},A.prototype.record_tag=function(S){var b=new L(this._current_frame,S,this._printer.indent_level);this._current_frame=b},A.prototype._try_pop_frame=function(S){var b=null;return S&&(b=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),b},A.prototype._get_frame=function(S,b){for(var y=this._current_frame;y&&!(S.indexOf(y.tag)!==-1);){if(b&&b.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},A.prototype.try_pop=function(S,b){var y=this._get_frame([S],b);return this._try_pop_frame(y)},A.prototype.indent_to_tag=function(S){var b=this._get_frame(S);b&&(this._printer.indent_level=b.indent_level)};function E(S,b,y,M){this._source_text=S||"",b=b||{},this._js_beautify=y,this._css_beautify=M,this._tag_stack=null;var B=new c(b,"html");this._options=B,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"}E.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
|
|
`,S&&l.test(S)&&(b=S.match(l)[0])),S=S.replace(r,`
|
|
`);var y=S.match(/^[\t ]*/)[0],M={text:"",type:""},B=new _,R=new o(this._options,y),H=new d(S,this._options).tokenize();this._tag_stack=new A(R);for(var N=null,C=H.next();C.type!==i.EOF;)C.type===i.TAG_OPEN||C.type===i.COMMENT?(N=this._handle_tag_open(R,C,B,M),B=N):C.type===i.ATTRIBUTE||C.type===i.EQUALS||C.type===i.VALUE||C.type===i.TEXT&&!B.tag_complete?N=this._handle_inside_tag(R,C,B,H):C.type===i.TAG_CLOSE?N=this._handle_tag_close(R,C,B):C.type===i.TEXT?N=this._handle_text(R,C,B):R.add_raw_token(C),M=N,C=H.next();var K=R._output.get_code(b);return K},E.prototype._handle_tag_close=function(S,b,y){var M={text:b.text,type:b.type};return S.alignment_size=0,y.tag_complete=!0,S.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted?S.add_raw_token(b):(y.tag_start_char==="<"&&(S.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(b)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(S.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&S.set_wrap_point(),M},E.prototype._handle_inside_tag=function(S,b,y,M){var B=y.has_wrapped_attrs,R={text:b.text,type:b.type};if(S.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),y.is_unformatted)S.add_raw_token(b);else if(y.tag_start_char==="{"&&b.type===i.TEXT)S.print_preserved_newlines(b)?(b.newlines=0,S.add_raw_token(b)):S.print_token(b);else{if(b.type===i.ATTRIBUTE?(S.set_space_before_token(!0),y.attr_count+=1):(b.type===i.EQUALS||b.type===i.VALUE&&b.previous.type===i.EQUALS)&&S.set_space_before_token(!1),b.type===i.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(b),B=B||b.newlines!==0),this._is_wrap_attributes_force)){var H=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var N=!0,C=0,K;do{if(K=M.peek(C),K.type===i.ATTRIBUTE){N=!1;break}C+=1}while(C<4&&K.type!==i.EOF&&K.type!==i.TAG_CLOSE);H=!N}H&&(S.print_newline(!1),B=!0)}S.print_token(b),B=B||S.previous_token_wrapped(),y.has_wrapped_attrs=B}return R},E.prototype._handle_text=function(S,b,y){var M={text:b.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(S,b,y):y.is_unformatted||y.is_content_unformatted?S.add_raw_token(b):(S.traverse_whitespace(b),S.print_token(b)),M},E.prototype._print_custom_beatifier_text=function(S,b,y){var M=this;if(b.text!==""){var B=b.text,R,H=1,N="",C="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:y.custom_beautifier_name==="html"&&(R=function(be,Te){var Ce=new E(be,Te,M._js_beautify,M._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-S.indent_level);var K=S.get_full_indent(H);if(B=B.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!Z){S.add_raw_token(b);return}N=K+Z[1]+`
|
|
`,B=Z[4],Z[5]&&(C=K+Z[5]),B=B.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
|
|
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(b.whitespace_before=Z[0]))}if(B)if(R){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var fe=new oe;B=R(K+B,fe)}else{var xe=b.whitespace_before;xe&&(B=B.replace(new RegExp(`
|
|
(`+xe+")?","g"),`
|
|
`)),B=K+B.replace(/\n/g,`
|
|
`+K)}N&&(B?B=N+B+`
|
|
`+C:B=N+C),S.print_newline(!1),B&&(b.text=B,b.whitespace_before="",b.newlines=0,S.add_raw_token(b),S.print_newline(!0))}},E.prototype._handle_tag_open=function(S,b,y,M){var B=this._get_tag_open_token(b);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&b.type===i.TAG_OPEN&&b.text.indexOf("</")===0?(S.add_raw_token(b),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(S.traverse_whitespace(b),this._set_tag_position(S,b,B,y,M),B.is_inline_element||S.set_wrap_point(),S.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=b.text.length+1),!B.tag_complete&&!B.is_unformatted&&(S.alignment_size=B.alignment_size),B};var _=function(S,b){if(this.parent=S||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 y;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(y=b.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[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===i.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 M=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(M=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(M)))}};E.prototype._get_tag_open_token=function(S){var b=new _(this._tag_stack.get_parser_token(),S);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||x(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&&x(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&x(b.tag_check,this._options.content_unformatted),b.is_inline_element=x(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},E.prototype._set_tag_position=function(S,b,y,M,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=T(y.tag_check,b)))),x(y.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var R=S.current_line_has_match(/{{#if/);R||S.print_newline(!1)}y.tag_name==="!--"&&B.type===i.TAG_CLOSE&&M.is_end_tag&&y.text.indexOf(`
|
|
`)===-1||(y.is_inline_element||y.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,y))}else if(y.is_end_tag){var H=!1;H=y.start_tag_token&&y.start_tag_token.multiline_content,H=H||!y.is_inline_element&&!(M.is_inline_element||M.is_unformatted)&&!(B.type===i.TAG_CLOSE&&y.start_tag_token===M)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(H=!1),H&&S.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,y)},E.prototype._calcluate_parent_multiline=function(S,b){b.parent&&S._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.parent.multiline_content=!0)};var m=["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"],f=["a","audio","del","ins","map","noscript","video"];E.prototype._do_optional_end_element=function(S){var b=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(S.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&m.indexOf(S.tag_name)!==-1){var y=S.parent.parent;(!y||f.indexOf(y.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.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"])):S.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"])):(S.tag_name==="th"||S.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 S.parent=this._tag_stack.get_parser_token(),b},g.exports.Beautifier=E},function(g,p,h){var c=h(6).Options;function s(d){c.call(this,d,"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"])}s.prototype=new c,g.exports.Options=s},function(g,p,h){var c=h(9).Tokenizer,s=h(9).TOKEN,d=h(13).Directives,i=h(14).TemplatablePattern,l=h(12).Pattern,r={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:s.START,RAW:s.RAW,EOF:s.EOF},o=new d(/<\!--/,/-->/),w=function(T,x){c.call(this,T,x),this._current_tag_name="";var L=new i(this._input).read_options(this._options),A=new l(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:A.starting_with(/{{!--/).until_after(/--}}/),handlebars:A.starting_with(/{{/).until_after(/}}/),handlebars_open:A.until(/[\n\r\t }]/),handlebars_raw_close:A.until(/}}/),comment:A.starting_with(/<!--/).until_after(/-->/),cdata:A.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:A.starting_with(/<!\[/).until_after(/]>/),processing:A.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 E=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=A.matching(E).until_after(E)}};w.prototype=new c,w.prototype._is_comment=function(T){return!1},w.prototype._is_opening=function(T){return T.type===r.TAG_OPEN},w.prototype._is_closing=function(T,x){return T.type===r.TAG_CLOSE&&x&&((T.text===">"||T.text==="/>")&&x.text[0]==="<"||T.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(T,x){var L=null;this._readWhitespace();var A=this._input.peek();return A===null?this._create_token(r.EOF,""):(L=L||this._read_open_handlebars(A,x),L=L||this._read_attribute(A,T,x),L=L||this._read_close(A,x),L=L||this._read_raw_content(A,T,x),L=L||this._read_content_word(A),L=L||this._read_comment_or_cdata(A),L=L||this._read_processing(A),L=L||this._read_open(A,x),L=L||this._create_token(r.UNKNOWN,this._input.next()),L)},w.prototype._read_comment_or_cdata=function(T){var x=null,L=null,A=null;if(T==="<"){var E=this._input.peek(1);E==="!"&&(L=this.__patterns.comment.read(),L?(A=o.get_directives(L),A&&A.ignore==="start"&&(L+=o.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=A)}return x},w.prototype._read_processing=function(T){var x=null,L=null,A=null;if(T==="<"){var E=this._input.peek(1);(E==="!"||E==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(x=this._create_token(r.COMMENT,L),x.directives=A)}return x},w.prototype._read_open=function(T,x){var L=null,A=null;return x||T==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),A=this._create_token(r.TAG_OPEN,L)),A},w.prototype._read_open_handlebars=function(T,x){var L=null,A=null;return x||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),A=this._create_token(r.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),A=this._create_token(r.TAG_OPEN,L))),A},w.prototype._read_close=function(T,x){var L=null,A=null;return x&&(x.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(L=this._input.next(),T==="/"&&(L+=this._input.next()),A=this._create_token(r.TAG_CLOSE,L)):x.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),A=this._create_token(r.TAG_CLOSE,"}}"))),A},w.prototype._read_attribute=function(T,x,L){var A=null,E="";if(L&&L.text[0]==="<")if(T==="=")A=this._create_token(r.EQUALS,this._input.next());else if(T==='"'||T==="'"){var _=this._input.next();T==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),A=this._create_token(r.VALUE,_)}else E=this.__patterns.attribute.read(),E&&(x.type===r.EQUALS?A=this._create_token(r.VALUE,E):A=this._create_token(r.ATTRIBUTE,E));return A},w.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},w.prototype._read_raw_content=function(T,x,L){var A="";if(L&&L.text[0]==="{")A=this.__patterns.handlebars_raw_close.read();else if(x.type===r.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var E=x.opened.text.substr(1).toLowerCase();if(E==="script"||E==="style"){var _=this._read_comment_or_cdata(T);if(_)return _.type=r.TEXT,_;A=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(E)&&(A=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig")))}return A?this._create_token(r.TEXT,A):null},w.prototype._read_content_word=function(T){var x="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(r.TEXT,x)},g.exports.Tokenizer=w,g.exports.TOKEN=r}],W={};function n(g){var p=W[g];if(p!==void 0)return p.exports;var h=W[g]={exports:{}};return G[g](h,h.exports,n),h.exports}var I=n(18);D=I})();var V=D;if(!0)!(q=[P,P("6UM0"),P("TXwP")],z=function(G){var W=P("6UM0"),n=P("TXwP");return{html_beautify:function(I,g){return V(I,g,W.js_beautify,n.css_beautify)}}}.apply(de,q),z!==void 0&&(ke.exports=z));else var U,O})()},"qJ4+":function(ke,de,P){},"rAM+":function(ke,de,P){"use strict";P.d(de,"a",function(){return z});var q=P("Qw5x");function z(D,V){var U;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(U=Object(q.a)(D))||V&&D&&typeof D.length=="number"){U&&(D=U);var O=0,G=function(){};return{s:G,n:function(){return O>=D.length?{done:!0}:{done:!1,value:D[O++]}},e:function(p){throw p},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,n=!1,I;return{s:function(){U=D[Symbol.iterator]()},n:function(){var p=U.next();return W=p.done,p},e:function(p){n=!0,I=p},f:function(){try{!W&&U.return!=null&&U.return()}finally{if(n)throw I}}}}},rUJ1:function(ke,de){const P=/[&<>"']/,q=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,V={"&":"&","<":"<",">":">",'"':""","'":"'"},U=A=>V[A];function O(A,E){if(E){if(P.test(A))return A.replace(q,U)}else if(z.test(A))return A.replace(D,U);return A}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(A){return A.replace(G,(E,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(A,E){A=A.source||A,E=E||"";const _={replace:(m,f)=>(f=f.source||f,f=f.replace(n,"$1"),A=A.replace(m,f),_),getRegex:()=>new RegExp(A,E)};return _}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(A,E,_){if(A){let m;try{m=decodeURIComponent(W(_)).replace(g,"").toLowerCase()}catch(f){return null}if(m.indexOf("javascript:")===0||m.indexOf("vbscript:")===0||m.indexOf("data:")===0)return null}E&&!p.test(_)&&(_=l(E,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(m){return null}return _}const c={},s=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(A,E){c[" "+A]||(s.test(A)?c[" "+A]=A+"/":c[" "+A]=T(A,"/",!0)),A=c[" "+A];const _=A.indexOf(":")===-1;return E.substring(0,2)==="//"?_?E:A.replace(d,"$1")+E:E.charAt(0)==="/"?_?E:A.replace(i,"$1")+E:A+E}const r={exec:function(){}};function o(A){let E=1,_,m;for(;E<arguments.length;E++){_=arguments[E];for(m in _)Object.prototype.hasOwnProperty.call(_,m)&&(A[m]=_[m])}return A}function w(A,E){const _=A.replace(/\|/g,(S,b,y)=>{let M=!1,B=b;for(;--B>=0&&y[B]==="\\";)M=!M;return M?"|":" |"}),m=_.split(/ \|/);let f=0;if(m.length>E)m.splice(E);else for(;m.length<E;)m.push("");for(;f<m.length;f++)m[f]=m[f].trim().replace(/\\\|/g,"|");return m}function T(A,E,_){const m=A.length;if(m===0)return"";let f=0;for(;f<m;){const S=A.charAt(m-f-1);if(S===E&&!_)f++;else if(S!==E&&_)f++;else break}return A.substr(0,m-f)}function x(A,E){if(A.indexOf(E[1])===-1)return-1;const _=A.length;let m=0,f=0;for(;f<_;f++)if(A[f]==="\\")f++;else if(A[f]===E[0])m++;else if(A[f]===E[1]&&(m--,m<0))return f;return-1}function L(A){A&&A.sanitize&&!A.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")}ke.exports={escape:O,unescape:W,edit:I,cleanUrl:h,resolveUrl:l,noopTest:r,merge:o,splitCells:w,rtrim:T,findClosingBracket:x,checkSanitizeDeprecation:L}},rdUC:function(ke,de,P){var q=P("MFOe"),z=q.Global;ke.exports={name:"localStorage",read:V,write:U,each:O,remove:G,clearAll:W};function D(){return z.localStorage}function V(n){return D().getItem(n)}function U(n,I){return D().setItem(n,I)}function O(n){for(var I=D().length-1;I>=0;I--){var g=D().key(I);n(V(g),g)}}function G(n){return D().removeItem(n)}function W(){return D().clear()}},sR1s:function(ke,de,P){"use strict";P.d(de,"b",function(){return V}),P.d(de,"a",function(){return U}),P.d(de,"c",function(){return O}),P.d(de,"d",function(){return G});var q=P("U8pU"),z="RC_TABLE_KEY";function D(W){return W==null?[]:Array.isArray(W)?W:[W]}function V(W,n){if(!n&&typeof n!="number")return W;for(var I=D(n),g=W,p=0;p<I.length;p+=1){if(!g)return null;var h=I[p];g=g[h]}return g}function U(W){var n=[],I={};return W.forEach(function(g){for(var p=g||{},h=p.key,c=p.dataIndex,s=h||D(c).join("-")||z;I[s];)s="".concat(s,"_next");I[s]=!0,n.push(s)}),n}function O(){var W={};function n(h,c){c&&Object.keys(c).forEach(function(s){var d=c[s];d&&Object(q.a)(d)==="object"?(h[s]=h[s]||{},n(h[s],d)):h[s]=d})}for(var I=arguments.length,g=new Array(I),p=0;p<I;p++)g[p]=arguments[p];return g.forEach(function(h){n(W,h)}),W}function G(W){return W!=null}},sboe:function(ke,de,P){"use strict";P.d(de,"a",function(){return D});var q=P("q1tI"),z=P.n(q),D=q.createContext(null)},"t/PP":function(ke,de,P){ke.exports=P.p+"static/title.dd3b799f.svg"},t23M:function(ke,de,P){"use strict";var q=P("VTBJ"),z=P("1OyB"),D=P("vuIU"),V=P("Ji7U"),U=P("LK+K"),O=P("q1tI"),G=P.n(O),W=P("m+aA"),n=P("Zm9Q"),I=P("Kwbf"),g=P("c+Xe"),p=P("bdgK"),h="rc-observer-key",c=function(s){Object(V.a)(i,s);var d=Object(U.a)(i);function i(){var l;return Object(z.a)(this,i),l=d.apply(this,arguments),l.resizeObserver=null,l.childNode=null,l.currentElement=null,l.state={width:0,height:0,offsetHeight:0,offsetWidth:0},l.onResize=function(r){var o=l.props.onResize,w=r[0].target,T=w.getBoundingClientRect(),x=T.width,L=T.height,A=w.offsetWidth,E=w.offsetHeight,_=Math.floor(x),m=Math.floor(L);if(l.state.width!==_||l.state.height!==m||l.state.offsetWidth!==A||l.state.offsetHeight!==E){var f={width:_,height:m,offsetWidth:A,offsetHeight:E};l.setState(f),o&&Promise.resolve().then(function(){o(Object(q.a)(Object(q.a)({},f),{},{offsetWidth:A,offsetHeight:E}))})}},l.setChildNode=function(r){l.childNode=r},l}return Object(D.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var r=this.props.disabled;if(r){this.destroyObserver();return}var o=Object(W.a)(this.childNode||this),w=o!==this.currentElement;w&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new p.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,o=Object(n.a)(r);if(o.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var w=o[0];if(O.isValidElement(w)&&Object(g.c)(w)){var T=w.ref;o[0]=O.cloneElement(w,{ref:Object(g.a)(T,this.setChildNode)})}return o.length===1?o[0]:o.map(function(x,L){return!O.isValidElement(x)||"key"in x&&x.key!==null?x:O.cloneElement(x,{key:"".concat(h,"-").concat(L)})})}}]),i}(O.Component);c.displayName="ResizeObserver",de.a=c},t9D7:function(ke,de,P){"use strict";P.d(de,"b",function(){return G}),P.d(de,"g",function(){return n}),P.d(de,"d",function(){return I}),P.d(de,"e",function(){return g}),P.d(de,"a",function(){return p}),P.d(de,"f",function(){return s}),P.d(de,"c",function(){return d});var q=P("Vhoy"),z=P("MI8n"),D=P("pmY6"),V=P("Cg/j"),U=P("ic2d"),O=P("nEHx");const G=Object(V.c)("themeService");var W;(function(i){function l(r){return r&&typeof r=="object"&&typeof r.id=="string"}i.isThemeColor=l})(W||(W={}));function n(i){return{id:i}}var I;(function(i){function l(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||W.isThemeColor(L.color))}i.isThemeIcon=l;const r=new RegExp(`^\\$\\((${q.a.iconNameExpression}(?:${q.a.iconModifierExpression})?)\\)$`);function o(L){const A=r.exec(L);if(!A)return;let[,E]=A;return{id:E}}i.fromString=o;function w(L,A){let E=L.id;const _=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),A&&(E=`${E}~${A}`),{id:E}}i.modify=w;function T(L,A){var E,_;return L.id===A.id&&((E=L.color)===null||E===void 0?void 0:E.id)===((_=A.color)===null||_===void 0?void 0:_.id)}i.isEqual=T;function x(L,A){return{id:L.id,color:A?n(A):void 0}}i.asThemeIcon=x,i.asClassNameArray=q.a.asClassNameArray,i.asClassName=q.a.asClassName,i.asCSSSelector=q.a.asCSSSelector})(I||(I={}));function g(i){switch(i){case O.a.DARK:return"vs-dark";case O.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class h{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(D.i)(()=>{const l=this.themingParticipants.indexOf(i);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new h;U.a.add(p.ThemingContribution,c);function s(i){return c.onColorThemeChange(i)}class d extends D.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},uD2n:function(ke,de,P){ke.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:function(ke,de,P){ke.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(ke,de,P){ke.exports=q;function q(){return P("gaXo"),{}}},ulZh:function(ke,de,P){typeof window!="undefined"&&function(z,D){ke.exports=D()}(this,function(){return function(q){var z={};function D(V){if(z[V])return z[V].exports;var U=z[V]={i:V,l:!1,exports:{}};return q[V].call(U.exports,U,U.exports,D),U.l=!0,U.exports}return D.m=q,D.c=z,D.d=function(V,U,O){D.o(V,U)||Object.defineProperty(V,U,{enumerable:!0,get:O})},D.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},D.t=function(V,U){if(U&1&&(V=D(V)),U&8)return V;if(U&4&&typeof V=="object"&&V&&V.__esModule)return V;var O=Object.create(null);if(D.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:V}),U&2&&typeof V!="string")for(var G in V)D.d(O,G,function(W){return V[W]}.bind(null,G));return O},D.n=function(V){var U=V&&V.__esModule?function(){return V.default}:function(){return V};return D.d(U,"a",U),U},D.o=function(V,U){return Object.prototype.hasOwnProperty.call(V,U)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(q,z,D){"use strict";var V=Object.prototype.hasOwnProperty,U="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(U=!1));function G(g,p,h){this.fn=g,this.context=p,this.once=h||!1}function W(g,p,h,c,s){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new G(h,c||g,s),i=U?U+p:p;return g._events[i]?g._events[i].fn?g._events[i]=[g._events[i],d]:g._events[i].push(d):(g._events[i]=d,g._eventsCount++),g}function n(g,p){--g._eventsCount===0?g._events=new O:delete g._events[p]}function I(){this._events=new O,this._eventsCount=0}I.prototype.eventNames=function(){var p=[],h,c;if(this._eventsCount===0)return p;for(c in h=this._events)V.call(h,c)&&p.push(U?c.slice(1):c);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},I.prototype.listeners=function(p){var h=U?U+p:p,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var s=0,d=c.length,i=new Array(d);s<d;s++)i[s]=c[s].fn;return i},I.prototype.listenerCount=function(p){var h=U?U+p:p,c=this._events[h];return c?c.fn?1:c.length:0},I.prototype.emit=function(p,h,c,s,d,i){var l=U?U+p:p;if(!this._events[l])return!1;var r=this._events[l],o=arguments.length,w,T;if(r.fn){r.once&&this.removeListener(p,r.fn,void 0,!0);switch(o){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,h),!0;case 3:return r.fn.call(r.context,h,c),!0;case 4:return r.fn.call(r.context,h,c,s),!0;case 5:return r.fn.call(r.context,h,c,s,d),!0;case 6:return r.fn.call(r.context,h,c,s,d,i),!0}for(T=1,w=new Array(o-1);T<o;T++)w[T-1]=arguments[T];r.fn.apply(r.context,w)}else{var x=r.length,L;for(T=0;T<x;T++){r[T].once&&this.removeListener(p,r[T].fn,void 0,!0);switch(o){case 1:r[T].fn.call(r[T].context);break;case 2:r[T].fn.call(r[T].context,h);break;case 3:r[T].fn.call(r[T].context,h,c);break;case 4:r[T].fn.call(r[T].context,h,c,s);break;default:if(!w)for(L=1,w=new Array(o-1);L<o;L++)w[L-1]=arguments[L];r[T].fn.apply(r[T].context,w)}}}return!0},I.prototype.on=function(p,h,c){return W(this,p,h,c,!1)},I.prototype.once=function(p,h,c){return W(this,p,h,c,!0)},I.prototype.removeListener=function(p,h,c,s){var d=U?U+p:p;if(!this._events[d])return this;if(!h)return n(this,d),this;var i=this._events[d];if(i.fn)i.fn===h&&(!s||i.once)&&(!c||i.context===c)&&n(this,d);else{for(var l=0,r=[],o=i.length;l<o;l++)(i[l].fn!==h||s&&!i[l].once||c&&i[l].context!==c)&&r.push(i[l]);r.length?this._events[d]=r.length===1?r[0]:r:n(this,d)}return this},I.prototype.removeAllListeners=function(p){var h;return p?(h=U?U+p:p,this._events[h]&&n(this,h)):(this._events=new O,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=U,I.EventEmitter=I,q.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(q,z,D){(function(V){var U=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,g,p){if(p=p||{},I=I.trim(),g=g.trim(),!g){if(!p.alwaysNormalize)return I;var h=n.parseURL(I);if(!h)throw new Error("Error trying to parse base URL.");return h.path=n.normalizePath(h.path),n.buildURLFromParts(h)}var c=n.parseURL(g);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return p.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):g;var s=n.parseURL(I);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var d=O.exec(s.path);s.netLoc=d[1],s.path=d[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(i.netLoc=s.netLoc,c.path[0]!=="/"))if(!c.path)i.path=s.path,c.params||(i.params=s.params,c.query||(i.query=s.query));else{var l=s.path,r=l.substring(0,l.lastIndexOf("/")+1)+c.path;i.path=n.normalizePath(r)}return i.path===null&&(i.path=p.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(i)},parseURL:function(I){var g=U.exec(I);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(G,"");I.length!==(I=I.replace(W,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};q.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(q,z,D){function V(p){var h={};function c(d){if(h[d])return h[d].exports;var i=h[d]={i:d,l:!1,exports:{}};return p[d].call(i.exports,i,i.exports,c),i.l=!0,i.exports}c.m=p,c.c=h,c.i=function(d){return d},c.d=function(d,i,l){c.o(d,i)||Object.defineProperty(d,i,{configurable:!1,enumerable:!0,get:l})},c.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},c.n=function(d){var i=d&&d.__esModule?function(){return d.default}:function(){return d};return c.d(i,"a",i),i},c.o=function(d,i){return Object.prototype.hasOwnProperty.call(d,i)},c.p="/",c.oe=function(d){throw console.error(d),d};var s=c(c.s=ENTRY_MODULE);return s.default||s}var U="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+U+").*?\\)";function G(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(p){return!isNaN(1*p)}function n(p,h,c){var s={};s[c]=[];var d=h.toString(),i=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var l=i[1],r=new RegExp("(\\\\n|\\W)"+G(l)+O,"g"),o;o=r.exec(d);){if(o[3]==="dll-reference")continue;s[c].push(o[3])}for(r=new RegExp("\\("+G(l)+'\\("(dll-reference\\s('+U+'))"\\)\\)'+O,"g");o=r.exec(d);)p[o[2]]||(s[c].push(o[1]),p[o[2]]=D(o[1]).m),s[o[2]]=s[o[2]]||[],s[o[2]].push(o[4]);for(var w=Object.keys(s),T=0;T<w.length;T++)for(var x=0;x<s[w[T]].length;x++)W(s[w[T]][x])&&(s[w[T]][x]=1*s[w[T]][x]);return s}function I(p){var h=Object.keys(p);return h.reduce(function(c,s){return c||p[s].length>0},!1)}function g(p,h){for(var c={main:[h]},s={main:[]},d={main:{}};I(c);)for(var i=Object.keys(c),l=0;l<i.length;l++){var r=i[l],o=c[r],w=o.pop();if(d[r]=d[r]||{},d[r][w]||!p[r][w])continue;d[r][w]=!0,s[r]=s[r]||[],s[r].push(w);for(var T=n(p,p[r][w],r),x=Object.keys(T),L=0;L<x.length;L++)c[x[L]]=c[x[L]]||[],c[x[L]]=c[x[L]].concat(T[x[L]])}return s}q.exports=function(p,h){h=h||{};var c={main:D.m},s=h.all?{main:Object.keys(c.main)}:g(c,p),d="";Object.keys(s).filter(function(w){return w!=="main"}).forEach(function(w){for(var T=0;s[w][T];)T++;s[w].push(T),c[w][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+w+" = ("+V.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+s[w].map(function(x){return""+JSON.stringify(x)+": "+c[w][x].toString()}).join(",")+`});
|
|
`}),d=d+"new (("+V.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+s.main.map(function(w){return""+JSON.stringify(w)+": "+c.main[w].toString()}).join(",")+"}))(self);";var i=new window.Blob([d],{type:"text/javascript"});if(h.bare)return i;var l=window.URL||window.webkitURL||window.mozURL||window.msURL,r=l.createObjectURL(i),o=new window.Worker(r);return o.objectURL=r,o}},"./src/config.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"hlsDefaultConfig",function(){return L}),D.d(z,"mergeConfig",function(){return E}),D.d(z,"enableStreamingMode",function(){return _});var V=D("./src/controller/abr-controller.ts"),U=D("./src/controller/audio-stream-controller.ts"),O=D("./src/controller/audio-track-controller.ts"),G=D("./src/controller/subtitle-stream-controller.ts"),W=D("./src/controller/subtitle-track-controller.ts"),n=D("./src/controller/buffer-controller.ts"),I=D("./src/controller/timeline-controller.ts"),g=D("./src/controller/cap-level-controller.ts"),p=D("./src/controller/fps-controller.ts"),h=D("./src/controller/eme-controller.ts"),c=D("./src/controller/cmcd-controller.ts"),s=D("./src/utils/xhr-loader.ts"),d=D("./src/utils/fetch-loader.ts"),i=D("./src/utils/cues.ts"),l=D("./src/utils/mediakeys-helper.ts"),r=D("./src/utils/logger.ts");function o(){return o=Object.assign||function(m){for(var f=1;f<arguments.length;f++){var S=arguments[f];for(var b in S)Object.prototype.hasOwnProperty.call(S,b)&&(m[b]=S[b])}return m},o.apply(this,arguments)}function w(m,f){var S=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);f&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(m,y).enumerable})),S.push.apply(S,b)}return S}function T(m){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?w(Object(S),!0).forEach(function(b){x(m,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(S)):w(Object(S)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(S,b))})}return m}function x(m,f,S){return f in m?Object.defineProperty(m,f,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[f]=S,m}var L=T(T({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:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:V.default,bufferController:n.default,capLevelController:g.default,fpsController:p.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:l.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:W.default,timelineController:I.TimelineController,audioStreamController:U.default,audioTrackController:O.default,emeController:h.default,cmcdController:c.default});function A(){return{cueHandler:i.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 E(m,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},m,f)}function _(m){var f=m.loader;if(f!==d.default&&f!==s.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),m.progressive=!1;else{var S=Object(d.fetchSupported)();S&&(m.loader=d.default,m.progressive=!0,m.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),U=D("./src/utils/ewma-bandwidth-estimator.ts"),O=D("./src/events.ts"),G=D("./src/utils/buffer-helper.ts"),W=D("./src/errors.ts"),n=D("./src/types/loader.ts"),I=D("./src/utils/logger.ts");function g(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function p(c,s,d){return s&&g(c.prototype,s),d&&g(c,d),c}var h=function(){function c(d){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=d;var i=d.config;this.bwEstimator=new U.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=c.prototype;return s.registerListeners=function(){var i=this.hls;i.on(O.Events.FRAG_LOADING,this.onFragLoading,this),i.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(O.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(O.Events.FRAG_LOADING,this.onFragLoading,this),i.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(O.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(i,l){var r=l.frag;if(r.type===n.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=r,this.partCurrent=(o=l.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,l){var r=this.hls.config;l.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,l=this.partCurrent,r=this.hls,o=r.autoLevelEnabled,w=r.config,T=r.media;if(!i||!T)return;var x=l?l.stats:i.stats,L=l?l.duration:i.duration;if(x.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||T.paused||!T.playbackRate||!T.readyState)return;var A=performance.now()-x.loading.start,E=Math.abs(T.playbackRate);if(A<=500*L/E)return;var _=r.levels,m=r.minAutoLevel,f=_[i.level],S=x.total||Math.max(x.loaded,Math.round(L*f.maxBitrate/8)),b=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/A),y=(S-x.loaded)/b,M=T.currentTime,B=(G.BufferHelper.bufferInfo(T,M,w.maxBufferHole).end-M)/E;if(B>=2*L/E||y<=B)return;var R=Number.POSITIVE_INFINITY,H;for(H=i.level-1;H>m;H--){var N=_[H].maxBitrate;if(R=L*N/(8*.8*b),R<B)break}if(R>=y)return;var C=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+i.sn+(l?" part "+l.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
|
|
Current BW estimate: `+(Object(V.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+y.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+R.toFixed(3)+` s
|
|
Time to underbuffer: `+B.toFixed(3)+" s"),r.nextLoadLevel=H,this.bwEstimator.sample(A,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),r.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:l,stats:x})},s.onFragLoaded=function(i,l){var r=l.frag,o=l.part;if(r.type===n.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(r.sn)){var w=o?o.stats:r.stats,T=o?o.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[r.level],L=(x.loaded?x.loaded.bytes:0)+w.loaded,A=(x.loaded?x.loaded.duration:0)+T;x.loaded={bytes:L,duration:A},x.realBitrate=Math.round(8*L/A)}if(r.bitrateTest){var E={stats:w,frag:r,part:o,id:r.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,E),r.bitrateTest=!1}}},s.onFragBuffered=function(i,l){var r=l.frag,o=l.part,w=o?o.stats:r.stats;if(w.aborted)return;if(r.type!==n.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var T=w.parsing.end-w.loading.start;this.bwEstimator.sample(T,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},s.onError=function(i,l){switch(l.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,l=this.partCurrent,r=this.hls,o=r.maxAutoLevel,w=r.config,T=r.minAutoLevel,x=r.media,L=l?l.duration:i?i.duration:0,A=x?x.currentTime:0,E=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,m=(G.BufferHelper.bufferInfo(x,A,w.maxBufferHole).end-A)/E,f=this.findBestLevel(_,T,o,m,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(f>=0)return f;I.logger.trace((m?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=L?Math.min(L,w.maxStarvationDelay):w.maxStarvationDelay,b=w.abrBandWidthFactor,y=w.abrBandWidthUpFactor;if(!m){var M=this.bitrateTestDelay;if(M){var B=L?Math.min(L,w.maxLoadingDelay):w.maxLoadingDelay;S=B-M,I.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),b=y=1}}return f=this.findBestLevel(_,T,o,m+S,b,y),Math.max(f,0)},s.findBestLevel=function(i,l,r,o,w,T){for(var x,L=this.fragCurrent,A=this.partCurrent,E=this.lastLoadedFragLevel,_=this.hls.levels,m=_[E],f=!!(m!=null&&(x=m.details)!==null&&x!==void 0&&x.live),S=m==null?void 0:m.codecSet,b=A?A.duration:L?L.duration:0,y=r;y>=l;y--){var M=_[y];if(!M||S&&M.codecSet!==S)continue;var B=M.details,R=(A?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||b,H=void 0;y<=E?H=w*i:H=T*i;var N=_[y].maxBitrate,C=N*R/H;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(H)+"/"+N+"/"+R+"/"+o+"/"+C),H>N&&(!C||f&&!this.bitrateTestDelay||C<o))return y}return-1},p(c,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,l=this.bwEstimator;if(i!==-1&&(!l||!l.canEstimate()))return i;var r=this.getNextABRAutoLevel();return i!==-1&&(r=Math.min(i,r)),r},set:function(i){this._nextAutoLevel=i}}]),c}();z.default=h},"./src/controller/audio-stream-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),U=D("./src/controller/base-stream-controller.ts"),O=D("./src/events.ts"),G=D("./src/utils/buffer-helper.ts"),W=D("./src/controller/fragment-tracker.ts"),n=D("./src/types/level.ts"),I=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),p=D("./src/demux/chunk-cache.ts"),h=D("./src/demux/transmuxer-interface.ts"),c=D("./src/types/transmuxer.ts"),s=D("./src/controller/fragment-finders.ts"),d=D("./src/utils/discontinuities.ts"),i=D("./src/errors.ts"),l=D("./src/utils/logger.ts");function r(){return r=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(L[_]=E[_])}return L},r.apply(this,arguments)}function o(L,A){L.prototype=Object.create(A.prototype),L.prototype.constructor=L,w(L,A)}function w(L,A){return w=Object.setPrototypeOf||function(_,m){return _.__proto__=m,_},w(L,A)}var T=100,x=function(L){o(A,L);function A(_,m){var f;return f=L.call(this,_,m,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var E=A.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var m=this.hls;m.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.on(O.Events.ERROR,this.onError,this),m.on(O.Events.BUFFER_RESET,this.onBufferReset,this),m.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var m=this.hls;m.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),m.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),m.off(O.Events.ERROR,this.onError,this),m.off(O.Events.BUFFER_RESET,this.onBufferReset,this),m.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),m.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onInitPtsFound=function(m,f){var S=f.frag,b=f.id,y=f.initPTS;if(b==="main"){var M=S.cc;this.initPTS[S.cc]=y,this.log("InitPTS for cc: "+M+" found from main: "+y),this.videoTrackCC=M,this.state===U.State.WAITING_INIT_PTS&&this.tick()}},E.startLoad=function(m){if(!this.levels){this.startPosition=m,this.state=U.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,f>0&&m===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()},E.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var m,f=this.levels,S=this.trackId,b=f==null||((m=f[S])===null||m===void 0)?void 0:m.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var y,M=performance.now(),B=this.retryDate;(!B||M>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var H=R.frag,N=R.part,C=R.cache,K=R.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var Z=C.flush(),oe={frag:H,part:N,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(oe),K&&L.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)l.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),xe=G.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),be=Object(s.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,H);be<0&&(l.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},E.clearWaitingFragment=function(){var m=this.waitingData;m&&(this.fragmentTracker.removeFragment(m.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},E.onTickEnd=function(){var m=this.media;if(!m||!m.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:m,S=f.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=m.currentTime},E.doTickIdle=function(){var m,f,S=this.hls,b=this.levels,y=this.media,M=this.trackId,B=S.config;if(!b||!b[M])return;if(!y&&(this.startFragRequested||!B.startFragPrefetch))return;var R=b[M],H=R.details;if(!H||H.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(H)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(N===null)return;var C=N.len,K=this.getMaxBufferLength(),Z=this.audioSwitch;if(C>=K&&!Z)return;if(!Z&&this._streamEnded(N,H)){S.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var oe=H.fragments,fe=oe[0].start,xe=N.end;if(Z){var be=this.getLoadPosition();xe=be,H.PTSKnown&&be<fe&&((N.end>fe||N.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=fe+.05))}var Te=this.getNextFragment(xe,H);if(!Te){this.bufferFlushed=!0;return}((m=Te.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((f=Te.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Te,H):this.loadFragment(Te,H,xe)},E.getMaxBufferLength=function(){var m=L.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return f===null?m:Math.max(m,f.len)},E.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(m,f){var S=f.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(b){return new n.Level(b)})},E.onAudioTrackSwitching=function(m,f){var S=!!f.url;this.trackId=f.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(T):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(m,f){this.mainDetails=f.details},E.onAudioTrackLoaded=function(m,f){var S,b=this.levels,y=f.details,M=f.id;if(!b){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=b[M],R=0;if(y.live||(S=B.details)!==null&&S!==void 0&&S.live){var H=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!H)return;!B.details&&y.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(y,H),R=y.fragments[0].start):R=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,R),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=U.State.IDLE),this.tick()},E._handleFragmentLoadProgress=function(m){var f,S=m.frag,b=m.part,y=m.payload,M=this.config,B=this.trackId,R=this.levels;if(!R){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var H=R[B];console.assert(H,"Audio track is defined on fragment load progress");var N=H.details;console.assert(N,"Audio track details are defined on fragment load progress");var C=M.defaultAudioCodec||H.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new h.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[S.cc],oe=(f=S.initSegment)===null||f===void 0?void 0:f.data;if(Z!==void 0){var fe=!1,xe=b?b.index:-1,be=xe!==-1,Te=new c.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,y.byteLength,xe,be);K.push(y,oe,C,"",S,b,N.totalduration,fe,Te,Z)}else{l.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+N.startSN+" ,"+N.endSN+"],track "+B);var Ce=this.waitingData=this.waitingData||{frag:S,part:b,cache:new p.default,complete:!1},Le=Ce.cache;Le.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},E._handleFragmentLoadComplete=function(m){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,m)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(m,f){var S=f.tracks.audio;S&&(this.mediaBuffer=S.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},E.onFragBuffered=function(m,f){var S=f.frag,b=f.part;if(S.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(b?" p: "+b.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,b)},E.onError=function(m,f){switch(f.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,f);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=f.fatal?U.State.ERROR:U.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var S=!0,b=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);b&&b.len>.5&&(S=!this.reduceMaxBufferLength(b.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},E.onBufferFlushed=function(m,f){var S=f.type;S===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(m){var f,S="audio",b=this.hls,y=m.remuxResult,M=m.chunkMeta,B=this.getCurrentContext(M);if(!B){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var R=B.frag,H=B.part,N=y.audio,C=y.text,K=y.id3,Z=y.initSegment;if(this.fragContextChanged(R))return;if(this.state=U.State.PARSING,this.audioSwitch&&N&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,R,M),b.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:S,tracks:Z.tracks})),N){var oe=N.startPTS,fe=N.endPTS,xe=N.startDTS,be=N.endDTS;H&&(H.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:fe,startDTS:xe,endDTS:be}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,oe,fe,xe,be),this.bufferFragmentData(N,R,H,M)}if(K!=null&&(f=K.samples)!==null&&f!==void 0&&f.length){var Te=r({frag:R,id:S},K);b.trigger(O.Events.FRAG_PARSING_METADATA,Te)}if(C){var Ce=r({frag:R,id:S},C);b.trigger(O.Events.FRAG_PARSING_USERDATA,Ce)}},E._bufferInitSegment=function(m,f,S){if(this.state!==U.State.PARSING)return;m.video&&delete m.video;var b=m.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(O.Events.BUFFER_CODECS,m);var y=b.initSegment;if(y!=null&&y.byteLength){var M={type:"audio",frag:f,part:null,chunkMeta:S,parent:f.type,data:y};this.hls.trigger(O.Events.BUFFER_APPENDING,M)}this.tick()},E.loadFragment=function(m,f,S){var b=this.fragmentTracker.getState(m);this.fragCurrent=m,(this.audioSwitch||b===W.FragmentState.NOT_LOADED||b===W.FragmentState.PARTIAL)&&(m.sn==="initSegment"?this._loadInitSegment(m):f.live&&!Object(V.isFiniteNumber)(this.initPTS[m.cc])?(this.log("Waiting for video PTS in continuity counter "+m.cc+" of live stream before loading audio fragment "+m.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,m,f,S)))},E.completeAudioSwitch=function(){var m=this.hls,f=this.media,S=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,m.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:S})},A}(U.default);z.default=x},"./src/controller/audio-track-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),U=D("./src/errors.ts"),O=D("./src/controller/base-playlist-controller.ts"),G=D("./src/types/loader.ts");function W(h,c){for(var s=0;s<c.length;s++){var d=c[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}function n(h,c,s){return c&&W(h.prototype,c),s&&W(h,s),h}function I(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,g(h,c)}function g(h,c){return g=Object.setPrototypeOf||function(d,i){return d.__proto__=i,d},g(h,c)}var p=function(h){I(c,h);function c(d){var i;return i=h.call(this,d,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=c.prototype;return s.registerListeners=function(){var i=this.hls;i.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(V.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(V.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(V.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(i,l){this.tracks=l.audioTracks||[]},s.onAudioTrackLoaded=function(i,l){var r=l.id,o=l.details,w=this.tracksInGroup[r];if(!w){this.warn("Invalid audio track id "+r);return}var T=w.details;w.details=l.details,this.log("audioTrack "+r+" loaded ["+o.startSN+"-"+o.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,l,T))},s.onLevelLoading=function(i,l){this.switchLevel(l.level)},s.onLevelSwitching=function(i,l){this.switchLevel(l.level)},s.switchLevel=function(i){var l=this.hls.levels[i];if(!(l!=null&&l.audioGroupIds))return;var r=l.audioGroupIds[l.urlId];if(this.groupId!==r){this.groupId=r;var o=this.tracks.filter(function(T){return!r||T.groupId===r});this.selectDefaultTrack&&!o.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var w={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(V.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},s.onError=function(i,l){if(h.prototype.onError.call(this,i,l),l.fatal||!l.context)return;l.context.type===G.PlaylistContextType.AUDIO_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},s.setAudioTrack=function(i){var l=this.tracksInGroup;if(i<0||i>=l.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=l[this.trackId];this.log("Now switching to audio-track index "+i);var o=l[i],w=o.id,T=o.groupId,x=T===void 0?"":T,L=o.name,A=o.type,E=o.url;if(this.trackId=i,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:x,name:L,type:A,url:E}),o.details&&!o.details.live)return;var _=this.switchParams(o.url,r==null?void 0:r.details);this.loadPlaylist(_)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var l=this.trackName,r=this.findTrackId(l)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var l=this.tracksInGroup,r=0;r<l.length;r++){var o=l[r];if((!this.selectDefaultTrack||o.default)&&(!i||i===o.name))return o.id}return-1},s.loadPlaylist=function(i){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var r=l.id,o=l.groupId,w=l.url;if(i)try{w=i.addDirectives(w)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(V.Events.AUDIO_TRACK_LOADING,{url:w,id:r,groupId:o,deliveryDirectives:i||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),c}(O.default);z.default=p},"./src/controller/base-playlist-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/polyfills/number.ts"),U=D("./src/types/level.ts"),O=D("./src/controller/level-helper.ts"),G=D("./src/utils/logger.ts"),W=D("./src/errors.ts"),n=function(){function I(p,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,h+":"),this.warn=G.logger.warn.bind(G.logger,h+":"),this.hls=p}var g=I.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(h,c){c.fatal&&c.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(h,c){var s=c==null?void 0:c.renditionReports;if(s)for(var d=0;d<s.length;d++){var i=s[d],l=""+i.URI;if(l===h.substr(-l.length)){var r=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var w=Math.min(c.age-c.partTarget,c.targetduration);o!==void 0&&w>c.partTarget&&(o+=1)}if(Object(V.isFiniteNumber)(r))return new U.HlsUrlParameters(r,Object(V.isFiniteNumber)(o)?o:void 0,U.HlsSkip.No)}}},g.loadPlaylist=function(h){},g.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},g.playlistLoaded=function(h,c,s){var d=this,i=c.details,l=c.stats,r=l.loading.end?Math.max(0,self.performance.now()-l.loading.end):0;if(i.advancedDateTime=Date.now()-r,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+h+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(O.mergeDetails)(s,i),!this.canLoad||!i.live)return;var o,w=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,L=i.lastPartSn,A=i.endSN,E=i.lastPartIndex,_=E!==-1,m=L===A,f=x?0:E;_?(w=m?A+1:L,T=m?f:E+1):w=A+1;var S=i.age,b=S+i.ageHeader,y=Math.min(b-i.partTarget,i.targetduration*1.5);if(y>0){if(s&&y>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var M=Math.floor(y/i.targetduration);if(w+=M,T!==void 0){var B=Math.round(y%i.targetduration/i.partTarget);T+=B}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+y+" skip sn "+M+" to part "+T)}i.tuneInGoal=y}if(o=this.getDeliveryDirectives(i,c.deliveryDirectives,w,T),x||!m){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,c.deliveryDirectives,w,T);var R=Object(O.computeReloadInterval)(i,l);w!==void 0&&i.canBlockReload&&(R-=i.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(o)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(h,c,s,d){var i=Object(U.getSkipValue)(h,s);return c!=null&&c.skip&&h.deltaUpdateFailed&&(s=c.msn,d=c.part,i=U.HlsSkip.No),new U.HlsUrlParameters(s,d,i)},g.retryLoadingOrFail=function(h){var c=this,s=this.hls.config,d=this.retryCount<s.levelLoadingMaxRetry;if(d){var i;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(i=h.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return d},I}()},"./src/controller/base-stream-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"State",function(){return A}),D.d(z,"default",function(){return E});var V=D("./src/polyfills/number.ts"),U=D("./src/task-loop.ts"),O=D("./src/controller/fragment-tracker.ts"),G=D("./src/utils/buffer-helper.ts"),W=D("./src/utils/logger.ts"),n=D("./src/events.ts"),I=D("./src/errors.ts"),g=D("./src/types/transmuxer.ts"),p=D("./src/utils/mp4-tools.ts"),h=D("./src/utils/discontinuities.ts"),c=D("./src/controller/fragment-finders.ts"),s=D("./src/controller/level-helper.ts"),d=D("./src/loader/fragment-loader.ts"),i=D("./src/crypt/decrypter.ts"),l=D("./src/utils/time-ranges.ts"),r=D("./src/types/loader.ts");function o(_,m){for(var f=0;f<m.length;f++){var S=m[f];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}function w(_,m,f){return m&&o(_.prototype,m),f&&o(_,f),_}function T(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function x(_,m){_.prototype=Object.create(m.prototype),_.prototype.constructor=_,L(_,m)}function L(_,m){return L=Object.setPrototypeOf||function(S,b){return S.__proto__=b,S},L(_,m)}var A={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"},E=function(_){x(m,_);function m(S,b,y){var M;return M=_.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=A.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=y,M.log=W.logger.log.bind(W.logger,y+":"),M.warn=W.logger.warn.bind(W.logger,y+":"),M.hls=S,M.fragmentLoader=new d.default(S.config),M.fragmentTracker=b,M.config=S.config,M.decrypter=new i.default(S,S.config),S.on(n.Events.KEY_LOADED,M.onKeyLoaded,T(M)),M}var f=m.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(b){},f.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=A.STOPPED},f._streamEnded=function(b,y){var M=this.fragCurrent,B=this.fragmentTracker;if(!y.live&&M&&M.sn===y.endSN&&!b.nextStart){var R=B.getState(M);return R===O.FragmentState.PARTIAL||R===O.FragmentState.OK}return!1},f.onMediaAttached=function(b,y){var M=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(B.startPosition)},f.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()},f.onMediaSeeking=function(){var b=this.config,y=this.fragCurrent,M=this.media,B=this.mediaBuffer,R=this.state,H=M?M.currentTime:0,N=G.BufferHelper.bufferInfo(B||M,H,b.maxBufferHole);if(this.log("media seeking to "+(Object(V.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+R),R===A.ENDED)this.resetLoadingState();else if(y&&!N.len){var C=b.maxFragLookUpTolerance,K=y.start-C,Z=y.start+y.duration+C,oe=H>Z;(H<K||oe)&&(oe&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=H),!this.loadedmetadata&&!N.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(b,y){if(this.state!==A.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var M=this.levels[y.frag.level].details;M&&this.loadFragment(y.frag,M,y.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=A.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,_.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(b,y){this.log("Loading key for "+b.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=A.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(n.Events.KEY_LOADING,{frag:b})},f.loadFragment=function(b,y,M){this._loadFragForPlayback(b,y,M)},f._loadFragForPlayback=function(b,y,M){var B=this,R=function(N){if(B.fragContextChanged(b)){B.warn("Fragment "+b.sn+(N.part?" p: "+N.part.index:"")+" of level "+b.level+" was dropped during download."),B.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,B._handleFragmentLoadProgress(N)};this._doFragLoad(b,y,M,R).then(function(H){if(!H)return;B.fragLoadError=0;var N=B.state;if(B.fragContextChanged(b)){(N===A.FRAG_LOADING||N===A.BACKTRACKING||!B.fragCurrent&&N===A.PARSING)&&(B.fragmentTracker.removeFragment(b),B.state=A.IDLE);return}if("payload"in H&&(B.log("Loaded fragment "+b.sn+" of level "+b.level),B.hls.trigger(n.Events.FRAG_LOADED,H),B.state===A.BACKTRACKING)){B.fragmentTracker.backtrack(b,H),B.resetFragmentLoading(b);return}B._handleFragmentLoadComplete(H)}).catch(function(H){B.warn(H),B.resetFragmentLoading(b)})},f.flushMainBuffer=function(b,y,M){if(M===void 0&&(M=null),!(b-y))return;var B={startOffset:b,endOffset:y,type:M};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,B)},f._loadInitSegment=function(b){var y=this;this._doFragLoad(b).then(function(M){if(!M||y.fragContextChanged(b)||!y.levels)throw new Error("init load aborted");return M}).then(function(M){var B=y.hls,R=M.payload,H=b.decryptdata;if(R&&R.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var N=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(R),H.key.buffer,H.iv.buffer).then(function(C){var K=self.performance.now();return B.trigger(n.Events.FRAG_DECRYPTED,{frag:b,payload:C,stats:{tstart:N,tdecrypt:K}}),M.payload=C,M})}return M}).then(function(M){var B=y.fragCurrent,R=y.hls,H=y.levels;if(!H)throw new Error("init load aborted, missing levels");var N=H[b.level].details;console.assert(N,"Level details are defined when init segment is loaded");var C=b.stats;y.state=A.IDLE,y.fragLoadError=0,b.data=new Uint8Array(M.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),M.frag===B&&R.trigger(n.Events.FRAG_BUFFERED,{stats:C,frag:B,part:null,id:b.type}),y.tick()}).catch(function(M){y.warn(M),y.resetFragmentLoading(b)})},f.fragContextChanged=function(b){var y=this.fragCurrent;return!b||!y||b.level!==y.level||b.sn!==y.sn||b.urlId!==y.urlId},f.fragBufferedComplete=function(b,y){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+l.default.toString(G.BufferHelper.getBuffered(M))),this.state=A.IDLE,this.tick()},f._handleFragmentLoadComplete=function(b){var y=this.transmuxer;if(!y)return;var M=b.frag,B=b.part,R=b.partsLoaded,H=!R||R.length===0||R.some(function(C){return!C}),N=new g.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,B?B.index:-1,!H);y.flush(N)},f._handleFragmentLoadProgress=function(b){},f._doFragLoad=function(b,y,M,B){var R=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(b.start,M||0),this.config.lowLatencyMode&&y){var H=y.partList;if(H&&B){M>b.end&&y.fragmentHint&&(b=y.fragmentHint);var N=this.getNextPart(H,b,M);if(N>-1){var C=H[N];return this.log("Loading part sn: "+b.sn+" p: "+C.index+" cc: "+b.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+N+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,part:H[N],targetBufferTime:M}),this.doFragPartsLoad(b,H,N,B).catch(function(K){return R.handleFragLoadError(K)})}else if(!b.url||this.loadedEndOfParts(H,M))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(M.toFixed(3))),Object(V.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=A.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:b,targetBufferTime:M}),this.fragmentLoader.load(b,B).catch(function(K){return R.handleFragLoadError(K)})},f.doFragPartsLoad=function(b,y,M,B){var R=this;return new Promise(function(H,N){var C=[],K=function Z(oe){var fe=y[oe];R.fragmentLoader.loadPart(b,fe,B).then(function(xe){C[fe.index]=xe;var be=xe.part;R.hls.trigger(n.Events.FRAG_LOADED,xe);var Te=y[oe+1];if(Te&&Te.fragment===b)Z(oe+1);else return H({frag:b,part:be,partsLoaded:C})}).catch(N)};K(M)})},f.handleFragLoadError=function(b){var y=b.data;return y&&y.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(n.Events.ERROR,y),null},f._handleTransmuxerFlush=function(b){var y=this.getCurrentContext(b);if(!y||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var M=y.frag,B=y.part,R=y.level,H=self.performance.now();M.stats.parsing.end=H,B&&(B.stats.parsing.end=H),this.updateLevelTiming(M,B,R,b.partial)},f.getCurrentContext=function(b){var y=this.levels,M=b.level,B=b.sn,R=b.part;if(!y||!y[M])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+M+". The current chunk will not be buffered."),null;var H=y[M],N=R>-1?Object(s.getPartWith)(H,B,R):null,C=N?N.fragment:Object(s.getFragmentWithSN)(H,B,this.fragCurrent);return C?{frag:C,part:N,level:H}:null},f.bufferFragmentData=function(b,y,M,B){if(!b||this.state!==A.PARSING)return;var R=b.data1,H=b.data2,N=R;if(R&&H&&(N=Object(p.appendUint8Array)(R,H)),!N||!N.length)return;var C={type:b.type,frag:y,part:M,chunkMeta:B,parent:y.type,data:N};this.hls.trigger(n.Events.BUFFER_APPENDING,C),b.dropped&&b.independent&&!M&&this.flushBufferGap(y)},f.flushBufferGap=function(b){var y=this.media;if(!y)return;if(!G.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,b.start);return}var M=y.currentTime,B=G.BufferHelper.bufferInfo(y,M,0),R=b.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),N=Math.max(Math.min(b.start-H,B.end-H),M+H);b.start-N>H&&this.flushMainBuffer(N,b.start)},f.getFwdBufferInfo=function(b,y){var M=this.config,B=this.getLoadPosition();if(!Object(V.isFiniteNumber)(B))return null;var R=G.BufferHelper.bufferInfo(b,B,M.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(B,y);if(H&&R.nextStart<H.end)return G.BufferHelper.bufferInfo(b,B,Math.max(R.nextStart,M.maxBufferHole))}return R},f.getMaxBufferLength=function(b){var y=this.config,M;return b?M=Math.max(8*y.maxBufferSize/b,y.maxBufferLength):M=y.maxBufferLength,Math.min(M,y.maxMaxBufferLength)},f.reduceMaxBufferLength=function(b){var y=this.config,M=b||y.maxBufferLength;return y.maxMaxBufferLength>=M?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(b,y){var M,B,R=y.fragments,H=R.length;if(!H)return null;var N=this.config,C=R[0].start,K;if(y.live){var Z=N.initialLiveManifestSize;if(H<Z)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+Z+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(y,R),this.startPosition=K?this.hls.liveSyncPosition||K.start:b)}else b<=C&&(K=R[0]);if(!K){var oe=N.lowLatencyMode?y.partEnd:y.fragmentEnd;K=this.getFragmentAtPosition(b,oe,y)}return(M=K)!==null&&M!==void 0&&M.initSegment&&!((B=K)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},f.getNextPart=function(b,y,M){for(var B=-1,R=!1,H=!0,N=0,C=b.length;N<C;N++){var K=b[N];if(H=H&&!K.independent,B>-1&&M<K.start)break;var Z=K.loaded;!Z&&(R||K.independent||H)&&K.fragment===y&&(B=N),R=Z}return B},f.loadedEndOfParts=function(b,y){var M=b[b.length-1];return M&&y>M.start&&M.loaded},f.getInitialLiveFragment=function(b,y){var M=this.fragPrevious,B=null;if(M){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),B=Object(c.findFragmentByPDT)(y,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var R=M.sn+1;if(R>=b.startSN&&R<=b.endSN){var H=y[R-b.startSN];M.cc===H.cc&&(B=H,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(c.findFragWithCC)(y,M.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var N=this.hls.liveSyncPosition;N!==null&&(B=this.getFragmentAtPosition(N,this.bitrateTest?b.fragmentEnd:b.edge,b))}return B},f.getFragmentAtPosition=function(b,y,M){var B=this.config,R=this.fragPrevious,H=M.fragments,N=M.endSN,C=M.fragmentHint,K=B.maxFragLookUpTolerance,Z=!!(B.lowLatencyMode&&M.partList&&C);Z&&C&&!this.bitrateTest&&(H=H.concat(C),N=C.sn);var oe;if(b<y){var fe=b>y-K?0:K;oe=Object(c.findFragmentByPTS)(R,H,b,fe)}else oe=H[H.length-1];if(oe){var xe=oe.sn-M.startSN,be=R&&oe.level===R.level,Te=H[xe+1],Ce=this.fragmentTracker.getState(oe);if(Ce===O.FragmentState.BACKTRACKED){oe=null;for(var Le=xe;H[Le]&&this.fragmentTracker.getState(H[Le])===O.FragmentState.BACKTRACKED;)R?oe=H[Le--]:oe=H[--Le];oe||(oe=Te)}else R&&oe.sn===R.sn&&!Z&&(be&&(oe.sn<N&&this.fragmentTracker.getState(Te)!==O.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Te.sn),oe=Te):oe=null))}return oe},f.synchronizeToLiveEdge=function(b){var y=this.config,M=this.media;if(!M)return;var B=this.hls.liveSyncPosition,R=M.currentTime,H=b.fragments[0].start,N=b.edge,C=R>=H-y.maxFragLookUpTolerance&&R<=N;if(B!==null&&M.duration>B&&(R<B||!C)){var K=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*b.targetduration;(!C&&M.readyState<4||R<N-K)&&(this.loadedmetadata||(this.nextLoadPosition=B),M.readyState&&(this.warn("Playback: "+R.toFixed(3)+" is located too far from the end of live sliding playlist: "+N+", reset currentTime to : "+B.toFixed(3)),M.currentTime=B))}},f.alignPlaylists=function(b,y){var M=this.levels,B=this.levelLastLoaded,R=this.fragPrevious,H=B!==null?M[B]:null,N=b.fragments.length;if(!N)return this.warn("No fragments in live playlist"),0;var C=b.fragments[0].start,K=!y,Z=b.alignedSliding&&Object(V.isFiniteNumber)(C);if(K||!Z&&!C){Object(h.alignStream)(R,H,b);var oe=b.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+b.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+N),oe}return C},f.waitForCdnTuneIn=function(b){var y=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*y)},f.setStartPosition=function(b,y){var M=this.startPosition;if(M<y&&(M=-1),M===-1||this.lastCurrentTime===-1){var B=b.startTimeOffset;Object(V.isFiniteNumber)(B)?(M=y+B,B<0&&(M+=b.totalduration),M=Math.min(Math.max(y,M),y+b.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+M),this.startPosition=M):b.live?M=this.hls.liveSyncPosition||y:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},f.getLoadPosition=function(){var b=this.media,y=0;return this.loadedmetadata&&b?y=b.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},f.handleFragLoadAborted=function(b,y){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(y?" part"+y.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},f.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=A.IDLE)},f.onFragmentOrKeyLoadError=function(b,y){if(y.fatal)return;var M=y.frag;if(!M||M.type!==b)return;var B=this.fragCurrent;console.assert(B&&M.sn===B.sn&&M.level===B.level&&M.urlId===B.urlId,"Frag load error must match current frag to retry");var R=this.config;if(this.fragLoadError+1<=R.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+b+" "+M.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(b===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(W.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},f.afterBufferFlushed=function(b,y,M){if(!b)return;var B=G.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(y,B,M),this.state===A.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},f.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[b].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(b,y,M,B){var R=this,H=M.details;console.assert(!!H,"level.details must be defined");var N=Object.keys(b.elementaryStreams).reduce(function(C,K){var Z=b.elementaryStreams[K];if(Z){var oe=Z.endPTS-Z.startPTS;if(oe<=0)return R.warn("Could not parse fragment "+b.sn+" "+K+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),R.resetTransmuxer(),C||!1;var fe=B?0:Object(s.updateFragPTSDTS)(H,b,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return R.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:H,level:M,drift:fe,type:K,frag:b,start:Z.startPTS,end:Z.endPTS}),!0}return C},!1);N?(this.state=A.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:b,part:y})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(m,[{key:"state",get:function(){return this._state},set:function(b){var y=this._state;y!==b&&(this._state=b,this.log(y+"->"+b))}}]),m}(U.default)},"./src/controller/buffer-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./src/polyfills/number.ts"),U=D("./src/events.ts"),O=D("./src/utils/logger.ts"),G=D("./src/errors.ts"),W=D("./src/utils/buffer-helper.ts"),n=D("./src/utils/mediasource-helper.ts"),I=D("./src/loader/fragment.ts"),g=D("./src/controller/buffer-operation-queue.ts"),p=Object(n.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function s(i){var l=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 r=l.hls,o=l.media,w=l.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),o&&(l.updateMediaElementDuration(),r.trigger(U.Events.MEDIA_ATTACHED,{media:o})),w&&w.removeEventListener("sourceopen",l._onMediaSourceOpen),l.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var d=s.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var l=this.hls;l.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(U.Events.BUFFER_RESET,this.onBufferReset,this),l.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.on(U.Events.BUFFER_EOS,this.onBufferEos,this),l.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.on(U.Events.FRAG_PARSED,this.onFragParsed,this),l.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var l=this.hls;l.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(U.Events.BUFFER_RESET,this.onBufferReset,this),l.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),l.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),l.off(U.Events.BUFFER_EOS,this.onBufferEos,this),l.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),l.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),l.off(U.Events.FRAG_PARSED,this.onFragParsed,this),l.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(l,r){var o=2;(r.audio&&!r.video||!r.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(l,r){var o=this.media=r.media;if(o&&p){var w=this.mediaSource=new p;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(w),this._objectUrl=o.src}},d.onMediaDetaching=function(){var l=this.media,r=this.mediaSource,o=this._objectUrl;if(r){if(O.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(w){O.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),l&&(o&&self.URL.revokeObjectURL(o),l.src===o?(l.removeAttribute("src"),l.load()):O.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(U.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var l=this;this.getSourceBufferTypes().forEach(function(r){var o=l.sourceBuffer[r];try{o&&(l.removeBufferListeners(r),l.mediaSource&&l.mediaSource.removeSourceBuffer(o),l.sourceBuffer[r]=void 0)}catch(w){O.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",w)}}),this._initSourceBuffer()},d.onBufferCodecs=function(l,r){var o=this,w=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(T){if(w){var x=o.tracks[T];if(x&&typeof x.buffer.changeType=="function"){var L=r[T],A=L.codec,E=L.levelCodec,_=L.container,m=(x.levelCodec||x.codec).replace(h,"$1"),f=(E||A).replace(h,"$1");if(m!==f){var S=_+";codecs="+(E||A);o.appendChangeType(T,S)}}}else o.pendingTracks[T]=r[T]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(l,r){var o=this,w=this.operationQueue,T={execute:function(){var L=o.sourceBuffer[l];L&&(O.logger.log("[buffer-controller]: changing "+l+" sourceBuffer type to "+r),L.changeType(r)),w.shiftAndExecuteNext(l)},onStart:function(){},onComplete:function(){},onError:function(L){O.logger.warn("[buffer-controller]: Failed to change "+l+" SourceBuffer type",L)}};w.append(T,l)},d.onBufferAppending=function(l,r){var o=this,w=this.hls,T=this.operationQueue,x=this.tracks,L=r.data,A=r.type,E=r.frag,_=r.part,m=r.chunkMeta,f=m.buffering[A],S=self.performance.now();f.start=S;var b=E.stats.buffering,y=_?_.stats.buffering:null;b.start===0&&(b.start=S),y&&y.start===0&&(y.start=S);var M=x.audio,B=A==="audio"&&m.id===1&&(M==null?void 0:M.container)==="audio/mpeg",R={execute:function(){if(f.executeStart=self.performance.now(),B){var N=o.sourceBuffer[A];if(N){var C=E.start-N.timestampOffset;Math.abs(C)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+E.start+" (delta: "+C+") sn: "+E.sn+")"),N.timestampOffset=E.start)}}o.appendExecutor(L,A)},onStart:function(){},onComplete:function(){var N=self.performance.now();f.executeEnd=f.end=N,b.first===0&&(b.first=N),y&&y.first===0&&(y.first=N);var C=o.sourceBuffer,K={};for(var Z in C)K[Z]=W.BufferHelper.getBuffered(C[Z]);o.appendError=0,o.hls.trigger(U.Events.BUFFER_APPENDED,{type:A,frag:E,part:_,chunkMeta:m,parent:E.type,timeRanges:K})},onError:function(N){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",N);var C={type:G.ErrorTypes.MEDIA_ERROR,parent:E.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=G.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,C.details=G.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>w.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),w.trigger(U.Events.ERROR,C)}};T.append(R,A)},d.onBufferFlushing=function(l,r){var o=this,w=this.operationQueue,T=function(L){return{execute:o.removeExecutor.bind(o,L,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(U.Events.BUFFER_FLUSHED,{type:L})},onError:function(E){O.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",E)}}};r.type?w.append(T(r.type),r.type):this.getSourceBufferTypes().forEach(function(x){w.append(T(x),x)})},d.onFragParsed=function(l,r){var o=this,w=r.frag,T=r.part,x=[],L=T?T.elementaryStreams:w.elementaryStreams;L[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(L[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),L[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var A=function(){var _=self.performance.now();w.stats.buffering.end=_,T&&(T.stats.buffering.end=_);var m=T?T.stats:w.stats;o.hls.trigger(U.Events.FRAG_BUFFERED,{frag:w,part:T,stats:m,id:w.type})};x.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(A,x)},d.onFragChanged=function(l,r){this.flushBackBuffer()},d.onBufferEos=function(l,r){var o=this,w=this.getSourceBufferTypes().reduce(function(T,x){var L=o.sourceBuffer[x];return(!r.type||r.type===x)&&(L&&!L.ended&&(L.ended=!0,O.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),T&&!!(!L||L.ended)},!0);w&&this.blockBuffers(function(){var T=o.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},d.onLevelUpdated=function(l,r){var o=r.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var l=this.hls,r=this.details,o=this.media,w=this.sourceBuffer;if(!o||r===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var x=r.live&&l.config.liveBackBufferLength!==null?l.config.liveBackBufferLength:l.config.backBufferLength;if(!Object(V.isFiniteNumber)(x)||x<0)return;var L=o.currentTime,A=r.levelTargetDuration,E=Math.max(x,A),_=Math.floor(L/A)*A-E;T.forEach(function(m){var f=w[m];if(f){var S=W.BufferHelper.getBuffered(f);S.length>0&&_>S.start(0)&&(l.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),r.live&&l.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),l.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:m}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var l=this.details,r=this.hls,o=this.media,w=this.mediaSource,T=l.fragments[0].start+l.totalduration,x=o.duration,L=Object(V.isFiniteNumber)(w.duration)?w.duration:0;l.live&&r.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(l)):(T>L&&T>x||!Object(V.isFiniteNumber)(x))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),w.duration=T)},d.updateSeekableRange=function(l){var r=this.mediaSource,o=l.fragments,w=o.length;if(w&&l.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var T=Math.max(0,o[0].start),x=Math.max(T,T+l.totalduration);r.setLiveSeekableRange(T,x)}},d.checkPendingTracks=function(){var l=this.bufferCodecEventsExpected,r=this.operationQueue,o=this.pendingTracks,w=Object.keys(o).length;if(w&&!l||w===2){this.createSourceBuffers(o),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(x){r.executeNext(x)})}},d.createSourceBuffers=function(l){var r=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var T in l)if(!r[T]){var x=l[T];if(!x)throw Error("source buffer exists for track "+T+", however track does not");var L=x.levelCodec||x.codec,A=x.container+";codecs="+L;O.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var E=r[T]=o.addSourceBuffer(A),_=T;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[T]={buffer:E,codec:L,container:x.container,levelCodec:x.levelCodec,id:x.id},w++}catch(m){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+m.message),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:m,mimeType:A})}}w&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(l){var r=this.operationQueue,o=r.current(l);o.onStart()},d._onSBUpdateEnd=function(l){var r=this.operationQueue,o=r.current(l);o.onComplete(),r.shiftAndExecuteNext(l)},d._onSBUpdateError=function(l,r){O.logger.error("[buffer-controller]: "+l+" SourceBuffer error",r),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(l);o&&o.onError(r)},d.removeExecutor=function(l,r,o){var w=this.media,T=this.mediaSource,x=this.operationQueue,L=this.sourceBuffer,A=L[l];if(!w||!T||!A){O.logger.warn("[buffer-controller]: Attempting to remove from the "+l+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(l);return}var E=Object(V.isFiniteNumber)(w.duration)?w.duration:Infinity,_=Object(V.isFiniteNumber)(T.duration)?T.duration:Infinity,m=Math.max(0,r),f=Math.min(o,E,_);f>m?(O.logger.log("[buffer-controller]: Removing ["+m+","+f+"] from the "+l+" SourceBuffer"),console.assert(!A.updating,l+" sourceBuffer must not be updating"),A.remove(m,f)):x.shiftAndExecuteNext(l)},d.appendExecutor=function(l,r){var o=this.operationQueue,w=this.sourceBuffer,T=w[r];if(!T){O.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(r);return}T.ended=!1,console.assert(!T.updating,r+" sourceBuffer must not be updating"),T.appendBuffer(l)},d.blockBuffers=function(l,r){var o=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(l);return}var w=this.operationQueue,T=r.map(function(x){return w.appendBlocker(x)});Promise.all(T).then(function(){l(),r.forEach(function(x){var L=o.sourceBuffer[x];(!L||!L.updating)&&w.shiftAndExecuteNext(x)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(l,r,o){var w=this.sourceBuffer[l];if(!w)return;var T=o.bind(this,l);this.listeners[l].push({event:r,listener:T}),w.addEventListener(r,T)},d.removeBufferListeners=function(l){var r=this.sourceBuffer[l];if(!r)return;this.listeners[l].forEach(function(o){r.removeEventListener(o.event,o.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return U});var V=D("./src/utils/logger.ts"),U=function(){function O(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=O.prototype;return G.append=function(n,I){var g=this.queues[I];g.push(n),g.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(n,I){var g=this.queues[I];g.unshift(n),this.executeNext(I)},G.appendBlocker=function(n){var I,g=new Promise(function(h){I=h}),p={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,n),g},G.executeNext=function(n){var I=this.buffers,g=this.queues,p=I[n],h=g[n];if(h.length){var c=h[0];try{c.execute()}catch(s){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(s),(!p||!p.updating)&&(h.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},O}()},"./src/controller/cap-level-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts");function U(W,n){for(var I=0;I<n.length;I++){var g=n[I];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(W,g.key,g)}}function O(W,n,I){return n&&U(W.prototype,n),I&&U(W,I),W}var G=function(){function W(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=W.prototype;return n.setStreamController=function(g){this.streamController=g},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 g=this.hls;g.on(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var g=this.hls;g.off(V.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(V.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(g,p){W.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},n.onMediaAttaching=function(g,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},n.onManifestParsed=function(g,p){var h=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onBufferCodecs=function(g,p){var h=this.hls;h.config.capLevelToPlayerSize&&p.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(g.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},n.getMaxLevel=function(g){var p=this,h=this.hls.levels;if(!h.length)return-1;var c=h.filter(function(s,d){return W.isLevelAllowed(d,p.restrictedLevels)&&d<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(c,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 g=this.media,p={width:0,height:0};if(g){var h=g.getBoundingClientRect();p.width=h.width,p.height=h.height,!p.width&&!p.height&&(p.width=h.right-h.left||g.width||0,p.height=h.bottom-h.top||g.height||0)}return this.clientRect=p,p},W.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,p,h){if(!g||!g.length)return-1;for(var c=function(r,o){return o?r.width!==o.width||r.height!==o.height:!0},s=g.length-1,d=0;d<g.length;d+=1){var i=g[d];if((i.width>=p||i.height>=h)&&c(i,g[d+1])){s=d;break}}return s},O(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),W}();z.default=G},"./src/controller/cmcd-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./src/events.ts"),U=D("./src/types/cmcd.ts"),O=D("./src/utils/buffer-helper.ts"),G=D("./src/utils/logger.ts");function W(s,d){for(var i=0;i<d.length;i++){var l=d[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(s,l.key,l)}}function n(s,d,i){return d&&W(s.prototype,d),i&&W(s,i),s}function I(s,d){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=g(s))||d&&s&&typeof s.length=="number"){i&&(s=i);var l=0;return function(){return l>=s.length?{done:!0}:{done:!1,value:s[l++]}}}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 g(s,d){if(!s)return;if(typeof s=="string")return p(s,d);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return p(s,d)}function p(s,d){(d==null||d>s.length)&&(d=s.length);for(var i=0,l=new Array(d);i<d;i++)l[i]=s[i];return l}function h(){return h=Object.assign||function(s){for(var d=1;d<arguments.length;d++){var i=arguments[d];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(s[l]=i[l])}return s},h.apply(this,arguments)}var c=function(){function s(i){var l=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(){l.initialized&&(l.starved=!0),l.buffering=!0},this.onPlaying=function(){l.initialized||(l.initialized=!0),l.buffering=!1},this.applyPlaylistData=function(w){try{l.apply(w,{ot:U.CMCDObjectType.MANIFEST,su:!l.initialized})}catch(T){G.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(w){try{var T=w.frag,x=l.hls.levels[T.level],L=l.getObjectType(T),A={d:T.duration*1e3,ot:L};(L===U.CMCDObjectType.VIDEO||L===U.CMCDObjectType.AUDIO||L==U.CMCDObjectType.MUXED)&&(A.br=x.bitrate/1e3,A.tb=l.getTopBandwidth(L),A.bl=l.getBufferLength(L)),l.apply(w,A)}catch(E){G.logger.warn("Could not generate segment CMCD data.",E)}},this.hls=i;var r=this.config=i.config,o=r.cmcd;o!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||s.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var d=s.prototype;return d.registerListeners=function(){var l=this.hls;l.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.on(V.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var l=this.hls;l.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),l.off(V.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(l,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(l,r){var o,w;this.audioBuffer=(o=r.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(w=r.tracks.video)===null||w===void 0?void 0:w.buffer},d.createData=function(){var l;return{v:U.CMCDVersion,sf:U.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(l=this.media)===null||l===void 0?void 0:l.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(l,r){r===void 0&&(r={}),h(r,this.createData());var o=r.ot===U.CMCDObjectType.INIT||r.ot===U.CMCDObjectType.VIDEO||r.ot===U.CMCDObjectType.MUXED;if(this.starved&&o&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var w=s.toHeaders(r);if(!Object.keys(w).length)return;l.headers||(l.headers={}),h(l.headers,w)}else{var T=s.toQuery(r);if(!T)return;l.url=s.appendQueryToUri(l.url,T)}},d.getObjectType=function(l){var r=l.type;return r==="subtitle"?U.CMCDObjectType.TIMED_TEXT:l.sn==="initSegment"?U.CMCDObjectType.INIT:r==="audio"?U.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?U.CMCDObjectType.VIDEO:U.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(l){for(var r=0,o=l===U.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=I(o),T;!(T=w()).done;){var x=T.value;x.bitrate>r&&(r=x.bitrate)}return r>0?r:NaN},d.getBufferLength=function(l){var r=this.hls.media,o=l===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!r)return NaN;var w=O.BufferHelper.bufferInfo(o,r.currentTime,this.config.maxBufferHole);return w.len*1e3},d.createPlaylistLoader=function(){var l=this.config.pLoader,r=this.applyPlaylistData,o=l||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new o(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(L,A,E){r(L),this.loader.load(L,A,E)},n(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},d.createFragmentLoader=function(){var l=this.config.fLoader,r=this.applyFragmentData,o=l||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new o(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(L,A,E){r(L),this.loader.load(L,A,E)},n(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},s.uuid=function(){var l=URL.createObjectURL(new Blob),r=l.toString();return URL.revokeObjectURL(l),r.substr(r.lastIndexOf("/")+1)},s.serialize=function(l){for(var r=[],o=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},w=function(B){return Math.round(B)},T=function(B){return w(B/100)*100},x=function(B){return encodeURIComponent(B)},L={br:w,d:w,bl:T,dl:T,mtp:T,nor:x,rtp:T,tb:w},A=Object.keys(l||{}).sort(),E=I(A),_;!(_=E()).done;){var m=_.value,f=l[m];if(!o(f))continue;if(m==="v"&&f===1)continue;if(m=="pr"&&f===1)continue;var S=L[m];S&&(f=S(f));var b=typeof f,y=void 0;m==="ot"||m==="sf"||m==="st"?y=m+"="+f:b==="boolean"?y=m:b==="number"?y=m+"="+f:y=m+"="+JSON.stringify(f),r.push(y)}return r.join(",")},s.toHeaders=function(l){for(var r=Object.keys(l),o={},w=["Object","Request","Session","Status"],T=[{},{},{},{}],x={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},L=0,A=r;L<A.length;L++){var E=A[L],_=x[E]!=null?x[E]:1;T[_][E]=l[E]}for(var m=0;m<T.length;m++){var f=s.serialize(T[m]);f&&(o["CMCD-"+w[m]]=f)}return o},s.toQuery=function(l){return"CMCD="+encodeURIComponent(s.serialize(l))},s.appendQueryToUri=function(l,r){if(!r)return l;var o=l.includes("?")?"&":"?";return""+l+o+r},s}()},"./src/controller/eme-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),U=D("./src/errors.ts"),O=D("./src/utils/logger.ts"),G=D("./src/utils/mediakeys-helper.ts");function W(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,s,d){return s&&W(c.prototype,s),d&&W(c,d),c}var I=3,g=function(s,d,i){var l={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(r){l.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:i.audioRobustness||""})}),d.forEach(function(r){l.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:i.videoRobustness||""})}),[l]},p=function(s,d,i,l){switch(s){case G.KeySystems.WIDEVINE:return g(d,i,l);default:throw new Error("Unknown key-system: "+s)}},h=function(){function c(d){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=d,this._config=d.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 s=c.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,l,r){var o=this,w=p(i,l,r,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(i,w);this.mediaKeysPromise=T.then(function(x){return o._onMediaKeySystemAccessObtained(i,x)}),T.catch(function(x){O.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},s._onMediaKeySystemAccessObtained=function(i,l){var r=this;O.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:l,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var w=Promise.resolve().then(function(){return l.createMediaKeys()}).then(function(T){return o.mediaKeys=T,O.logger.log('Media-keys created for key-system "'+i+'"'),r._onMediaKeysCreated(),T});return w.catch(function(T){O.logger.error("Failed to create media-keys:",T)}),w},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(l){l.mediaKeysSession||(l.mediaKeysSession=l.mediaKeys.createSession(),i._onNewMediaKeySession(l.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var l=this;O.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(r){l._onKeySessionMessage(i,r.message)},!1)},s._onKeySessionMessage=function(i,l){O.logger.log("Got EME message event, creating license request"),this._requestLicense(l,function(r){O.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),i.update(r)})},s.onMediaEncrypted=function(i){var l=this;if(O.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(w){if(!l._media)return;l._attemptSetMediaKeys(w),l._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(r).catch(r)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var l=this._mediaKeysList[0];if(!l||!l.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(l.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,l){var r=this,o=this._mediaKeysList[0];if(!o){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var w=o.mediaKeysSession;if(!w){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!l){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,w.generateRequest(i,l).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(T){O.logger.error("Error generating key-session request:",T),r.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,l,r){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,i,l,r);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,o,i),w=void 0}catch(T){O.logger.error(T)}try{o.readyState||o.open("POST",i,!0),w&&w.call(this.hls,o,i)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return o},s._onLicenseRequestReadyStageChange=function(i,l,r,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var w=i.response,T=this._licenseResponseCallback;if(T)try{w=T.call(this.hls,i,l)}catch(L){O.logger.error(L)}o(w)}else{if(O.logger.error("License Request XHR failed ("+l+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(r,o)}break}},s._generateLicenseRequestChallenge=function(i,l){switch(i.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return l}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,l){O.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(r.mediaKeySystemDomain),w=this._createLicenseXhr(o,i,l);O.logger.log("Sending license request to URL: "+o);var T=this._generateLicenseRequestChallenge(r,i);w.send(T)}catch(x){O.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,l){if(!this._emeEnabled)return;var r=l.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,l=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(l.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,l){if(!this._emeEnabled)return;var r=l.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),o=l.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,r,o)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();z.default=h},"./src/controller/fps-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),U=D("./src/utils/logger.ts"),O=function(){function G(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 W=G.prototype;return W.setStreamController=function(I){this.streamController=I},W.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(I,g){var p=this.hls.config;if(p.capLevelOnFPSDrop){var h=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(I,g,p){var h=performance.now();if(g){if(this.lastTime){var c=h-this.lastTime,s=p-this.lastDroppedFrames,d=g-this.lastDecodedFrames,i=1e3*s/c,l=this.hls;if(l.trigger(V.Events.FPS_DROP,{currentDropped:s,currentDecoded:d,totalDroppedFrames:p}),i>0&&s>l.config.fpsDroppedMonitoringThreshold*d){var r=l.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=r)&&(r=r-1,l.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:l.currentLevel}),l.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},W.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var g=I.getVideoPlaybackQuality();this.checkFPS(I,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},G}();z.default=O},"./src/controller/fragment-finders.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"findFragmentByPDT",function(){return O}),D.d(z,"findFragmentByPTS",function(){return G}),D.d(z,"fragmentWithinToleranceTest",function(){return W}),D.d(z,"pdtWithinToleranceTest",function(){return n}),D.d(z,"findFragWithCC",function(){return I});var V=D("./src/polyfills/number.ts"),U=D("./src/utils/binary-search.ts");function O(g,p,h){if(p===null||!Array.isArray(g)||!g.length||!Object(V.isFiniteNumber)(p))return null;var c=g[0].programDateTime;if(p<(c||0))return null;var s=g[g.length-1].endProgramDateTime;if(p>=(s||0))return null;h=h||0;for(var d=0;d<g.length;++d){var i=g[d];if(n(p,h,i))return i}return null}function G(g,p,h,c){h===void 0&&(h=0),c===void 0&&(c=0);var s=null;if(g?s=p[g.sn-p[0].sn+1]||null:h===0&&p[0].start===0&&(s=p[0]),s&&W(h,c,s)===0)return s;var d=U.default.search(p,W.bind(null,h,c));return d||s}function W(g,p,h){g===void 0&&(g=0),p===void 0&&(p=0);var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-c<=g?1:h.start-c>g&&h.start?-1:0}function n(g,p,h){var c=Math.min(p,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,s=h.endProgramDateTime||0;return s-c>g}function I(g,p){return U.default.search(g,function(h){return h.cc<p?1:h.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"FragmentState",function(){return O}),D.d(z,"FragmentTracker",function(){return G});var V=D("./src/events.ts"),U=D("./src/types/loader.ts"),O;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(O||(O={}));var G=function(){function I(p){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=p,this._registerListeners()}var g=I.prototype;return g._registerListeners=function(){var h=this.hls;h.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var h=this.hls;h.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(h,c){if(c===U.PlaylistLevelType.MAIN){var s=this.activeFragment,d=this.activeParts;if(!s)return null;if(d)for(var i=d.length;i--;){var l=d[i],r=l?l.end:s.appendedPTS;if(l.start<=h&&r!==void 0&&h<=r)return i>9&&(this.activeParts=d.slice(i-9)),l}else if(s.start<=h&&s.appendedPTS!==void 0&&h<=s.appendedPTS)return s}return this.getBufferedFrag(h,c)},g.getBufferedFrag=function(h,c){for(var s=this.fragments,d=Object.keys(s),i=d.length;i--;){var l=s[d[i]];if((l==null?void 0:l.body.type)===c&&l.buffered){var r=l.body;if(r.start<=h&&h<=r.end)return r}}return null},g.detectEvictedFragments=function(h,c,s){var d=this;Object.keys(this.fragments).forEach(function(i){var l=d.fragments[i];if(!l)return;if(!l.buffered){l.body.type===s&&d.removeFragment(l.body);return}var r=l.range[h];if(!r)return;r.time.some(function(o){var w=!d.isTimeBuffered(o.startPTS,o.endPTS,c);return w&&d.removeFragment(l.body),w})})},g.detectPartialFragments=function(h){var c=this,s=this.timeRanges,d=h.frag,i=h.part;if(!s||d.sn==="initSegment")return;var l=n(d),r=this.fragments[l];if(!r)return;Object.keys(s).forEach(function(o){var w=d.elementaryStreams[o];if(!w)return;var T=s[o],x=i!==null||w.partial===!0;r.range[o]=c.getBufferedTimes(d,i,x,T)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},g.fragBuffered=function(h){var c=n(h),s=this.fragments[c];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},g.getBufferedTimes=function(h,c,s,d){for(var i={time:[],partial:s},l=c?c.start:h.start,r=c?c.end:h.end,o=h.minEndPTS||r,w=h.maxStartPTS||l,T=0;T<d.length;T++){var x=d.start(T)-this.bufferPadding,L=d.end(T)+this.bufferPadding;if(w>=x&&o<=L){i.time.push({startPTS:Math.max(l,d.start(T)),endPTS:Math.min(r,d.end(T))});break}else if(l<L&&r>x)i.partial=!0,i.time.push({startPTS:Math.max(l,d.start(T)),endPTS:Math.min(r,d.end(T))});else if(r<=x)break}return i},g.getPartialFragment=function(h){var c=null,s,d,i,l=0,r=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(w){var T=o[w];if(!T)return;W(T)&&(d=T.body.start-r,i=T.body.end+r,h>=d&&h<=i&&(s=Math.min(h-d,i-h),l<=s&&(c=T.body,l=s)))}),c},g.getState=function(h){var c=n(h),s=this.fragments[c];return s?s.buffered?W(s)?O.PARTIAL:O.OK:s.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(h,c){var s=n(h),d=this.fragments[s];if(!d||d.backtrack)return null;var i=d.backtrack=c||d.loaded;return d.loaded=null,i},g.getBacktrackData=function(h){var c=n(h),s=this.fragments[c];if(s){var d,i=s.backtrack;if(i!=null&&(d=i.payload)!==null&&d!==void 0&&d.byteLength)return i;this.removeFragment(h)}return null},g.isTimeBuffered=function(h,c,s){for(var d,i,l=0;l<s.length;l++){if(d=s.start(l)-this.bufferPadding,i=s.end(l)+this.bufferPadding,h>=d&&c<=i)return!0;if(c<=d)return!1}return!1},g.onFragLoaded=function(h,c){var s=c.frag,d=c.part;if(s.sn==="initSegment"||s.bitrateTest||d)return;var i=n(s);this.fragments[i]={body:s,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(h,c){var s=this,d=c.frag,i=c.part,l=c.timeRanges;if(d.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=d,i){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(i)}else this.activeParts=null;this.timeRanges=l,Object.keys(l).forEach(function(o){var w=l[o];if(s.detectEvictedFragments(o,w),!i)for(var T=0;T<w.length;T++)d.appendedPTS=Math.max(w.end(T),d.appendedPTS||0)})},g.onFragBuffered=function(h,c){this.detectPartialFragments(c)},g.hasFragment=function(h){var c=n(h);return!!this.fragments[c]},g.removeFragmentsInRange=function(h,c,s){var d=this;Object.keys(this.fragments).forEach(function(i){var l=d.fragments[i];if(!l)return;if(l.buffered){var r=l.body;r.type===s&&r.start<c&&r.end>h&&d.removeFragment(r)}})},g.removeFragment=function(h){var c=n(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[c]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function W(I){var g,p;return I.buffered&&(((g=I.range.video)===null||g===void 0?void 0:g.partial)||((p=I.range.audio)===null||p===void 0?void 0:p.partial))}function n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"STALL_MINIMUM_DURATION_MS",function(){return W}),D.d(z,"MAX_START_GAP_JUMP",function(){return n}),D.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),D.d(z,"SKIP_BUFFER_RANGE_START",function(){return g}),D.d(z,"default",function(){return p});var V=D("./src/utils/buffer-helper.ts"),U=D("./src/errors.ts"),O=D("./src/events.ts"),G=D("./src/utils/logger.ts"),W=250,n=2,I=.1,g=.05,p=function(){function h(s,d,i,l){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=s,this.media=d,this.fragmentTracker=i,this.hls=l}var c=h.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(d){var i=this.config,l=this.media,r=this.stalled,o=l.currentTime,w=l.seeking,T=this.seeking&&!w,x=!this.seeking&&w;if(this.seeking=w,o!==d){if(this.moved=!0,r!==null){if(this.stallReported){var L=self.performance.now()-r;G.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||T)&&(this.stalled=null),l.paused||l.ended||l.playbackRate===0||!V.BufferHelper.getBuffered(l).length)return;var A=V.BufferHelper.bufferInfo(l,o,0),E=A.len>0,_=A.nextStart||0;if(!E&&!_)return;if(w){var m=A.len>n,f=!_||_-o>n&&!this.fragmentTracker.getPartialFragment(o);if(m||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,b=Math.max(_,A.start||0)-o,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=y==null||((S=y.details)===null||S===void 0)?void 0:S.live,B=M?y.details.targetduration*2:n;if(b>0&&b<=B){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(r===null){this.stalled=R;return}var H=R-r;!w&&H>=W&&this._reportStall(A.len);var N=V.BufferHelper.bufferInfo(l,o,i.maxBufferHole);this._tryFixBufferStall(N,H)},c._tryFixBufferStall=function(d,i){var l=this.config,r=this.fragmentTracker,o=this.media,w=o.currentTime,T=r.getPartialFragment(w);if(T){var x=this._trySkipBufferHole(T);if(x)return}d.len>l.maxBufferHole&&i>l.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(d){var i=this.hls,l=this.media,r=this.stallReported;r||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+l.currentTime+" due to low buffer (buffer="+d+")"),i.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},c._trySkipBufferHole=function(d){for(var i=this.config,l=this.hls,r=this.media,o=r.currentTime,w=0,T=V.BufferHelper.getBuffered(r),x=0;x<T.length;x++){var L=T.start(x);if(o+i.maxBufferHole>=w&&o<L){var A=Math.max(L+g,r.currentTime+I);return G.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+A),this.moved=!0,this.stalled=null,r.currentTime=A,d&&l.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+A,frag:d}),A}w=T.end(x)}return 0},c._tryNudgeBuffer=function(){var d=this.config,i=this.hls,l=this.media,r=l.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<d.nudgeMaxRetry){var w=r+o*d.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+r+" to "+w),l.currentTime=w,i.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+d.nudgeMaxRetry+" nudges"),i.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),U=D("./src/utils/texttrack-utils.ts"),O=D("./src/demux/id3.ts"),G=.25,W=function(){function n(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var p=this.hls;p.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var p=this.hls;p.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(V.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(p,h){this.media=h.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(U.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(p){if(!this.media)return;for(var h=0;h<p.length;h++){var c=p[h];if(c.kind==="metadata"&&c.label==="id3")return Object(U.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(p,h){if(!this.media)return;var c=h.frag,s=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var l=O.getID3Frames(s[i].data);if(l){var r=s[i].pts,o=i<s.length-1?s[i+1].pts:c.end,w=o-r;w<=0&&(o=r+G);for(var T=0;T<l.length;T++){var x=l[T];if(!O.isTimeStampFrame(x)){var L=new d(r,o,"");L.value=x,this.id3Track.addCue(L)}}}}},I.onBufferFlushing=function(p,h){var c=h.startOffset,s=h.endOffset,d=h.type;if(!d||d==="audio"){var i=this.id3Track;i&&Object(U.removeCuesInRange)(i,c,s)}},n}();z.default=W},"./src/controller/latency-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/errors.ts"),U=D("./src/events.ts"),O=D("./src/utils/logger.ts");function G(I,g){for(var p=0;p<g.length;p++){var h=g[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(I,h.key,h)}}function W(I,g,p){return g&&G(I.prototype,g),p&&G(I,p),I}var n=function(){function I(p){var h=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 h.timeupdate()},this.hls=p,this.config=p.config,this.registerListeners()}var g=I.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(U.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(U.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(U.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(U.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(U.Events.ERROR,this.onError)},g.onMediaAttached=function(h,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(h,c){var s=c.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(h,c){if(c.details!==V.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var h=this.media,c=this.levelDetails;if(!h||!c)return;this.currentTime=h.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var d=this.config,i=d.lowLatencyMode,l=d.maxLiveSyncPlaybackRate;if(!i||l===1)return;var r=this.targetLatency;if(r===null)return;var o=s-r,w=Math.min(this.maxLatency,r+c.targetduration),T=o<w;if(c.live&&T&&o>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,l)),L=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;h.playbackRate=Math.min(x,Math.max(1,L))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},g.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},g.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},W(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,c=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:c?h.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var c=h.holdBack,s=h.partHoldBack,d=h.targetduration,i=this.config,l=i.liveSyncDuration,r=i.liveSyncDurationCount,o=i.lowLatencyMode,w=this.hls.userConfig,T=o&&s||c;(w.liveSyncDuration||w.liveSyncDurationCount||T===0)&&(T=l!==void 0?l:r*d);var x=d,L=1;return T+Math.min(this.stallCount*L,x)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),c=this.targetLatency,s=this.levelDetails;if(h===null||c===null||s===null)return null;var d=s.edge,i=h-c-this.edgeStalled,l=d-s.totalduration,r=d-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(l,i),r)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var c=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-c,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,c=this.levelDetails;if(!h||!c)return 0;var s=h.buffered.length;return s?h.buffered.end(s-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return i});var V=D("./src/types/level.ts"),U=D("./src/events.ts"),O=D("./src/errors.ts"),G=D("./src/utils/codecs.ts"),W=D("./src/controller/level-helper.ts"),n=D("./src/controller/base-playlist-controller.ts"),I=D("./src/types/loader.ts");function g(){return g=Object.assign||function(l){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var w in o)Object.prototype.hasOwnProperty.call(o,w)&&(l[w]=o[w])}return l},g.apply(this,arguments)}function p(l,r){for(var o=0;o<r.length;o++){var w=r[o];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,w.key,w)}}function h(l,r,o){return r&&p(l.prototype,r),o&&p(l,o),l}function c(l,r){l.prototype=Object.create(r.prototype),l.prototype.constructor=l,s(l,r)}function s(l,r){return s=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},s(l,r)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(l){c(r,l);function r(w){var T;return T=l.call(this,w,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var o=r.prototype;return o._registerListeners=function(){var T=this.hls;T.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(U.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var T=this.hls;T.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(U.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(U.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(U.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,l.prototype.destroy.call(this)},o.startLoad=function(){var T=this._levels;T.forEach(function(x){x.loadError=0}),l.prototype.startLoad.call(this)},o.onManifestLoaded=function(T,x){var L=[],A=[],E=[],_,m={},f,S=!1,b=!1,y=!1;if(x.levels.forEach(function(H){var N=H.attrs;S=S||!!(H.width&&H.height),b=b||!!H.videoCodec,y=y||!!H.audioCodec,d&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var C=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;f=m[C],f?f.url.push(H.url):(f=new V.Level(H),m[C]=f,L.push(f)),N&&(N.AUDIO&&Object(W.addGroupId)(f,"audio",N.AUDIO),N.SUBTITLES&&Object(W.addGroupId)(f,"text",N.SUBTITLES))}),(S||b)&&y&&(L=L.filter(function(H){var N=H.videoCodec,C=H.width,K=H.height;return!!N||!!(C&&K)})),L=L.filter(function(H){var N=H.audioCodec,C=H.videoCodec;return(!N||Object(G.isCodecSupportedInMp4)(N,"audio"))&&(!C||Object(G.isCodecSupportedInMp4)(C,"video"))}),x.audioTracks&&(A=x.audioTracks.filter(function(H){return!H.audioCodec||Object(G.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(A)),x.subtitles&&(E=x.subtitles,Object(W.assignTrackIdsByGroup)(E)),L.length>0){_=L[0].bitrate,L.sort(function(H,N){return H.bitrate-N.bitrate}),this._levels=L;for(var M=0;M<L.length;M++)if(L[M].bitrate===_){this._firstLevel=M,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+_);break}var B=y&&!b,R={levels:L,audioTracks:A,subtitleTracks:E,firstLevel:this._firstLevel,stats:x.stats,audio:y,video:b,altAudio:!B&&A.some(function(H){return!!H.url})};this.hls.trigger(U.Events.MANIFEST_PARSED,R),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(T,x){if(l.prototype.onError.call(this,T,x),x.fatal)return;var L=x.context,A=this._levels[this.currentLevelIndex];if(L&&(L.type===I.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&L.groupId===A.audioGroupIds[A.urlId]||L.type===I.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&L.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var E=!1,_=!0,m;switch(x.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:if(x.frag){var f=this._levels[x.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(m=x.frag.level)):m=x.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(_=!1),m=L.level),E=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:m=x.level,E=!0;break}m!==void 0&&this.recoverLevel(x,m,E,_)},o.recoverLevel=function(T,x,L,A){var E=T.details,_=this._levels[x];if(_.loadError++,L){var m=this.retryLoadingOrFail(T);if(m)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var f=_.url.length;if(f>1&&_.loadError<f)T.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var S=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(E+": switch to "+S),T.levelRetry=!0,this.hls.nextAutoLevel=S)}}},o.redundantFailover=function(T){var x=this._levels[T],L=x.url.length;if(L>1){var A=(x.urlId+1)%L;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(E){E.urlId=A}),this.level=T}},o.onFragLoaded=function(T,x){var L=x.frag;if(L!==void 0&&L.type===I.PlaylistLevelType.MAIN){var A=this._levels[L.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},o.onLevelLoaded=function(T,x){var L,A=x.level,E=x.details,_=this._levels[A];if(!_){var m;this.warn("Invalid level index "+A),(m=x.deliveryDirectives)!==null&&m!==void 0&&m.skip&&(E.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(A,x,_.details)):(L=x.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(E.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(T,x){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var A=-1,E=this.hls.audioTracks[x.id].groupId,_=0;_<L.audioGroupIds.length;_++)if(L.audioGroupIds[_]===E){A=_;break}A!==L.urlId&&(L.urlId=A,this.startLoad())}},o.loadPlaylist=function(T){var x=this.currentLevelIndex,L=this._levels[x];if(this.canLoad&&L&&L.url.length>0){var A=L.urlId,E=L.url[A];if(T)try{E=T.addDirectives(E)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+x+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+A+" "+E),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:E,level:x,id:A,deliveryDirectives:T||null})}},o.removeLevel=function(T,x){var L=function(_,m){return m!==x},A=this._levels.filter(function(E,_){return _!==T?!0:E.url.length>1&&x!==void 0?(E.url=E.url.filter(L),E.audioGroupIds&&(E.audioGroupIds=E.audioGroupIds.filter(L)),E.textGroupIds&&(E.textGroupIds=E.textGroupIds.filter(L)),E.urlId=0,!0):!1}).map(function(E,_){var m=E.details;return m!=null&&m.fragments&&m.fragments.forEach(function(f){f.level=_}),E});this._levels=A,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:A})},h(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var x,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===T&&(x=L[T])!==null&&x!==void 0&&x.details)return;if(T<0||T>=L.length){var A=T<0;if(this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:A,reason:"invalid level idx"}),A)return;T=Math.min(T,L.length-1)}this.clearTimer();var E=this.currentLevelIndex,_=L[E],m=L[T];this.log("switching to level "+T+" from "+E),this.currentLevelIndex=T;var f=g({},m,{level:T,maxBitrate:m.maxBitrate,uri:m.uri,urlId:m.urlId});delete f._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,f);var S=m.details;if(!S||S.live){var b=this.switchParams(m.uri,_==null?void 0:_.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),r}(n.default)},"./src/controller/level-helper.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"addGroupId",function(){return O}),D.d(z,"assignTrackIdsByGroup",function(){return G}),D.d(z,"updatePTS",function(){return W}),D.d(z,"updateFragPTSDTS",function(){return I}),D.d(z,"mergeDetails",function(){return g}),D.d(z,"mapPartIntersection",function(){return p}),D.d(z,"mapFragmentIntersection",function(){return h}),D.d(z,"adjustSliding",function(){return c}),D.d(z,"addSliding",function(){return s}),D.d(z,"computeReloadInterval",function(){return d}),D.d(z,"getFragmentWithSN",function(){return i}),D.d(z,"getPartWith",function(){return l});var V=D("./src/polyfills/number.ts"),U=D("./src/utils/logger.ts");function O(r,o,w){switch(o){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(w);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(w);break}}function G(r){var o={};r.forEach(function(w){var T=w.groupId||"";w.id=o[T]=o[T]||0,o[T]++})}function W(r,o,w){var T=r[o],x=r[w];n(T,x)}function n(r,o){var w=o.startPTS;if(Object(V.isFiniteNumber)(w)){var T=0,x;o.sn>r.sn?(T=w-r.start,x=r):(T=r.start-w,x=o),x.duration!==T&&(x.duration=T)}else if(o.sn>r.sn){var L=r.cc===o.cc;L&&r.minEndPTS?o.start=r.start+(r.minEndPTS-r.start):o.start=r.start+r.duration}else o.start=Math.max(r.start-o.duration,0)}function I(r,o,w,T,x,L){var A=T-w;A<=0&&(U.logger.warn("Fragment should have a positive duration",o),T=w+o.duration,L=x+o.duration);var E=w,_=T,m=o.startPTS,f=o.endPTS;if(Object(V.isFiniteNumber)(m)){var S=Math.abs(m-w);Object(V.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(S,o.deltaPTS):o.deltaPTS=S,E=Math.max(w,m),w=Math.min(w,m),x=Math.min(x,o.startDTS),_=Math.min(T,f),T=Math.max(T,f),L=Math.max(L,o.endDTS)}o.duration=T-w;var b=w-o.start;o.appendedPTS=T,o.start=o.startPTS=w,o.maxStartPTS=E,o.startDTS=x,o.endPTS=T,o.minEndPTS=_,o.endDTS=L;var y=o.sn;if(!r||y<r.startSN||y>r.endSN)return 0;var M,B=y-r.startSN,R=r.fragments;for(R[B]=o,M=B;M>0;M--)n(R[M],R[M-1]);for(M=B;M<R.length-1;M++)n(R[M],R[M+1]);return r.fragmentHint&&n(R[R.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,b}function g(r,o){for(var w=null,T=r.fragments,x=T.length-1;x>=0;x--){var L=T[x].initSegment;if(L){w=L;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var A=0,E;if(h(r,o,function(M,B){M.relurl&&(A=M.cc-B.cc),Object(V.isFiniteNumber)(M.startPTS)&&Object(V.isFiniteNumber)(M.endPTS)&&(B.start=B.startPTS=M.startPTS,B.startDTS=M.startDTS,B.appendedPTS=M.appendedPTS,B.maxStartPTS=M.maxStartPTS,B.endPTS=M.endPTS,B.endDTS=M.endDTS,B.minEndPTS=M.minEndPTS,B.duration=M.endPTS-M.startPTS,B.duration&&(E=B),o.PTSKnown=o.alignedSliding=!0),B.elementaryStreams=M.elementaryStreams,B.loader=M.loader,B.stats=M.stats,B.urlId=M.urlId,M.initSegment&&(B.initSegment=M.initSegment,w=M.initSegment)}),w){var _=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;_.forEach(function(M){var B;(!M.initSegment||M.initSegment.relurl===((B=w)===null||B===void 0?void 0:B.relurl))&&(M.initSegment=w)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(M){return!M}),o.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var m=o.skippedSegments;m--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var f=o.fragments;if(A){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<f.length;S++)f[S].cc+=A}o.skippedSegments&&(o.startCC=o.fragments[0].cc),p(r.partList,o.partList,function(M,B){B.elementaryStreams=M.elementaryStreams,B.stats=M.stats}),E?I(o,E,E.startPTS,E.endPTS,E.startDTS,E.endDTS):c(r,o),f.length&&(o.totalduration=o.edge-f[0].start),o.driftStartTime=r.driftStartTime,o.driftStart=r.driftStart;var b=o.advancedDateTime;if(o.advanced&&b){var y=o.edge;o.driftStart||(o.driftStartTime=b,o.driftStart=y),o.driftEndTime=b,o.driftEnd=y}else o.driftEndTime=r.driftEndTime,o.driftEnd=r.driftEnd,o.advancedDateTime=r.advancedDateTime}function p(r,o,w){if(r&&o)for(var T=0,x=0,L=r.length;x<=L;x++){var A=r[x],E=o[x+T];A&&E&&A.index===E.index&&A.fragment.sn===E.fragment.sn?w(A,E):T--}}function h(r,o,w){for(var T=o.skippedSegments,x=Math.max(r.startSN,o.startSN)-o.startSN,L=(r.fragmentHint?1:0)+(T?o.endSN:Math.min(r.endSN,o.endSN))-o.startSN,A=o.startSN-r.startSN,E=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,_=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,m=x;m<=L;m++){var f=_[A+m],S=E[m];T&&!S&&m<T&&(S=o.fragments[m]=f),f&&S&&w(f,S)}}function c(r,o){var w=o.startSN+o.skippedSegments-r.startSN,T=r.fragments;if(w<0||w>=T.length)return;s(o,T[w].start)}function s(r,o){if(o){for(var w=r.fragments,T=r.skippedSegments;T<w.length;T++)w[T].start+=o;r.fragmentHint&&(r.fragmentHint.start+=o)}}function d(r,o){var w=1e3*r.levelTargetDuration,T=w/2,x=r.age,L=x>0&&x<w*3,A=o.loading.end-o.loading.start,E,_=r.availabilityDelay;if(r.updated===!1)if(L){var m=333*r.misses;E=Math.max(Math.min(T,A*2),m),r.availabilityDelay=(r.availabilityDelay||0)+E}else E=T;else L?(_=Math.min(_||w/2,x),r.availabilityDelay=_,E=_+w-x):E=w-A;return Math.round(E)}function i(r,o,w){if(!r||!r.details)return null;var T=r.details,x=T.fragments[o-T.startSN];return x||(x=T.fragmentHint,x&&x.sn===o?x:o<T.startSN&&w&&w.sn===o?w:null)}function l(r,o,w){if(!r||!r.details)return null;var T=r.details.partList;if(T)for(var x=T.length;x--;){var L=T[x];if(L.index===w&&L.fragment.sn===o)return L}return null}},"./src/controller/stream-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return T});var V=D("./src/polyfills/number.ts"),U=D("./src/controller/base-stream-controller.ts"),O=D("./src/is-supported.ts"),G=D("./src/events.ts"),W=D("./src/utils/buffer-helper.ts"),n=D("./src/controller/fragment-tracker.ts"),I=D("./src/types/loader.ts"),g=D("./src/loader/fragment.ts"),p=D("./src/demux/transmuxer-interface.ts"),h=D("./src/types/transmuxer.ts"),c=D("./src/controller/gap-controller.ts"),s=D("./src/errors.ts"),d=D("./src/utils/logger.ts");function i(x,L){for(var A=0;A<L.length;A++){var E=L[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}function l(x,L,A){return L&&i(x.prototype,L),A&&i(x,A),x}function r(x,L){x.prototype=Object.create(L.prototype),x.prototype.constructor=x,o(x,L)}function o(x,L){return o=Object.setPrototypeOf||function(E,_){return E.__proto__=_,E},o(x,L)}var w=100,T=function(x){r(L,x);function L(E,_){var m;return m=x.call(this,E,_,"[stream-controller]")||this,m.audioCodecSwap=!1,m.gapController=null,m.level=-1,m._forceStartLoad=!1,m.altAudio=!1,m.audioOnly=!1,m.fragPlaying=null,m.onvplaying=null,m.onvseeked=null,m.fragLastKbps=0,m.stalled=!1,m.couldBacktrack=!1,m.audioCodecSwitch=!1,m.videoBuffer=null,m._registerListeners(),m}var A=L.prototype;return A._registerListeners=function(){var _=this.hls;_.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(G.Events.ERROR,this.onError,this),_.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var _=this.hls;_.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(G.Events.ERROR,this.onError,this),_.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(_){if(this.levels){var m=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=f.startLevel;S===-1&&(f.config.testBandwidth?(S=0,this.bitrateTest=!0):S=f.nextAutoLevel),this.level=f.nextLoadLevel=S,this.loadedmetadata=!1}m>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),_=m),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var _,m=this.levels,f=this.level,S=m==null||((_=m[f])===null||_===void 0)?void 0:_.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var b,y=self.performance.now(),M=this.retryDate;(!M||y>=M||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var _,m,f=this.hls,S=this.levelLastLoaded,b=this.levels,y=this.media,M=f.config,B=f.nextLoadLevel;if(S===null||!y&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[B])return;var R=b[B];this.level=f.nextLoadLevel=B;var H=R.details;if(!H||this.state===U.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==B){this.state=U.State.WAITING_LEVEL;return}var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,I.PlaylistLevelType.MAIN);if(N===null)return;var C=N.len,K=this.getMaxBufferLength(R.maxBitrate);if(C>=K)return;if(this._streamEnded(N,H)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Z),this.state=U.State.ENDED;return}var oe=N.end,fe=this.getNextFragment(oe,H);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var xe=fe.sn-H.startSN;xe>1&&(fe=H.fragments[xe-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===n.FragmentState.OK&&this.nextLoadPosition>oe){var be=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,be,I.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,H)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((_=fe.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((m=fe.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(fe,H):this.loadFragment(fe,H,oe)},A.loadFragment=function(_,m,f){var S,b=this.fragmentTracker.getState(_);if(this.fragCurrent=_,b===n.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(_);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else b=n.FragmentState.NOT_LOADED}b===n.FragmentState.NOT_LOADED||b===n.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,_,m,f)):b===n.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(_){var m=this.fragmentTracker.getAppendedFrag(_,I.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},A.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,I.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var _=this.levels,m=this.media;if(m!=null&&m.readyState){var f,S=this.getAppendedFrag(m.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!m.paused&&_){var b=this.hls.nextLoadLevel,y=_[b],M=this.fragLastKbps;M&&this.fragCurrent?f=this.fragCurrent.duration*y.maxBitrate/(1e3*M)+1:f=0}else f=0;var B=this.getBufferedFrag(m.currentTime+f);if(B){var R=this.followingBufferedFrag(B);if(R){this.abortCurrentFrag();var H=R.maxStartPTS?R.maxStartPTS:R.start,N=R.duration,C=Math.max(B.end,H+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.75));this.flushMainBuffer(C,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(_,m){x.prototype.flushMainBuffer.call(this,_,m,this.altAudio?"video":null)},A.onMediaAttached=function(_,m){x.prototype.onMediaAttached.call(this,_,m);var f=m.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,f,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var _=this.media,m=_?_.currentTime:null;Object(V.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(_,m){var f=!1,S=!1,b;m.levels.forEach(function(y){b=y.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(f=!0),b.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=f&&S&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=m.levels,this.startFragRequested=!1},A.onLevelLoading=function(_,m){var f=this.levels;if(!f||this.state!==U.State.IDLE)return;var S=f[m.level];(!S.details||S.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(S.details))&&(this.state=U.State.WAITING_LEVEL)},A.onLevelLoaded=function(_,m){var f,S=this.levels,b=m.level,y=m.details,M=y.totalduration;if(!S){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+M);var B=this.fragCurrent;B&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==m.level&&B.loader&&(this.state=U.State.IDLE,B.loader.abort()));var R=S[b],H=0;if(y.live||(f=R.details)!==null&&f!==void 0&&f.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;H=this.alignPlaylists(y,R.details)}if(R.details=y,this.levelLastLoaded=b,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:y,level:b}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=U.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,H),this.tick()},A._handleFragmentLoadProgress=function(_){var m,f=_.frag,S=_.part,b=_.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var M=y[f.level],B=M.details;if(!B){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var R=M.videoCodec,H=B.PTSKnown||!B.live,N=(m=f.initSegment)===null||m===void 0?void 0:m.data,C=this._getAudioCodec(M),K=this.transmuxer=this.transmuxer||new p.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=S?S.index:-1,oe=Z!==-1,fe=new h.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,b.byteLength,Z,oe),xe=this.initPTS[f.cc];K.push(b,N,C,R,f,S,B.totalduration,H,fe,xe)},A.onAudioTrackSwitching=function(_,m){var f=this.altAudio,S=!!m.url,b=m.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;f&&M.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:b})}},A.onAudioTrackSwitched=function(_,m){var f=m.id,S=!!this.hls.audioTracks[f].url;if(S){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=S,this.tick()},A.onBufferCreated=function(_,m){var f=m.tracks,S,b,y=!1;for(var M in f){var B=f[M];if(B.id==="main"){if(b=M,S=B,M==="video"){var R=f[M];R&&(this.videoBuffer=R.buffer)}}else y=!0}y&&S?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(_,m){var f=m.frag,S=m.part;if(f&&f.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(S?" p: "+S.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===U.State.PARSED&&(this.state=U.State.IDLE);return}var b=S?S.stats:f.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,S)},A.onError=function(_,m){switch(m.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,m);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(m.fatal?(this.warn(""+m.details),this.state=U.State.ERROR):!m.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var f=!0,S=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);S&&S.len>.5&&(f=!this.reduceMaxBufferLength(S.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var _=this.media,m=this.gapController;if(!_||!m||!_.readyState)return;var f=W.BufferHelper.getBuffered(_);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):m.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(_,m){var f=m.type;if(f!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(f===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,f,I.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(_,m){this.levels=m.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var _=this.media,m=_.currentTime,f=this.startPosition;if(f>=0&&m<f){if(_.seeking){d.logger.log("could not seek to "+f+", already seeking at "+m);return}var S=W.BufferHelper.getBuffered(_),b=S.length?S.start(0):0,y=b-f;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+y+" to match buffer start"),f+=y,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+m),_.currentTime=f}},A._getAudioCodec=function(_){var m=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&m&&(this.log("Swapping audio codec"),m.indexOf("mp4a.40.5")!==-1?m="mp4a.40.2":m="mp4a.40.5"),m},A._loadBitrateTestFrag=function(_){var m=this;this._doFragLoad(_).then(function(f){var S=m.hls;if(!f||S.nextLoadLevel||m.fragContextChanged(_))return;m.fragLoadError=0,m.state=U.State.IDLE,m.startFragRequested=!1,m.bitrateTest=!1;var b=_.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),S.trigger(G.Events.FRAG_LOADED,f)})},A._handleTransmuxComplete=function(_){var m,f="main",S=this.hls,b=_.remuxResult,y=_.chunkMeta,M=this.getCurrentContext(y);if(!M){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var B=M.frag,R=M.part,H=M.level,N=b.video,C=b.text,K=b.id3,Z=b.initSegment,oe=this.altAudio?void 0:b.audio;if(this.fragContextChanged(B))return;if(this.state=U.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(H,Z.tracks,B,y),S.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:f,tracks:Z.tracks}));var fe=Z.initPTS,xe=Z.timescale;Object(V.isFiniteNumber)(fe)&&(this.initPTS[B.cc]=fe,S.trigger(G.Events.INIT_PTS_FOUND,{frag:B,id:f,initPTS:fe,timescale:xe}))}if(N&&b.independent!==!1){if(H.details){var be=N.startPTS,Te=N.endPTS,Ce=N.startDTS,Le=N.endDTS;if(R)R.elementaryStreams[N.type]={startPTS:be,endPTS:Te,startDTS:Ce,endDTS:Le};else if(N.firstKeyFrame&&N.independent&&(this.couldBacktrack=!0),N.dropped&&N.independent){var ge=this.getLoadPosition()+this.config.maxBufferHole;if(ge<be){this.backtrack(B);return}B.setElementaryStreamInfo(N.type,B.start,Te,B.start,Le,!0)}B.setElementaryStreamInfo(N.type,be,Te,Ce,Le),this.bufferFragmentData(N,B,R,y)}}else if(b.independent===!1){this.backtrack(B);return}if(oe){var Y=oe.startPTS,k=oe.endPTS,j=oe.startDTS,J=oe.endDTS;R&&(R.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:k,startDTS:j,endDTS:J}),B.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Y,k,j,J),this.bufferFragmentData(oe,B,R,y)}if(K!=null&&(m=K.samples)!==null&&m!==void 0&&m.length){var ie={frag:B,id:f,samples:K.samples};S.trigger(G.Events.FRAG_PARSING_METADATA,ie)}if(C){var X={frag:B,id:f,samples:C.samples};S.trigger(G.Events.FRAG_PARSING_USERDATA,X)}},A._bufferInitSegment=function(_,m,f,S){var b=this;if(this.state!==U.State.PARSING)return;this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var y=m.audio,M=m.video,B=m.audiovideo;if(y){var R=_.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),y.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(R="mp4a.40.5")),H.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),_.audioCodec&&_.audioCodec!==R&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+R+'"'),y.levelCodec=R,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(_.audioCodec||"")+"/"+y.codec+"]")}M&&(M.levelCodec=_.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+M.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(N){var C=m[N],K=C.initSegment;K!=null&&K.byteLength&&b.hls.trigger(G.Events.BUFFER_APPENDING,{type:N,data:K,frag:f,part:null,chunkMeta:S,parent:f.type})}),this.tick()},A.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var m=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,m?this.resetFragmentLoading(_):this.state=U.State.BACKTRACKING},A.checkFragmentChanged=function(){var _=this.media,m=null;if(_&&_.readyState>1&&_.seeking===!1){var f=_.currentTime;if(W.BufferHelper.isBuffered(_,f)?m=this.getAppendedFrag(f):W.BufferHelper.isBuffered(_,f+.1)&&(m=this.getAppendedFrag(f+.1)),m){var S=this.fragPlaying,b=m.level;(!S||m.sn!==S.sn||S.level!==b||m.urlId!==S.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:m}),(!S||S.level!==b)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=m)}}},l(L,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var m=this.getAppendedFrag(_.currentTime);if(m)return m.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var m=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(m)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"SubtitleStreamController",function(){return r});var V=D("./src/events.ts"),U=D("./src/utils/logger.ts"),O=D("./src/utils/buffer-helper.ts"),G=D("./src/controller/fragment-finders.ts"),W=D("./src/utils/discontinuities.ts"),n=D("./src/controller/level-helper.ts"),I=D("./src/controller/fragment-tracker.ts"),g=D("./src/controller/base-stream-controller.ts"),p=D("./src/types/loader.ts"),h=D("./src/types/level.ts");function c(o,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(o,x.key,x)}}function s(o,w,T){return w&&c(o.prototype,w),T&&c(o,T),o}function d(o,w){o.prototype=Object.create(w.prototype),o.prototype.constructor=o,i(o,w)}function i(o,w){return i=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},i(o,w)}var l=500,r=function(o){d(w,o);function w(x,L){var A;return A=o.call(this,x,L,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var T=w.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var L=this.hls;L.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(V.Events.ERROR,this.onError,this),L.on(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var L=this.hls;L.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(V.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(V.Events.ERROR,this.onError,this),L.off(V.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(V.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(V.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(V.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(l),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(L,A){this.mainDetails=A.details},T.onSubtitleFragProcessed=function(L,A){var E=A.frag,_=A.success;if(this.fragPrevious=E,this.state=g.State.IDLE,!_)return;var m=this.tracksBuffered[this.currentTrackId];if(!m)return;for(var f,S=E.start,b=0;b<m.length;b++)if(S>=m[b].start&&S<=m[b].end){f=m[b];break}var y=E.start+E.duration;f?f.end=y:(f={start:S,end:y},m.push(f)),this.fragmentTracker.fragBuffered(E)},T.onBufferFlushing=function(L,A){var E=A.startOffset,_=A.endOffset;if(E===0&&_!==Number.POSITIVE_INFINITY){var m=this.currentTrackId,f=this.levels;if(!f.length||!f[m]||!f[m].details)return;var S=f[m].details,b=S.targetduration,y=_-b;if(y<=0)return;A.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(M){for(var B=0;B<M.length;){if(M[B].end<=y){M.shift();continue}else if(M[B].start<y)M[B].start=y;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(E,y,p.PlaylistLevelType.SUBTITLE)}},T.onError=function(L,A){var E,_=A.frag;if(!_||_.type!==p.PlaylistLevelType.SUBTITLE)return;(E=this.fragCurrent)!==null&&E!==void 0&&E.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},T.onSubtitleTracksUpdated=function(L,A){var E=this,_=A.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(m){return new h.Level(m)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(m){E.tracksBuffered[m.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(L,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var E=this.levels[this.currentTrackId];E!=null&&E.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,E&&this.setInterval(l)},T.onSubtitleTrackLoaded=function(L,A){var E,_=A.details,m=A.id,f=this.currentTrackId,S=this.levels;if(!S.length)return;var b=S[f];if(m>=S.length||m!==f||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(E=b.details)!==null&&E!==void 0&&E.live){var y=this.mainDetails;if(_.deltaUpdateFailed||!y)return;var M=y.fragments[0];if(!b.details)_.hasProgramDateTime&&y.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(_,y):M&&Object(n.addSliding)(_,M.start);else{var B=this.alignPlaylists(_,b.details);B===0&&M&&Object(n.addSliding)(_,M.start)}}if(b.details=_,this.levelLastLoaded=m,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var R=Object(G.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},T._handleFragmentLoadComplete=function(L){var A=L.frag,E=L.payload,_=A.decryptdata,m=this.hls;if(this.fragContextChanged(A))return;if(E&&E.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(E),_.key.buffer,_.iv.buffer).then(function(S){var b=performance.now();m.trigger(V.Events.FRAG_DECRYPTED,{frag:A,payload:S,stats:{tstart:f,tdecrypt:b}})})}},T.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,A=this.currentTrackId,E=this.levels;if(!E.length||!E[A]||!E[A].details)return;var _=E[A].details,m=_.targetduration,f=this.config,S=this.media,b=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-m,f.maxBufferHole),y=b.end,M=b.len,B=this.getMaxBufferLength()+m;if(M>B)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var R=_.fragments,H=R.length,N=_.edge,C,K=this.fragPrevious;if(y<N){var Z=f.maxFragLookUpTolerance;K&&_.hasProgramDateTime&&(C=Object(G.findFragmentByPDT)(R,K.endProgramDateTime,Z)),C||(C=Object(G.findFragmentByPTS)(K,R,y,Z),!C&&K&&K.start<R[0].start&&(C=R[0]))}else C=R[H-1];(L=C)!==null&&L!==void 0&&L.encrypted?(U.logger.log("Loading key for "+C.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(V.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===I.FragmentState.NOT_LOADED&&this.loadFragment(C,_,y)}},T.loadFragment=function(L,A,E){this.fragCurrent=L,o.prototype.loadFragment.call(this,L,A,E)},s(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(g.default)},"./src/controller/subtitle-track-controller.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/events.ts"),U=D("./src/utils/texttrack-utils.ts"),O=D("./src/controller/base-playlist-controller.ts"),G=D("./src/types/loader.ts");function W(c,s){for(var d=0;d<s.length;d++){var i=s[d];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}function n(c,s,d){return s&&W(c.prototype,s),d&&W(c,d),c}function I(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,g(c,s)}function g(c,s){return g=Object.setPrototypeOf||function(i,l){return i.__proto__=l,i},g(c,s)}var p=function(c){I(s,c);function s(i){var l;return l=c.call(this,i,"[subtitle-track-controller]")||this,l.media=null,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.selectDefaultTrack=!0,l.queuedDefaultTrack=-1,l.trackChangeListener=function(){return l.onTextTracksChanged()},l.asyncPollTrackChange=function(){return l.pollTrackChange(0)},l.useTextTrackPolling=!1,l.subtitlePollingInterval=-1,l.subtitleDisplay=!0,l.registerListeners(),l}var d=s.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},d.registerListeners=function(){var l=this.hls;l.on(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(V.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.on(V.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var l=this.hls;l.off(V.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(V.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(V.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(V.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(V.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(V.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(V.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),l.off(V.Events.ERROR,this.onError,this)},d.onMediaAttached=function(l,r){if(this.media=r.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)},d.pollTrackChange=function(l){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,l)},d.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 l=h(this.media.textTracks);l.forEach(function(r){Object(U.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(l,r){this.tracks=r.subtitleTracks},d.onSubtitleTrackLoaded=function(l,r){var o=r.id,w=r.details,T=this.trackId,x=this.tracksInGroup[T];if(!x){this.warn("Invalid subtitle track id "+o);return}var L=x.details;x.details=r.details,this.log("subtitle track "+o+" loaded ["+w.startSN+"-"+w.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,r,L))},d.onLevelLoading=function(l,r){this.switchLevel(r.level)},d.onLevelSwitching=function(l,r){this.switchLevel(r.level)},d.switchLevel=function(l){var r=this.hls.levels[l];if(!(r!=null&&r.textGroupIds))return;var o=r.textGroupIds[r.urlId];if(this.groupId!==o){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(A){return!o||A.groupId===o});this.tracksInGroup=T;var x=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=o;var L={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,L),x!==-1&&this.setSubtitleTrack(x,w)}},d.findTrackId=function(l){for(var r=this.tracksInGroup,o=0;o<r.length;o++){var w=r[o];if((!this.selectDefaultTrack||w.default)&&(!l||l===w.name))return w.id}return-1},d.onError=function(l,r){if(c.prototype.onError.call(this,l,r),r.fatal||!r.context)return;r.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.loadPlaylist=function(l){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var o=r.id,w=r.groupId,T=r.url;if(l)try{T=l.addDirectives(T)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(V.Events.SUBTITLE_TRACK_LOADING,{url:T,id:o,groupId:w,deliveryDirectives:l||null})}},d.toggleTrackModes=function(l){var r=this,o=this.media,w=this.subtitleDisplay,T=this.trackId;if(!o)return;var x=h(o.textTracks),L=x.filter(function(_){return _.groupId===r.groupId});if(l===-1)[].slice.call(x).forEach(function(_){_.mode="disabled"});else{var A=L[T];A&&(A.mode="disabled")}var E=L[l];E&&(E.mode=w?"showing":"hidden")},d.setSubtitleTrack=function(l,r){var o,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=l;return}if(this.trackId!==l&&this.toggleTrackModes(l),this.trackId===l&&(l===-1||(o=w[l])!==null&&o!==void 0&&o.details)||l<-1||l>=w.length)return;this.clearTimer();var T=w[l];if(this.log("Switching to subtitle track "+l),this.trackId=l,T){var x=T.id,L=T.groupId,A=L===void 0?"":L,E=T.name,_=T.type,m=T.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:A,name:E,type:_,url:m});var f=this.switchParams(T.url,r==null?void 0:r.details);this.loadPlaylist(f)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:l})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var l=-1,r=h(this.media.textTracks),o=0;o<r.length;o++)if(r[o].mode==="hidden")l=o;else if(r[o].mode==="showing"){l=o;break}this.subtitleTrack!==l&&(this.subtitleTrack=l)},n(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(l,r)}}]),s}(O.default);function h(c){for(var s=[],d=0;d<c.length;d++){var i=c[d];i.kind==="subtitles"&&i.label&&s.push(c[d])}return s}z.default=p},"./src/controller/timeline-controller.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"TimelineController",function(){return h});var V=D("./src/polyfills/number.ts"),U=D("./src/events.ts"),O=D("./src/utils/cea-608-parser.ts"),G=D("./src/utils/output-filter.ts"),W=D("./src/utils/webvtt-parser.ts"),n=D("./src/utils/texttrack-utils.ts"),I=D("./src/utils/imsc1-ttml-parser.ts"),g=D("./src/types/loader.ts"),p=D("./src/utils/logger.ts"),h=function(){function i(r){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=d(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.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 o=new G.default(this,"textTrack1"),w=new G.default(this,"textTrack2"),T=new G.default(this,"textTrack3"),x=new G.default(this,"textTrack4");this.cea608Parser1=new O.default(1,o,w),this.cea608Parser2=new O.default(3,T,x)}r.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(U.Events.FRAG_LOADING,this.onFragLoading,this),r.on(U.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var l=i.prototype;return l.destroy=function(){var o=this.hls;o.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(U.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(U.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(U.Events.FRAG_LOADING,this.onFragLoading,this),o.off(U.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(U.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(U.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(U.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(U.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},l.addCues=function(o,w,T,x,L){for(var A=!1,E=L.length;E--;){var _=L[E],m=s(_[0],_[1],w,T);if(m>=0&&(_[0]=Math.min(_[0],w),_[1]=Math.max(_[1],T),A=!0,m/(T-w)>.5))return}if(A||L.push([w,T]),this.config.renderTextTracksNatively){var f=this.captionsTracks[o];this.Cues.newCue(f,w,T,x)}else{var S=this.Cues.newCue(null,w,T,x);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:S,track:o})}},l.onInitPtsFound=function(o,w){var T=this,x=w.frag,L=w.id,A=w.initPTS,E=w.timescale,_=this.unparsedVttFrags;L==="main"&&(this.initPTS[x.cc]=A,this.timescale[x.cc]=E),_.length&&(this.unparsedVttFrags=[],_.forEach(function(m){T.onFragLoaded(U.Events.FRAG_LOADED,m)}))},l.getExistingTrack=function(o){var w=this.media;if(w)for(var T=0;T<w.textTracks.length;T++){var x=w.textTracks[T];if(x[o])return x}return null},l.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},l.createNativeTrack=function(o){if(this.captionsTracks[o])return;var w=this.captionsProperties,T=this.captionsTracks,x=this.media,L=w[o],A=L.label,E=L.languageCode,_=this.getExistingTrack(o);if(_)T[o]=_,Object(n.clearCurrentCues)(T[o]),Object(n.sendAddTrackEvent)(T[o],x);else{var m=this.createTextTrack("captions",A,E);m&&(m[o]=!0,T[o]=m)}},l.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var w=this.captionsProperties[o];if(!w)return;var T=w.label,x={_id:o,label:T,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[o]=x,this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},l.createTextTrack=function(o,w,T){var x=this.media;return x?x.addTextTrack(o,w,T):void 0},l.onMediaAttaching=function(o,w){this.media=w.media,this._cleanTracks()},l.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(w){Object(n.clearCurrentCues)(o[w]),delete o[w]}),this.nonNativeCaptionsTracks={}},l.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),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())},l._cleanTracks=function(){var o=this.media;if(!o)return;var w=o.textTracks;if(w)for(var T=0;T<w.length;T++)Object(n.clearCurrentCues)(w[T])},l.onSubtitleTracksUpdated=function(o,w){var T=this;this.textTracks=[];var x=w.subtitleTracks||[],L=x.some(function(m){return m.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var A=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var E=this.media?this.media.textTracks:[];this.tracks.forEach(function(m,f){var S;if(f<E.length){for(var b=null,y=0;y<E.length;y++)if(c(E[y],m)){b=E[y];break}b&&(S=b)}S?Object(n.clearCurrentCues)(S):(S=T.createTextTrack("subtitles",m.name,m.lang),S&&(S.mode="disabled")),S&&(S.groupId=m.groupId,T.textTracks.push(S))})}else if(!A&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(m){return{label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}});this.hls.trigger(U.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},l.onManifestLoaded=function(o,w){var T=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(x){var L=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!L)return;var A="textTrack"+L[1],E=T.captionsProperties[A];if(!E)return;E.label=x.name,x.lang&&(E.languageCode=x.lang),E.media=x})},l.onFragLoading=function(o,w){var T=this.cea608Parser1,x=this.cea608Parser2,L=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(T&&x))return;if(w.frag.type===g.PlaylistLevelType.MAIN){var E,_,m=w.frag.sn,f=(E=w==null||((_=w.part)===null||_===void 0)?void 0:_.index)!=null?E:-1;m===L+1||m===L&&f===A+1||(T.reset(),x.reset()),this.lastSn=m,this.lastPartIndex=f}},l.onFragLoaded=function(o,w){var T=w.frag,x=w.payload,L=this.initPTS,A=this.unparsedVttFrags;if(T.type===g.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(V.isFiniteNumber)(L[T.cc])){A.push(w),L.length&&this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var E=T.decryptdata;if(E==null||E.key==null||E.method!=="AES-128"){var _=this.tracks[T.level],m=this.vttCCs;m[T.cc]||(m[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),_&&_.textCodec===I.IMSC1_CODEC?this._parseIMSC1(T,x):this._parseVTTs(T,x,m)}}else this.hls.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},l._parseIMSC1=function(o,w){var T=this,x=this.hls;Object(I.parseIMSC1)(w,this.initPTS[o.cc],this.timescale[o.cc],function(L){T._appendCues(L,o.level),x.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(L){p.logger.log("Failed to parse IMSC1: "+L),x.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:L})})},l._parseVTTs=function(o,w,T){var x=this,L=this.hls;Object(W.parseWebVTT)(w,this.initPTS[o.cc],this.timescale[o.cc],T,o.cc,o.start,function(A){x._appendCues(A,o.level),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){x._fallbackToIMSC1(o,w),p.logger.log("Failed to parse VTT cue: "+A),L.trigger(U.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},l._fallbackToIMSC1=function(o,w){var T=this,x=this.tracks[o.level];x.textCodec||Object(I.parseIMSC1)(w,this.initPTS[o.cc],this.timescale[o.cc],function(){x.textCodec=I.IMSC1_CODEC,T._parseIMSC1(o,w)},function(){x.textCodec="wvtt"})},l._appendCues=function(o,w){var T=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[w];if(x.mode==="disabled")return;o.forEach(function(E){return Object(n.addCueToTrack)(x,E)})}else{var L=this.tracks[w],A=L.default?"default":"subtitles"+w;T.trigger(U.Events.CUES_PARSED,{type:"subtitles",cues:o,track:A})}},l.onFragDecrypted=function(o,w){var T=w.frag;if(T.type===g.PlaylistLevelType.SUBTITLE){if(!Object(V.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(U.Events.FRAG_LOADED,w)}},l.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},l.onFragParsingUserdata=function(o,w){var T=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(T&&x))return;for(var L=0;L<w.samples.length;L++){var A=w.samples[L].bytes;if(A){var E=this.extractCea608Data(A);T.addData(w.samples[L].pts,E[0]),x.addData(w.samples[L].pts,E[1])}}},l.onBufferFlushing=function(o,w){var T=w.startOffset,x=w.endOffset,L=w.endOffsetSubtitles,A=w.type,E=this.media;if(!E||E.currentTime<x)return;if(!A||A==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(f){return Object(n.removeCuesInRange)(_[f],T,x)})}if(this.config.renderTextTracksNatively&&(T===0&&L!==void 0)){var m=this.textTracks;Object.keys(m).forEach(function(f){return Object(n.removeCuesInRange)(m[f],T,L)})}},l.extractCea608Data=function(o){for(var w=o[0]&31,T=2,x=[[],[]],L=0;L<w;L++){var A=o[T++],E=127&o[T++],_=127&o[T++],m=(4&A)!==0,f=3&A;if(E===0&&_===0)continue;m&&((f===0||f===1)&&(x[f].push(E),x[f].push(_)))}return x},i}();function c(i,l){return i&&i.label===l.name&&!(i.textTrack1||i.textTrack2)}function s(i,l,r,o){return Math.min(l,o)-Math.max(i,r)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function U(G,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=W}var O=U.prototype;return O.decrypt=function(W,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,W)},U}()},"./src/crypt/aes-decryptor.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"removePadding",function(){return U}),D.d(z,"default",function(){return O});var V=D("./src/utils/typed-array.ts");function U(G){var W=G.byteLength,n=W&&new DataView(G.buffer).getUint8(W-1);return n?Object(V.sliceUint8)(G,0,W-n):G}var O=function(){function G(){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 W=G.prototype;return W.uint8ArrayToUint32Array_=function(I){for(var g=new DataView(I),p=new Uint32Array(4),h=0;h<4;h++)p[h]=g.getUint32(h*4);return p},W.initTable=function(){var I=this.sBox,g=this.invSBox,p=this.subMix,h=p[0],c=p[1],s=p[2],d=p[3],i=this.invSubMix,l=i[0],r=i[1],o=i[2],w=i[3],T=new Uint32Array(256),x=0,L=0,A=0;for(A=0;A<256;A++)A<128?T[A]=A<<1:T[A]=A<<1^283;for(A=0;A<256;A++){var E=L^L<<1^L<<2^L<<3^L<<4;E=E>>>8^E&255^99,I[x]=E,g[E]=x;var _=T[x],m=T[_],f=T[m],S=T[E]*257^E*16843008;h[x]=S<<24|S>>>8,c[x]=S<<16|S>>>16,s[x]=S<<8|S>>>24,d[x]=S,S=f*16843009^m*65537^_*257^x*16843008,l[E]=S<<24|S>>>8,r[E]=S<<16|S>>>16,o[E]=S<<8|S>>>24,w[E]=S,x?(x=_^T[T[T[f^_]]],L^=T[T[L]]):x=L=1}},W.expandKey=function(I){for(var g=this.uint8ArrayToUint32Array_(I),p=!0,h=0;h<g.length&&p;)p=g[h]===this.key[h],h++;if(p)return;this.key=g;var c=this.keySize=g.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var s=this.ksRows=(c+6+1)*4,d,i,l=this.keySchedule=new Uint32Array(s),r=this.invKeySchedule=new Uint32Array(s),o=this.sBox,w=this.rcon,T=this.invSubMix,x=T[0],L=T[1],A=T[2],E=T[3],_,m;for(d=0;d<s;d++){if(d<c){_=l[d]=g[d];continue}m=_,d%c===0?(m=m<<8|m>>>24,m=o[m>>>24]<<24|o[m>>>16&255]<<16|o[m>>>8&255]<<8|o[m&255],m^=w[d/c|0]<<24):c>6&&d%c===4&&(m=o[m>>>24]<<24|o[m>>>16&255]<<16|o[m>>>8&255]<<8|o[m&255]),l[d]=_=(l[d-c]^m)>>>0}for(i=0;i<s;i++)d=s-i,i&3?m=l[d]:m=l[d-4],i<4||d<=4?r[i]=m:r[i]=x[o[m>>>24]]^L[o[m>>>16&255]]^A[o[m>>>8&255]]^E[o[m&255]],r[i]=r[i]>>>0},W.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},W.decrypt=function(I,g,p){for(var h=this.keySize+6,c=this.invKeySchedule,s=this.invSBox,d=this.invSubMix,i=d[0],l=d[1],r=d[2],o=d[3],w=this.uint8ArrayToUint32Array_(p),T=w[0],x=w[1],L=w[2],A=w[3],E=new Int32Array(I),_=new Int32Array(E.length),m,f,S,b,y,M,B,R,H,N,C,K,Z,oe,fe=this.networkToHostOrderSwap;g<E.length;){for(H=fe(E[g]),N=fe(E[g+1]),C=fe(E[g+2]),K=fe(E[g+3]),y=H^c[0],M=K^c[1],B=C^c[2],R=N^c[3],Z=4,oe=1;oe<h;oe++)m=i[y>>>24]^l[M>>16&255]^r[B>>8&255]^o[R&255]^c[Z],f=i[M>>>24]^l[B>>16&255]^r[R>>8&255]^o[y&255]^c[Z+1],S=i[B>>>24]^l[R>>16&255]^r[y>>8&255]^o[M&255]^c[Z+2],b=i[R>>>24]^l[y>>16&255]^r[M>>8&255]^o[B&255]^c[Z+3],y=m,M=f,B=S,R=b,Z=Z+4;m=s[y>>>24]<<24^s[M>>16&255]<<16^s[B>>8&255]<<8^s[R&255]^c[Z],f=s[M>>>24]<<24^s[B>>16&255]<<16^s[R>>8&255]<<8^s[y&255]^c[Z+1],S=s[B>>>24]<<24^s[R>>16&255]<<16^s[y>>8&255]<<8^s[M&255]^c[Z+2],b=s[R>>>24]<<24^s[y>>16&255]<<16^s[M>>8&255]<<8^s[B&255]^c[Z+3],_[g]=fe(m^T),_[g+1]=fe(b^x),_[g+2]=fe(S^L),_[g+3]=fe(f^A),T=H,x=N,L=C,A=K,g=g+4}return _.buffer},G}()},"./src/crypt/decrypter.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return g});var V=D("./src/crypt/aes-crypto.ts"),U=D("./src/crypt/fast-aes-key.ts"),O=D("./src/crypt/aes-decryptor.ts"),G=D("./src/utils/logger.ts"),W=D("./src/utils/mp4-tools.ts"),n=D("./src/utils/typed-array.ts"),I=16,g=function(){function p(c,s,d){var i=d===void 0?{}:d,l=i.removePKCS7Padding,r=l===void 0?!0:l;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=c,this.config=s,this.removePKCS7Padding=r,r)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=p.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var d=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(d):d},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(s,d,i,l){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),d,i);var r=this.flush();r&&l(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),d,i).then(l)},h.softwareDecrypt=function(s,d,i){var l=this.currentIV,r=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(s=Object(W.appendUint8Array)(o,s),this.remainderData=null);var w=this.getValidChunk(s);if(!w.length)return null;l&&(i=l);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new O.default),T.expandKey(d);var x=r;return this.currentResult=T.decrypt(w.buffer,0,i),this.currentIV=Object(n.sliceUint8)(w,-16).buffer,x||null},h.webCryptoDecrypt=function(s,d,i){var l=this,r=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new U.default(r,d)),this.fastAesKey.expandKey().then(function(o){if(!r)return Promise.reject(new Error("web crypto not initialized"));var w=new V.default(r,i);return w.decrypt(s.buffer,o)}).catch(function(o){return l.onWebCryptoError(o,s,d,i)})},h.onWebCryptoError=function(s,d,i,l){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,i,l)},h.getValidChunk=function(s){var d=s,i=s.length-s.length%I;return i!==s.length&&(d=Object(n.sliceUint8)(s,0,i),this.remainderData=Object(n.sliceUint8)(s,i)),d},h.logOnce=function(s){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function U(G,W){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=W}var O=U.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},U}()},"./src/demux/aacdemuxer.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/demux/base-audio-demuxer.ts"),U=D("./src/demux/adts.ts"),O=D("./src/utils/logger.ts"),G=D("./src/demux/id3.ts");function W(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(g,p)}var I=function(g){W(p,g);function p(c,s){var d;return d=g.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=c,d.config=s,d}var h=p.prototype;return h.resetInitSegment=function(s,d,i){g.prototype.resetInitSegment.call(this,s,d,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(s){if(!s)return!1;for(var d=G.getID3Data(s,0)||[],i=d.length,l=s.length;i<l;i++)if(U.probe(s,i))return O.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(s,d){return U.canParse(s,d)},h.appendFrame=function(s,d,i){U.initTrackConfig(s,this.observer,d,i,s.manifestCodec);var l=U.appendFrame(s,d,i,this.initPTS,this.frameIndex);if(l&&l.missing===0)return l},p}(V.default);I.minProbeByteLength=9,z.default=I},"./src/demux/adts.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"getAudioConfig",function(){return G}),D.d(z,"isHeaderPattern",function(){return W}),D.d(z,"getHeaderLength",function(){return n}),D.d(z,"getFullFrameLength",function(){return I}),D.d(z,"canGetFrameLength",function(){return g}),D.d(z,"isHeader",function(){return p}),D.d(z,"canParse",function(){return h}),D.d(z,"probe",function(){return c}),D.d(z,"initTrackConfig",function(){return s}),D.d(z,"getFrameDuration",function(){return d}),D.d(z,"parseFrameHeader",function(){return i}),D.d(z,"appendFrame",function(){return l});var V=D("./src/utils/logger.ts"),U=D("./src/errors.ts"),O=D("./src/events.ts");function G(r,o,w,T){var x,L,A,E,_=navigator.userAgent.toLowerCase(),m=T,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((o[w+2]&192)>>>6)+1;var S=(o[w+2]&60)>>>2;if(S>f.length-1){r.trigger(O.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return A=(o[w+2]&1)<<2,A|=(o[w+3]&192)>>>6,V.logger.log("manifest codec:"+T+", ADTS type:"+x+", samplingIndex:"+S),/firefox/i.test(_)?S>=6?(x=5,E=new Array(4),L=S-3):(x=2,E=new Array(2),L=S):_.indexOf("android")!==-1?(x=2,E=new Array(2),L=S):(x=5,E=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&S>=6?L=S-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(S>=6&&A===1||/vivaldi/i.test(_))||!T&&A===1)&&(x=2,E=new Array(2)),L=S)),E[0]=x<<3,E[0]|=(S&14)>>1,E[1]|=(S&1)<<7,E[1]|=A<<3,x===5&&(E[1]|=(L&14)>>1,E[2]=(L&1)<<7,E[2]|=2<<2,E[3]=0),{config:E,samplerate:f[S],channelCount:A,codec:"mp4a.40."+x,manifestCodec:m}}function W(r,o){return r[o]===255&&(r[o+1]&246)===240}function n(r,o){return r[o+1]&1?7:9}function I(r,o){return(r[o+3]&3)<<11|r[o+4]<<3|(r[o+5]&224)>>>5}function g(r,o){return o+5<r.length}function p(r,o){return o+1<r.length&&W(r,o)}function h(r,o){return g(r,o)&&W(r,o)&&I(r,o)<=r.length-o}function c(r,o){if(p(r,o)){var w=n(r,o);if(o+w>=r.length)return!1;var T=I(r,o);if(T<=w)return!1;var x=o+T;return x===r.length||p(r,x)}return!1}function s(r,o,w,T,x){if(!r.samplerate){var L=G(o,w,T,x);if(!L)return;r.config=L.config,r.samplerate=L.samplerate,r.channelCount=L.channelCount,r.codec=L.codec,r.manifestCodec=L.manifestCodec,V.logger.log("parsed codec:"+r.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function d(r){return 1024*9e4/r}function i(r,o,w,T,x){var L=n(r,o),A=I(r,o);if(A-=L,A>0){var E=w+T*x;return{headerLength:L,frameLength:A,stamp:E}}}function l(r,o,w,T,x){var L=d(r.samplerate),A=i(o,w,T,x,L);if(A){var E=A.frameLength,_=A.headerLength,m=A.stamp,f=_+E,S=Math.max(0,w+f-o.length),b;S?(b=new Uint8Array(f-_),b.set(o.subarray(w+_,o.length),0)):b=o.subarray(w+_,w+f);var y={unit:b,pts:m};return S||r.samples.push(y),{sample:y,length:f,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"initPTSFn",function(){return I});var V=D("./src/polyfills/number.ts"),U=D("./src/demux/id3.ts"),O=D("./src/demux/dummy-demuxed-track.ts"),G=D("./src/utils/mp4-tools.ts"),W=D("./src/utils/typed-array.ts"),n=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=g.prototype;return p.resetInitSegment=function(c,s,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(c,s){return!1},p.appendFrame=function(c,s,d){},p.demux=function(c,s){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var d=U.getID3Data(c,0),i=d?d.length:0,l,r,o=this._audioTrack,w=this._id3Track,T=d?U.getTimeStamp(d):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(T,s)),d&&d.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),r=this.initPTS;i<x;){if(this.canParse(c,i)){var L=this.appendFrame(o,c,i);L?(this.frameIndex++,r=L.sample.pts,i+=L.length,l=i):i=x}else U.canParse(c,i)?(d=U.getID3Data(c,i),w.samples.push({pts:r,dts:r,data:d}),i+=d.length,l=i):i++;if(i===x&&l!==x){var A=Object(W.sliceUint8)(c,l);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:o,avcTrack:Object(O.dummyTrack)(),id3Track:w,textTrack:Object(O.dummyTrack)()}},p.demuxSampleAes=function(c,s,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(c){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},p.destroy=function(){},g}(),I=function(p,h){return Object(V.isFiniteNumber)(p)?p*90:h*9e4};z.default=n},"./src/demux/chunk-cache.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function O(){this.chunks=[],this.dataLength=0}var G=O.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,I=this.dataLength,g;if(n.length)n.length===1?g=n[0]:g=U(n,I);else return new Uint8Array(0);return this.reset(),g},G.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function U(O,G){for(var W=new Uint8Array(G),n=0,I=0;I<O.length;I++){var g=O[I];W.set(g,n),n+=g.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"dummyTrack",function(){return V});function V(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/utils/logger.ts"),U=function(){function O(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var G=O.prototype;return G.loadWord=function(){var n=this.data,I=this.bytesAvailable,g=n.byteLength-I,p=new Uint8Array(4),h=Math.min(4,I);if(h===0)throw new Error("no bytes available");p.set(n.subarray(g,g+h)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},G.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var I=Math.min(this.bitsAvailable,n),g=this.word>>>32-I;return n>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=n-I,I>0&&this.bitsAvailable?g<<I|this.readBits(I):g},G.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()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var I=8,g=8,p,h=0;h<n;h++)g!==0&&(p=this.readEG(),g=(I+p+256)%256),I=g===0?I:g},G.readSPS=function(){var n=0,I=0,g=0,p=0,h,c,s,d=this.readUByte.bind(this),i=this.readBits.bind(this),l=this.readUEG.bind(this),r=this.readBoolean.bind(this),o=this.skipBits.bind(this),w=this.skipEG.bind(this),T=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);d();var L=d();if(i(5),o(3),d(),T(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var A=l();if(A===3&&o(1),T(),T(),o(1),r())for(c=A!==3?8:12,s=0;s<c;s++)r()&&(s<6?x(16):x(64))}T();var E=l();if(E===0)l();else if(E===1)for(o(1),w(),w(),h=l(),s=0;s<h;s++)w();T(),o(1);var _=l(),m=l(),f=i(1);f===0&&o(1),o(1),r()&&(n=l(),I=l(),g=l(),p=l());var S=[1,1];if(r()&&r()){var b=d();switch(b){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((_+1)*16-n*2-I*2),height:(2-f)*(m+1)*16-(f?2:4)*(g+p),pixelRatio:S}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();z.default=U},"./src/demux/id3.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"isHeader",function(){return V}),D.d(z,"isFooter",function(){return U}),D.d(z,"getID3Data",function(){return O}),D.d(z,"canParse",function(){return W}),D.d(z,"getTimeStamp",function(){return n}),D.d(z,"isTimeStampFrame",function(){return I}),D.d(z,"getID3Frames",function(){return p}),D.d(z,"decodeFrame",function(){return h}),D.d(z,"utf8ArrayToStr",function(){return l}),D.d(z,"testables",function(){return r});var V=function(x,L){return L+10<=x.length&&(x[L]===73&&x[L+1]===68&&x[L+2]===51&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},U=function(x,L){return L+10<=x.length&&(x[L]===51&&x[L+1]===68&&x[L+2]===73&&(x[L+3]<255&&x[L+4]<255&&(x[L+6]<128&&x[L+7]<128&&x[L+8]<128&&x[L+9]<128)))},O=function(x,L){for(var A=L,E=0;V(x,L);){E+=10;var _=G(x,L+6);E+=_,U(x,L+10)&&(E+=10),L+=E}return E>0?x.subarray(A,A+E):void 0},G=function(x,L){var A=0;return A=(x[L]&127)<<21,A|=(x[L+1]&127)<<14,A|=(x[L+2]&127)<<7,A|=x[L+3]&127,A},W=function(x,L){return V(x,L)&&G(x,L+6)+10<=x.length-L},n=function(x){for(var L=p(x),A=0;A<L.length;A++){var E=L[A];if(I(E))return i(E)}return},I=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},g=function(x){var L=String.fromCharCode(x[0],x[1],x[2],x[3]),A=G(x,4),E=10;return{type:L,size:A,data:x.subarray(E,E+A)}},p=function(x){for(var L=0,A=[];V(x,L);){var E=G(x,L+6);L+=10;for(var _=L+E;L+8<_;){var m=g(x.subarray(L)),f=h(m);f&&A.push(f),L+=m.size+10}U(x,L)&&(L+=10)}return A},h=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?d(x):s(x)},c=function(x){if(x.size<2)return;var L=l(x.data,!0),A=new Uint8Array(x.data.subarray(L.length+1));return{key:x.type,info:L,data:A.buffer}},s=function(x){if(x.size<2)return;if(x.type==="TXXX"){var L=1,A=l(x.data.subarray(L),!0);L+=A.length+1;var E=l(x.data.subarray(L));return{key:x.type,info:A,data:E}}var _=l(x.data.subarray(1));return{key:x.type,data:_}},d=function(x){if(x.type==="WXXX"){if(x.size<2)return;var L=1,A=l(x.data.subarray(L),!0);L+=A.length+1;var E=l(x.data.subarray(L));return{key:x.type,info:A,data:E}}var _=l(x.data);return{key:x.type,data:_}},i=function(x){if(x.data.byteLength===8){var L=new Uint8Array(x.data),A=L[3]&1,E=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return E/=45,A&&(E+=4772185884e-2),Math.round(E)}return},l=function(x,L){L===void 0&&(L=!1);var A=w();if(A){var E=A.decode(x);if(L){var _=E.indexOf("\0");return _!==-1?E.substring(0,_):E}return E.replace(/\0/g,"")}for(var m=x.length,f,S,b,y="",M=0;M<m;){if(f=x[M++],f===0&&L)return y;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(f);break;case 12:case 13:S=x[M++],y+=String.fromCharCode((f&31)<<6|S&63);break;case 14:S=x[M++],b=x[M++],y+=String.fromCharCode((f&15)<<12|(S&63)<<6|(b&63)<<0);break;default:}}return y},r={decodeTextFrame:s},o;function w(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/demux/base-audio-demuxer.ts"),U=D("./src/demux/id3.ts"),O=D("./src/utils/logger.ts"),G=D("./src/demux/mpegaudio.ts");function W(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,n(g,p)}function n(g,p){return n=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},n(g,p)}var I=function(g){W(p,g);function p(){return g.apply(this,arguments)||this}var h=p.prototype;return h.resetInitSegment=function(s,d,i){g.prototype.resetInitSegment.call(this,s,d,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},p.probe=function(s){if(!s)return!1;for(var d=U.getID3Data(s,0)||[],i=d.length,l=s.length;i<l;i++)if(G.probe(s,i))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(s,d){return G.canParse(s,d)},h.appendFrame=function(s,d,i){return this.initPTS===null?void 0:G.appendFrame(s,d,i,this.initPTS,this.frameIndex)},p}(V.default);I.minProbeByteLength=4,z.default=I},"./src/demux/mp4demuxer.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/utils/mp4-tools.ts"),U=D("./src/demux/dummy-demuxed-track.ts"),O=function(){function G(n,I){this.remainderData=null,this.config=void 0,this.config=I}var W=G.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},G.probe=function(I){return Object(V.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},W.demux=function(I){var g=I,p=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(V.appendUint8Array)(this.remainderData,I));var h=Object(V.segmentValidRange)(g);this.remainderData=h.remainder,p.samples=h.valid||new Uint8Array}else p.samples=g;return{audioTrack:Object(U.dummyTrack)(),avcTrack:p,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.flush=function(){var I=Object(U.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:I,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.demuxSampleAes=function(I,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();O.minProbeByteLength=1024,z.default=O},"./src/demux/mpegaudio.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"appendFrame",function(){return n}),D.d(z,"parseHeader",function(){return I}),D.d(z,"isHeaderPattern",function(){return g}),D.d(z,"isHeader",function(){return p}),D.d(z,"canParse",function(){return h}),D.d(z,"probe",function(){return c});var V=null,U=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function n(s,d,i,l,r){if(i+24>d.length)return;var o=I(d,i);if(o&&i+o.frameLength<=d.length){var w=o.samplesPerFrame*9e4/o.sampleRate,T=l+r*w,x={unit:d.subarray(i,i+o.frameLength),pts:T,dts:T};return s.config=[],s.channelCount=o.channelCount,s.samplerate=o.sampleRate,s.samples.push(x),{sample:x,length:o.frameLength,missing:0}}}function I(s,d){var i=s[d+1]>>3&3,l=s[d+1]>>1&3,r=s[d+2]>>4&15,o=s[d+2]>>2&3;if(i!==1&&r!==0&&r!==15&&o!==3){var w=s[d+2]>>1&1,T=s[d+3]>>6,x=i===3?3-l:l===3?3:4,L=U[x*14+r-1]*1e3,A=i===3?0:i===2?1:2,E=O[A*3+o],_=T===3?1:2,m=G[i][l],f=W[l],S=m*8*f,b=Math.floor(m*L/E+w)*f;if(V===null){var y=navigator.userAgent||"",M=y.match(/Chrome\/(\d+)/i);V=M?parseInt(M[1]):0}var B=!!V&&V<=87;return B&&l===2&&L>=224e3&&T===0&&(s[d+3]=s[d+3]|128),{sampleRate:E,channelCount:_,frameLength:b,samplesPerFrame:S}}}function g(s,d){return s[d]===255&&(s[d+1]&224)===224&&(s[d+1]&6)!==0}function p(s,d){return d+1<s.length&&g(s,d)}function h(s,d){var i=4;return g(s,d)&&i<=s.length-d}function c(s,d){if(d+1<s.length&&g(s,d)){var i=4,l=I(s,d),r=i;l!=null&&l.frameLength&&(r=l.frameLength);var o=d+r;return o===s.length||p(s,o)}return!1}},"./src/demux/sample-aes.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/crypt/decrypter.ts"),U=D("./src/demux/tsdemuxer.ts"),O=function(){function G(n,I,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new V.default(n,I,{removePKCS7Padding:!1})}var W=G.prototype;return W.decryptBuffer=function(I,g){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,g)},W.decryptAacSample=function(I,g,p,h){var c=I[g].unit,s=c.subarray(16,c.length-c.length%16),d=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(d,function(l){var r=new Uint8Array(l);c.set(r,16),h||i.decryptAacSamples(I,g+1,p)})},W.decryptAacSamples=function(I,g,p){for(;;g++){if(g>=I.length){p();return}if(I[g].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(I,g,p,h),!h)return}},W.getAvcEncryptedData=function(I){for(var g=Math.floor((I.length-48)/160)*16+16,p=new Int8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)p.set(I.subarray(c,c+16),h);return p},W.getAvcDecryptedUnit=function(I,g){for(var p=new Uint8Array(g),h=0,c=32;c<=I.length-16;c+=160,h+=16)I.set(p.subarray(h,h+16),c);return I},W.decryptAvcSample=function(I,g,p,h,c,s){var d=Object(U.discardEPB)(c.data),i=this.getAvcEncryptedData(d),l=this;this.decryptBuffer(i.buffer,function(r){c.data=l.getAvcDecryptedUnit(d,r),s||l.decryptAvcSamples(I,g,p+1,h)})},W.decryptAvcSamples=function(I,g,p,h){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=I.length){h();return}for(var c=I[g].units;!(p>=c.length);p++){var s=c[p];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(I,g,p,h,s,d),!d)return}}},G}();z.default=O},"./src/demux/transmuxer-interface.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c});var V=D("./node_modules/webworkify-webpack/index.js"),U=D.n(V),O=D("./src/events.ts"),G=D("./src/demux/transmuxer.ts"),W=D("./src/utils/logger.ts"),n=D("./src/errors.ts"),I=D("./src/utils/mediasource-helper.ts"),g=D("./node_modules/eventemitter3/index.js"),p=D.n(g),h=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function s(i,l,r,o){var w=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=i,this.id=l,this.onTransmuxComplete=r,this.onFlush=o;var T=i.config,x=function(m,f){f=f||{},f.frag=w.frag,f.id=w.id,i.trigger(m,f)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,x),this.observer.on(O.Events.ERROR,x);var L={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var E;try{E=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),E.addEventListener("message",this.onwmsg),E.onerror=function(_){i.trigger(O.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},E.postMessage({cmd:"init",typeSupported:L,vendor:A,id:l,config:JSON.stringify(T)})}catch(_){W.logger.warn("Error in worker:",_),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),E&&self.URL.revokeObjectURL(E.objectURL),this.transmuxer=new G.default(this.observer,L,T,A,l),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,T,A,l)}var d=s.prototype;return d.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},d.push=function(l,r,o,w,T,x,L,A,E,_){var m=this;E.transmuxing.start=self.performance.now();var f=this.transmuxer,S=this.worker,b=x?x.start:T.start,y=T.decryptdata,M=this.frag,B=!(M&&T.cc===M.cc),R=!(M&&E.level===M.level),H=M?E.sn-M.sn:-1,N=this.part?E.part-this.part.index:1,C=!R&&(H===1||H===0&&N===1),K=self.performance.now();(R||H||T.stats.parsing.start===0)&&(T.stats.parsing.start=K),x&&(N||!C)&&(x.stats.parsing.start=K);var Z=new G.TransmuxState(B,C,A,R,b);if(!C||B){W.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+E.sn+" p: "+E.part+" level: "+E.level+" id: "+E.id+`
|
|
discontinuity: `+B+`
|
|
trackSwitch: `+R+`
|
|
contiguous: `+C+`
|
|
accurateTimeOffset: `+A+`
|
|
timeOffset: `+b);var oe=new G.TransmuxConfig(o,w,r,L,_);this.configureTransmuxer(oe)}if(this.frag=T,this.part=x,S)S.postMessage({cmd:"demux",data:l,decryptdata:y,chunkMeta:E,state:Z},l instanceof ArrayBuffer?[l]:[]);else if(f){var fe=f.push(l,y,E,Z);Object(G.isPromise)(fe)?fe.then(function(xe){m.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(fe)}},d.flush=function(l){var r=this;l.transmuxing.start=self.performance.now();var o=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:l});else if(o){var T=o.flush(l);Object(G.isPromise)(T)?T.then(function(x){r.handleFlushResult(x,l)}):this.handleFlushResult(T,l)}},d.handleFlushResult=function(l,r){var o=this;l.forEach(function(w){o.handleTransmuxComplete(w)}),this.onFlush(r)},d.onWorkerMessage=function(l){var r=l.data,o=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,o.trigger(r.event,r.data);break}}},d.configureTransmuxer=function(l){var r=this.worker,o=this.transmuxer;r?r.postMessage({cmd:"configure",config:l}):o&&o.configure(l)},d.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},s}()},"./src/demux/transmuxer-worker.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return n});var V=D("./src/demux/transmuxer.ts"),U=D("./src/events.ts"),O=D("./src/utils/logger.ts"),G=D("./node_modules/eventemitter3/index.js"),W=D.n(G);function n(c){var s=new G.EventEmitter,d=function(l,r){c.postMessage({event:l,data:r})};s.on(U.Events.FRAG_DECRYPTED,d),s.on(U.Events.ERROR,d),c.addEventListener("message",function(i){var l=i.data;switch(l.cmd){case"init":{var r=JSON.parse(l.config);c.transmuxer=new V.default(s,l.typeSupported,r,l.vendor,l.id),Object(O.enableLogs)(r.debug),d("init",null);break}case"configure":{c.transmuxer.configure(l.config);break}case"demux":{var o=c.transmuxer.push(l.data,l.decryptdata,l.chunkMeta,l.state);Object(V.isPromise)(o)?o.then(function(x){I(c,x)}):I(c,o);break}case"flush":{var w=l.chunkMeta,T=c.transmuxer.flush(w);Object(V.isPromise)(T)?T.then(function(x){p(c,x,w)}):p(c,T,w);break}default:break}})}function I(c,s){if(h(s.remuxResult))return;var d=[],i=s.remuxResult,l=i.audio,r=i.video;l&&g(d,l),r&&g(d,r),c.postMessage({event:"transmuxComplete",data:s},d)}function g(c,s){s.data1&&c.push(s.data1.buffer),s.data2&&c.push(s.data2.buffer)}function p(c,s,d){s.forEach(function(i){I(c,i)}),c.postMessage({event:"flush",data:d})}function h(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r}),D.d(z,"isPromise",function(){return T}),D.d(z,"TransmuxConfig",function(){return x}),D.d(z,"TransmuxState",function(){return L});var V=D("./src/events.ts"),U=D("./src/errors.ts"),O=D("./src/crypt/decrypter.ts"),G=D("./src/demux/aacdemuxer.ts"),W=D("./src/demux/mp4demuxer.ts"),n=D("./src/demux/tsdemuxer.ts"),I=D("./src/demux/mp3demuxer.ts"),g=D("./src/remux/mp4-remuxer.ts"),p=D("./src/remux/passthrough-remuxer.ts"),h=D("./src/demux/chunk-cache.ts"),c=D("./src/utils/mp4-tools.ts"),s=D("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(A){s.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var i=[{demux:n.default,remux:g.default},{demux:W.default,remux:p.default},{demux:G.default,remux:g.default},{demux:I.default,remux:g.default}],l=1024;i.forEach(function(A){var E=A.demux;l=Math.max(l,E.minProbeByteLength)});var r=function(){function A(_,m,f,S,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 h.default,this.observer=_,this.typeSupported=m,this.config=f,this.vendor=S,this.id=b}var E=A.prototype;return E.configure=function(m){this.transmuxConfig=m,this.decrypter&&this.decrypter.reset()},E.push=function(m,f,S,b){var y=this,M=S.transmuxing;M.executeStart=d();var B=new Uint8Array(m),R=this.cache,H=this.config,N=this.currentTransmuxState,C=this.transmuxConfig;b&&(this.currentTransmuxState=b);var K=o(B,f);if(K&&K.method==="AES-128"){var Z=this.getDecrypter();if(H.enableSoftwareAES){var oe=Z.softwareDecrypt(B,K.key.buffer,K.iv.buffer);if(!oe)return M.executeEnd=d(),w(S);B=new Uint8Array(oe)}else return this.decryptionPromise=Z.webCryptoDecrypt(B,K.key.buffer,K.iv.buffer).then(function(Ie){var Ue=y.push(Ie,null,S);return y.decryptionPromise=null,Ue}),this.decryptionPromise}var fe=b||N,xe=fe.contiguous,be=fe.discontinuity,Te=fe.trackSwitch,Ce=fe.accurateTimeOffset,Le=fe.timeOffset,ge=C.audioCodec,Y=C.videoCodec,k=C.defaultInitPts,j=C.duration,J=C.initSegmentData;if((be||Te)&&this.resetInitSegment(J,ge,Y,j),be&&this.resetInitialTimestamp(k),xe||this.resetContiguity(),this.needsProbing(B,be,Te)){if(R.dataLength){var ie=R.flush();B=Object(c.appendUint8Array)(ie,B)}this.configureTransmuxer(B,C)}var X=this.transmux(B,K,Le,Ce,S),ve=this.currentTransmuxState;return ve.contiguous=!0,ve.discontinuity=!1,ve.trackSwitch=!1,M.executeEnd=d(),X},E.flush=function(m){var f=this,S=m.transmuxing;S.executeStart=d();var b=this.decrypter,y=this.cache,M=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return f.flush(m)});var R=[],H=M.timeOffset;if(b){var N=b.flush();N&&R.push(this.push(N,null,m))}var C=y.dataLength;y.reset();var K=this.demuxer,Z=this.remuxer;if(!K||!Z)return C>=l&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=d(),[w(m)];var oe=K.flush(H);return T(oe)?oe.then(function(fe){return f.flushRemux(R,fe,m),R}):(this.flushRemux(R,oe,m),R)},E.flushRemux=function(m,f,S){var b=f.audioTrack,y=f.avcTrack,M=f.id3Track,B=f.textTrack,R=this.currentTransmuxState,H=R.accurateTimeOffset,N=R.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var C=this.remuxer.remux(b,y,M,B,N,H,!0,this.id);m.push({remuxResult:C,chunkMeta:S}),S.transmuxing.executeEnd=d()},E.resetInitialTimestamp=function(m){var f=this.demuxer,S=this.remuxer;if(!f||!S)return;f.resetTimeStamp(m),S.resetTimeStamp(m)},E.resetContiguity=function(){var m=this.demuxer,f=this.remuxer;if(!m||!f)return;m.resetContiguity(),f.resetNextTimestamp()},E.resetInitSegment=function(m,f,S,b){var y=this.demuxer,M=this.remuxer;if(!y||!M)return;y.resetInitSegment(f,S,b),M.resetInitSegment(m,f,S)},E.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},E.transmux=function(m,f,S,b,y){var M;return f&&f.method==="SAMPLE-AES"?M=this.transmuxSampleAes(m,f,S,b,y):M=this.transmuxUnencrypted(m,S,b,y),M},E.transmuxUnencrypted=function(m,f,S,b){var y=this.demuxer.demux(m,f,!1,!this.config.progressive),M=y.audioTrack,B=y.avcTrack,R=y.id3Track,H=y.textTrack,N=this.remuxer.remux(M,B,R,H,f,S,!1,this.id);return{remuxResult:N,chunkMeta:b}},E.transmuxSampleAes=function(m,f,S,b,y){var M=this;return this.demuxer.demuxSampleAes(m,f,S).then(function(B){var R=M.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,S,b,!1,M.id);return{remuxResult:R,chunkMeta:y}})},E.configureTransmuxer=function(m,f){for(var S=this.config,b=this.observer,y=this.typeSupported,M=this.vendor,B=f.audioCodec,R=f.defaultInitPts,H=f.duration,N=f.initSegmentData,C=f.videoCodec,K,Z=0,oe=i.length;Z<oe;Z++)if(i[Z].demux.probe(m)){K=i[Z];break}K||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:W.default,remux:p.default});var fe=this.demuxer,xe=this.remuxer,be=K.remux,Te=K.demux;(!xe||!(xe instanceof be))&&(this.remuxer=new be(b,S,y,M)),(!fe||!(fe instanceof Te))&&(this.demuxer=new Te(b,S,y),this.probe=Te.probe),this.resetInitSegment(N,B,C,H),this.resetInitialTimestamp(R)},E.needsProbing=function(m,f,S){return!this.demuxer||!this.remuxer||f||S},E.getDecrypter=function(){var m=this.decrypter;return m||(m=this.decrypter=new O.default(this.observer,this.config)),m},A}();function o(A,E){var _=null;return A.byteLength>0&&E!=null&&E.key!=null&&E.iv!==null&&E.method!=null&&(_=E),_}var w=function(E){return{remuxResult:{},chunkMeta:E}};function T(A){return"then"in A&&A.then instanceof Function}var x=function(E,_,m,f,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=E,this.videoCodec=_,this.initSegmentData=m,this.duration=f,this.defaultInitPts=S},L=function(E,_,m,f,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=E,this.contiguous=_,this.accurateTimeOffset=m,this.trackSwitch=f,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"discardEPB",function(){return w});var V=D("./src/demux/adts.ts"),U=D("./src/demux/mpegaudio.ts"),O=D("./src/demux/exp-golomb.ts"),G=D("./src/demux/id3.ts"),W=D("./src/demux/sample-aes.ts"),n=D("./src/events.ts"),I=D("./src/utils/mp4-tools.ts"),g=D("./src/utils/logger.ts"),p=D("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},c=function(){function T(L,A,E){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=L,this.config=A,this.typeSupported=E}T.probe=function(A){var E=T.syncOffset(A);return E<0?!1:(E&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+E+", junk ahead ?"),!0)},T.syncOffset=function(A){for(var E=Math.min(1e3,A.length-3*188),_=0;_<E;){if(A[_]===71&&A[_+188]===71&&A[_+2*188]===71)return _;_++}return-1},T.createTrack=function(A,E){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:h[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?E:void 0}};var x=T.prototype;return x.resetInitSegment=function(A,E,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",_),this._audioTrack=T.createTrack("audio",_),this._id3Track=T.createTrack("id3",_),this._txtTrack=T.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=E,this._duration=_},x.resetTimeStamp=function(){},x.resetContiguity=function(){var A=this._audioTrack,E=this._avcTrack,_=this._id3Track;A&&(A.pesData=null),E&&(E.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(A,E,_,m){_===void 0&&(_=!1),m===void 0&&(m=!1),_||(this.sampleAes=null);var f,S=this._avcTrack,b=this._audioTrack,y=this._id3Track,M=S.pid,B=S.pesData,R=b.pid,H=y.pid,N=b.pesData,C=y.pesData,K=!1,Z=this.pmtParsed,oe=this._pmtId,fe=A.length;if(this.remainderData&&(A=Object(I.appendUint8Array)(this.remainderData,A),fe=A.length,this.remainderData=null),fe<188&&!m)return this.remainderData=A,{audioTrack:b,avcTrack:S,id3Track:y,textTrack:this._txtTrack};var xe=Math.max(0,T.syncOffset(A));fe-=(fe+xe)%188,fe<A.byteLength&&!m&&(this.remainderData=new Uint8Array(A.buffer,fe,A.buffer.byteLength-fe));for(var be=xe;be<fe;be+=188)if(A[be]===71){var Te=!!(A[be+1]&64),Ce=((A[be+1]&31)<<8)+A[be+2],Le=(A[be+3]&48)>>4,ge=void 0;if(Le>1){if(ge=be+5+A[be+4],ge===be+188)continue}else ge=be+4;switch(Ce){case M:Te&&(B&&(f=l(B))&&this.parseAVCPES(f,!1),B={data:[],size:0}),B&&(B.data.push(A.subarray(ge,be+188)),B.size+=be+188-ge);break;case R:Te&&(N&&(f=l(N))&&(b.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),N={data:[],size:0}),N&&(N.data.push(A.subarray(ge,be+188)),N.size+=be+188-ge);break;case H:Te&&(C&&(f=l(C))&&this.parseID3PES(f),C={data:[],size:0}),C&&(C.data.push(A.subarray(ge,be+188)),C.size+=be+188-ge);break;case 0:Te&&(ge+=A[ge]+1),oe=this._pmtId=d(A,ge);break;case oe:{Te&&(ge+=A[ge]+1);var Y=i(A,ge,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);M=Y.avc,M>0&&(S.pid=M),R=Y.audio,R>0&&(b.pid=R,b.isAAC=Y.isAAC),H=Y.id3,H>0&&(y.pid=H),K&&!Z&&(g.logger.log("reparse from beginning"),K=!1,be=xe-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=B,b.pesData=N,y.pesData=C;var k={audioTrack:b,avcTrack:S,id3Track:y,textTrack:this._txtTrack};return m&&this.extractRemainingSamples(k),k},x.flush=function(){var A=this.remainderData;this.remainderData=null;var E;return A?E=this.demux(A,-1,!1,!0):E={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(E),this.sampleAes?this.decrypt(E,this.sampleAes):E},x.extractRemainingSamples=function(A){var E=A.audioTrack,_=A.avcTrack,m=A.id3Track,f=_.pesData,S=E.pesData,b=m.pesData,y;f&&(y=l(f))?(this.parseAVCPES(y,!0),_.pesData=null):_.pesData=f,S&&(y=l(S))?(E.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),E.pesData=null):(S!=null&&S.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),E.pesData=S),b&&(y=l(b))?(this.parseID3PES(y),m.pesData=null):m.pesData=b},x.demuxSampleAes=function(A,E,_){var m=this.demux(A,_,!0,!this.config.progressive),f=this.sampleAes=new W.default(this.observer,this.config,E);return this.decrypt(m,f)},x.decrypt=function(A,E){return new Promise(function(_){var m=A.audioTrack,f=A.avcTrack;m.samples&&m.isAAC?E.decryptAacSamples(m.samples,0,function(){f.samples?E.decryptAvcSamples(f.samples,0,0,function(){_(A)}):_(A)}):f.samples&&E.decryptAvcSamples(f.samples,0,0,function(){_(A)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(A,E){var _=this,m=this._avcTrack,f=this.parseAVCNALu(A.data),S=!1,b=this.avcSample,y,M=!1;A.data=null,b&&f.length&&!m.audFound&&(r(b,m),b=this.avcSample=s(!1,A.pts,A.dts,"")),f.forEach(function(B){switch(B.type){case 1:{y=!0,b||(b=_.avcSample=s(!0,A.pts,A.dts,"")),S&&(b.debug+="NDR "),b.frame=!0;var R=B.data;if(M&&R.length>4){var H=new O.default(R).readSliceType();(H===2||H===4||H===7||H===9)&&(b.key=!0)}break}case 5:y=!0,b||(b=_.avcSample=s(!0,A.pts,A.dts,"")),S&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{y=!0,S&&b&&(b.debug+="SEI ");var N=new O.default(w(B.data));N.readUByte();for(var C=0,K=0,Z=!1,oe=0;!Z&&N.bytesAvailable>1;){C=0;do oe=N.readUByte(),C+=oe;while(oe===255);K=0;do oe=N.readUByte(),K+=oe;while(oe===255);if(C===4&&N.bytesAvailable!==0){Z=!0;var fe=N.readUByte();if(fe===181){var xe=N.readUShort();if(xe===49){var be=N.readUInt();if(be===1195456820){var Te=N.readUByte();if(Te===3){for(var Ce=N.readUByte(),Le=N.readUByte(),ge=31&Ce,Y=[Ce,Le],k=0;k<ge;k++)Y.push(N.readUByte()),Y.push(N.readUByte()),Y.push(N.readUByte());o(_._txtTrack.samples,{type:3,pts:A.pts,bytes:Y})}}}}}else if(C===5&&N.bytesAvailable!==0){if(Z=!0,K>16){for(var j=[],J=0;J<16;J++)j.push(N.readUByte().toString(16)),(J===3||J===5||J===7||J===9)&&j.push("-");for(var ie=K-16,X=new Uint8Array(ie),ve=0;ve<ie;ve++)X[ve]=N.readUByte();o(_._txtTrack.samples,{pts:A.pts,payloadType:C,uuid:j.join(""),userData:Object(G.utf8ArrayToStr)(X),userDataBytes:X})}}else if(K<N.bytesAvailable)for(var Ie=0;Ie<K;Ie++)N.readUByte()}break}case 7:if(y=!0,M=!0,S&&b&&(b.debug+="SPS "),!m.sps){var Ue=new O.default(B.data),pe=Ue.readSPS();m.width=pe.width,m.height=pe.height,m.pixelRatio=pe.pixelRatio,m.sps=[B.data],m.duration=_._duration;for(var _e=B.data.subarray(1,4),Ae="avc1.",De=0;De<3;De++){var je=_e[De].toString(16);je.length<2&&(je="0"+je),Ae+=je}m.codec=Ae}break;case 8:y=!0,S&&b&&(b.debug+="PPS "),m.pps||(m.pps=[B.data]);break;case 9:y=!1,m.audFound=!0,b&&r(b,m),b=_.avcSample=s(!1,A.pts,A.dts,S?"AUD ":"");break;case 12:y=!1;break;default:y=!1,b&&(b.debug+="unknown NAL "+B.type+" ");break}if(b&&y){var ze=b.units;ze.push(B)}}),E&&b&&(r(b,m),this.avcSample=null)},x.getLastNalUnit=function(){var A,E=this.avcSample,_;if(!E||E.units.length===0){var m=this._avcTrack.samples;E=m[m.length-1]}if((A=E)!==null&&A!==void 0&&A.units){var f=E.units;_=f[f.length-1]}return _},x.parseAVCNALu=function(A){var E=A.byteLength,_=this._avcTrack,m=_.naluState||0,f=m,S=[],b=0,y,M,B,R=-1,H=0;for(m===-1&&(R=0,H=A[0]&31,m=0,b=1);b<E;){if(y=A[b++],!m){m=y?0:1;continue}if(m===1){m=y?0:2;continue}if(!y)m=3;else if(y===1){if(R>=0){var N={data:A.subarray(R,b-m-1),type:H};S.push(N)}else{var C=this.getLastNalUnit();if(C&&(f&&b<=4-f&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-f))),M=b-m-1,M>0)){var K=new Uint8Array(C.data.byteLength+M);K.set(C.data,0),K.set(A.subarray(0,M),C.data.byteLength),C.data=K,C.state=0}}b<E?(B=A[b]&31,R=b,H=B,m=0):m=-1}else m=0}if(R>=0&&m>=0){var Z={data:A.subarray(R,E),type:H,state:m};S.push(Z)}if(S.length===0){var oe=this.getLastNalUnit();if(oe){var fe=new Uint8Array(oe.data.byteLength+A.byteLength);fe.set(oe.data,0),fe.set(A,oe.data.byteLength),oe.data=fe}}return _.naluState=m,S},x.parseAACPES=function(A){var E=0,_=this._audioTrack,m=this.aacOverFlow,f=A.data;if(m){this.aacOverFlow=null;var S=m.sample.unit.byteLength,b=Math.min(m.missing,S),y=S-b;m.sample.unit.set(f.subarray(0,b),y),_.samples.push(m.sample),E=m.missing}var M,B;for(M=E,B=f.length;M<B-1&&!V.isHeader(f,M);M++);if(M!==E){var R,H;if(M<B-1?(R="AAC PES did not start with ADTS header,offset:"+M,H=!1):(R="no ADTS header found in AAC PES",H=!0),g.logger.warn("parsing error:"+R),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:R}),H)return}V.initTrackConfig(_,this.observer,f,M,this.audioCodec);var N;if(A.pts!==void 0)N=A.pts;else if(m){var C=V.getFrameDuration(_.samplerate);N=m.sample.pts+C}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;M<B;)if(V.isHeader(f,M)){if(M+5<B){var Z=V.appendFrame(_,f,M,N,K);if(Z)if(Z.missing)this.aacOverFlow=Z;else{M+=Z.length,K++;continue}}break}else M++},x.parseMPEGPES=function(A){var E=A.data,_=E.length,m=0,f=0,S=A.pts;if(S===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<_;)if(U.isHeader(E,f)){var b=U.appendFrame(this._audioTrack,E,f,S,m);if(b)f+=b.length,m++;else break}else f++},x.parseID3PES=function(A){if(A.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},T}();c.minProbeByteLength=188;function s(T,x,L,A){return{key:T,frame:!1,pts:x,dts:L,units:[],debug:A,length:0}}function d(T,x){return(T[x+10]&31)<<8|T[x+11]}function i(T,x,L,A){var E={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(T[x+1]&15)<<8|T[x+2],m=x+3+_-4,f=(T[x+10]&15)<<8|T[x+11];for(x+=12+f;x<m;){var S=(T[x+1]&31)<<8|T[x+2];switch(T[x]){case 207:if(!A){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:E.audio===-1&&(E.audio=S);break;case 21:E.id3===-1&&(E.id3=S);break;case 219:if(!A){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:E.avc===-1&&(E.avc=S);break;case 3:case 4:L?E.audio===-1&&(E.audio=S,E.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((T[x+3]&15)<<8|T[x+4])+5}return E}function l(T){var x=0,L,A,E,_,m,f=T.data;if(!T||T.size===0)return null;for(;f[0].length<19&&f.length>1;){var S=new Uint8Array(f[0].length+f[1].length);S.set(f[0]),S.set(f[1],f[0].length),f[0]=S,f.splice(1,1)}L=f[0];var b=(L[0]<<16)+(L[1]<<8)+L[2];if(b===1){if(A=(L[4]<<8)+L[5],A&&A>T.size-6)return null;var y=L[7];y&192&&(_=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,y&64?(m=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,_-m>60*9e4&&(g.logger.warn(Math.round((_-m)/9e4)+"s delta between PTS and DTS, align them"),_=m)):m=_),E=L[8];var M=E+9;if(T.size<=M)return null;T.size-=M;for(var B=new Uint8Array(T.size),R=0,H=f.length;R<H;R++){L=f[R];var N=L.byteLength;if(M)if(M>N){M-=N;continue}else L=L.subarray(M),N-=M,M=0;B.set(L,x),x+=N}return A&&(A-=E+3),{data:B,pts:_,dts:m,len:A}}return null}function r(T,x){if(T.units.length&&T.frame){if(T.pts===void 0){var L=x.samples,A=L.length;if(A){var E=L[A-1];T.pts=E.pts,T.dts=E.dts}else{x.dropped++;return}}x.samples.push(T)}T.debug.length&&g.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function o(T,x){var L=T.length;if(L>0){if(x.pts>=T[L-1].pts)T.push(x);else for(var A=L-1;A>=0;A--)if(x.pts<T[A].pts){T.splice(A,0,x);break}}else T.push(x)}function w(T){for(var x=T.byteLength,L=[],A=1;A<x-2;)T[A]===0&&T[A+1]===0&&T[A+2]===3?(L.push(A+2),A+=2):A++;if(L.length===0)return T;var E=x-L.length,_=new Uint8Array(E),m=0;for(A=0;A<E;m++,A++)m===L[0]&&(m++,L.shift()),_[A]=T[m];return _}z.default=c},"./src/errors.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"ErrorTypes",function(){return V}),D.d(z,"ErrorDetails",function(){return U});var V;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(V||(V={}));var U;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(U||(U={}))},"./src/events.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"Events",function(){return V});var V;(function(U){U.MEDIA_ATTACHING="hlsMediaAttaching",U.MEDIA_ATTACHED="hlsMediaAttached",U.MEDIA_DETACHING="hlsMediaDetaching",U.MEDIA_DETACHED="hlsMediaDetached",U.BUFFER_RESET="hlsBufferReset",U.BUFFER_CODECS="hlsBufferCodecs",U.BUFFER_CREATED="hlsBufferCreated",U.BUFFER_APPENDING="hlsBufferAppending",U.BUFFER_APPENDED="hlsBufferAppended",U.BUFFER_EOS="hlsBufferEos",U.BUFFER_FLUSHING="hlsBufferFlushing",U.BUFFER_FLUSHED="hlsBufferFlushed",U.MANIFEST_LOADING="hlsManifestLoading",U.MANIFEST_LOADED="hlsManifestLoaded",U.MANIFEST_PARSED="hlsManifestParsed",U.LEVEL_SWITCHING="hlsLevelSwitching",U.LEVEL_SWITCHED="hlsLevelSwitched",U.LEVEL_LOADING="hlsLevelLoading",U.LEVEL_LOADED="hlsLevelLoaded",U.LEVEL_UPDATED="hlsLevelUpdated",U.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",U.LEVELS_UPDATED="hlsLevelsUpdated",U.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",U.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",U.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",U.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",U.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",U.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",U.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",U.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",U.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",U.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",U.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",U.CUES_PARSED="hlsCuesParsed",U.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",U.INIT_PTS_FOUND="hlsInitPtsFound",U.FRAG_LOADING="hlsFragLoading",U.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",U.FRAG_LOADED="hlsFragLoaded",U.FRAG_DECRYPTED="hlsFragDecrypted",U.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",U.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",U.FRAG_PARSING_METADATA="hlsFragParsingMetadata",U.FRAG_PARSED="hlsFragParsed",U.FRAG_BUFFERED="hlsFragBuffered",U.FRAG_CHANGED="hlsFragChanged",U.FPS_DROP="hlsFpsDrop",U.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",U.ERROR="hlsError",U.DESTROYING="hlsDestroying",U.KEY_LOADING="hlsKeyLoading",U.KEY_LOADED="hlsKeyLoaded",U.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",U.BACK_BUFFER_REACHED="hlsBackBufferReached"})(V||(V={}))},"./src/hls.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return T});var V=D("./node_modules/url-toolkit/src/url-toolkit.js"),U=D.n(V),O=D("./src/loader/playlist-loader.ts"),G=D("./src/loader/key-loader.ts"),W=D("./src/controller/id3-track-controller.ts"),n=D("./src/controller/latency-controller.ts"),I=D("./src/controller/level-controller.ts"),g=D("./src/controller/fragment-tracker.ts"),p=D("./src/controller/stream-controller.ts"),h=D("./src/is-supported.ts"),c=D("./src/utils/logger.ts"),s=D("./src/config.ts"),d=D("./node_modules/eventemitter3/index.js"),i=D.n(d),l=D("./src/events.ts"),r=D("./src/errors.ts");function o(x,L){for(var A=0;A<L.length;A++){var E=L[A];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}function w(x,L,A){return L&&o(x.prototype,L),A&&o(x,A),x}var T=function(){x.isSupported=function(){return Object(h.isSupported)()};function x(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.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 E=this.config=Object(s.mergeConfig)(x.DefaultConfig,A);this.userConfig=A,Object(c.enableLogs)(E.debug),this._autoLevelCapping=-1,E.progressive&&Object(s.enableStreamingMode)(E);var _=E.abrController,m=E.bufferController,f=E.capLevelController,S=E.fpsController,b=this.abrController=new _(this),y=this.bufferController=new m(this),M=this.capLevelController=new f(this),B=new S(this),R=new O.default(this),H=new G.default(this),N=new W.default(this),C=this.levelController=new I.default(this),K=new g.FragmentTracker(this),Z=this.streamController=new p.default(this,K);M.setStreamController(Z),B.setStreamController(Z);var oe=[C,Z];this.networkControllers=oe;var fe=[R,H,b,y,M,B,N,K];this.audioTrackController=this.createController(E.audioTrackController,null,oe),this.createController(E.audioStreamController,K,oe),this.subtitleTrackController=this.createController(E.subtitleTrackController,null,oe),this.createController(E.subtitleStreamController,K,oe),this.createController(E.timelineController,null,fe),this.emeController=this.createController(E.emeController,null,fe),this.cmcdController=this.createController(E.cmcdController,null,fe),this.latencyController=this.createController(n.default,null,fe),this.coreComponents=fe}var L=x.prototype;return L.createController=function(E,_,m){if(E){var f=_?new E(this,_):new E(this);return m&&m.push(f),f}return null},L.on=function(E,_,m){m===void 0&&(m=this),this._emitter.on(E,_,m)},L.once=function(E,_,m){m===void 0&&(m=this),this._emitter.once(E,_,m)},L.removeAllListeners=function(E){this._emitter.removeAllListeners(E)},L.off=function(E,_,m,f){m===void 0&&(m=this),this._emitter.off(E,_,m,f)},L.listeners=function(E){return this._emitter.listeners(E)},L.emit=function(E,_,m){return this._emitter.emit(E,_,m)},L.trigger=function(E,_){if(this.config.debug)return this.emit(E,E,_);try{return this.emit(E,E,_)}catch(m){c.logger.error("An internal error happened while handling event "+E+'. Error message: "'+m.message+'". Here is a stacktrace:',m),this.trigger(l.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:E,error:m})}return!1},L.listenerCount=function(E){return this._emitter.listenerCount(E)},L.destroy=function(){c.logger.log("destroy"),this.trigger(l.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(E){return E.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(E){return E.destroy()}),this.coreComponents.length=0},L.attachMedia=function(E){c.logger.log("attachMedia"),this._media=E,this.trigger(l.Events.MEDIA_ATTACHING,{media:E})},L.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(l.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(E){this.stopLoad();var _=this.media,m=this.url,f=this.url=V.buildAbsoluteURL(self.location.href,E,{alwaysNormalize:!0});c.logger.log("loadSource:"+f),_&&m&&m!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(l.Events.MANIFEST_LOADING,{url:E})},L.startLoad=function(E){E===void 0&&(E=-1),c.logger.log("startLoad("+E+")"),this.networkControllers.forEach(function(_){_.startLoad(E)})},L.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(E){E.stopLoad()})},L.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){c.logger.log("recoverMediaError");var E=this._media;this.detachMedia(),E&&this.attachMedia(E)},L.removeLevel=function(E,_){_===void 0&&(_=0),this.levelController.removeLevel(E,_)},w(x,[{key:"levels",get:function(){var E=this.levelController.levels;return E||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(E){c.logger.log("set currentLevel:"+E),this.loadLevel=E,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(E){c.logger.log("set nextLevel:"+E),this.levelController.manualLevel=E,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(E){c.logger.log("set loadLevel:"+E),this.levelController.manualLevel=E}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(E){this.levelController.nextLoadLevel=E}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(E){c.logger.log("set firstLevel:"+E),this.levelController.firstLevel=E}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(E){c.logger.log("set startLevel:"+E),E!==-1&&(E=Math.max(E,this.minAutoLevel)),this.levelController.startLevel=E}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(E){var _=!!E;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(E){this._autoLevelCapping!==E&&(c.logger.log("set autoLevelCapping:"+E),this._autoLevelCapping=E)}},{key:"bandwidthEstimate",get:function(){var E=this.abrController.bwEstimator;return E?E.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var E=this.levels,_=this.config.minAutoBitrate;if(!E)return 0;for(var m=E.length,f=0;f<m;f++)if(E[f].maxBitrate>_)return f;return 0}},{key:"maxAutoLevel",get:function(){var E=this.levels,_=this.autoLevelCapping,m;return _===-1&&E&&E.length?m=E.length-1:m=_,m}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(E){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,E)}},{key:"audioTracks",get:function(){var E=this.audioTrackController;return E?E.audioTracks:[]}},{key:"audioTrack",get:function(){var E=this.audioTrackController;return E?E.audioTrack:-1},set:function(E){var _=this.audioTrackController;_&&(_.audioTrack=E)}},{key:"subtitleTracks",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var E=this.subtitleTrackController;return E?E.subtitleTrack:-1},set:function(E){var _=this.subtitleTrackController;_&&(_.subtitleTrack=E)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var E=this.subtitleTrackController;return E?E.subtitleDisplay:!1},set:function(E){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=E)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(E){this.config.lowLatencyMode=E}},{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 l.Events}},{key:"ErrorTypes",get:function(){return r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(E){x.defaultConfig=E}}]),x}();T.defaultConfig=void 0},"./src/is-supported.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"isSupported",function(){return O}),D.d(z,"changeTypeSupported",function(){return G});var V=D("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var W=Object(V.getMediaSource)();if(!W)return!1;var n=U(),I=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!g}function G(){var W,n=U();return typeof(n==null||((W=n.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return c}),D.d(z,"LoadError",function(){return d});var V=D("./src/polyfills/number.ts"),U=D("./src/errors.ts");function O(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,g(i,l)}function G(i){var l=typeof Map=="function"?new Map:void 0;return G=function(o){if(o===null||!I(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l!="undefined"){if(l.has(o))return l.get(o);l.set(o,w)}function w(){return W(o,arguments,p(this).constructor)}return w.prototype=Object.create(o.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),g(w,o)},G(i)}function W(i,l,r){return n()?W=Reflect.construct:W=function(w,T,x){var L=[null];L.push.apply(L,T);var A=Function.bind.apply(w,L),E=new A;return x&&g(E,x.prototype),E},W.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(i){return!1}}function I(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function g(i,l){return g=Object.setPrototypeOf||function(o,w){return o.__proto__=w,o},g(i,l)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},p(i)}var h=Math.pow(2,17),c=function(){function i(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var l=i.prototype;return l.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},l.abort=function(){this.loader&&this.loader.abort()},l.load=function(o,w){var T=this,x=o.url;if(!x)return Promise.reject(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var L=this.config,A=L.fLoader,E=L.loader;return new Promise(function(_,m){T.loader&&T.loader.destroy();var f=T.loader=o.loader=A?new A(L):new E(L),S=s(o),b={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};o.stats=f.stats,f.load(S,b,{onSuccess:function(M,B,R,H){T.resetLoader(o,f),_({frag:o,part:null,payload:M.data,networkDetails:H})},onError:function(M,B,R){T.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:M,networkDetails:R}))},onAbort:function(M,B,R){T.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:R}))},onTimeout:function(M,B,R){T.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:R}))},onProgress:function(M,B,R,H){w&&w({frag:o,part:null,payload:R,networkDetails:H})}})})},l.loadPart=function(o,w,T){var x=this;this.abort();var L=this.config,A=L.fLoader,E=L.loader;return new Promise(function(_,m){x.loader&&x.loader.destroy();var f=x.loader=o.loader=A?new A(L):new E(L),S=s(o,w),b={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:h};w.stats=f.stats,f.load(S,b,{onSuccess:function(M,B,R,H){x.resetLoader(o,f),x.updateStatsFromPart(o,w);var N={frag:o,part:w,payload:M.data,networkDetails:H};T(N),_(N)},onError:function(M,B,R){x.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:w,response:M,networkDetails:R}))},onAbort:function(M,B,R){o.stats.aborted=w.stats.aborted,x.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:w,networkDetails:R}))},onTimeout:function(M,B,R){x.resetLoader(o,f),m(new d({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:w,networkDetails:R}))}})})},l.updateStatsFromPart=function(o,w){var T=o.stats,x=w.stats,L=x.total;if(T.loaded+=x.loaded,L){var A=Math.round(o.duration/w.duration),E=Math.min(Math.round(T.loaded/L),A),_=A-E,m=_*Math.round(T.loaded/E);T.total=T.loaded+m}else T.total=Math.max(T.loaded,T.total);var f=T.loading,S=x.loading;f.start?f.first+=S.first-S.start:(f.start=S.start,f.first=S.first),f.end=S.end},l.resetLoader=function(o,w){o.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},i}();function s(i,l){l===void 0&&(l=null);var r=l||i,o={frag:i,part:l,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},w=r.byteRangeStartOffset,T=r.byteRangeEndOffset;return Object(V.isFiniteNumber)(w)&&Object(V.isFiniteNumber)(T)&&(o.rangeStart=w,o.rangeEnd=T),o}var d=function(i){O(l,i);function l(r){for(var o,w=arguments.length,T=new Array(w>1?w-1:0),x=1;x<w;x++)T[x-1]=arguments[x];return o=i.call.apply(i,[this].concat(T))||this,o.data=void 0,o.data=r,o}return l}(G(Error))},"./src/loader/fragment.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"ElementaryStreamTypes",function(){return c}),D.d(z,"BaseSegment",function(){return s}),D.d(z,"Fragment",function(){return d}),D.d(z,"Part",function(){return i});var V=D("./src/polyfills/number.ts"),U=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(U),G=D("./src/utils/logger.ts"),W=D("./src/loader/level-key.ts"),n=D("./src/loader/load-stats.ts");function I(l,r){l.prototype=Object.create(r.prototype),l.prototype.constructor=l,g(l,r)}function g(l,r){return g=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},g(l,r)}function p(l,r){for(var o=0;o<r.length;o++){var w=r[o];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(l,w.key,w)}}function h(l,r,o){return r&&p(l.prototype,r),o&&p(l,o),l}var c;(function(l){l.AUDIO="audio",l.VIDEO="video",l.AUDIOVIDEO="audiovideo"})(c||(c={}));var s=function(){function l(o){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[c.AUDIO]=null,w[c.VIDEO]=null,w[c.AUDIOVIDEO]=null,w),this.baseurl=o}var r=l.prototype;return r.setByteRange=function(w,T){var x=w.split("@",2),L=[];x.length===1?L[0]=T?T.byteRangeEndOffset:0:L[0]=parseInt(x[1]),L[1]=parseInt(x[0])+L[0],this._byteRange=L},h(l,[{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(U.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),l}(),d=function(l){I(r,l);function r(w,T){var x;return x=l.call(this,T)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new n.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=w,x}var o=r.prototype;return o.createInitializationVector=function(T){for(var x=new Uint8Array(16),L=12;L<16;L++)x[L]=T>>8*(15-L)&255;return x},o.setDecryptDataFromLevelKey=function(T,x){var L=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(L=W.LevelKey.fromURI(T.uri),L.method=T.method,L.iv=this.createInitializationVector(x),L.keyFormat="identity"),L},o.setElementaryStreamInfo=function(T,x,L,A,E,_){_===void 0&&(_=!1);var m=this.elementaryStreams,f=m[T];if(!f){m[T]={startPTS:x,endPTS:L,startDTS:A,endDTS:E,partial:_};return}f.startPTS=Math.min(f.startPTS,x),f.endPTS=Math.max(f.endPTS,L),f.startDTS=Math.min(f.startDTS,A),f.endDTS=Math.max(f.endDTS,E)},o.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[c.AUDIO]=null,T[c.VIDEO]=null,T[c.AUDIOVIDEO]=null},h(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var T=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),r}(s),i=function(l){I(r,l);function r(o,w,T,x,L){var A;A=l.call(this,T)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new n.LoadStats,A.duration=o.decimalFloatingPoint("DURATION"),A.gap=o.bool("GAP"),A.independent=o.bool("INDEPENDENT"),A.relurl=o.enumeratedString("URI"),A.fragment=w,A.index=x;var E=o.enumeratedString("BYTERANGE");return E&&A.setByteRange(E,L),L&&(A.fragOffset=L.fragOffset+L.duration),A}return h(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),r}(s)},"./src/loader/key-loader.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return G});var V=D("./src/events.ts"),U=D("./src/errors.ts"),O=D("./src/utils/logger.ts"),G=function(){function W(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=W.prototype;return n._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var p=this.loaders[g];p&&p.destroy()}this.loaders={}},n.onKeyLoading=function(g,p){var h=p.frag,c=h.type,s=this.loaders[c];if(!h.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=h.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(O.logger.warn("abort previous key loader for type:"+c),s.abort()),!d){O.logger.warn("key uri is falsy");return}var l=i.loader,r=h.loader=this.loaders[c]=new l(i);this.decrypturl=d,this.decryptkey=null;var o={url:d,frag:h,responseType:"arraybuffer"},w={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(o,w,T)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:h}))},n.loadsuccess=function(g,p,h){var c=h.frag;if(!c.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(g.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:c})},n.loaderror=function(g,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:g})},n.loadtimeout=function(g,p){var h=p.frag,c=h.loader;c&&c.abort(),delete this.loaders[h.type],this.hls.trigger(V.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},W}()},"./src/loader/level-details.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"LevelDetails",function(){return W});var V=D("./src/polyfills/number.ts");function U(n,I){for(var g=0;g<I.length;g++){var p=I[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function O(n,I,g){return I&&U(n.prototype,I),g&&U(n,g),n}var G=10,W=function(){function n(g){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=g}var I=n.prototype;return I.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-p.lastPartSn,c=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!c||!!h,this.advanced=this.endSN>p.endSN||h>0||h===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},O(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var h=this.driftEnd-this.driftStart;return h*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"LevelKey",function(){return W});var V=D("./node_modules/url-toolkit/src/url-toolkit.js"),U=D.n(V);function O(n,I){for(var g=0;g<I.length;g++){var p=I[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}function G(n,I,g){return I&&O(n.prototype,I),g&&O(n,g),n}var W=function(){n.fromURL=function(g,p){return new n(g,p)},n.fromURI=function(g){return new n(g)};function n(I,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(V.buildAbsoluteURL)(I,g,{alwaysNormalize:!0}):this._uri=I}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"LoadStats",function(){return V});var V=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(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r});var V=D("./src/polyfills/number.ts"),U=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(U),G=D("./src/loader/fragment.ts"),W=D("./src/loader/level-details.ts"),n=D("./src/loader/level-key.ts"),I=D("./src/utils/attr-list.ts"),g=D("./src/utils/logger.ts"),p=D("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=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("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function l(L){var A,E;return i.test((A=(E=U.parseURL(L))===null||E===void 0?void 0:E.path)!=null?A:"")}var r=function(){function L(){}return L.findGroup=function(E,_){for(var m=0;m<E.length;m++){var f=E[m];if(f.id===_)return f}},L.convertAVC1ToAVCOTI=function(E){var _=E.split(".");if(_.length>2){var m=_.shift()+".";return m+=parseInt(_.shift()).toString(16),m+=("000"+parseInt(_.shift()).toString(16)).substr(-4),m}return E},L.resolve=function(E,_){return U.buildAbsoluteURL(_,E,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(E,_){var m=[],f={},S=!1;h.lastIndex=0;for(var b;(b=h.exec(E))!=null;)if(b[1]){var y=new I.AttrList(b[1]),M={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:L.resolve(b[2],_)},B=y.decimalResolution("RESOLUTION");B&&(M.width=B.width,M.height=B.height),o((y.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=L.convertAVC1ToAVCOTI(M.videoCodec)),m.push(M)}else if(b[3]){var R=new I.AttrList(b[3]);R["DATA-ID"]&&(S=!0,f[R["DATA-ID"]]=R)}return{levels:m,sessionData:S?f:null}},L.parseMasterPlaylistMedia=function(E,_,m,f){f===void 0&&(f=[]);var S,b=[],y=0;for(c.lastIndex=0;(S=c.exec(E))!==null;){var M=new I.AttrList(S[1]);if(M.TYPE===m){var B={attrs:M,bitrate:0,id:y++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:m,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?L.resolve(M.URI,_):""};if(f.length){var R=L.findGroup(f,B.groupId)||f[0];w(B,R,"audioCodec"),w(B,R,"textCodec")}b.push(B)}}return b},L.parseLevelPlaylist=function(E,_,m,f,S){var b=new W.LevelDetails(_),y=b.fragments,M=null,B=0,R=0,H=0,N=0,C=null,K=new G.Fragment(f,_),Z,oe,fe,xe=-1,be=!1;for(s.lastIndex=0,b.m3u8=E;(Z=s.exec(E))!==null;){be&&(be=!1,K=new G.Fragment(f,_),K.start=H,K.sn=B,K.cc=N,K.level=m,M&&(K.initSegment=M,K.rawProgramDateTime=M.rawProgramDateTime));var Te=Z[1];if(Te){K.duration=parseFloat(Te);var Ce=(" "+Z[2]).slice(1);K.title=Ce||null,K.tagList.push(Ce?["INF",Te,Ce]:["INF",Te])}else if(Z[3])Object(V.isFiniteNumber)(K.duration)&&(K.start=H,fe&&(K.levelkey=fe),K.sn=B,K.level=m,K.cc=N,K.urlId=S,y.push(K),K.relurl=(" "+Z[3]).slice(1),x(K,C),C=K,H+=K.duration,B++,R=0,be=!0);else if(Z[4]){var Le=(" "+Z[4]).slice(1);C?K.setByteRange(Le,C):K.setByteRange(Le)}else if(Z[5])K.rawProgramDateTime=(" "+Z[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),xe===-1&&(xe=y.length);else{if(Z=Z[0].match(d),!Z){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<Z.length&&!(typeof Z[oe]!="undefined");oe++);var ge=(" "+Z[oe]).slice(1),Y=(" "+Z[oe+1]).slice(1),k=Z[oe+2]?(" "+Z[oe+2]).slice(1):"";switch(ge){case"PLAYLIST-TYPE":b.type=Y.toUpperCase();break;case"MEDIA-SEQUENCE":B=b.startSN=parseInt(Y);break;case"SKIP":{var j=new I.AttrList(Y),J=j.decimalInteger("SKIPPED-SEGMENTS");if(Object(V.isFiniteNumber)(J)){b.skippedSegments=J;for(var ie=J;ie--;)y.unshift(null);B+=J}var X=j.enumeratedString("RECENTLY-REMOVED-DATERANGES");X&&(b.recentlyRemovedDateranges=X.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(Y);break;case"VERSION":b.version=parseInt(Y);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(Y||k)&&K.tagList.push(k?[Y,k]:[Y]);break;case"DIS":N++;case"GAP":K.tagList.push([ge]);break;case"BITRATE":K.tagList.push([ge,Y]);break;case"DISCONTINUITY-SEQ":N=parseInt(Y);break;case"KEY":{var ve,Ie=new I.AttrList(Y),Ue=Ie.enumeratedString("METHOD"),pe=Ie.URI,_e=Ie.hexadecimalInteger("IV"),Ae=Ie.enumeratedString("KEYFORMATVERSIONS"),De=Ie.enumeratedString("KEYID"),je=(ve=Ie.enumeratedString("KEYFORMAT"))!=null?ve:"identity",ze=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(ze.indexOf(je)>-1){g.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;Ue&&(fe=n.LevelKey.fromURL(_,pe),pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ue)>=0&&(fe.method=Ue,fe.keyFormat=je,De&&(fe.keyID=De),Ae&&(fe.keyFormatVersions=Ae),fe.iv=_e));break}case"START":{var Je=new I.AttrList(Y),$e=Je.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)($e)&&(b.startTimeOffset=$e);break}case"MAP":{var tt=new I.AttrList(Y);K.relurl=tt.URI,tt.BYTERANGE&&K.setByteRange(tt.BYTERANGE),K.level=m,K.sn="initSegment",fe&&(K.levelkey=fe),K.initSegment=null,M=K,be=!0;break}case"SERVER-CONTROL":{var Qe=new I.AttrList(Y);b.canBlockReload=Qe.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=Qe.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&Qe.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=Qe.optionalFloat("PART-HOLD-BACK",0),b.holdBack=Qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Re=new I.AttrList(Y);b.partTarget=Re.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Oe=b.partList;Oe||(Oe=b.partList=[]);var We=R>0?Oe[Oe.length-1]:void 0,He=R++,ue=new G.Part(new I.AttrList(Y),K,_,He,We);Oe.push(ue),K.duration+=ue.duration;break}case"PRELOAD-HINT":{var Q=new I.AttrList(Y);b.preloadHint=Q;break}case"RENDITION-REPORT":{var te=new I.AttrList(Y);b.renditionReports=b.renditionReports||[],b.renditionReports.push(te);break}default:g.logger.warn("line parsed but not handled: "+Z);break}}}C&&!C.relurl?(y.pop(),H-=C.duration,b.partList&&(b.fragmentHint=C)):b.partList&&(x(K,C),K.cc=N,b.fragmentHint=K);var ae=y.length,ce=y[0],re=y[ae-1];if(H+=b.skippedSegments*b.targetduration,H>0&&ae&&re){b.averagetargetduration=H/ae;var se=re.sn;b.endSN=se!=="initSegment"?se:0,ce&&(b.startCC=ce.cc,ce.initSegment||b.fragments.every(function(he){return he.relurl&&l(he.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new G.Fragment(f,_),K.relurl=re.relurl,K.level=m,K.sn="initSegment",ce.initSegment=K,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(H+=b.fragmentHint.duration),b.totalduration=H,b.endCC=N,xe>0&&T(y,xe),b},L}();function o(L,A){["video","audio","text"].forEach(function(E){var _=L.filter(function(f){return Object(p.isCodecType)(f,E)});if(_.length){var m=_.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});A[E+"Codec"]=m.length>0?m[0]:_[0],L=L.filter(function(f){return _.indexOf(f)===-1})}}),A.unknownCodecs=L}function w(L,A,E){var _=A[E];_&&(L[E]=_)}function T(L,A){for(var E=L[A],_=A;_--;){var m=L[_];if(!m)return;m.programDateTime=E.programDateTime-m.duration*1e3,E=m}}function x(L,A){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):A!=null&&A.programDateTime&&(L.programDateTime=A.endProgramDateTime),Object(V.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),U=D("./src/events.ts"),O=D("./src/errors.ts"),G=D("./src/utils/logger.ts"),W=D("./src/utils/mp4-tools.ts"),n=D("./src/loader/m3u8-parser.ts"),I=D("./src/types/loader.ts"),g=D("./src/utils/attr-list.ts");function p(s){var d=s.type;switch(d){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function h(s,d){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=d.url),i}var c=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var d=s.prototype;return d.registerListeners=function(){var l=this.hls;l.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var l=this.hls;l.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),l.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(l){var r=this.hls.config,o=r.pLoader,w=r.loader,T=o||w,x=new T(r);return l.loader=x,this.loaders[l.type]=x,x},d.getInternalLoader=function(l){return this.loaders[l.type]},d.resetInternalLoader=function(l){this.loaders[l]&&delete this.loaders[l]},d.destroyInternalLoaders=function(){for(var l in this.loaders){var r=this.loaders[l];r&&r.destroy(),this.resetInternalLoader(l)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(l,r){var o=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},d.onLevelLoading=function(l,r){var o=r.id,w=r.level,T=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:null,level:w,responseType:"text",type:I.PlaylistContextType.LEVEL,url:T,deliveryDirectives:x})},d.onAudioTrackLoading=function(l,r){var o=r.id,w=r.groupId,T=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:x})},d.onSubtitleTrackLoading=function(l,r){var o=r.id,w=r.groupId,T=r.url,x=r.deliveryDirectives;this.load({id:o,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:x})},d.load=function(l){var r,o=this.hls.config,w=this.getInternalLoader(l);if(w){var T=w.context;if(T&&T.url===l.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+l.type),w.abort()}var x,L,A,E;switch(l.type){case I.PlaylistContextType.MANIFEST:x=o.manifestLoadingMaxRetry,L=o.manifestLoadingTimeOut,A=o.manifestLoadingRetryDelay,E=o.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,L=o.levelLoadingTimeOut;break;default:x=o.levelLoadingMaxRetry,L=o.levelLoadingTimeOut,A=o.levelLoadingRetryDelay,E=o.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(l),(r=l.deliveryDirectives)!==null&&r!==void 0&&r.part){var _;if(l.type===I.PlaylistContextType.LEVEL&&l.level!==null?_=this.hls.levels[l.level].details:l.type===I.PlaylistContextType.AUDIO_TRACK&&l.id!==null?_=this.hls.audioTracks[l.id].details:l.type===I.PlaylistContextType.SUBTITLE_TRACK&&l.id!==null&&(_=this.hls.subtitleTracks[l.id].details),_){var m=_.partTarget,f=_.targetduration;m&&f&&(L=Math.min(Math.max(m*3,f*.8)*1e3,L))}}var S={timeout:L,maxRetry:x,retryDelay:A,maxRetryDelay:E,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(l,S,b)},d.loadsuccess=function(l,r,o,w){if(w===void 0&&(w=null),o.isSidxRequest){this.handleSidxRequest(l,o),this.handlePlaylistLoaded(l,r,o,w);return}this.resetInternalLoader(o.type);var T=l.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,o,"no EXTM3U delimiter",w);return}r.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(l,r,o,w):this.handleMasterPlaylist(l,r,o,w)},d.loaderror=function(l,r,o){o===void 0&&(o=null),this.handleNetworkError(r,o,!1,l)},d.loadtimeout=function(l,r,o){o===void 0&&(o=null),this.handleNetworkError(r,o,!0)},d.handleMasterPlaylist=function(l,r,o,w){var T=this.hls,x=l.data,L=h(l,o),A=n.default.parseMasterPlaylist(x,L),E=A.levels,_=A.sessionData;if(!E.length){this.handleManifestParsingError(l,o,"no level found in manifest",w);return}var m=E.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),f=E.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),S=n.default.parseMasterPlaylistMedia(x,L,"AUDIO",m),b=n.default.parseMasterPlaylistMedia(x,L,"SUBTITLES",f),y=n.default.parseMasterPlaylistMedia(x,L,"CLOSED-CAPTIONS");if(S.length){var M=S.some(function(B){return!B.url});!M&&E[0].audioCodec&&!E[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}T.trigger(U.Events.MANIFEST_LOADED,{levels:E,audioTracks:S,subtitles:b,captions:y,url:L,stats:r,networkDetails:w,sessionData:_})},d.handleTrackOrLevelPlaylist=function(l,r,o,w){var T=this.hls,x=o.id,L=o.level,A=o.type,E=h(l,o),_=Object(V.isFiniteNumber)(x)?x:0,m=Object(V.isFiniteNumber)(L)?L:_,f=p(o),S=n.default.parseLevelPlaylist(l.data,E,m,f,_);if(!S.fragments.length){T.trigger(U.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:E,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(A===I.PlaylistContextType.MANIFEST){var b={attrs:new g.AttrList({}),bitrate:0,details:S,name:"",url:E};T.trigger(U.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:E,stats:r,networkDetails:w,sessionData:null})}if(r.parsing.end=performance.now(),S.needSidxRanges){var y,M=(y=S.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:M,isSidxRequest:!0,type:A,level:L,levelDetails:S,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=S,this.handlePlaylistLoaded(l,r,o,w)},d.handleSidxRequest=function(l,r){var o=Object(W.parseSegmentIndex)(new Uint8Array(l.data));if(!o)return;var w=o.references,T=r.levelDetails;w.forEach(function(x,L){var A=x.info,E=T.fragments[L];E.byteRange.length===0&&E.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),E.initSegment&&E.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(l,r,o,w){this.hls.trigger(U.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===I.PlaylistContextType.MANIFEST,url:l.url,reason:o,response:l,context:r,networkDetails:w})},d.handleNetworkError=function(l,r,o,w){o===void 0&&(o=!1),G.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+l.type+" level: "+l.level+" id: "+l.id+' group-id: "'+l.groupId+'"');var T=O.ErrorDetails.UNKNOWN,x=!1,L=this.getInternalLoader(l);switch(l.type){case I.PlaylistContextType.MANIFEST:T=o?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:T=o?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:T=o?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:T=o?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}L&&this.resetInternalLoader(l.type);var A={type:O.ErrorTypes.NETWORK_ERROR,details:T,fatal:x,url:l.url,loader:L,context:l,networkDetails:r};w&&(A.response=w),this.hls.trigger(U.Events.ERROR,A)},d.handlePlaylistLoaded=function(l,r,o,w){var T=o.type,x=o.level,L=o.id,A=o.groupId,E=o.loader,_=o.levelDetails,m=o.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(l,o,"invalid target duration",w);return}if(!E)return;_.live&&(E.getCacheAge&&(_.ageHeader=E.getCacheAge()||0),(!E.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(T){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:_,level:x||0,id:L||0,stats:r,networkDetails:w,deliveryDirectives:m});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:_,id:L||0,groupId:A||"",stats:r,networkDetails:w,deliveryDirectives:m});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:_,id:L||0,groupId:A||"",stats:r,networkDetails:w,deliveryDirectives:m});break}},s}();z.default=c},"./src/polyfills/number.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"isFiniteNumber",function(){return V}),D.d(z,"MAX_SAFE_INTEGER",function(){return U});var V=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(q,z,D){"use strict";D.r(z);var V=function(){function U(){}return U.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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},U}();z.default=V},"./src/remux/mp4-generator.ts":function(q,z,D){"use strict";D.r(z);var V=Math.pow(2,32)-1,U=function(){function O(){}return O.init=function(){O.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 W;for(W in O.types)O.types.hasOwnProperty(W)&&(O.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.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]),I=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]);O.HDLR_TYPES={video:n,audio:I};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=p,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,h,s,h,c),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(W){for(var n=8,I=arguments.length,g=new Array(I>1?I-1:0),p=1;p<I;p++)g[p-1]=arguments[p];for(var h=g.length,c=h;h--;)n+=g[h].byteLength;var s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=n&255,s.set(W,4),h=0,n=8;h<c;h++)s.set(g[h],n),n+=g[h].byteLength;return s},O.hdlr=function(W){return O.box(O.types.hdlr,O.HDLR_TYPES[W])},O.mdat=function(W){return O.box(O.types.mdat,W)},O.mdhd=function(W,n){n*=W;var I=Math.floor(n/(V+1)),g=Math.floor(n%(V+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},O.mdia=function(W){return O.box(O.types.mdia,O.mdhd(W.timescale,W.duration),O.hdlr(W.type),O.minf(W))},O.mfhd=function(W){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},O.minf=function(W){return W.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(W)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(W))},O.moof=function(W,n,I){return O.box(O.types.moof,O.mfhd(W),O.traf(I,n))},O.moov=function(W){for(var n=W.length,I=[];n--;)I[n]=O.trak(W[n]);return O.box.apply(null,[O.types.moov,O.mvhd(W[0].timescale,W[0].duration)].concat(I).concat(O.mvex(W)))},O.mvex=function(W){for(var n=W.length,I=[];n--;)I[n]=O.trex(W[n]);return O.box.apply(null,[O.types.mvex].concat(I))},O.mvhd=function(W,n){n*=W;var I=Math.floor(n/(V+1)),g=Math.floor(n%(V+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,I>>24,I>>16&255,I>>8&255,I&255,g>>24,g>>16&255,g>>8&255,g&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 O.box(O.types.mvhd,p)},O.sdtp=function(W){var n=W.samples||[],I=new Uint8Array(4+n.length),g,p;for(g=0;g<n.length;g++)p=n[g].flags,I[g+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return O.box(O.types.sdtp,I)},O.stbl=function(W){return O.box(O.types.stbl,O.stsd(W),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(W){var n=[],I=[],g,p,h;for(g=0;g<W.sps.length;g++)p=W.sps[g],h=p.byteLength,n.push(h>>>8&255),n.push(h&255),n=n.concat(Array.prototype.slice.call(p));for(g=0;g<W.pps.length;g++)p=W.pps[g],h=p.byteLength,I.push(h>>>8&255),I.push(h&255),I=I.concat(Array.prototype.slice.call(p));var c=O.box(O.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|W.sps.length].concat(n).concat([W.pps.length]).concat(I))),s=W.width,d=W.height,i=W.pixelRatio[0],l=W.pixelRatio[1];return O.box(O.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,s>>8&255,s&255,d>>8&255,d&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]),c,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,l>>24,l>>16&255,l>>8&255,l&255])))},O.esds=function(W){var n=W.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(W.config).concat([6,1,2]))},O.mp4a=function(W){var n=W.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),O.box(O.types.esds,O.esds(W)))},O.mp3=function(W){var n=W.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},O.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(W)):O.box(O.types.stsd,O.STSD,O.mp4a(W)):O.box(O.types.stsd,O.STSD,O.avc1(W))},O.tkhd=function(W){var n=W.id,I=W.duration*W.timescale,g=W.width,p=W.height,h=Math.floor(I/(V+1)),c=Math.floor(I%(V+1));return O.box(O.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,h>>24,h>>16&255,h>>8&255,h&255,c>>24,c>>16&255,c>>8&255,c&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,g>>8&255,g&255,0,0,p>>8&255,p&255,0,0]))},O.traf=function(W,n){var I=O.sdtp(W),g=W.id,p=Math.floor(n/(V+1)),h=Math.floor(n%(V+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,h>>24,h>>16&255,h>>8&255,h&255])),O.trun(W,I.length+16+20+8+16+8+8),I)},O.trak=function(W){return W.duration=W.duration||4294967295,O.box(O.types.trak,O.tkhd(W),O.mdia(W))},O.trex=function(W){var n=W.id;return O.box(O.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]))},O.trun=function(W,n){var I=W.samples||[],g=I.length,p=12+16*g,h=new Uint8Array(p),c,s,d,i,l,r;for(n+=8+p,h.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<g;c++)s=I[c],d=s.duration,i=s.size,l=s.flags,r=s.cts,h.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,l.degradPrio&240<<8,l.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*c);return O.box(O.types.trun,h)},O.initSegment=function(W){O.types||O.init();var n=O.moov(W),I=new Uint8Array(O.FTYP.byteLength+n.byteLength);return I.set(O.FTYP),I.set(n,O.FTYP.byteLength),I},O}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,z.default=U},"./src/remux/mp4-remuxer.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return r}),D.d(z,"normalizePts",function(){return o});var V=D("./src/polyfills/number.ts"),U=D("./src/remux/aac-helper.ts"),O=D("./src/remux/mp4-generator.ts"),G=D("./src/events.ts"),W=D("./src/errors.ts"),n=D("./src/utils/logger.ts"),I=D("./src/types/loader.ts"),g=D("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(L){for(var A=1;A<arguments.length;A++){var E=arguments[A];for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(L[_]=E[_])}return L},p.apply(this,arguments)}var h=10*1e3,c=1024,s=1152,d=null,i=null,l=!1,r=function(){function L(E,_,m,f){if(f===void 0&&(f=""),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=E,this.config=_,this.typeSupported=m,this.ISGenerated=!1,d===null){var S=navigator.userAgent||"",b=S.match(/Chrome\/(\d+)/i);d=b?parseInt(b[1]):0}if(i===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);i=y?parseInt(y[1]):0}l=!!d&&d<75||!!i&&i<600}var A=L.prototype;return A.destroy=function(){},A.resetTimeStamp=function(_){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},A.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(_){var m=!1,f=_.reduce(function(S,b){var y=b.pts-S;return y<-4294967296?(m=!0,o(S,b.pts)):y>0?S:b.pts},_[0].pts);return m&&n.logger.debug("PTS rollover detected"),f},A.remux=function(_,m,f,S,b,y,M,B){var R,H,N,C,K,Z,oe=b,fe=b,xe=_.pid>-1,be=m.pid>-1,Te=m.samples.length,Ce=_.samples.length>0,Le=Te>1,ge=(!xe||Ce)&&(!be||Le)||this.ISGenerated||M;if(ge){this.ISGenerated||(N=this.generateIS(_,m,b));var Y=this.isVideoContiguous,k=-1;if(Le&&(k=w(m.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,k>0){n.logger.warn("[mp4-remuxer]: Dropped "+k+" out of "+Te+" video samples due to a missing keyframe");var j=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(k),m.dropped+=k,fe+=(m.samples[0].pts-j)/(m.timescale||9e4)}else k===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),Z=!1);if(this.ISGenerated){if(Ce&&Le){var J=this.getVideoStartPts(m.samples),ie=o(_.samples[0].pts,J)-J,X=ie/m.inputTimeScale;oe+=Math.max(0,X),fe+=Math.max(0,-X)}if(Ce){if(_.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(_,m,b)),H=this.remuxAudio(_,oe,this.isAudioContiguous,y,be||Le||B===I.PlaylistLevelType.AUDIO?fe:void 0),Le){var ve=H?H.endPTS-H.startPTS:0;m.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(_,m,b)),R=this.remuxVideo(m,fe,Y,ve)}}else Le&&(R=this.remuxVideo(m,fe,Y,0));R&&(R.firstKeyFrame=k,R.independent=k!==-1)}}return this.ISGenerated&&(f.samples.length&&(K=this.remuxID3(f,b)),S.samples.length&&(C=this.remuxText(S,b))),{audio:H,video:R,initSegment:N,independent:Z,text:C,id3:K}},A.generateIS=function(_,m,f){var S=_.samples,b=m.samples,y=this.typeSupported,M={},B=!Object(V.isFiniteNumber)(this._initPTS),R="audio/mp4",H,N,C;if(B&&(H=N=Infinity),_.config&&S.length&&(_.timescale=_.samplerate,_.isAAC||(y.mpeg?(R="audio/mpeg",_.codec=""):y.mp3&&(_.codec="mp3")),M.audio={id:"audio",container:R,codec:_.codec,initSegment:!_.isAAC&&y.mpeg?new Uint8Array(0):O.default.initSegment([_]),metadata:{channelCount:_.channelCount}},B&&(C=_.inputTimeScale,H=N=S[0].pts-Math.round(C*f))),m.sps&&m.pps&&b.length&&(m.timescale=m.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:O.default.initSegment([m]),metadata:{width:m.width,height:m.height}},B)){C=m.inputTimeScale;var K=this.getVideoStartPts(b),Z=Math.round(C*f);N=Math.min(N,o(b[0].dts,K)-Z),H=Math.min(H,K-Z)}if(Object.keys(M).length)return this.ISGenerated=!0,B&&(this._initPTS=H,this._initDTS=N),{tracks:M,initPTS:H,timescale:C}},A.remuxVideo=function(_,m,f,S){var b=_.inputTimeScale,y=_.samples,M=[],B=y.length,R=this._initPTS,H=this.nextAvcDts,N=8,C,K,Z,oe=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,xe=0,be=!1;if(!f||H===null){var Te=m*b,Ce=y[0].pts-o(y[0].dts,y[0].pts);H=Te-Ce}for(var Le=0;Le<B;Le++){var ge=y[Le];if(ge.pts=o(ge.pts-R,H),ge.dts=o(ge.dts-R,H),ge.dts>ge.pts){var Y=9e4*.2;xe=Math.max(Math.min(xe,ge.pts-ge.dts),-1*Y)}ge.dts<y[Le>0?Le-1:Le].dts&&(be=!0)}be&&y.sort(function(Rt,lt){var it=Rt.dts-lt.dts,Wt=Rt.pts-lt.pts;return it||Wt}),K=y[0].dts,Z=y[y.length-1].dts;var k=Math.round((Z-K)/(B-1));if(xe<0){if(xe<k*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-k,!0)+" ms");for(var j=xe,J=0;J<B;J++)y[J].dts=j=Math.max(j,y[J].pts-k),y[J].pts=Math.max(j,y[J].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(xe,!0)+" ms to overcome this issue");for(var ie=0;ie<B;ie++)y[ie].dts=y[ie].dts+xe}K=y[0].dts}if(f){var X=K-H,ve=X>k,Ie=X<-1;if(ve||Ie){ve?n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(X,!0)+" ms ("+X+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-X,!0)+" ms ("+X+"dts) overlapping between fragments detected"),K=H;var Ue=y[0].pts-X;y[0].dts=K,y[0].pts=Ue,n.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ue,!0)+"/"+Object(g.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(X,!0)+" ms")}}l&&(K=Math.max(0,K));for(var pe=0,_e=0,Ae=0;Ae<B;Ae++){for(var De=y[Ae],je=De.units,ze=je.length,Je=0,$e=0;$e<ze;$e++)Je+=je[$e].data.length;_e+=Je,pe+=ze,De.length=Je,De.dts=Math.max(De.dts,K),De.pts=Math.max(De.pts,De.dts,0),oe=Math.min(De.pts,oe),fe=Math.max(De.pts,fe)}Z=y[B-1].dts;var tt=_e+4*pe+8,Qe;try{Qe=new Uint8Array(tt)}catch(Rt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:tt,reason:"fail allocating video mdat "+tt});return}var Re=new DataView(Qe.buffer);Re.setUint32(0,tt),Qe.set(O.default.types.mdat,4);for(var Oe=0;Oe<B;Oe++){for(var We=y[Oe],He=We.units,ue=0,Q=0,te=He.length;Q<te;Q++){var ae=He[Q],ce=ae.data,re=ae.data.byteLength;Re.setUint32(N,re),N+=4,Qe.set(ce,N),N+=re,ue+=4+re}if(Oe<B-1)C=y[Oe+1].dts-We.dts;else{var se=this.config,he=We.dts-y[Oe>0?Oe-1:Oe].dts;if(se.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(se.maxBufferHole*b),ye=(S?oe+S*b:this.nextAudioPts)-We.pts;ye>me?(C=ye-he,C<0&&(C=he),n.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=he}else C=he}var Se=Math.round(We.pts-We.dts);M.push(new T(We.key,C,ue,Se))}if(M.length&&d&&d<70){var Fe=M[0].flags;Fe.dependsOn=2,Fe.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Z+C,this.isVideoContiguous=!0;var Ge=O.default.moof(_.sequenceNumber++,K,p({},_,{samples:M})),Ze="video",Ye={data1:Ge,data2:Qe,startPTS:oe/b,endPTS:(fe+C)/b,startDTS:K/b,endDTS:H/b,type:Ze,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(Qe.length,"MDAT length must not be zero"),Ye},A.remuxAudio=function(_,m,f,S,b){var y=_.inputTimeScale,M=_.samplerate?_.samplerate:y,B=y/M,R=_.isAAC?c:s,H=R*B,N=this._initPTS,C=!_.isAAC&&this.typeSupported.mpeg,K=[],Z=_.samples,oe=C?0:8,fe=this.nextAudioPts||-1,xe=m*y;if(this.isAudioContiguous=f=f||Z.length&&fe>0&&(S&&Math.abs(xe-fe)<9e3||Math.abs(o(Z[0].pts-N,xe)-fe)<20*H),Z.forEach(function(ce){ce.pts=o(ce.pts-N,xe)}),!f||fe<0){if(Z=Z.filter(function(ce){return ce.pts>=0}),!Z.length)return;b===0?fe=0:S?fe=Math.max(0,xe):fe=Z[0].pts}if(_.isAAC)for(var be=b!==void 0,Te=this.config.maxAudioFramesDrift,Ce=0,Le=fe;Ce<Z.length;Ce++){var ge=Z[Ce],Y=ge.pts,k=Y-Le,j=Math.abs(1e3*k/y);if(k<=-Te*H&&be)Ce===0&&(n.logger.warn("Audio frame @ "+(Y/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*k/y)+" ms."),this.nextAudioPts=fe=Le=Y);else if(k>=Te*H&&j<h&&be){var J=Math.round(k/H);Le=Y-J*H,Le<0&&(J--,Le+=H),Ce===0&&(this.nextAudioPts=fe=Le),n.logger.warn("[mp4-remuxer]: Injecting "+J+" audio frame @ "+(Le/y).toFixed(3)+"s due to "+Math.round(1e3*k/y)+" ms gap.");for(var ie=0;ie<J;ie++){var X=Math.max(Le,0),ve=U.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);ve||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ve=ge.unit.subarray()),Z.splice(Ce,0,{unit:ve,pts:X}),Le+=H,Ce++}}ge.pts=Le,Le+=H}for(var Ie=null,Ue=null,pe,_e=0,Ae=Z.length;Ae--;)_e+=Z[Ae].unit.byteLength;for(var De=0,je=Z.length;De<je;De++){var ze=Z[De],Je=ze.unit,$e=ze.pts;if(Ue!==null){var tt=K[De-1];tt.duration=Math.round(($e-Ue)/B)}else if(f&&_.isAAC&&($e=fe),Ie=$e,_e>0){_e+=oe;try{pe=new Uint8Array(_e)}catch(ce){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_e,reason:"fail allocating audio mdat "+_e});return}if(!C){var Qe=new DataView(pe.buffer);Qe.setUint32(0,_e),pe.set(O.default.types.mdat,4)}}else return;pe.set(Je,oe);var Re=Je.byteLength;oe+=Re,K.push(new T(!0,R,Re,0)),Ue=$e}var Oe=K.length;if(!Oe)return;var We=K[K.length-1];this.nextAudioPts=fe=Ue+B*We.duration;var He=C?new Uint8Array(0):O.default.moof(_.sequenceNumber++,Ie/B,p({},_,{samples:K}));_.samples=[];var ue=Ie/y,Q=fe/y,te="audio",ae={data1:He,data2:pe,startPTS:ue,endPTS:Q,startDTS:ue,endDTS:Q,type:te,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert(pe.length,"MDAT length must not be zero"),ae},A.remuxEmptyAudio=function(_,m,f,S){var b=_.inputTimeScale,y=_.samplerate?_.samplerate:b,M=b/y,B=this.nextAudioPts,R=(B!==null?B:S.startDTS*b)+this._initDTS,H=S.endDTS*b+this._initDTS,N=M*c,C=Math.ceil((H-R)/N),K=U.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){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<C;oe++){var fe=R+oe*N;Z.push({unit:K,pts:fe,dts:fe})}return _.samples=Z,this.remuxAudio(_,m,f,!1)},A.remuxID3=function(_,m){var f=_.samples.length;if(!f)return;for(var S=_.inputTimeScale,b=this._initPTS,y=this._initDTS,M=0;M<f;M++){var B=_.samples[M];B.pts=o(B.pts-b,m*S)/S,B.dts=o(B.dts-y,m*S)/S}var R=_.samples;return _.samples=[],{samples:R}},A.remuxText=function(_,m){var f=_.samples.length;if(!f)return;for(var S=_.inputTimeScale,b=this._initPTS,y=0;y<f;y++){var M=_.samples[y];M.pts=o(M.pts-b,m*S)/S}_.samples.sort(function(R,H){return R.pts-H.pts});var B=_.samples;return _.samples=[],{samples:B}},L}();function o(L,A){var E;if(A===null)return L;for(A<L?E=-8589934592:E=8589934592;Math.abs(L-A)>4294967296;)L+=E;return L}function w(L){for(var A=0;A<L.length;A++)if(L[A].key)return A;return-1}var T=function(A,E,_,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=E,this.size=_,this.cts=m,this.flags=new x(A)},x=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/polyfills/number.ts"),U=D("./src/utils/mp4-tools.ts"),O=D("./src/loader/fragment.ts"),G=D("./src/utils/logger.ts"),W=function(){function g(){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 p=g.prototype;return p.destroy=function(){},p.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(c,s,d){this.audioCodec=s,this.videoCodec=d,this.generateInitSegment(c),this.emitInitSegment=!0},p.generateInitSegment=function(c){var s=this.audioCodec,d=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(U.parseInitSegment)(c);s||(s=I(i.audio,O.ElementaryStreamTypes.AUDIO)),d||(d=I(i.video,O.ElementaryStreamTypes.VIDEO));var l={};i.audio&&i.video?l.audiovideo={container:"video/mp4",codec:s+","+d,initSegment:c,id:"main"}:i.audio?l.audio={container:"audio/mp4",codec:s,initSegment:c,id:"audio"}:i.video?l.video={container:"video/mp4",codec:d,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=l},p.remux=function(c,s,d,i,l){var r=this.initPTS,o=this.lastEndDTS,w={audio:void 0,video:void 0,text:i,id3:d,initSegment:void 0};Object(V.isFiniteNumber)(o)||(o=this.lastEndDTS=l||0);var T=s.samples;if(!T||!T.length)return w;var x={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(T),L=this.initData),!L||!L.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(V.isFiniteNumber)(r)||(this.initPTS=x.initPTS=r=n(L,T,o));var A=Object(U.getDuration)(T,L),E=o,_=A+E;Object(U.offsetStartDTS)(L,T,r),A>0?this.lastEndDTS=_:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!L.audio,f=!!L.video,S="";m&&(S+="audio"),f&&(S+="video");var b={data1:T,startPTS:E,startDTS:E,endPTS:_,endDTS:_,type:S,hasAudio:m,hasVideo:f,nb:1,dropped:0};return w.audio=b.type==="audio"?b:void 0,w.video=b.type!=="audio"?b:void 0,w.text=i,w.id3=d,w.initSegment=x,w},g}(),n=function(p,h,c){return Object(U.getStartDTS)(p,h)-c};function I(g,p){var h=g==null?void 0:g.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||p===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=W},"./src/task-loop.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=U.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},U}()},"./src/types/cmcd.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"CMCDVersion",function(){return V}),D.d(z,"CMCDObjectType",function(){return U}),D.d(z,"CMCDStreamingFormat",function(){return O}),D.d(z,"CMCDStreamType",function(){return G});var V=1,U;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(U||(U={}));var O;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(O||(O={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"HlsSkip",function(){return O}),D.d(z,"getSkipValue",function(){return G}),D.d(z,"HlsUrlParameters",function(){return W}),D.d(z,"Level",function(){return n});function V(I,g){for(var p=0;p<g.length;p++){var h=g[p];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(I,h.key,h)}}function U(I,g,p){return g&&V(I.prototype,g),p&&V(I,p),I}var O;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(O||(O={}));function G(I,g){var p=I.canSkipUntil,h=I.canSkipDateRanges,c=I.endSN,s=g!==void 0?g-c:0;return p&&s<p?h?O.v2:O.Yes:O.No}var W=function(){function I(p,h,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=h,this.skip=c}var g=I.prototype;return g.addDirectives=function(h){var c=new self.URL(h);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),n=function(){function I(g){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=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return U(I,[{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(p){var h=p%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),I}()},"./src/types/loader.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"PlaylistContextType",function(){return V}),D.d(z,"PlaylistLevelType",function(){return U});var V;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(V||(V={}));var U;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(U||(U={}))},"./src/types/transmuxer.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"ChunkMetadata",function(){return V});var V=function(G,W,n,I,g,p){I===void 0&&(I=0),g===void 0&&(g=-1),p===void 0&&(p=!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=U(),this.buffering={audio:U(),video:U(),audiovideo:U()},this.level=G,this.sn=W,this.id=n,this.size=I,this.part=g,this.partial=p};function U(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"AttrList",function(){return O});var V=/^(\d+)x(\d+)$/,U=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var W=G.prototype;return W.decimalInteger=function(I){var g=parseInt(this[I],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.hexadecimalInteger=function(I){if(this[I]){var g=(this[I]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var p=new Uint8Array(g.length/2),h=0;h<g.length/2;h++)p[h]=parseInt(g.slice(h*2,h*2+2),16);return p}else return null},W.hexadecimalIntegerAsNumber=function(I){var g=parseInt(this[I],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(I){return parseFloat(this[I])},W.optionalFloat=function(I,g){var p=this[I];return p?parseFloat(p):g},W.enumeratedString=function(I){return this[I]},W.bool=function(I){return this[I]==="YES"},W.decimalResolution=function(I){var g=V.exec(this[I]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},G.parseAttrList=function(I){var g,p={},h='"';for(U.lastIndex=0;(g=U.exec(I))!==null;){var c=g[2];c.indexOf(h)===0&&c.lastIndexOf(h)===c.length-1&&(c=c.slice(1,-1)),p[g[1]]=c}return p},G}()},"./src/utils/binary-search.ts":function(q,z,D){"use strict";D.r(z);var V={search:function(O,G){for(var W=0,n=O.length-1,I=null,g=null;W<=n;){I=(W+n)/2|0,g=O[I];var p=G(g);if(p>0)W=I+1;else if(p<0)n=I-1;else return g}return null}};z.default=V},"./src/utils/buffer-helper.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"BufferHelper",function(){return O});var V=D("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function G(){}return G.isBuffered=function(n,I){try{if(n){for(var g=G.getBuffered(n),p=0;p<g.length;p++)if(I>=g.start(p)&&I<=g.end(p))return!0}}catch(h){}return!1},G.bufferInfo=function(n,I,g){try{if(n){var p=G.getBuffered(n),h=[],c;for(c=0;c<p.length;c++)h.push({start:p.start(c),end:p.end(c)});return this.bufferedInfo(h,I,g)}}catch(s){}return{len:0,start:I,end:I,nextStart:void 0}},G.bufferedInfo=function(n,I,g){I=Math.max(0,I),n.sort(function(x,L){var A=x.start-L.start;return A||L.end-x.end});var p=[];if(g)for(var h=0;h<n.length;h++){var c=p.length;if(c){var s=p[c-1].end;n[h].start-s<g?n[h].end>s&&(p[c-1].end=n[h].end):p.push(n[h])}else p.push(n[h])}else p=n;for(var d=0,i,l=I,r=I,o=0;o<p.length;o++){var w=p[o].start,T=p[o].end;if(I+g>=w&&I<T)l=w,r=T,d=r-I;else if(I+g<w){i=w;break}}return{len:d,start:l||0,end:r||0,nextStart:i}},G.getBuffered=function(n){try{return n.buffered}catch(I){return V.logger.log("failed to get media.buffered",I),U}},G}()},"./src/utils/cea-608-parser.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"Row",function(){return r}),D.d(z,"CaptionScreen",function(){return o});var V=D("./src/utils/logger.ts"),U={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},O=function(_){var m=_;return U.hasOwnProperty(_)&&(m=U[_]),String.fromCharCode(m)},G=15,W=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(E){E[E.ERROR=0]="ERROR",E[E.TEXT=1]="TEXT",E[E.WARNING=2]="WARNING",E[E.INFO=2]="INFO",E[E.DEBUG=3]="DEBUG",E[E.DATA=3]="DATA"})(c||(c={}));var s=function(){function E(){this.time=null,this.verboseLevel=c.ERROR}var _=E.prototype;return _.log=function(f,S){this.verboseLevel>=f&&V.logger.log(this.time+" ["+f+"] "+S)},E}(),d=function(_){for(var m=[],f=0;f<_.length;f++)m.push(_[f].toString(16));return m},i=function(){function E(m,f,S,b,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=m||"white",this.underline=f||!1,this.italics=S||!1,this.background=b||"black",this.flash=y||!1}var _=E.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(f){for(var S=["foreground","underline","italics","background","flash"],b=0;b<S.length;b++){var y=S[b];f.hasOwnProperty(y)&&(this[y]=f[y])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},_.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},E}(),l=function(){function E(m,f,S,b,y,M){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new i(f,S,b,y,M)}var _=E.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(f,S){this.uchar=f,this.penState.copy(S)},_.setPenState=function(f){this.penState.copy(f)},_.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},_.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},E}(),r=function(){function E(m){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<W;f++)this.chars.push(new l);this.logger=m,this.pos=0,this.currPenState=new i}var _=E.prototype;return _.equals=function(f){for(var S=!0,b=0;b<W;b++)if(!this.chars[b].equals(f.chars[b])){S=!1;break}return S},_.copy=function(f){for(var S=0;S<W;S++)this.chars[S].copy(f.chars[S])},_.isEmpty=function(){for(var f=!0,S=0;S<W;S++)if(!this.chars[S].isEmpty()){f=!1;break}return f},_.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},_.moveCursor=function(f){var S=this.pos+f;if(f>1)for(var b=this.pos+1;b<S+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(S)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(f){f>=144&&this.backSpace();var S=O(f);if(this.pos>=W){this.logger.log(c.ERROR,"Cannot insert "+f.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(f){var S;for(S=f;S<W;S++)this.chars[S].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var f=[],S=!0,b=0;b<W;b++){var y=this.chars[b].uchar;y!==" "&&(S=!1),f.push(y)}return S?"":f.join("")},_.setPenStyles=function(f){this.currPenState.setStyles(f);var S=this.chars[this.pos];S.setPenState(this.currPenState)},E}(),o=function(){function E(m){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<G;f++)this.rows.push(new r(m));this.logger=m,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=E.prototype;return _.reset=function(){for(var f=0;f<G;f++)this.rows[f].clear();this.currRow=G-1},_.equals=function(f){for(var S=!0,b=0;b<G;b++)if(!this.rows[b].equals(f.rows[b])){S=!1;break}return S},_.copy=function(f){for(var S=0;S<G;S++)this.rows[S].copy(f.rows[S])},_.isEmpty=function(){for(var f=!0,S=0;S<G;S++)if(!this.rows[S].isEmpty()){f=!1;break}return f},_.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},_.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},_.insertChar=function(f){var S=this.rows[this.currRow];S.insertChar(f)},_.setPen=function(f){var S=this.rows[this.currRow];S.setPenStyles(f)},_.moveCursor=function(f){var S=this.rows[this.currRow];S.moveCursor(f)},_.setCursor=function(f){this.logger.log(c.INFO,"setCursor: "+f);var S=this.rows[this.currRow];S.setCursor(f)},_.setPAC=function(f){this.logger.log(c.INFO,"pacData = "+JSON.stringify(f));var S=f.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var b=0;b<G;b++)this.rows[b].clear();var y=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var B=M.rows[y].cueStartTime,R=this.logger.time;if(B&&R!==null&&B<R)for(var H=0;H<this.nrRollUpRows;H++)this.rows[S-this.nrRollUpRows+H+1].copy(M.rows[y+H])}}this.currRow=S;var N=this.rows[this.currRow];if(f.indent!==null){var C=f.indent,K=Math.max(C-1,0);N.setCursor(f.indent),f.color=N.chars[K].penState.foreground}var Z={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(Z)},_.setBkgData=function(f){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},_.setRollUpRows=function(f){this.nrRollUpRows=f},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(f,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(c.INFO,"Rolling up")},_.getDisplayText=function(f){f=f||!1;for(var S=[],b="",y=-1,M=0;M<G;M++){var B=this.rows[M].getTextString();B&&(y=M+1,f?S.push("Row "+y+": '"+B+"'"):S.push(B.trim()))}return S.length>0&&(f?b="["+S.join(" | ")+"]":b=S.join(`
|
|
`)),b},_.getTextAndFormat=function(){return this.rows},E}(),w=function(){function E(m,f,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=m,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new o(S),this.nonDisplayedMemory=new o(S),this.lastOutputScreen=new o(S),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var _=E.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(f){this.outputFilter=f},_.setPAC=function(f){this.writeScreen.setPAC(f)},_.setBkgData=function(f){this.writeScreen.setBkgData(f)},_.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(c.INFO,"MODE="+f),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=f},_.insertChars=function(f){for(var S=0;S<f.length;S++)this.writeScreen.insertChar(f[S]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(f){this.logger.log(c.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},_.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(f){this.logger.log(c.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},_.ccMIDROW=function(f){var S={flash:!1};if(S.underline=f%2===1,S.italics=f>=46,S.italics)S.foreground="white";else{var b=Math.floor(f/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=y[b]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},_.outputDataUpdate=function(f){f===void 0&&(f=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},E}(),T=function(){function E(m,f,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new s;this.channels=[null,new w(m,f,b),new w(m+1,S,b)],this.cmdHistory=A(),this.logger=b}var _=E.prototype;return _.getHandler=function(f){return this.channels[f].getHandler()},_.setHandler=function(f,S){this.channels[f].setHandler(S)},_.addData=function(f,S){var b,y,M,B=!1;this.logger.time=f;for(var R=0;R<S.length;R+=2){if(y=S[R]&127,M=S[R+1]&127,y===0&&M===0)continue;if(this.logger.log(c.DATA,"["+d([S[R],S[R+1]])+"] -> ("+d([y,M])+")"),b=this.parseCmd(y,M),b||(b=this.parseMidrow(y,M)),b||(b=this.parsePAC(y,M)),b||(b=this.parseBackgroundAttributes(y,M)),!b&&(B=this.parseChars(y,M),B)){var H=this.currentChannel;if(H&&H>0){var N=this.channels[H];N.insertChars(B)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!B&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+d([y,M])+" orig: "+d([S[R],S[R+1]]))}},_.parseCmd=function(f,S){var b=this.cmdHistory,y=(f===20||f===28||f===21||f===29)&&S>=32&&S<=47,M=(f===23||f===31)&&S>=33&&S<=35;if(!(y||M))return!1;if(L(f,S,b))return x(null,null,b),this.logger.log(c.DEBUG,"Repeated command ("+d([f,S])+") is dropped"),!0;var B=f===20||f===21||f===23?1:2,R=this.channels[B];return f===20||f===21||f===28||f===29?S===32?R.ccRCL():S===33?R.ccBS():S===34?R.ccAOF():S===35?R.ccAON():S===36?R.ccDER():S===37?R.ccRU(2):S===38?R.ccRU(3):S===39?R.ccRU(4):S===40?R.ccFON():S===41?R.ccRDC():S===42?R.ccTR():S===43?R.ccRTD():S===44?R.ccEDM():S===45?R.ccCR():S===46?R.ccENM():S===47&&R.ccEOC():R.ccTO(S-32),x(f,S,b),this.currentChannel=B,!0},_.parseMidrow=function(f,S){var b=0;if((f===17||f===25)&&S>=32&&S<=47){if(f===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[b];return y?(y.ccMIDROW(S),this.logger.log(c.DEBUG,"MIDROW ("+d([f,S])+")"),!0):!1}return!1},_.parsePAC=function(f,S){var b,y=this.cmdHistory,M=(f>=17&&f<=23||f>=25&&f<=31)&&S>=64&&S<=127,B=(f===16||f===24)&&S>=64&&S<=95;if(!(M||B))return!1;if(L(f,S,y))return x(null,null,y),!0;var R=f<=23?1:2;S>=64&&S<=95?b=R===1?n[f]:g[f]:b=R===1?I[f]:p[f];var H=this.channels[R];return H?(H.setPAC(this.interpretPAC(b,S)),x(f,S,y),this.currentChannel=R,!0):!1},_.interpretPAC=function(f,S){var b,y={color:null,italics:!1,indent:null,underline:!1,row:f};return S>95?b=S-96:b=S-64,y.underline=(b&1)===1,b<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((b-16)/2)*4,y},_.parseChars=function(f,S){var b,y=null,M=null;if(f>=25?(b=2,M=f-8):(b=1,M=f),M>=17&&M<=19){var B;M===17?B=S+80:M===18?B=S+112:B=S+144,this.logger.log(c.INFO,"Special char '"+O(B)+"' in channel "+b),y=[B]}else f>=32&&f<=127&&(y=S===0?[f]:[f,S]);if(y){var R=d(y);this.logger.log(c.DEBUG,"Char codes = "+R.join(",")),x(f,S,this.cmdHistory)}return y},_.parseBackgroundAttributes=function(f,S){var b=(f===16||f===24)&&S>=32&&S<=47,y=(f===23||f===31)&&S>=45&&S<=47;if(!(b||y))return!1;var M,B={};f===16||f===24?(M=Math.floor((S-32)/2),B.background=h[M],S%2===1&&(B.background=B.background+"_semi")):S===45?B.background="transparent":(B.foreground="black",S===47&&(B.underline=!0));var R=f<=23?1:2,H=this.channels[R];return H.setBkgData(B),x(f,S,this.cmdHistory),!0},_.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var S=this.channels[f];S&&S.reset()}this.cmdHistory=A()},_.cueSplitAtTime=function(f){for(var S=0;S<this.channels.length;S++){var b=this.channels[S];b&&b.cueSplitAtTime(f)}},E}();function x(E,_,m){m.a=E,m.b=_}function L(E,_,m){return m.a===E&&m.b===_}function A(){return{a:null,b:null}}z.default=T},"./src/utils/codecs.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"isCodecType",function(){return U}),D.d(z,"isCodecSupportedInMp4",function(){return O});var V={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 U(G,W){var n=V[W];return!!n&&n[G.slice(0,4)]===!0}function O(G,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/utils/vttparser.ts"),U=D("./src/utils/webvtt-parser.ts"),O=D("./src/utils/texttrack-utils.ts"),G=/\s/,W={newCue:function(I,g,p,h){for(var c=[],s,d,i,l,r,o=self.VTTCue||self.TextTrackCue,w=0;w<h.rows.length;w++)if(s=h.rows[w],i=!0,l=0,r="",!s.isEmpty()){for(var T=0;T<s.chars.length;T++)G.test(s.chars[T].uchar)&&i?l++:(r+=s.chars[T].uchar,i=!1);s.cueStartTime=g,g===p&&(p+=1e-4),l>=16?l--:l++;var x=Object(V.fixLineBreaks)(r.trim()),L=Object(U.generateCueId)(g,p,x);(!I||!I.cues||!I.cues.getCueById(L))&&(d=new o(g,p,x),d.id=L,d.line=w+1,d.align="left",d.position=10+Math.min(80,Math.floor(l*8/32)*10),c.push(d))}return I&&c.length&&(c.sort(function(A,E){return A.line==="auto"||E.line==="auto"?0:A.line>8&&E.line>8?E.line-A.line:A.line-E.line}),c.forEach(function(A){return Object(O.addCueToTrack)(I,A)})),c}};z.default=W},"./src/utils/discontinuities.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"findFirstFragWithCC",function(){return G}),D.d(z,"shouldAlignOnDiscontinuities",function(){return W}),D.d(z,"findDiscontinuousReferenceFrag",function(){return n}),D.d(z,"adjustSlidingStart",function(){return g}),D.d(z,"alignStream",function(){return p}),D.d(z,"alignPDT",function(){return c}),D.d(z,"alignFragmentByPDTDelta",function(){return s}),D.d(z,"alignMediaPlaylistByPDT",function(){return d});var V=D("./src/polyfills/number.ts"),U=D("./src/utils/logger.ts"),O=D("./src/controller/level-helper.ts");function G(i,l){for(var r=null,o=0,w=i.length;o<w;o++){var T=i[o];if(T&&T.cc===l){r=T;break}}return r}function W(i,l,r){return!!(l.details&&(r.endCC>r.startCC||i&&i.cc<r.startCC))}function n(i,l){var r=i.fragments,o=l.fragments;if(!o.length||!r.length){U.logger.log("No fragments to align");return}var w=G(r,o[0].cc);if(!w||w&&!w.startPTS){U.logger.log("No frag in previous level to align on");return}return w}function I(i,l){if(i){var r=i.start+l;i.start=i.startPTS=r,i.endPTS=r+i.duration}}function g(i,l){for(var r=l.fragments,o=0,w=r.length;o<w;o++)I(r[o],i);l.fragmentHint&&I(l.fragmentHint,i),l.alignedSliding=!0}function p(i,l,r){if(!l)return;h(i,r,l),!r.alignedSliding&&l.details&&c(r,l.details),!r.alignedSliding&&l.details&&!r.skippedSegments&&Object(O.adjustSliding)(l.details,r)}function h(i,l,r){if(W(i,r,l)){var o=n(r.details,l);o&&Object(V.isFiniteNumber)(o.start)&&(U.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),g(o.start,l))}}function c(i,l){if(!l.fragments.length||!i.hasProgramDateTime||!l.hasProgramDateTime)return;var r=l.fragments[0].programDateTime,o=i.fragments[0].programDateTime,w=(o-r)/1e3+l.fragments[0].start;w&&Object(V.isFiniteNumber)(w)&&(U.logger.log("Adjusting PTS using programDateTime delta "+(o-r)+"ms, sliding:"+w.toFixed(3)+" "+i.url+" "),g(w,i))}function s(i,l){var r=i.programDateTime;if(!r)return;var o=(r-l)/1e3;i.start=i.startPTS=o,i.endPTS=o+i.duration}function d(i,l){if(!l.fragments.length||!i.hasProgramDateTime||!l.hasProgramDateTime)return;var r=l.fragments[0].programDateTime,o=l.fragments[0].start,w=r-o*1e3;i.fragments.forEach(function(T){s(T,w)}),i.fragmentHint&&s(i.fragmentHint,w),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/utils/ewma.ts"),U=function(){function O(W,n,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new V.default(W),this.fast_=new V.default(n)}var G=O.prototype;return G.update=function(n,I){var g=this.slow_,p=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new V.default(n,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new V.default(I,p.getEstimate(),p.getTotalWeight()))},G.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var g=8*I,p=n/1e3,h=g/p;this.fast_.sample(p,h),this.slow_.sample(p,h)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},O}();z.default=U},"./src/utils/ewma.ts":function(q,z,D){"use strict";D.r(z);var V=function(){function U(G,W,n){W===void 0&&(W=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=n}var O=U.prototype;return O.sample=function(W,n){var I=Math.pow(this.alpha_,W);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=W},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},U}();z.default=V},"./src/utils/fetch-loader.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"fetchSupported",function(){return s});var V=D("./src/polyfills/number.ts"),U=D("./src/loader/load-stats.ts"),O=D("./src/demux/chunk-cache.ts");function G(o,w){o.prototype=Object.create(w.prototype),o.prototype.constructor=o,p(o,w)}function W(o){var w=typeof Map=="function"?new Map:void 0;return W=function(x){if(x===null||!g(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(x))return w.get(x);w.set(x,L)}function L(){return n(x,arguments,h(this).constructor)}return L.prototype=Object.create(x.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),p(L,x)},W(o)}function n(o,w,T){return I()?n=Reflect.construct:n=function(L,A,E){var _=[null];_.push.apply(_,A);var m=Function.bind.apply(L,_),f=new m;return E&&p(f,E.prototype),f},n.apply(null,arguments)}function I(){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 g(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function p(o,w){return p=Object.setPrototypeOf||function(x,L){return x.__proto__=L,x},p(o,w)}function h(o){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},h(o)}function c(){return c=Object.assign||function(o){for(var w=1;w<arguments.length;w++){var T=arguments[w];for(var x in T)Object.prototype.hasOwnProperty.call(T,x)&&(o[x]=T[x])}return o},c.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var d=function(){function o(T){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=T.fetchSetup||l,this.controller=new self.AbortController,this.stats=new U.LoadStats}var w=o.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(x,L,A){var E=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var m=i(x,this.controller.signal),f=A.onProgress,S=x.responseType==="arraybuffer",b=S?"byteLength":"length";this.context=x,this.config=L,this.callbacks=A,this.request=this.fetchSetup(x,m),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){E.abortInternal(),A.onTimeout(_,x,E.response)},L.timeout),self.fetch(this.request).then(function(y){if(E.response=E.loader=y,!y.ok){var M=y.status,B=y.statusText;throw new r(B||"fetch, bad network response",M,y)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(y.headers.get("Content-Length")||"0"),f&&Object(V.isFiniteNumber)(L.highWaterMark)?E.loadProgressively(y,_,x,L.highWaterMark,f):S?y.arrayBuffer():y.text()}).then(function(y){var M=E.response;self.clearTimeout(E.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=y[b];var B={url:M.url,data:y};f&&!Object(V.isFiniteNumber)(L.highWaterMark)&&f(_,x,y,M),A.onSuccess(B,_,x,M)}).catch(function(y){if(self.clearTimeout(E.requestTimeout),_.aborted)return;var M=y.code||0;A.onError({code:M,text:y.message},x,y.details)})},w.getCacheAge=function(){var x=null;if(this.response){var L=this.response.headers.get("age");x=L?parseFloat(L):null}return x},w.loadProgressively=function(x,L,A,E,_){E===void 0&&(E=0);var m=new O.default,f=x.body.getReader(),S=function b(){return f.read().then(function(y){if(y.done)return m.dataLength&&_(L,A,m.flush(),x),Promise.resolve(new ArrayBuffer(0));var M=y.value,B=M.length;return L.loaded+=B,B<E||m.dataLength?(m.push(M),m.dataLength>=E&&_(L,A,m.flush(),x)):_(L,A,M,x),b()}).catch(function(){return Promise.reject()})};return S()},o}();function i(o,w){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(c({},o.headers))};return o.rangeEnd&&T.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),T}function l(o,w){return new self.Request(o.url,w)}var r=function(o){G(w,o);function w(T,x,L){var A;return A=o.call(this,T)||this,A.code=void 0,A.details=void 0,A.code=x,A.details=L,A}return w}(W(Error));z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"IMSC1_CODEC",function(){return g}),D.d(z,"parseIMSC1",function(){return s});var V=D("./src/utils/mp4-tools.ts"),U=D("./src/utils/vttparser.ts"),O=D("./src/utils/vttcue.ts"),G=D("./src/demux/id3.ts"),W=D("./src/utils/timescale-conversion.ts"),n=D("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var m=arguments[_];for(var f in m)Object.prototype.hasOwnProperty.call(m,f)&&(E[f]=m[f])}return E},I.apply(this,arguments)}var g="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(E,_,m,f,S){var b=Object(V.findBox)(new Uint8Array(E),["mdat"]);if(b.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var y=b[0],M=Object(G.utf8ArrayToStr)(new Uint8Array(E,y.start,y.end-y.start)),B=Object(W.toTimescaleFromScale)(_,1,m);try{f(d(M,B))}catch(R){S(R)}}function d(E,_){var m=new DOMParser,f=m.parseFromString(E,"text/xml"),S=f.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(b).reduce(function(N,C){return N[C]=S.getAttribute("ttp:"+C)||b[C],N},{}),M=S.getAttribute("xml:space")!=="preserve",B=l(i(S,"styling","style")),R=l(i(S,"layout","region")),H=i(S,"body","[begin]");return[].map.call(H,function(N){var C=r(N,M);if(!C||!N.hasAttribute("begin"))return null;var K=x(N.getAttribute("begin"),y),Z=x(N.getAttribute("dur"),y),oe=x(N.getAttribute("end"),y);if(K===null)throw T(N);if(oe===null){if(Z===null)throw T(N);oe=K+Z}var fe=new O.default(K-_,oe-_,C);fe.id=Object(n.generateCueId)(fe.startTime,fe.endTime,fe.text);var xe=R[N.getAttribute("region")],be=B[N.getAttribute("style")];fe.position=10,fe.size=80;var Te=o(xe,be),Ce=Te.textAlign;if(Ce){var Le=c[Ce];Le&&(fe.lineAlign=Le),fe.align=Ce}return I(fe,Te),fe}).filter(function(N){return N!==null})}function i(E,_,m){var f=E.getElementsByTagName(_)[0];return f?[].slice.call(f.querySelectorAll(m)):[]}function l(E){return E.reduce(function(_,m){var f=m.getAttribute("xml:id");return f&&(_[f]=m),_},{})}function r(E,_){return[].slice.call(E.childNodes).reduce(function(m,f,S){var b;return f.nodeName==="br"&&S?m+`
|
|
`:(b=f.childNodes)!==null&&b!==void 0&&b.length?r(f,_):_?m+f.textContent.trim().replace(/\s+/g," "):m+f.textContent},"")}function o(E,_){var m="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(S,b){var y=w(_,m,b)||w(E,m,b);return y&&(S[b]=y),S},{})}function w(E,_,m){return E.hasAttributeNS(_,m)?E.getAttributeNS(_,m):null}function T(E){return new Error("Could not parse ttml timestamp "+E)}function x(E,_){if(!E)return null;var m=Object(U.parseTimeStamp)(E);return m===null&&(p.test(E)?m=L(E,_):h.test(E)&&(m=A(E,_))),m}function L(E,_){var m=p.exec(E),f=(m[4]|0)+(m[5]|0)/_.subFrameRate;return(m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+f/_.frameRate}function A(E,_){var m=h.exec(E),f=Number(m[1]),S=m[2];switch(S){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/_.frameRate;case"t":return f/_.tickRate}return f}},"./src/utils/logger.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"enableLogs",function(){return n}),D.d(z,"logger",function(){return I});var V=function(){},U={trace:V,debug:V,log:V,warn:V,info:V,error:V},O=U;function G(g){var p=self.console[g];return p?p.bind(self.console,"["+g+"] >"):V}function W(g){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];h.forEach(function(s){O[s]=g[s]?g[s].bind(g):G(s)})}function n(g){if(self.console&&g===!0||typeof g=="object"){W(g,"debug","log","info","warn","error");try{O.log()}catch(p){O=U}}else O=U}var I=O},"./src/utils/mediakeys-helper.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"KeySystems",function(){return V}),D.d(z,"requestMediaKeySystemAccess",function(){return U});var V;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(V||(V={}));var U=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"getMediaSource",function(){return V});function V(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"bin2str",function(){return W}),D.d(z,"readUint16",function(){return n}),D.d(z,"readUint32",function(){return I}),D.d(z,"writeUint32",function(){return g}),D.d(z,"findBox",function(){return p}),D.d(z,"parseSegmentIndex",function(){return h}),D.d(z,"parseInitSegment",function(){return c}),D.d(z,"getStartDTS",function(){return s}),D.d(z,"getDuration",function(){return d}),D.d(z,"computeRawDurationFromSamples",function(){return i}),D.d(z,"offsetStartDTS",function(){return l}),D.d(z,"segmentValidRange",function(){return r}),D.d(z,"appendUint8Array",function(){return o});var V=D("./src/utils/typed-array.ts"),U=D("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,G=[].push;function W(w){return String.fromCharCode.apply(null,w)}function n(w,T){"data"in w&&(T+=w.start,w=w.data);var x=w[T]<<8|w[T+1];return x<0?65536+x:x}function I(w,T){"data"in w&&(T+=w.start,w=w.data);var x=w[T]<<24|w[T+1]<<16|w[T+2]<<8|w[T+3];return x<0?4294967296+x:x}function g(w,T,x){"data"in w&&(T+=w.start,w=w.data),w[T]=x>>24,w[T+1]=x>>16&255,w[T+2]=x>>8&255,w[T+3]=x&255}function p(w,T){var x=[];if(!T.length)return x;var L,A,E;"data"in w?(L=w.data,A=w.start,E=w.end):(L=w,A=0,E=L.byteLength);for(var _=A;_<E;){var m=I(L,_),f=W(L.subarray(_+4,_+8)),S=m>1?_+m:E;if(f===T[0])if(T.length===1)x.push({data:L,start:_+8,end:S});else{var b=p({data:L,start:_+8,end:S},T.slice(1));b.length&&G.apply(x,b)}_=S}return x}function h(w){var T=p(w,["moov"]),x=T[0],L=x?x.end:null,A=p(w,["sidx"]);if(!A||!A[0])return null;var E=[],_=A[0],m=_.data[0],f=m===0?8:16,S=I(_,f);f+=4;var b=0,y=0;m===0?f+=8:f+=16,f+=2;var M=_.end+y,B=n(_,f);f+=2;for(var R=0;R<B;R++){var H=f,N=I(_,H);H+=4;var C=N&2147483647,K=(N&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=I(_,H);H+=4,E.push({referenceSize:C,subsegmentDuration:Z,info:{duration:Z/S,start:M,end:M+C-1}}),M+=C,H+=4,f=H}return{earliestPresentationTime:b,timescale:S,version:m,referencesCount:B,references:E,moovEndOffset:L}}function c(w){for(var T=[],x=p(w,["moov","trak"]),L=0;L<x.length;L++){var A=x[L],E=p(A,["tkhd"])[0];if(E){var _=E.data[E.start],m=_===0?12:20,f=I(E,m),S=p(A,["mdia","mdhd"])[0];if(S){_=S.data[S.start],m=_===0?12:20;var b=I(S,m),y=p(A,["mdia","hdlr"])[0];if(y){var M=W(y.data.subarray(y.start+8,y.start+12)),B={soun:U.ElementaryStreamTypes.AUDIO,vide:U.ElementaryStreamTypes.VIDEO}[M];if(B){var R=p(A,["mdia","minf","stbl","stsd"])[0],H=void 0;R&&(H=W(R.data.subarray(R.start+12,R.start+16))),T[f]={timescale:b,type:B},T[B]={timescale:b,id:f,codec:H}}}}}}var N=p(w,["moov","mvex","trex"]);return N.forEach(function(C){var K=I(C,4),Z=T[K];Z&&(Z.default={duration:I(C,12),flags:I(C,20)})}),T}function s(w,T){return p(T,["moof","traf"]).reduce(function(x,L){var A=p(L,["tfdt"])[0],E=A.data[A.start],_=p(L,["tfhd"]).reduce(function(m,f){var S=I(f,4),b=w[S];if(b){var y=I(A,4);E===1&&(y*=Math.pow(2,32),y+=I(A,8));var M=b.timescale||9e4,B=y/M;if(isFinite(B)&&(m===null||B<m))return B}return m},null);return _!==null&&isFinite(_)&&(x===null||_<x)?_:x},null)||0}function d(w,T){for(var x=0,L=0,A=0,E=p(w,["moof","traf"]),_=0;_<E.length;_++){var m=E[_],f=p(m,["tfhd"])[0],S=I(f,4),b=T[S];if(!b)continue;var y=b.default,M=I(f,0)|(y==null?void 0:y.flags),B=y==null?void 0:y.duration;M&8&&(M&2?B=I(f,12):B=I(f,8));for(var R=b.timescale||9e4,H=p(m,["trun"]),N=0;N<H.length;N++){if(B){var C=I(H[N],4);x=B*C}else x=i(H[N]);b.type===U.ElementaryStreamTypes.VIDEO?L+=x/R:b.type===U.ElementaryStreamTypes.AUDIO&&(A+=x/R)}}if(L===0&&A===0){var K=h(w);if(K!=null&&K.references)return K.references.reduce(function(Z,oe){return Z+oe.info.duration||0},0)}return L||A}function i(w){var T=I(w,0),x=8;T&1&&(x+=4),T&4&&(x+=4);for(var L=0,A=I(w,4),E=0;E<A;E++){if(T&256){var _=I(w,x);L+=_,x+=4}T&512&&(x+=4),T&1024&&(x+=4),T&2048&&(x+=4)}return L}function l(w,T,x){p(T,["moof","traf"]).forEach(function(L){p(L,["tfhd"]).forEach(function(A){var E=I(A,4),_=w[E];if(!_)return;var m=_.timescale||9e4;p(L,["tfdt"]).forEach(function(f){var S=f.data[f.start],b=I(f,4);if(S===0)g(f,4,b-x*m);else{b*=Math.pow(2,32),b+=I(f,8),b-=x*m,b=Math.max(b,0);var y=Math.floor(b/(O+1)),M=Math.floor(b%(O+1));g(f,4,y),g(f,8,M)}})})})}function r(w){var T={valid:null,remainder:null},x=p(w,["moof"]);if(x){if(x.length<2)return T.remainder=w,T}else return T;var L=x[x.length-1];return T.valid=Object(V.sliceUint8)(w,0,L.start-8),T.remainder=Object(V.sliceUint8)(w,L.start-8),T}function o(w,T){var x=new Uint8Array(w.length+T.length);return x.set(w),x.set(T,w.length),x}},"./src/utils/output-filter.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"default",function(){return V});var V=function(){function U(G,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=W}var O=U.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(W,n,I){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"sendAddTrackEvent",function(){return U}),D.d(z,"addCueToTrack",function(){return O}),D.d(z,"clearCurrentCues",function(){return G}),D.d(z,"removeCuesInRange",function(){return W}),D.d(z,"getCuesInRange",function(){return I});var V=D("./src/utils/logger.ts");function U(g,p){var h;try{h=new Event("addtrack")}catch(c){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=g,p.dispatchEvent(h)}function O(g,p){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(p.id))try{if(g.addCue(p),!g.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(s){V.logger.debug("[texttrack-utils]: "+s);var c=new self.TextTrackCue(p.startTime,p.endTime,p.text);c.id=p.id,g.addCue(c)}h==="disabled"&&(g.mode=h)}function G(g){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues)for(var h=g.cues.length;h--;)g.removeCue(g.cues[h]);p==="disabled"&&(g.mode=p)}function W(g,p,h){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var s=I(g.cues,p,h),d=0;d<s.length;d++)g.removeCue(s[d]);c==="disabled"&&(g.mode=c)}function n(g,p){if(p<g[0].startTime)return 0;var h=g.length-1;if(p>g[h].endTime)return-1;for(var c=0,s=h;c<=s;){var d=Math.floor((s+c)/2);if(p<g[d].startTime)s=d-1;else if(p>g[d].startTime&&c<h)c=d+1;else return d}return g[c].startTime-p<p-g[s].startTime?c:s}function I(g,p,h){var c=[],s=n(g,p);if(s>-1)for(var d=s,i=g.length;d<i;d++){var l=g[d];if(l.startTime>=p&&l.endTime<=h)c.push(l);else if(l.startTime>h)return c}return c}},"./src/utils/time-ranges.ts":function(q,z,D){"use strict";D.r(z);var V={toString:function(O){for(var G="",W=O.length,n=0;n<W;n++)G+="["+O.start(n).toFixed(3)+","+O.end(n).toFixed(3)+"]";return G}};z.default=V},"./src/utils/timescale-conversion.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"toTimescaleFromBase",function(){return U}),D.d(z,"toTimescaleFromScale",function(){return O}),D.d(z,"toMsFromMpegTsClock",function(){return G}),D.d(z,"toMpegTsClockFromTimescale",function(){return W});var V=9e4;function U(n,I,g,p){g===void 0&&(g=1),p===void 0&&(p=!1);var h=n*I*g;return p?Math.round(h):h}function O(n,I,g,p){return g===void 0&&(g=1),p===void 0&&(p=!1),U(n,I,1/g,p)}function G(n,I){return I===void 0&&(I=!1),U(n,1e3,1/V,I)}function W(n,I){return I===void 0&&(I=1),U(n,V,1/I)}},"./src/utils/typed-array.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"sliceUint8",function(){return V});function V(U,O,G){return Uint8Array.prototype.slice?U.slice(O,G):new Uint8Array(Array.prototype.slice.call(U,O,G))}},"./src/utils/vttcue.ts":function(q,z,D){"use strict";D.r(z),z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var V=["","lr","rl"],U=["start","middle","end","left","right"];function O(g,p){if(typeof p!="string")return!1;if(!Array.isArray(g))return!1;var h=p.toLowerCase();return~g.indexOf(h)?h:!1}function G(g){return O(V,g)}function W(g){return O(U,g)}function n(g){for(var p=arguments.length,h=new Array(p>1?p-1:0),c=1;c<p;c++)h[c-1]=arguments[c];for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var i in d)g[i]=d[i]}return g}function I(g,p,h){var c=this,s={enumerable:!0};c.hasBeenReset=!1;var d="",i=!1,l=g,r=p,o=h,w=null,T="",x=!0,L="auto",A="start",E=50,_="middle",m=50,f="middle";Object.defineProperty(c,"id",n({},s,{get:function(){return d},set:function(b){d=""+b}})),Object.defineProperty(c,"pauseOnExit",n({},s,{get:function(){return i},set:function(b){i=!!b}})),Object.defineProperty(c,"startTime",n({},s,{get:function(){return l},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");l=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},s,{get:function(){return r},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},s,{get:function(){return o},set:function(b){o=""+b,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},s,{get:function(){return w},set:function(b){w=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},s,{get:function(){return T},set:function(b){var y=G(b);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},s,{get:function(){return x},set:function(b){x=!!b,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},s,{get:function(){return L},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},s,{get:function(){return A},set:function(b){var y=W(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},s,{get:function(){return E},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},s,{get:function(){return _},set:function(b){var y=W(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},s,{get:function(){return m},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},s,{get:function(){return f},set:function(b){var y=W(b);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");f=y,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"parseTimeStamp",function(){return O}),D.d(z,"fixLineBreaks",function(){return p}),D.d(z,"VTTParser",function(){return h});var V=D("./src/utils/vttcue.ts"),U=function(){function c(){}var s=c.prototype;return s.decode=function(i,l){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},c}();function O(c){function s(i,l,r,o){return(i|0)*3600+(l|0)*60+(r|0)+parseFloat(o||0)}var d=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?s(d[2],d[3],0,d[4]):s(d[1],d[2],d[3],d[4]):null}var G=function(){function c(){this.values=Object.create(null)}var s=c.prototype;return s.set=function(i,l){!this.get(i)&&l!==""&&(this.values[i]=l)},s.get=function(i,l,r){return r?this.has(i)?this.values[i]:l[r]:this.has(i)?this.values[i]:l},s.has=function(i){return i in this.values},s.alt=function(i,l,r){for(var o=0;o<r.length;++o)if(l===r[o]){this.set(i,l);break}},s.integer=function(i,l){/^-?\d+$/.test(l)&&this.set(i,parseInt(l,10))},s.percent=function(i,l){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(l)){var r=parseFloat(l);if(r>=0&&r<=100)return this.set(i,r),!0}return!1},c}();function W(c,s,d,i){var l=i?c.split(i):[c];for(var r in l){if(typeof l[r]!="string")continue;var o=l[r].split(d);if(o.length!==2)continue;var w=o[0],T=o[1];s(w,T)}}var n=new V.default(0,0,""),I=n.align==="middle"?"middle":"center";function g(c,s,d){var i=c;function l(){var w=O(c);if(w===null)throw new Error("Malformed timestamp: "+i);return c=c.replace(/^[^\sa-zA-Z-]+/,""),w}function r(w,T){var x=new G;W(w,function(E,_){var m;switch(E){case"region":for(var f=d.length-1;f>=0;f--)if(d[f].id===_){x.set(E,d[f].region);break}break;case"vertical":x.alt(E,_,["rl","lr"]);break;case"line":m=_.split(","),x.integer(E,m[0]),x.percent(E,m[0])&&x.set("snapToLines",!1),x.alt(E,m[0],["auto"]),m.length===2&&x.alt("lineAlign",m[1],["start",I,"end"]);break;case"position":m=_.split(","),x.percent(E,m[0]),m.length===2&&x.alt("positionAlign",m[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(E,_);break;case"align":x.alt(E,_,["start",I,"end","left","right"]);break}},/:/,/\s/),T.region=x.get("region",null),T.vertical=x.get("vertical","");var L=x.get("line","auto");L==="auto"&&n.line===-1&&(L=-1),T.line=L,T.lineAlign=x.get("lineAlign","start"),T.snapToLines=x.get("snapToLines",!0),T.size=x.get("size",100),T.align=x.get("align",I);var A=x.get("position","auto");A==="auto"&&n.position===50&&(A=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=A}function o(){c=c.replace(/^\s+/,"")}if(o(),s.startTime=l(),o(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);c=c.substr(3),o(),s.endTime=l(),o(),r(c,s)}function p(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var h=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=c.prototype;return s.parse=function(i){var l=this;i&&(l.buffer+=l.decoder.decode(i,{stream:!0}));function r(){var A=l.buffer,E=0;for(A=p(A);E<A.length&&A[E]!=="\r"&&A[E]!==`
|
|
`;)++E;var _=A.substr(0,E);return A[E]==="\r"&&++E,A[E]===`
|
|
`&&++E,l.buffer=A.substr(E),_}function o(A){W(A,function(E,_){},/:/)}try{var w="";if(l.state==="INITIAL"){if(!/\r\n|\n/.test(l.buffer))return this;w=r();var T=w.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");l.state="HEADER"}for(var x=!1;l.buffer;){if(!/\r\n|\n/.test(l.buffer))return this;x?x=!1:w=r();switch(l.state){case"HEADER":/:/.test(w)?o(w):w||(l.state="ID");continue;case"NOTE":w||(l.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){l.state="NOTE";break}if(!w)continue;if(l.cue=new V.default(0,0,""),l.state="CUE",w.indexOf("-->")===-1){l.cue.id=w;continue}case"CUE":if(!l.cue){l.state="BADCUE";continue}try{g(w,l.cue,l.regionList)}catch(A){l.cue=null,l.state="BADCUE";continue}l.state="CUETEXT";continue;case"CUETEXT":{var L=w.indexOf("-->")!==-1;if(!w||L&&(x=!0)){l.oncue&&l.cue&&l.oncue(l.cue),l.cue=null,l.state="ID";continue}if(l.cue===null)continue;l.cue.text&&(l.cue.text+=`
|
|
`),l.cue.text+=w}continue;case"BADCUE":w||(l.state="ID")}}}catch(A){l.state==="CUETEXT"&&l.cue&&l.oncue&&l.oncue(l.cue),l.cue=null,l.state=l.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
|
|
|
|
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(l){i.onparsingerror&&i.onparsingerror(l)}return i.onflush&&i.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(q,z,D){"use strict";D.r(z),D.d(z,"generateCueId",function(){return h}),D.d(z,"parseWebVTT",function(){return s});var V=D("./src/polyfills/number.ts"),U=D("./src/utils/vttparser.ts"),O=D("./src/demux/id3.ts"),G=D("./src/utils/timescale-conversion.ts"),W=D("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(i,l,r){return r===void 0&&(r=0),i.substr(r,l.length)===l},g=function(i){var l=parseInt(i.substr(-3)),r=parseInt(i.substr(-6,2)),o=parseInt(i.substr(-9,2)),w=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(l)||!Object(V.isFiniteNumber)(r)||!Object(V.isFiniteNumber)(o)||!Object(V.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return l+=1e3*r,l+=60*1e3*o,l+=60*60*1e3*w,l},p=function(i){for(var l=5381,r=i.length;r;)l=l*33^i.charCodeAt(--r);return(l>>>0).toString()};function h(d,i,l){return p(d.toString())+p(i.toString())+p(l)}var c=function(i,l,r){var o=i[l],w=i[o.prevCC];if(!w||!w.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(T=w)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=o.start-w.start,o.new=!1,o=w,w=i[o.prevCC]}i.presentationOffset=r};function s(d,i,l,r,o,w,T,x){var L=new U.VTTParser,A=Object(O.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(n,`
|
|
`).split(`
|
|
`),E=[],_=Object(G.toMpegTsClockFromTimescale)(i,l),m="00:00.000",f=0,S=0,b,y=!0,M=!1;L.oncue=function(B){var R=r[o],H=r.ccOffset,N=(f-_)/9e4;if(R!=null&&R.new&&(S!==void 0?H=r.ccOffset=R.start:c(r,o,N)),N&&(H=N-r.presentationOffset),M){var C=B.endTime-B.startTime,K=Object(W.normalizePts)((B.startTime+H-S)*9e4,w*9e4)/9e4;B.startTime=K,B.endTime=K+C}var Z=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(Z)),B.id||(B.id=h(B.startTime,B.endTime,Z)),B.endTime>0&&E.push(B)},L.onparsingerror=function(B){b=B},L.onflush=function(){if(b){x(b);return}T(E)},A.forEach(function(B){if(y)if(I(B,"X-TIMESTAMP-MAP=")){y=!1,M=!0,B.substr(16).split(",").forEach(function(R){I(R,"LOCAL:")?m=R.substr(6):I(R,"MPEGTS:")&&(f=parseInt(R.substr(7)))});try{S=g(m)/1e3}catch(R){M=!1,b=R}return}else B===""&&(y=!1);L.parse(B+`
|
|
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(q,z,D){"use strict";D.r(z);var V=D("./src/utils/logger.ts"),U=D("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,G=function(){function W(I){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=I?I.xhrSetup:null,this.stats=new U.LoadStats,this.retryDelay=0}var n=W.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},n.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(g,p,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=p,this.callbacks=h,this.retryDelay=p.retryDelay,this.loadInternal()},n.loadInternal=function(){var g=this.config,p=this.context;if(!g)return;var h=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var s=this.xhrSetup;try{if(s)try{s(h,p.url)}catch(l){h.open("GET",p.url,!0),s(h,p.url)}h.readyState||h.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var i in d)h.setRequestHeader(i,d[i])}catch(l){this.callbacks.onError({code:h.status,text:l.message},p,h);return}p.rangeEnd&&h.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),h.send()},n.readystatechange=function(){var g=this.context,p=this.loader,h=this.stats;if(!g||!p)return;var c=p.readyState,s=this.config;if(h.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),c===4){p.onreadystatechange=null,p.onprogress=null;var d=p.status;if(d>=200&&d<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var i,l;if(g.responseType==="arraybuffer"?(i=p.response,l=i.byteLength):(i=p.responseText,l=i.length),h.loaded=h.total=l,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(h,g,i,p),!this.callbacks)return;var o={url:p.responseURL,data:i};this.callbacks.onSuccess(o,h,g,p)}else h.retry>=s.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+g.url),this.callbacks.onError({code:d,text:p.statusText},g,p)):(V.logger.warn(d+" while loading "+g.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,s.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},n.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(g){var p=this.stats;p.loaded=g.loaded,g.lengthComputable&&(p.total=g.total)},n.getCacheAge=function(){var g=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},W}();z.default=G}}).default})},vHTk:function(ke,de,P){ke.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(ke,de,P){"use strict";P.d(de,"a",function(){return Je});var q=P("rePB"),z=P("VTBJ"),D=P("KQm4"),V=P("U8pU"),U=P("ODXe"),O=P("q1tI"),G=P("TSYQ"),W=P.n(G),n=P("Gytx"),I=P.n(n),g=P("Kwbf"),p=P("t23M"),h=P("qx4F"),c=P("6eGT"),s=P("IBYe"),d=P("Ff2n"),i=P("c+Xe"),l=P("fyJ8"),r=P("biw7");function o(Re,Oe,We,He,ue){var Q=We[Re]||{},te=We[Oe]||{},ae,ce;Q.fixed==="left"?ae=He.left[Re]:te.fixed==="right"&&(ce=He.right[Oe]);var re=!1,se=!1,he=!1,me=!1,ye=We[Oe+1],Se=We[Re-1];if(ue==="rtl"){if(ae!==void 0){var Fe=Se&&Se.fixed==="left";me=!Fe}else if(ce!==void 0){var Ge=ye&&ye.fixed==="right";he=!Ge}}else if(ae!==void 0){var Ze=ye&&ye.fixed==="left";re=!Ze}else if(ce!==void 0){var Ye=Se&&Se.fixed==="right";se=!Ye}return{fixLeft:ae,fixRight:ce,lastFixLeft:re,firstFixRight:se,lastFixRight:he,firstFixLeft:me,isSticky:He.isSticky}}var w=P("sR1s");function T(Re){var Oe=Re.cells,We=Re.stickyOffsets,He=Re.flattenColumns,ue=Re.rowComponent,Q=Re.cellComponent,te=Re.onHeaderRow,ae=Re.index,ce=O.useContext(r.a),re=ce.prefixCls,se=ce.direction,he;te&&(he=te(Oe.map(function(ye){return ye.column}),ae));var me=Object(w.a)(Oe.map(function(ye){return ye.column}));return O.createElement(ue,Object.assign({},he),Oe.map(function(ye,Se){var Fe=ye.column,Ge=o(ye.colStart,ye.colEnd,He,We,se),Ze;return Fe&&Fe.onHeaderCell&&(Ze=ye.column.onHeaderCell(Fe)),O.createElement(l.a,Object.assign({},ye,{ellipsis:Fe.ellipsis,align:Fe.align,component:Q,prefixCls:re,key:me[Se]},Ge,{additionalProps:Ze,rowType:"header"}))}))}T.displayName="HeaderRow";var x=T;function L(Re){var Oe=[];function We(te,ae){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Oe[ce]=Oe[ce]||[];var re=ae,se=te.filter(Boolean).map(function(he){var me={key:he.key,className:he.className||"",children:he.title,column:he,colStart:re},ye=1,Se=he.children;return Se&&Se.length>0&&(ye=We(Se,re,ce+1).reduce(function(Fe,Ge){return Fe+Ge},0),me.hasSubColumns=!0),"colSpan"in he&&(ye=he.colSpan),"rowSpan"in he&&(me.rowSpan=he.rowSpan),me.colSpan=ye,me.colEnd=me.colStart+ye-1,Oe[ce].push(me),re+=ye,ye});return se}We(Re,0);for(var He=Oe.length,ue=function(ae){Oe[ae].forEach(function(ce){!("rowSpan"in ce)&&!ce.hasSubColumns&&(ce.rowSpan=He-ae)})},Q=0;Q<He;Q+=1)ue(Q);return Oe}function A(Re){var Oe=Re.stickyOffsets,We=Re.columns,He=Re.flattenColumns,ue=Re.onHeaderRow,Q=O.useContext(r.a),te=Q.prefixCls,ae=Q.getComponent,ce=O.useMemo(function(){return L(We)},[We]),re=ae(["header","wrapper"],"thead"),se=ae(["header","row"],"tr"),he=ae(["header","cell"],"th");return O.createElement(re,{className:"".concat(te,"-thead")},ce.map(function(me,ye){var Se=O.createElement(x,{key:ye,flattenColumns:He,cells:me,stickyOffsets:Oe,rowComponent:se,cellComponent:he,onHeaderRow:ue,index:ye});return Se}))}var E=A,_=P("hW8S");function m(Re){for(var Oe=Re.colWidths,We=Re.columns,He=Re.columCount,ue=[],Q=He||We.length,te=!1,ae=Q-1;ae>=0;ae-=1){var ce=Oe[ae],re=We&&We[ae],se=re&&re[_.a];(ce||se||te)&&(ue.unshift(O.createElement("col",Object.assign({key:ae,style:{width:ce,minWidth:ce}},se))),te=!0)}return O.createElement("colgroup",null,ue)}var f=m;function S(Re,Oe){return Object(O.useMemo)(function(){for(var We=[],He=0;He<Oe;He+=1){var ue=Re[He];if(ue!==void 0)We[He]=ue;else return null}return We},[Re.join("_"),Oe])}var b=O.forwardRef(function(Re,Oe){var We=Re.noData,He=Re.columns,ue=Re.flattenColumns,Q=Re.colWidths,te=Re.columCount,ae=Re.stickyOffsets,ce=Re.direction,re=Re.fixHeader,se=Re.offsetHeader,he=Re.stickyClassName,me=Re.onScroll,ye=Object(d.a)(Re,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Se=O.useContext(r.a),Fe=Se.prefixCls,Ge=Se.scrollbarSize,Ze=Se.isSticky,Ye=Ze&&!re?0:Ge,Rt=O.useRef(null),lt=O.useCallback(function(on){Object(i.b)(Oe,on),Object(i.b)(Rt,on)},[]);O.useEffect(function(){var on;function an(Ct){var Mt=Ct.currentTarget,ht=Ct.deltaX;ht&&(me({currentTarget:Mt,scrollLeft:Mt.scrollLeft+ht}),Ct.preventDefault())}return(on=Rt.current)===null||on===void 0||on.addEventListener("wheel",an),function(){var Ct;(Ct=Rt.current)===null||Ct===void 0||Ct.removeEventListener("wheel",an)}},[]);var it=ue[ue.length-1],Wt={fixed:it?it.fixed:null,onHeaderCell:function(){return{className:"".concat(Fe,"-cell-scrollbar")}}},Nt=Object(O.useMemo)(function(){return Ye?[].concat(Object(D.a)(He),[Wt]):He},[Ye,He]),Ut=Object(O.useMemo)(function(){return Ye?[].concat(Object(D.a)(ue),[Wt]):ue},[Ye,ue]),rn=Object(O.useMemo)(function(){var on=ae.right,an=ae.left;return Object(z.a)(Object(z.a)({},ae),{},{left:ce==="rtl"?[].concat(Object(D.a)(an.map(function(Ct){return Ct+Ye})),[0]):an,right:ce==="rtl"?on:[].concat(Object(D.a)(on.map(function(Ct){return Ct+Ye})),[0]),isSticky:Ze})},[Ye,ae,Ze]),vt=S(Q,te);return O.createElement("div",{style:Object(z.a)({overflow:"hidden"},Ze?{top:se}:{}),ref:lt,className:W()("".concat(Fe,"-header"),Object(q.a)({},he,!!he))},O.createElement("table",{style:{tableLayout:"fixed",visibility:We||vt?null:"hidden"}},O.createElement(f,{colWidths:vt?[].concat(Object(D.a)(vt),[Ye]):[],columCount:te+1,columns:Ut}),O.createElement(E,Object.assign({},ye,{stickyOffsets:rn,columns:Nt,flattenColumns:Ut}))))});b.displayName="FixedHeader";var y=b,M=O.createContext(null),B=M;function R(Re){var Oe=Re.prefixCls,We=Re.children,He=Re.component,ue=Re.cellComponent,Q=Re.fixHeader,te=Re.fixColumn,ae=Re.horizonScroll,ce=Re.className,re=Re.expanded,se=Re.componentWidth,he=Re.colSpan,me=O.useContext(r.a),ye=me.scrollbarSize;return O.useMemo(function(){var Se=We;return te&&(Se=O.createElement("div",{style:{width:se-(Q?ye:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Oe,"-expanded-row-fixed")},Se)),O.createElement(He,{className:ce,style:{display:re?null:"none"}},O.createElement(l.a,{component:ue,prefixCls:Oe,colSpan:he},Se))},[We,He,Q,ae,ce,re,se,he,ye])}var H=R;function N(Re){var Oe=Re.className,We=Re.style,He=Re.record,ue=Re.index,Q=Re.rowKey,te=Re.getRowKey,ae=Re.rowExpandable,ce=Re.expandedKeys,re=Re.onRow,se=Re.indent,he=se===void 0?0:se,me=Re.rowComponent,ye=Re.cellComponent,Se=Re.childrenColumnName,Fe=O.useContext(r.a),Ge=Fe.prefixCls,Ze=Fe.fixedInfoList,Ye=O.useContext(B),Rt=Ye.fixHeader,lt=Ye.fixColumn,it=Ye.horizonScroll,Wt=Ye.componentWidth,Nt=Ye.flattenColumns,Ut=Ye.expandableType,rn=Ye.expandRowByClick,vt=Ye.onTriggerExpand,on=Ye.rowClassName,an=Ye.expandedRowClassName,Ct=Ye.indentSize,Mt=Ye.expandIcon,ht=Ye.expandedRowRender,Tt=Ye.expandIconColumnIndex,yt=O.useState(!1),Sn=Object(U.a)(yt,2),Kn=Sn[0],pn=Sn[1],et=ce&&ce.has(Re.recordKey);O.useEffect(function(){et&&pn(!0)},[et]);var Kt=Ut==="row"&&(!ae||ae(He)),Yt=Ut==="nest",xt=Se&&He&&He[Se],Dt=Kt||Yt,jt;re&&(jt=re(He,ue));var Fn=function(Et){if(rn&&Dt&&vt(He,Et),jt&&jt.onClick){for(var Be,Me=arguments.length,wt=new Array(Me>1?Me-1:0),Ht=1;Ht<Me;Ht++)wt[Ht-1]=arguments[Ht];(Be=jt).onClick.apply(Be,[Et].concat(wt))}},En;typeof on=="string"?En=on:typeof on=="function"&&(En=on(He,ue,he));var Ve=Object(w.a)(Nt),nt=O.createElement(me,Object.assign({},jt,{"data-row-key":Q,className:W()(Oe,"".concat(Ge,"-row"),"".concat(Ge,"-row-level-").concat(he),En,jt&&jt.className),style:Object(z.a)(Object(z.a)({},We),jt?jt.style:null),onClick:Fn}),Nt.map(function(jn,Et){var Be=jn.render,Me=jn.dataIndex,wt=jn.className,Ht=Ve[Et],_n=Ze[Et],mn;Et===(Tt||0)&&Yt&&(mn=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(Ct*he,"px")},className:"".concat(Ge,"-row-indent indent-level-").concat(he)}),Mt({prefixCls:Ge,expanded:et,expandable:xt,record:He,onExpand:vt})));var sn;return jn.onCell&&(sn=jn.onCell(He,ue)),O.createElement(l.a,Object.assign({className:wt,ellipsis:jn.ellipsis,align:jn.align,component:ye,prefixCls:Ge,key:Ht,record:He,index:ue,dataIndex:Me,render:Be,shouldCellUpdate:jn.shouldCellUpdate},_n,{appendNode:mn,additionalProps:sn}))})),rr;if(Kt&&(Kn||et)){var Dr=ht(He,ue,he+1,et),Ur=an&&an(He,ue,he);rr=O.createElement(H,{expanded:et,className:W()("".concat(Ge,"-expanded-row"),"".concat(Ge,"-expanded-row-level-").concat(he+1),Ur),prefixCls:Ge,fixHeader:Rt,fixColumn:lt,horizonScroll:it,component:me,componentWidth:Wt,cellComponent:ye,colSpan:Nt.length},Dr)}var Fr;return xt&&et&&(Fr=(He[Se]||[]).map(function(jn,Et){var Be=te(jn,Et);return O.createElement(N,Object.assign({},Re,{key:Be,rowKey:Be,record:jn,recordKey:Be,index:Et,indent:he+1}))})),O.createElement(O.Fragment,null,nt,rr,Fr)}N.displayName="BodyRow";var C=N,K=O.createContext(null),Z=K;function oe(Re){var Oe=Re.columnKey,We=Re.onColumnResize,He=O.useRef();return O.useEffect(function(){He.current&&We(Oe,He.current.offsetWidth)},[]),O.createElement(p.a,{onResize:function(Q){var te=Q.offsetWidth;We(Oe,te)}},O.createElement("td",{ref:He,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Re){var Oe=Re.data,We=Re.getRowKey,He=Re.measureColumnWidth,ue=Re.expandedKeys,Q=Re.onRow,te=Re.rowExpandable,ae=Re.emptyNode,ce=Re.childrenColumnName,re=O.useContext(Z),se=re.onColumnResize,he=O.useContext(r.a),me=he.prefixCls,ye=he.getComponent,Se=O.useContext(B),Fe=Se.fixHeader,Ge=Se.horizonScroll,Ze=Se.flattenColumns,Ye=Se.componentWidth;return O.useMemo(function(){var Rt=ye(["body","wrapper"],"tbody"),lt=ye(["body","row"],"tr"),it=ye(["body","cell"],"td"),Wt;Oe.length?Wt=Oe.map(function(Ut,rn){var vt=We(Ut,rn);return O.createElement(C,{key:vt,rowKey:vt,record:Ut,recordKey:vt,index:rn,rowComponent:lt,cellComponent:it,expandedKeys:ue,onRow:Q,getRowKey:We,rowExpandable:te,childrenColumnName:ce})}):Wt=O.createElement(H,{expanded:!0,className:"".concat(me,"-placeholder"),prefixCls:me,fixHeader:Fe,fixColumn:Ge,horizonScroll:Ge,component:lt,componentWidth:Ye,cellComponent:it,colSpan:Ze.length},ae);var Nt=Object(w.a)(Ze);return O.createElement(Rt,{className:"".concat(me,"-tbody")},He&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(me,"-measure-row"),style:{height:0}},Nt.map(function(Ut){return O.createElement(oe,{key:Ut,columnKey:Ut,onColumnResize:se})})),Wt)},[Oe,me,Q,He,ue,We,ye,Ye,ae,Ze])}var xe=O.memo(fe);xe.displayName="Body";var be=xe,Te=P("wRmb"),Ce=P("xEkU"),Le=P.n(Ce);function ge(Re){var Oe=Object(O.useRef)(Re),We=Object(O.useState)({}),He=Object(U.a)(We,2),ue=He[1],Q=Object(O.useRef)(null),te=Object(O.useRef)([]);function ae(ce){Q.current===null&&(te.current=[],Q.current=Le()(function(){te.current.forEach(function(re){Oe.current=re(Oe.current)}),Q.current=null,ue({})})),te.current.push(ce)}return Object(O.useEffect)(function(){return function(){Le.a.cancel(Q.current)}},[]),[Oe.current,ae]}function Y(Re){var Oe=Object(O.useRef)(Re),We=Object(O.useRef)(null);function He(){window.clearTimeout(We.current)}function ue(te){Oe.current=te,He(),We.current=window.setTimeout(function(){Oe.current=null,We.current=null},100)}function Q(){return Oe.current}return Object(O.useEffect)(function(){return He},[]),[ue,Q]}function k(Re,Oe,We){var He=Object(O.useMemo)(function(){for(var ue=[],Q=[],te=0,ae=0,ce=0;ce<Oe;ce+=1)if(We==="rtl"){Q[ce]=ae,ae+=Re[ce]||0;var re=Oe-ce-1;ue[re]=te,te+=Re[re]||0}else{ue[ce]=te,te+=Re[ce]||0;var se=Oe-ce-1;Q[se]=ae,ae+=Re[se]||0}return{left:ue,right:Q}},[Re,Oe,We]);return He}var j=k;function J(Re){var Oe=Re.className,We=Re.children;return O.createElement("div",{className:Oe},We)}var ie=J,X=P("n6Qo");function ve(Re){var Oe,We=Re.prefixCls,He=Re.record,ue=Re.onExpand,Q=Re.expanded,te=Re.expandable,ae="".concat(We,"-row-expand-icon");if(!te)return O.createElement("span",{className:W()(ae,"".concat(We,"-row-spaced"))});var ce=function(se){ue(He,se),se.stopPropagation()};return O.createElement("span",{className:W()(ae,(Oe={},Object(q.a)(Oe,"".concat(We,"-row-expanded"),Q),Object(q.a)(Oe,"".concat(We,"-row-collapsed"),!Q),Oe)),onClick:ce})}function Ie(Re,Oe,We){var He=[];function ue(Q){(Q||[]).forEach(function(te,ae){He.push(Oe(te,ae)),ue(te[We])})}return ue(Re),He}var Ue=P("zT1h"),pe=P("y0+3"),_e=function(Oe,We){var He,ue,Q=Oe.scrollBodyRef,te=Oe.onScroll,ae=Oe.offsetScroll,ce=O.useContext(r.a),re=ce.prefixCls,se=((He=Q.current)===null||He===void 0?void 0:He.scrollWidth)||0,he=((ue=Q.current)===null||ue===void 0?void 0:ue.clientWidth)||0,me=se&&he*(he/se),ye=O.useRef(),Se=ge({scrollLeft:0,isHiddenScrollBar:!1}),Fe=Object(U.a)(Se,2),Ge=Fe[0],Ze=Fe[1],Ye=O.useRef({delta:0,x:0}),Rt=O.useState(!1),lt=Object(U.a)(Rt,2),it=lt[0],Wt=lt[1],Nt=function(){Wt(!1)},Ut=function(Ct){Ct.persist(),Ye.current.delta=Ct.pageX-Ge.scrollLeft,Ye.current.x=0,Wt(!0),Ct.preventDefault()},rn=function(Ct){var Mt,ht=Ct||((Mt=window)===null||Mt===void 0?void 0:Mt.event),Tt=ht.buttons;if(!it||Tt===0){it&&Wt(!1);return}var yt=Ye.current.x+Ct.pageX-Ye.current.x-Ye.current.delta;yt<=0&&(yt=0),yt+me>=he&&(yt=he-me),te({scrollLeft:yt/he*(se+2)}),Ye.current.x=Ct.pageX},vt=function(){var Ct=Object(pe.b)(Q.current).top,Mt=Ct+Q.current.offsetHeight,ht=document.documentElement.scrollTop+window.innerHeight;Mt-Object(h.a)()<=ht||Ct>=ht-ae?Ze(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!0})}):Ze(function(Tt){return Object(z.a)(Object(z.a)({},Tt),{},{isHiddenScrollBar:!1})})},on=function(Ct){Ze(function(Mt){return Object(z.a)(Object(z.a)({},Mt),{},{scrollLeft:Ct/se*he||0})})};return O.useImperativeHandle(We,function(){return{setScrollLeft:on}}),O.useEffect(function(){var an=Object(Ue.a)(document.body,"mouseup",Nt,!1),Ct=Object(Ue.a)(document.body,"mousemove",rn,!1);return vt(),function(){an.remove(),Ct.remove()}},[me,it]),O.useEffect(function(){var an=Object(Ue.a)(window,"scroll",vt,!1),Ct=Object(Ue.a)(window,"resize",vt,!1);return function(){an.remove(),Ct.remove()}},[]),O.useEffect(function(){Ge.isHiddenScrollBar||Ze(function(an){var Ct,Mt;return Object(z.a)(Object(z.a)({},an),{},{scrollLeft:Q.current.scrollLeft/((Ct=Q.current)===null||Ct===void 0?void 0:Ct.scrollWidth)*((Mt=Q.current)===null||Mt===void 0?void 0:Mt.clientWidth)})})},[Ge.isHiddenScrollBar]),se<=he||!me||Ge.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(h.a)(),width:he,bottom:ae},className:"".concat(re,"-sticky-scroll")},O.createElement("div",{onMouseDown:Ut,ref:ye,className:W()("".concat(re,"-sticky-scroll-bar"),Object(q.a)({},"".concat(re,"-sticky-scroll-bar-active"),it)),style:{width:"".concat(me,"px"),transform:"translate3d(".concat(Ge.scrollLeft,"px, 0, 0)")}}))},Ae=O.forwardRef(_e);function De(Re,Oe){return O.useMemo(function(){var We=!!Re;return{isSticky:We,stickyClassName:We?"".concat(Oe,"-sticky-header"):"",offsetHeader:Object(V.a)(Re)==="object"&&Re.offsetHeader||0,offsetScroll:Object(V.a)(Re)==="object"&&Re.offsetScroll||0}},[Re,Oe])}var je=[],ze={},Je="rc-table-internal-hook",$e=O.memo(function(Re){var Oe=Re.children;return Oe},function(Re,Oe){return I()(Re.props,Oe.props)?Re.pingLeft!==Oe.pingLeft||Re.pingRight!==Oe.pingRight:!1});function tt(Re){var Oe,We=Re.prefixCls,He=Re.className,ue=Re.rowClassName,Q=Re.style,te=Re.data,ae=Re.rowKey,ce=Re.scroll,re=Re.tableLayout,se=Re.direction,he=Re.title,me=Re.footer,ye=Re.summary,Se=Re.id,Fe=Re.showHeader,Ge=Re.components,Ze=Re.emptyText,Ye=Re.onRow,Rt=Re.onHeaderRow,lt=Re.internalHooks,it=Re.transformColumns,Wt=Re.internalRefs,Nt=Re.sticky,Ut=te||je,rn=!!Ut.length,vt=O.useState(0),on=Object(U.a)(vt,2),an=on[0],Ct=on[1];O.useEffect(function(){Ct(Object(h.a)())});var Mt=O.useMemo(function(){return Object(w.c)(Ge,{})},[Ge]),ht=O.useCallback(function(bn,ln){return Object(w.b)(Mt,bn)||ln},[Mt]),Tt=O.useMemo(function(){return typeof ae=="function"?ae:function(bn){var ln=bn&&bn[ae];return ln}},[ae]),yt=Object(_.c)(Re),Sn=yt.expandIcon,Kn=yt.expandedRowKeys,pn=yt.defaultExpandedRowKeys,et=yt.defaultExpandAllRows,Kt=yt.expandedRowRender,Yt=yt.onExpand,xt=yt.onExpandedRowsChange,Dt=yt.expandRowByClick,jt=yt.rowExpandable,Fn=yt.expandIconColumnIndex,En=yt.expandedRowClassName,Ve=yt.childrenColumnName,nt=yt.indentSize,rr=Sn||ve,Dr=Ve||"children",Ur=O.useMemo(function(){return Kt?"row":Re.expandable&<===Je&&Re.expandable.__PARENT_RENDER_ICON__||Ut.some(function(bn){return bn&&Object(V.a)(bn)==="object"&&bn[Dr]})?"nest":!1},[!!Kt,Ut]),Fr=O.useState(function(){return pn||(et?Ie(Ut,Tt,Dr):[])}),jn=Object(U.a)(Fr,2),Et=jn[0],Be=jn[1],Me=O.useMemo(function(){return new Set(Kn||Et||[])},[Kn,Et]),wt=O.useCallback(function(bn){var ln=Tt(bn,Ut.indexOf(bn)),cn,pr=Me.has(ln);pr?(Me.delete(ln),cn=Object(D.a)(Me)):cn=[].concat(Object(D.a)(Me),[ln]),Be(cn),Yt&&Yt(!pr,bn),xt&&xt(cn)},[Tt,Me,Ut,Yt,xt]),Ht=O.useState(0),_n=Object(U.a)(Ht,2),mn=_n[0],sn=_n[1],Gt=Object(Te.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Re),yt),{},{expandable:!!Kt,expandedKeys:Me,getRowKey:Tt,onTriggerExpand:wt,expandIcon:rr,expandIconColumnIndex:Fn,direction:se}),lt===Je?it:null),_t=Object(U.a)(Gt,2),Ot=_t[0],Pt=_t[1],St=O.useMemo(function(){return{columns:Ot,flattenColumns:Pt}},[Ot,Pt]),qt=O.useRef(),rt=O.useRef(),hn=O.useRef(),Zt=O.useState(!1),Pn=Object(U.a)(Zt,2),Lt=Pn[0],Mn=Pn[1],Un=O.useState(!1),An=Object(U.a)(Un,2),Tn=An[0],In=An[1],ir=ge(new Map),cr=Object(U.a)(ir,2),Xn=cr[0],Cn=cr[1],dr=Object(w.a)(Pt),fn=dr.map(function(bn){return Xn.get(bn)}),gn=O.useMemo(function(){return fn},[fn.join("_")]),vn=j(gn,Pt.length,se),zt=ce&&Object(w.d)(ce.y),dt=ce&&Object(w.d)(ce.x),kt=dt&&Pt.some(function(bn){var ln=bn.fixed;return ln}),ut=O.useRef(),en=De(Nt,We),It=en.isSticky,ar=en.offsetHeader,kn=en.offsetScroll,hr=en.stickyClassName,Zr,Pr,zr;zt&&(Pr={overflowY:"scroll",maxHeight:ce.y}),dt&&(Zr={overflowX:"auto"},zt||(Pr={overflowY:"hidden"}),zr={width:ce.x===!0?"auto":ce.x,minWidth:"100%"});var Mr=O.useCallback(function(bn,ln){Cn(function(cn){var pr=new Map(cn);return pr.set(bn,ln),pr})},[]),Cr=Y(null),Kr=Object(U.a)(Cr,2),Wn=Kr[0],gt=Kr[1];function Vr(bn,ln){if(!ln)return;typeof ln=="function"?ln(bn):ln.scrollLeft!==bn&&(ln.scrollLeft=bn)}var vr=function(ln){var cn=ln.currentTarget,pr=ln.scrollLeft,Qr=typeof pr=="number"?pr:cn.scrollLeft,qr=cn||ze;if(!gt()||gt()===qr){var ri;Wn(qr),Vr(Qr,rt.current),Vr(Qr,hn.current),Vr(Qr,(ri=ut.current)===null||ri===void 0?void 0:ri.setScrollLeft)}if(cn){var Ti=cn.scrollWidth,Qt=cn.clientWidth;Mn(Qr>0),In(Qr<Ti-Qt)}},ni=function(){hn.current&&vr({currentTarget:hn.current})},pt=function(ln){var cn=ln.width;ni(),sn(qt.current?qt.current.offsetWidth:cn)};O.useEffect(function(){return ni},[]),O.useEffect(function(){dt&&ni()},[dt]),O.useEffect(function(){lt===Je&&Wt&&(Wt.body.current=hn.current)});var Ft=ht(["table"],"table"),bt=O.useMemo(function(){return re||(kt?ce.x==="max-content"?"auto":"fixed":zt||Pt.some(function(bn){var ln=bn.ellipsis;return ln})?"fixed":"auto")},[zt,kt,Pt,re]),Vt,$t={colWidths:gn,columCount:Pt.length,stickyOffsets:vn,onHeaderRow:Rt,fixHeader:zt},xn=O.useMemo(function(){return rn?null:typeof Ze=="function"?Ze():Ze},[rn,Ze]),tn=O.createElement(be,{data:Ut,measureColumnWidth:zt||dt||It,expandedKeys:Me,rowExpandable:jt,getRowKey:Tt,onRow:Ye,emptyNode:xn,childrenColumnName:Dr}),Nn=O.createElement(f,{colWidths:Pt.map(function(bn){var ln=bn.width;return ln}),columns:Pt}),er=ye&&O.createElement(X.b,null,ye(Ut)),Xt=ht(["body"]);if(zt||It){var yr;typeof Xt=="function"?(yr=Xt(Ut,{scrollbarSize:an,ref:hn,onScroll:vr}),$t.colWidths=Pt.map(function(bn,ln){var cn=bn.width,pr=ln===Ot.length-1?cn-an:cn;return typeof pr=="number"&&!Number.isNaN(pr)?pr:(Object(g.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):yr=O.createElement("div",{style:Object(z.a)(Object(z.a)({},Zr),Pr),onScroll:vr,ref:hn,className:W()("".concat(We,"-body"))},O.createElement(Ft,{style:Object(z.a)(Object(z.a)({},zr),{},{tableLayout:bt})},Nn,tn,er),It&&O.createElement(Ae,{ref:ut,offsetScroll:kn,scrollBodyRef:hn,onScroll:vr})),Vt=O.createElement(O.Fragment,null,Fe!==!1&&O.createElement(y,Object.assign({noData:!Ut.length},$t,St,{direction:se,offsetHeader:ar,stickyClassName:hr,ref:rt,onScroll:vr})),yr)}else Vt=O.createElement("div",{style:Object(z.a)(Object(z.a)({},Zr),Pr),className:W()("".concat(We,"-content")),onScroll:vr,ref:hn},O.createElement(Ft,{style:Object(z.a)(Object(z.a)({},zr),{},{tableLayout:bt})},Nn,Fe!==!1&&O.createElement(E,Object.assign({},$t,St)),tn,er));var yn=Object(_.b)(Re),Yn=O.createElement("div",Object.assign({className:W()(We,He,(Oe={},Object(q.a)(Oe,"".concat(We,"-rtl"),se==="rtl"),Object(q.a)(Oe,"".concat(We,"-ping-left"),Lt),Object(q.a)(Oe,"".concat(We,"-ping-right"),Tn),Object(q.a)(Oe,"".concat(We,"-layout-fixed"),re==="fixed"),Object(q.a)(Oe,"".concat(We,"-fixed-header"),zt),Object(q.a)(Oe,"".concat(We,"-fixed-column"),kt),Object(q.a)(Oe,"".concat(We,"-scroll-horizontal"),dt),Object(q.a)(Oe,"".concat(We,"-has-fix-left"),Pt[0]&&Pt[0].fixed),Object(q.a)(Oe,"".concat(We,"-has-fix-right"),Pt[Pt.length-1]&&Pt[Pt.length-1].fixed==="right"),Oe)),style:Q,id:Se,ref:qt},yn),O.createElement($e,{pingLeft:Lt,pingRight:Tn,props:Object(z.a)(Object(z.a)({},Re),{},{stickyOffsets:vn,mergedExpandedKeys:Me})},he&&O.createElement(ie,{className:"".concat(We,"-title")},he(Ut)),O.createElement("div",{className:"".concat(We,"-container")},Vt),me&&O.createElement(ie,{className:"".concat(We,"-footer")},me(Ut))));dt&&(Yn=O.createElement(p.a,{onResize:pt},Yn));var $n=O.useMemo(function(){return{prefixCls:We,getComponent:ht,scrollbarSize:an,direction:se,fixedInfoList:Pt.map(function(bn,ln){return o(ln,ln,Pt,vn,se)}),isSticky:It}},[We,ht,an,se,Pt,vn,se,It]),fr=O.useMemo(function(){return Object(z.a)(Object(z.a)({},St),{},{tableLayout:bt,rowClassName:ue,expandedRowClassName:En,componentWidth:mn,fixHeader:zt,fixColumn:kt,horizonScroll:dt,expandIcon:rr,expandableType:Ur,expandRowByClick:Dt,expandedRowRender:Kt,onTriggerExpand:wt,expandIconColumnIndex:Fn,indentSize:nt})},[St,bt,ue,En,mn,zt,kt,dt,rr,Ur,Dt,Kt,wt,Fn,nt]),Wi=O.useMemo(function(){return{onColumnResize:Mr}},[Mr]);return O.createElement(r.a.Provider,{value:$n},O.createElement(B.Provider,{value:fr},O.createElement(Z.Provider,{value:Wi},Yn)))}tt.Column=s.a,tt.ColumnGroup=c.a,tt.Summary=X.a,tt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Qe=de.b=tt},wRmb:function(ke,de,P){"use strict";P.d(de,"a",function(){return I});var q=P("rePB"),z=P("KQm4"),D=P("VTBJ"),V=P("Ff2n"),U=P("q1tI"),O=P.n(U),G=P("Kwbf"),W=P("Zm9Q"),n=P("hW8S");function I(s){return Object(W.a)(s).filter(function(d){return U.isValidElement(d)}).map(function(d){var i=d.key,l=d.props,r=l.children,o=Object(V.a)(l,["children"]),w=Object(D.a)({key:i},o);return r&&(w.children=I(r)),w})}function g(s){return s.reduce(function(d,i){var l=i.fixed,r=l===!0?"left":l,o=i.children;return o&&o.length>0?[].concat(Object(z.a)(d),Object(z.a)(g(o).map(function(w){return Object(D.a)({fixed:r},w)}))):[].concat(Object(z.a)(d),[Object(D.a)(Object(D.a)({},i),{},{fixed:r})])},[])}function p(s){for(var d=!0,i=0;i<s.length;i+=1){var l=s[i];if(d&&l.fixed!=="left")d=!1;else if(!d&&l.fixed==="left"){Object(G.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,o=s.length-1;o>=0;o-=1){var w=s[o];if(r&&w.fixed!=="right")r=!1;else if(!r&&w.fixed==="right"){Object(G.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function h(s){return s.map(function(d){var i=d.fixed,l=Object(V.a)(d,["fixed"]),r=i;return i==="left"?r="right":i==="right"&&(r="left"),Object(D.a)({fixed:r},l)})}function c(s,d){var i=s.prefixCls,l=s.columns,r=s.children,o=s.expandable,w=s.expandedKeys,T=s.getRowKey,x=s.onTriggerExpand,L=s.expandIcon,A=s.rowExpandable,E=s.expandIconColumnIndex,_=s.direction,m=s.expandRowByClick,f=U.useMemo(function(){return l||I(r)},[l,r]),S=U.useMemo(function(){if(o){var M,B=E||0,R=f[B],H=(M={},Object(q.a)(M,n.a,{className:"".concat(i,"-expand-icon-col")}),Object(q.a)(M,"title",""),Object(q.a)(M,"fixed",R?R.fixed:null),Object(q.a)(M,"className","".concat(i,"-row-expand-icon-cell")),Object(q.a)(M,"render",function(K,Z,oe){var fe=T(Z,oe),xe=w.has(fe),be=A?A(Z):!0,Te=L({prefixCls:i,expanded:xe,expandable:be,record:Z,onExpand:x});return m?U.createElement("span",{onClick:function(Le){return Le.stopPropagation()}},Te):Te}),M),N=f.slice();return B>=0&&N.splice(B,0,H),N}return f},[o,f,T,w,L,_]),b=U.useMemo(function(){var M=S;return d&&(M=d(M)),M.length||(M=[{render:function(){return null}}]),M},[d,S,_]),y=U.useMemo(function(){return _==="rtl"?h(g(b)):g(b)},[b,_]);return[b,y]}de.b=c},"y0+3":function(ke,de,P){"use strict";P.d(de,"a",function(){return g}),P.d(de,"b",function(){return h});var q=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},D={cssFloat:1,styleFloat:1,float:1};function V(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function U(c,s,d){if(s=s.toLowerCase(),d==="auto"){if(s==="height")return c.offsetHeight;if(s==="width")return c.offsetWidth}return s in z||(z[s]=q.test(s)),z[s]?parseFloat(d)||0:d}function O(c,s){var d=arguments.length,i=V(c);return s=D[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,d===1?i:U(c,s,i[s]||c.style[s])}function G(c,s,d){var i=arguments.length;if(s=D[s]?"cssFloat"in c.style?"cssFloat":"styleFloat":s,i===3)return typeof d=="number"&&q.test(s)&&(d="".concat(d,"px")),c.style[s]=d,d;for(var l in s)s.hasOwnProperty(l)&&G(c,l,s[l]);return V(c)}function W(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function n(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function I(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:s}}function g(){var c=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:s}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(c){var s=c.getBoundingClientRect(),d=document.documentElement;return{left:s.left+(window.pageXOffset||d.scrollLeft)-(d.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||d.scrollTop)-(d.clientTop||document.body.clientTop||0)}}},ynwM:function(ke,de,P){var q=P("MFOe"),z=q.Global;ke.exports={name:"oldFF-globalStorage",read:V,write:U,each:O,remove:G,clearAll:W};var D=z.globalStorage;function V(n){return D[n]}function U(n,I){D[n]=I}function O(n){for(var I=D.length-1;I>=0;I--){var g=D.key(I);n(D[g],g)}}function G(n){return D.removeItem(n)}function W(){O(function(n,I){delete D[n]})}}}]);
|